Skip to content

contrib/dbt-factory: add job cluster compute option + Lakeflow Jobs rename - #170

Merged
mwojtyczka merged 4 commits into
databricks:mainfrom
mwojtyczka:dbt-factory-job-cluster
Sep 22, 2026
Merged

mwojtyczka merged 4 commits into
databricks:mainfrom
mwojtyczka:dbt-factory-job-cluster

Conversation

@mwojtyczka

@mwojtyczka mwojtyczka commented Sep 21, 2026

Copy link
Copy Markdown
Collaborator

What

Extends the dbt-factory template (and its example) with a compute choice, and updates naming to the current product.

Job cluster support

  • New use_serverless prompt (default yes). Serverless is unchanged; choosing no renders a classic job cluster.
  • In job-cluster mode the generated resources/__init__.py:
    • sets job_cluster_key on every task instead of environment_key,
    • installs dbt-databricks as a per-task library (pinned to the version in the venv; installed once on the shared cluster),
    • defines a tunable job_clusters block (spark_version 18.x-scala2.13 = DBR 18 LTS, {{smallest_node_type}}, autoscale 1–4).
  • The vendored databricks_dbt_factory core is untouched (it already supports job_cluster_key), so the vendor-sync CI is unaffected. The serverless rendering is byte-for-byte unchanged.
  • databricks.yml only syncs dbt_serverless_env.yaml in serverless mode.

Rename to the current product name

  • "Databricks Workflows" → Databricks Lakeflow Jobs (singular Databricks Lakeflow Job for a deployed job) across the template and example docs.

Docs

  • New FAQ entries in the READMEs: SDLC (developers keep working in dbt; the factory acts on the deployment side) and Jinja/templating (no dynamic Databricks parameters; the manifest is pre-compiled).
  • The job-cluster README explains the cluster only orchestrates — queries run on the SQL warehouse — so it should be sized for task concurrency, not query load, and edited before the first deploy.
  • Added contributing guide
  • Removed reduncancy in REAMDEs
  • Moved migration scenario to the template

Verification

  • Offline unit tests (make test): 36 passed. tests/test_load_resources.py is now templated so its assertions match each compute mode.
  • End-to-end (make test-e2e): parametrized over both compute modes — each does a real bundle init → deploy → run → verify → teardown. Both serverless and job cluster pass on a live workspace (job SUCCESS; all six fixture tables materialized; the job cluster provisions on 18.x-scala2.13).
  • Manual tests: run init and run for the default example, both serverless and job cluster
Screenshot 2026-09-22 at 11 42 50

…ename

Add a `use_serverless` prompt (default "yes") to the dbt-factory template so the
generated job can run on serverless (unchanged) or a classic job cluster. In
job-cluster mode the generated resources/__init__.py sets `job_cluster_key`,
installs dbt-databricks as a per-task library, and defines a tunable
`job_clusters` block; the README explains sizing (the cluster only orchestrates —
queries run on the SQL warehouse). The vendored core is untouched.

Rename "Databricks Workflows" to the current product name "Databricks Lakeflow
Jobs" (singular "Databricks Lakeflow Job" for a deployed job) across the template
and example docs, and add two FAQ entries (SDLC; Jinja/templating).

Verification: offline unit tests (`make test`) cover both compute modes, and the
e2e test (`make test-e2e`) now runs the full deploy+run+verify for both
serverless and job-cluster modes.

Co-authored-by: Isaac <no-reply@databricks.com>
The job cluster only orchestrates — each task submits SQL to the SQL warehouse
and waits — so extra workers don't speed dbt up. Default the generated
`job_clusters` block to a single-node cluster (num_workers 0 + singleNode
profile) and update the sizing docs accordingly.

Co-authored-by: Isaac <no-reply@databricks.com>
@mwojtyczka
mwojtyczka merged commit d6c0dc4 into databricks:main Sep 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants