Skip to content

vmariiechko/databricks-bundle-template

Databricks Multi-Environment Bundle Template

Tests License: MIT

A custom template for Databricks Asset Bundles that generates production-ready, multi-environment projects with configurable compute, permissions, and CI/CD pipelines.

Why This Template?

Setting up a production-grade Databricks project involves many decisions: environment isolation, compute configuration, RBAC permissions, service principal setup, CI/CD pipelines, and Unity Catalog schemas. This template encodes proven patterns for all of these so you can go from zero to a deployable bundle in minutes, not days.

Requirements

  • Databricks CLI v0.274.0+ (pip install databricks-cli)
  • Unity Catalog enabled workspace

Usage

databricks bundle init https://github.com/vmariiechko/databricks-bundle-template

Or from a local clone:

databricks bundle init /path/to/databricks-bundle-template

The CLI will guide you through configuration options. Your generated project includes complete documentation for deployment and customization.

Windows users: Use PowerShell or Command Prompt for interactive prompts. Git Bash is not supported for interactive mode.

Quick Start with Config File

For a quick, non-interactive setup or if you prefer to skip the prompts:

# From remote (create config.json with your values first):
databricks bundle init https://github.com/vmariiechko/databricks-bundle-template \
  --config-file config.json
# From local clone:
cp tests/configs/full_with_sp.json my-config.json   # Copy and edit with your values
databricks bundle init . --config-file my-config.json

See example configs for options and refer to Template Options for available values.

What You Get

  • Multi-environment deployment (user/stage/prod, optional dev)
  • Unity Catalog integration with medallion architecture schemas
  • Sample ETL jobs and pipelines
  • Optional RBAC with environment-aware group permissions
  • Configurable compute (classic clusters, serverless, or both)
  • CI/CD pipeline templates (Azure DevOps, GitHub Actions, GitLab)

See the example project for a pre-generated output (AWS + GitHub Actions + classic compute, no RBAC).

Template Options

Option Choices Default
Environment setup full (user/stage/prod) / minimal (user/stage) full
Include dev environment yes / no no
Compute type classic / serverless / both classic
Cloud provider azure / aws / gcp azure
Workspace setup single_workspace / multi_workspace single_workspace
Include permissions yes / no yes
Include CI/CD yes / no yes
CI/CD platform azure_devops / github_actions / gitlab azure_devops
Default branch string main
Release branch string (full mode only) release

Template Development

This section is for developers modifying the template itself.

Repository Structure

databricks-bundle-template/
├── databricks_template_schema.json   # Prompt definitions
├── library/helpers.tmpl              # Go template helpers
├── template/
│   ├── update_layout.tmpl            # Conditional directory/file skipping
│   └── {{.project_name}}/            # Generated project structure
│       ├── .azure/                   # Azure DevOps CI/CD pipelines
│       ├── .github/                  # GitHub Actions workflows
│       ├── .gitlab-ci.yml.tmpl       # GitLab CI/CD pipeline
│       ├── docs/                     # Setup guides (CI/CD, permissions, groups)
│       └── ...                       # Bundle config, resources, src
├── tests/                            # Pytest test suite
├── ARCHITECTURE.md                   # Technical design
└── DEVELOPMENT.md                    # Developer notes

Testing

# Create and activate virtual environment
python -m venv venv
source venv/bin/activate    # Linux/macOS
venv\Scripts\activate       # Windows

# Install dependencies
pip install -r tests/requirements_dev.txt

# Run automated tests
pytest tests/ -V
# Manual testing
databricks bundle init . --output-dir ../test-output --config-file tests/configs/full_with_dev.json

# Validate (requires Databricks CLI authentication)
cd ../test-output/test_full_with_dev/
databricks bundle validate -t user

Documentation


Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines on how to get started.

Roadmap

See ROADMAP.md for planned features and the project direction. Highlights include asset sub-templates and advanced permissions profiles.

Community

License

This project is licensed under the MIT License.

About

A custom Databricks Asset Bundles template for production-ready, multi-environment data pipeline projects

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors