Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a31ca51
initial version
lorenzorubi-db Aug 5, 2025
6088654
trigger GHAction
lorenzorubi-db Aug 5, 2025
d6fb424
trigger GHAction -root dir
lorenzorubi-db Aug 5, 2025
378c8de
test GHAction
lorenzorubi-db Aug 5, 2025
00da846
test GHAction
lorenzorubi-db Aug 5, 2025
22a6e5a
test GHAction
lorenzorubi-db Aug 5, 2025
8c4e9f1
download liquibase typos
lorenzorubi-db Aug 5, 2025
3e0d9f8
download liquibase typos
lorenzorubi-db Aug 5, 2025
1ec2aa3
liquibase location
lorenzorubi-db Aug 5, 2025
4bb6ad0
Liquibase env variables
lorenzorubi-db Aug 7, 2025
7463a0c
Liquibase env variables -typo
lorenzorubi-db Aug 7, 2025
c6bf5ae
relative paths
lorenzorubi-db Aug 7, 2025
03d18db
ACH - refactor changelog files, add token
aleksandrachash Sep 17, 2025
6d4aec5
adapt workflows
aleksandrachash Sep 19, 2025
c52d6f2
minor change
aleksandrachash Sep 19, 2025
46ae53c
add trigger on xml
aleksandrachash Sep 19, 2025
c094650
minor change
aleksandrachash Sep 19, 2025
77ce240
fix tests
aleksandrachash Sep 19, 2025
9503081
fix tests
aleksandrachash Sep 19, 2025
190b6c4
fix tests
aleksandrachash Sep 19, 2025
850ddc6
minor change
aleksandrachash Sep 19, 2025
e8d4642
minor change
aleksandrachash Sep 19, 2025
ff88602
minor change
aleksandrachash Sep 19, 2025
d179a91
minor change
aleksandrachash Sep 19, 2025
52e1fc8
minor change
aleksandrachash Sep 19, 2025
6bc2d4a
minor change
aleksandrachash Sep 19, 2025
7a1f03c
minor change
aleksandrachash Sep 19, 2025
e66993b
minor change
aleksandrachash Sep 19, 2025
ed54cb8
minor change
aleksandrachash Sep 19, 2025
f0e3bd8
minor fix
aleksandrachash Sep 19, 2025
c51de05
minor change
aleksandrachash Sep 19, 2025
c20b5f9
minor change
aleksandrachash Sep 19, 2025
e4fe048
ACA add flights_raw table
aleksandrachash Oct 14, 2025
73f8049
attempt to fix unit tests
lorenzorubi-db Oct 23, 2025
7dcf449
attempt to fix unit tests
lorenzorubi-db Oct 23, 2025
aca15a6
fix unit tests pointing to a databricks workspace outside of vpn
lorenzorubi-db Oct 23, 2025
1e22a51
fix unit tests pointing to a databricks workspace outside of vpn
lorenzorubi-db Oct 23, 2025
580b297
remove flights-liquibase and make it a template instead
lorenzorubi-db Dec 11, 2025
b15f726
liquibase generated from template test
lorenzorubi-db Dec 11, 2025
a218caa
yml syntax error
lorenzorubi-db Dec 11, 2025
6b308c4
yml syntax error
lorenzorubi-db Dec 11, 2025
c6ca290
yml syntax error
lorenzorubi-db Dec 11, 2025
6461a1a
formatting
lorenzorubi-db Dec 11, 2025
74b7ad9
formatting
lorenzorubi-db Dec 11, 2025
f22b819
debugging
lorenzorubi-db Dec 16, 2025
3a76c2e
serverless dbconnect version
lorenzorubi-db Dec 16, 2025
8a1f151
missing txt files tracking
lorenzorubi-db Dec 16, 2025
e7f0099
cosmetics
lorenzorubi-db Dec 16, 2025
4d73fb2
cosmetics
lorenzorubi-db Dec 16, 2025
a876c78
correct property keywords
lorenzorubi-db Dec 17, 2025
14675ac
working version for the template
lorenzorubi-db Dec 18, 2025
9ef49f4
liquibase catalog/schema from GH env variables
lorenzorubi-db Dec 18, 2025
dddcc86
merge schema
lorenzorubi-db Dec 26, 2025
f4bc5fe
final cleanup
lorenzorubi-db Dec 26, 2025
f882192
tested at branch test/liquibase
lorenzorubi-db Dec 26, 2025
5c21b5d
updated README
lorenzorubi-db Dec 26, 2025
c10746a
Merge branch 'feat/liquibase' into test/liquibase
lorenzorubi-db Jan 19, 2026
566e763
missing author
lorenzorubi-db Jan 19, 2026
68a77f4
workspace as variable
lorenzorubi-db Jan 19, 2026
8a2dba5
change
lorenzorubi-db Feb 2, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions .github/workflows/flights_liquibase.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@

name: Deploy flights_project to TEST with liquibase

concurrency: 1

