Bump default serverless environment version to 5 - #6378
Conversation
Update the serverless environment version generated by the bundle templates from 4 to 5. Version 5 stays on Python 3.12, so the templates' databricks-connect requirement is unchanged (verified against the serverless-v5 environment in the databricks/environments repo). The shared default template body (default-python, pydabs, lakeflow-pipelines) is driven by the serverless_environment_version macro; dbt-sql and default-scala carry their own values and are bumped to match. Acceptance goldens are regenerated accordingly. Co-authored-by: Isaac <no-reply@databricks.com>
The `pipelines init` and `pipelines e2e` acceptance tests render the shared lakeflow-pipelines template, so their generated sample_job.job.yml goldens also move from environment_version "4" to "5". These live under acceptance/pipelines/ and were outside the bundle/templates test filter. Co-authored-by: Isaac <no-reply@databricks.com>
Approval status: pending
|
Integration test reportCommit: 3f41ff3
Top 3 slowest tests (at least 2 minutes):
|
| {{/* Python version specification for the template. | ||
| * This needs to be compatible with the version of DB Connect and the serverless_environment_version. | ||
| * | ||
| * Serverless environment version 4 (and upcoming v5), DBR 16, and DBR 17 all use Python 3.12. |
There was a problem hiding this comment.
Please also still mention 4 here (for maintainers)
There was a problem hiding this comment.
Done — the comment now reads "Serverless environment versions 4 and 5, DBR 16, and DBR 17 all use Python 3.12."
There was a problem hiding this comment.
We should probably bump this to the oldest possible DB Connect version that fully uses Python 3.12? Which might be v16?
- DB Connect only offers forward compatibility, which is why we use a conservative ("oldest") version here
- See also ohttps://github.com/Update templates to use serverless environment version 4 and matching Python version #3897 for version considerations.
| * See https://docs.databricks.com/release-notes/runtime/index.html for available versions. | ||
| */}} | ||
| {{define "latest_lts_dbr_version" -}} | ||
| 16.4.x-scala2.12 |
There was a problem hiding this comment.
We should bump this as well but since the Python version is the same that could be done in a separate PR.
There was a problem hiding this comment.
Agreed - I'll leave the latest_lts_dbr_version bump for a separate PR. It's independent of this change.
Per review feedback, move the templates' conservative DB Connect version from 15.4 (Python 3.11) to 16.4 — the oldest DB Connect that fully uses Python 3.12 — so local development matches the serverless v5 runtime. databricks-connect 16.4 wheels are requires-python ==3.12.*, so python_version_spec is pinned to >=3.12,<3.13 to keep generated projects installable. Comment also restored to mention env version 4 alongside 5. Regenerate affected pyproject.toml goldens; update changelog fragment. Co-authored-by: Isaac <no-reply@databricks.com>
| "pytest", | ||
| "ruff", | ||
| "databricks-dlt", | ||
| "databricks-connect>=15.4,<15.5", |
There was a problem hiding this comment.
[question]
environment_version 5 actually requires datbaricks-connect>=18.0 to work now.
Is updating the db-connect version for the Python version compatibility rather than the db-connect client <> server compatibility?
There was a problem hiding this comment.
Good point — bumped to >=18.0,<18.1 to match v5's DB Connect 18 (client↔server compat). Verified: uv sync resolves databricks-connect==18.0.9, v5's shipped version. 18.0 is also Python 3.12, so the Python pin is unchanged.
| @@ -0,0 +1 @@ | |||
| Bundle templates now generate serverless jobs and notebooks with `environment_version: "5"` instead of `"4"` (`default-python`, `default-scala`, `dbt-sql`, `pydabs`, and `lakeflow-pipelines`). For the Python templates, the generated `pyproject.toml` now pins `databricks-connect>=16.4,<16.5` and Python `>=3.12,<3.13` (previously `databricks-connect>=15.4,<15.5` and Python `>=3.10,<3.13`) so local development matches serverless environment version 5's Python 3.12 runtime. | |||
There was a problem hiding this comment.
[suggestion]
link the environment version 5 release notes to the change logs.
| Bundle templates now generate serverless jobs and notebooks with `environment_version: "5"` instead of `"4"` (`default-python`, `default-scala`, `dbt-sql`, `pydabs`, and `lakeflow-pipelines`). For the Python templates, the generated `pyproject.toml` now pins `databricks-connect>=16.4,<16.5` and Python `>=3.12,<3.13` (previously `databricks-connect>=15.4,<15.5` and Python `>=3.10,<3.13`) so local development matches serverless environment version 5's Python 3.12 runtime. | |
| Bundle templates are upgraded from serverless environment version 4 to [version 5](https://docs.databricks.com/aws/en/release-notes/serverless/environment-version/five) for generated serverless jobs and notebooks (`default-python`, `default-scala`, `dbt-sql`, `pydabs`, and `lakeflow-pipelines`). Python templates now pin `databricks-connect>=16.4,<16.5` and Python `>=3.12,<3.13` (previously `databricks-connect>=15.4,<15.5` and Python `>=3.10,<3.13`), aligning local development with environment version 5’s Python 3.12 runtime. |
There was a problem hiding this comment.
Done — applied (with the version bumped to 18.0).
| {{- end}} | ||
|
|
||
| {{define "latest_lts_db_connect_version_spec" -}} | ||
| >=15.4,<15.5 |
There was a problem hiding this comment.
[question]
Do we need to upgrade this?
…e notes Per review, serverless environment version 5 ships DB Connect 18, so set the templates' DB Connect floor to >=18.0,<18.1 to match the runtime for client-server compatibility (18.0 also uses Python 3.12, so the Python pin is unchanged). Pinned to the 18.0 minor to avoid resolving a client newer than the v5 server. Also link the environment version 5 release notes from the changelog. Regenerate affected pyproject.toml goldens. Co-authored-by: Isaac <no-reply@databricks.com>
Changes
Bumps the serverless
environment_versiongenerated by the bundle-init templates from4to5.libs/template/templates/default/library/versions.tmpl— the sharedserverless_environment_versionmacro (drivesdefault-python,pydabs,default-minimal,lakeflow-pipelines), plus a refresh of the stale "version 4 (and upcoming v5)" comment.libs/template/templates/dbt-sql/library/versions.tmplanddefault-scala/.../{{.project_name}}.job.yml.tmpl— these carry their own value; bumped to match.acceptance/bundle/templates/andacceptance/pipelines/(init + e2e)..nextchanges/bundles/.lakeflow-integrationsalready ships5;default-sqluses SQL-warehouse compute and has noenvironment_version. Theexperimental/sshtunnel keeps its own v4 default (a v5 driver-proxy bug, see 65b2901) and is intentionally untouched.Why
Serverless environment version 5 is the current version, and
lakeflow-integrationsalready generates it. Verified againstpython/serverless/serverless-v5/pyproject.tomlin the databricks/environments repo: v5 stays on Python 3.12 (requires-python = "==3.12.*"), so the templates'databricks-connectrequirement — the deliberately conservative>=15.4,<15.5floor — is unchanged.Tests
pipelinesacceptance goldens regenerated with-update; the resulting diff is exclusivelyenvironment_version: "4"→"5".go test ./libs/template/...and the template/pipelines acceptance suites pass.bundle initfordefault-python,default-scala, anddbt-sql— each generatesenvironment_version: "5"andbundle validatesucceeds against a live workspace.uv syncon the generateddefault-pythonproject resolvesdatabricks-connect==15.4.26/pyspark==3.5.0on Python 3.12 and imports cleanly.This pull request and its description were written by Isaac.