A clean, minimal template for migrating existing projects to Databricks Asset Bundles format.
-
Prerequisites
pip install databricks-cli
-
Configure Databricks
# Option A: Use databricks configure (interactive) databricks configure # Option B: Use environment file (recommended for CI/CD) cp env.example .env # Edit .env with your Databricks workspace URL, token, and warehouse ID # Get warehouse ID from: Databricks → SQL Warehouses → Copy warehouse ID
-
Deploy Everything
./scripts/deploy.sh
-
Clean Up When Done
./scripts/cleanup.sh
To enable automatic testing on Pull Requests:
-
Add GitHub Repository Secrets:
- Go to your repo → Settings → Secrets and variables → Actions
- Add secret:
DATABRICKS_TOKEN
(your Databricks token) - Optionally add variable:
DATABRICKS_HOST
(defaults tohttps://e2-demo-field-eng.cloud.databricks.com/
)
-
What happens automatically:
- Pull Requests: Validated and tested with isolated workspace paths
- Main branch: Deployed to your dev environment
- PR cleanup: Resources automatically cleaned up when PR is closed
- Workflow:
Databricks Demo Deployment Example - Two Simple Notebooks
- Notebooks:
notebook1.ipynb
→notebook2.ipynb
(sequential execution) - Dashboard:
Demo Dashboard
(deployed alongside notebooks) - App:
demo-app
(Simple Streamlit app) - Location:
/Workspace/Users/[email protected]/dbx-dabs-demo-dev/
databricks bundle validate # Check configuration
databricks bundle deploy # Deploy to workspace
databricks bundle run demo_workflow # Run the demo workflow
databricks bundle summary # See what's deployed
databricks bundle destroy # Remove everything
- Update
databricks.yml
with your job/notebook names - Replace
notebooks/notebook1.ipynb
andnotebooks/notebook2.ipynb
with your notebooks - Modify the workspace
host
androot_path
as needed
├── databricks.yml # Main DABs configuration
├── notebooks/
│ ├── notebook1.ipynb # First notebook
│ └── notebook2.ipynb # Second notebook (runs after first)
├── dashboards/
│ └── dashboard_example.lvdash.json # Demo dashboard
├── apps/
│ └── demo_app/
│ ├── app.py # Streamlit app
│ └── app.yaml # App configuration
└── scripts/
├── deploy.sh # Automated deployment
└── cleanup.sh # Automated cleanup
That's it! 🚀