on:
workflow_dispatch:

pull_request:
types:
- opened
- synchronize
branches:
- dev
paths:
- "**/*.yml"
- "**/*.py"

push:
branches:
- test/liquibase*
paths:
- "**/*.yml"
- "**/*.py"
- "**/*.xml"
- "**/*.txt"

jobs:
deploy:
name: "Test and deploy bundle"
runs-on: ubuntu-latest
environment: test
env:
DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }}
DATABRICKS_TOKEN: ${{ vars.DATABRICKS_TOKEN_TST }}
DATABRICKS_BUNDLE_ENV: dev # should be TST, 'dev' is set for demo purposes only
defaults:
run:
working-directory: .

steps:
- uses: actions/checkout@v3

- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: '3.12'

#----------------------------------------------
# Set up Java (Temurin JDK 8)
#----------------------------------------------
- name: Set up Java 8
uses: actions/setup-java@v4
with:
java-version: '8'
distribution: 'temurin'

#----------------------------------------------
# Download Liquibase CLI and make executable
#----------------------------------------------
- name: Download Liquibase CLI
run: |
LIQUIBASE_VERSION=4.33.0
wget https://github.com/liquibase/liquibase/releases/download/v${LIQUIBASE_VERSION}/liquibase-${LIQUIBASE_VERSION}.tar.gz
mkdir liquibase_download
tar -xzf liquibase-${LIQUIBASE_VERSION}.tar.gz -C liquibase_download

#----------------------------------------------
# Download Databricks JDBC and extension JARs
#----------------------------------------------
- name: Download Databricks JDBC Driver and Liquibase Extension
run: |
# Download Databricks JDBC driver
wget https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/jdbc/2.7.3/DatabricksJDBC42-2.7.3.1010.zip
unzip DatabricksJDBC42-2.7.3.1010.zip
mv DatabricksJDBC-2.7.3.1010/DatabricksJDBC42.jar liquibase_download/lib

# Download Liquibase-Databricks extension
wget https://github.com/liquibase/liquibase-databricks/releases/download/v1.4.2/liquibase-databricks-1.4.2.jar
mv liquibase-databricks-1.4.2.jar liquibase_download/lib

#----------------------------------------------
# Run Liquibase connection test & update
#----------------------------------------------
- name: Run Liquibase connection test & update
env:
LIQUIBASE_COMMAND_URL: ${{ vars.DATABRICKS_JDBC_URL }}
LIQUIBASE_COMMAND_USERNAME: "token"
LIQUIBASE_COMMAND_PASSWORD: ${{ secrets.DATABRICKS_TOKEN_TST }}
LIQUIBASE_COMMAND_DEFAULT_CATALOG_NAME: ${{ vars.LIQUIBASE_CATALOG_NAME }}
LIQUIBASE_COMMAND_DEFAULT_SCHEMA_NAME: ${{ vars.LIQUIBASE_SCHEMA_NAME }}
run: |
liquibase_download/liquibase update --changelog-file=./liquibase/root.changelog.xml --log-level INFO

#----------------------------------------------
# Install dependencies and package
#----------------------------------------------
- run: python -m pip install --upgrade pip
- run: pip install -r ./requirements.txt -r ./dev-requirements.txt
- run: pip install -e .

#----------------------------------------------
# run test suite
#----------------------------------------------
- name: Run unit tests
env:
DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }}
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN_TST }}
DATABRICKS_SERVERLESS_COMPUTE_ID: "auto"
run: |
pytest ./tests/

- uses: databricks/setup-cli@main

#----------------------------------------------
# run job (in staging)
#----------------------------------------------
- name: Run job (in staging)
env:
DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }}
DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN_TST }}
DATABRICKS_BUNDLE_ENV: dev # should be TST, 'dev' is set for demo purposes only
BUNDLE_VAR_liquibase_catalog: ${{ vars.LIQUIBASE_CATALOG_NAME }}
BUNDLE_VAR_liquibase_schema: ${{ vars.LIQUIBASE_SCHEMA_NAME }}
run: |
databricks bundle deploy; databricks bundle run flights_notebook; databricks bundle destroy --auto-approve

110 changes: 110 additions & 0 deletions databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# This is the configuration for the Databricks Asset Bundle flights-gen-bundle.

bundle:
name: flights-gen-bundle



include:
- resources/*.yml
- resources/dlt/*.yml

variables:

liquibase_catalog:
liquibase_schema:

catalog:
default: ${var.liquibase_catalog}
database:
default: ${var.liquibase_schema}
flights_dlt_schema:
default: ${resources.schemas.project_schema.name}_dlt
flights_test_schema:
default: "${resources.schemas.project_schema.name}_validation"
spark_version:
default: "15.4.x-scala2.12"
node_type_id:
default: "m6gd.xlarge"
artifact_dir:
default: "/Workspace/Users/${workspace.current_user.userName}/shared_code/${bundle.target}"
shared_cluster_config:
type: "complex"
default:
spark_version: ${var.spark_version}
node_type_id: ${var.node_type_id}
data_security_mode: USER_ISOLATION
autoscale:
min_workers: 1
max_workers: 2

targets:
# The 'dev' target, used for development purposes.
# Whenever a developer deploys using 'dev', they get their own copy.
dev:
# We use 'mode: development' to make sure everything deployed to this target gets a prefix
# like '[dev my_user_name]'. Setting this mode also disables any schedules and
# automatic triggers for jobs and enables the 'development' mode for Delta Live Tables pipelines.
mode: development
default: true

# RESOURCE OVERRIDE
## Only create this schema in dev, for other targets manage with Terraform.
resources:
schemas:
project_schema:
name: ${var.database}
catalog_name: ${var.catalog}
comment: "Schema for flight data"

test:
# For test/staging deployments, we only have a single copy, so we should deploy as
# the same user (Service Principal) ever time.
mode: production
workspace:
root_path: /Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
run_as:
user_name: ${workspace.current_user.userName}
variables:
database: flights_${bundle.target}
flights_dlt_schema: flights_dlt_${bundle.target}
flights_test_schema: flights_validation_test

test_automated:
# For test/staging deployments, we only have a single copy, so we should deploy as
# the same user (Service Principal) ever time.
mode: production
workspace:
root_path: /Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
run_as:
user_name: ${workspace.current_user.userName}
variables:
database: flights_${bundle.target}
flights_dlt_schema: flights_dlt_${bundle.target}
flights_test_schema: flights_validation_test
node_type_id: Standard_DS3_v2

staging:
mode: production
workspace:
root_path: /Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
run_as:
user_name: ${workspace.current_user.userName}
variables:
database: flights_${bundle.target}
flights_dlt_schema: flights_dlt_${bundle.target}
flights_test_schema: flights_validation_staging

# The 'prod' target, used for production deployment.
prod:
mode: production
workspace:
root_path: /Users/${workspace.current_user.userName}/.bundle/${bundle.name}/${bundle.target}
run_as:
# This can run as a specific user or service principal in production.
# To run as service principal use service_principal_name (see Databricks documentation).
user_name: ${workspace.current_user.userName}
variables:
database: flights_${bundle.target}
flights_dlt_schema: flights_dlt_${bundle.target}
flights_test_schema: flights_validation_prod
4 changes: 4 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wheel
pytest
databricks-sdk[notebook]>=0.46.0
pandas==2.2.3
18 changes: 18 additions & 0 deletions flights/flights-bundle-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Template on top of the [flights_simple](../flights-simple) project to enable the following deployment options:
1. Wheels or relative imports for the project's Python modules
2. Serverless compute or classic compute for workflows
3. Liquibase example setup

## Resources
A subset of [flights_simple](../flights-simple) resources are currently demonstrated at the [template resources dir](template/resources/).
Expand Down Expand Up @@ -49,3 +50,20 @@ A subset of [flights_simple](../flights-simple) resources are currently demonstr
```
$ databricks bundle run flights_notebook --profile <your CLI profile>
```

## Liquibase
If Liquibase is enabled, the template creates a GH action under `./.github/workflows/flights_liquibase.yml` which
- Downloads the Liquibase CLI + required JDBC driver and jars
- Runs a liquibase connection test and updates the changelog
- Runs local tests
- Deploys the bundle in target env and runs a job

### GH setup
Liquibase requires the following variables set in GitHub:
- `DATABRICKS_HOST`: e.g. `dbc-eae35cd0-9e95.cloud.databricks.com`
- `DATABRICKS_JDBC_URL`: DWH url e.g. `jdbc:databricks://dbc-eae35cd0-9e95.cloud.databricks.com:443/default;transportMode=http;ssl=1;AuthMech=3;httpPath=/sql/1.0/warehouses/863bcc7ff8fea25b;`
- `LIQUIBASE_CATALOG_NAME`: a catalog name e.g. `main`
- `LIQUIBASE_SCHEMA_NAME`: a schema name e.g. `liquibase_test`

Plus the secret:
- `DATABRICKS_TOKEN_TST`: Databricks token for deployment environment
12 changes: 9 additions & 3 deletions flights/flights-bundle-template/databricks_template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,25 @@
"type": "boolean",
"default": false,
"description": "Do you want the Databricks workflows to run on serverless?",
"order": 2
"order": 3
},
"catalog": {
"type": "string",
"default": "main",
"description": "Name of your UC catalog for your workflows/DLT?",
"order": 2
"order": 4
},
"database": {
"type": "string",
"default": "flights",
"description": "Name of your UC database for your workflows/DLT?",
"order": 2
"order": 5
},
"include_liquibase": {
"type": "boolean",
"default": false,
"description": "Do you want to use liquibase for DataOps data evolution?",
"order": 6
}
},
"success_message": "\nYour bundle '{{.project_name}}' has been created."
Expand Down
Loading