Skip to content

Publish DBR Scala 2.13 image when a runtime ships two Scala variants - #25

Open
rugpanov wants to merge 3 commits into
mainfrom
deco-28292-dbr-scala-variants
Open

Publish DBR Scala 2.13 image when a runtime ships two Scala variants#25
rugpanov wants to merge 3 commits into
mainfrom
deco-28292-dbr-scala-variants

Conversation

@rugpanov

@rugpanov rugpanov commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Why

dbr_meta read the Scala version with a single re.search, taking only the first version a runtime page lists. A runtime mid-migration publishes two images from one page (Scala: 2.12.15 or 2.13.10), but only the 2.12 folder was generated — so a cluster on the Scala 2.13 image (spark_version = 16.4.x-scala2.13) resolves to no published environment and 404s.

This is the largest E_ENV_UNSUPPORTED source in the VPEX telemetry (~69%: 16.4.x-scala2.13 + its cpu-ml variant), spread across many distinct workspaces. DBR 16.4 LTS is the only dual-image line today; the fix is version-agnostic so any future dual-image runtime is covered automatically.

What

  • sync.py — add dbr_scalas(), returning every Scala MAJOR.MINOR a page's System environment lists (one entry for a single-image page, both for a dual-image one), de-duped and in page order, with a fallback to the prior single-match if the field isn't </li>-delimited. dbr_meta returns that list; sync_dbr and the ML path write one folder per Scala version off the shared installed-python-libraries table (only the Java/Scala tables split per image, which this repo doesn't consume).
  • envgen.py — extend DROP_BY_ENV with the three 16.4.x…scala2.13 keys. The pandas 1.5.x-on-cp312 problem (dbr/16.4.x, serverless-v3: pandas 1.5.3 can't be installed on Python 3.12 (no cp312 wheel) #18) is Scala-independent, so the 2.13 image needs the same drop as the 2.12 image — without it the new folders would re-break dbr/16.4.x, serverless-v3: pandas 1.5.3 can't be installed on Python 3.12 (no cp312 wheel) #18.
  • Regenerated artifactsdbr/16.4.x-scala2.13, dbr/16.4.x-cpu-ml-scala2.13, dbr/16.4.x-gpu-ml-scala2.13. Pin sets are byte-identical to their 2.12 siblings (only the name strings differ).
  • Tests — new test_sync.py (dbr_scalas/dbr_meta on dual/single/missing/malformed input); extend the envgen pandas-drop test to the scala2.13 envs.

Verification

  • python -m unittest test_sync test_envgen → 22 passing (CI's test.yml auto-discovers test_sync.py).
  • python .github/scripts/sync.py --check"no changes — repo is in sync with published docs", exit 0.
  • Full uv sync (build + install) PASSES for all three new envs via the Databricks PyPI proxy.

This pull request and its description were written by Isaac.

rugpanov and others added 3 commits August 26, 2026 22:30
*Why*

dbr_meta read the Scala version with a single re.search, taking only the first
version a page lists. A runtime mid-migration publishes two images from one page
("Scala: 2.12.15 or 2.13.10"), but only the 2.12 folder was generated -- so a
cluster on the Scala 2.13 image (spark_version 16.4.x-scala2.13) resolves to no
published environment and 404s. This is the largest E_ENV_UNSUPPORTED source in
the VPEX telemetry (~69%: 16.4.x-scala2.13 + its cpu-ml variant), across many
distinct workspaces. DBR 16.4 LTS is the only dual-image line today; the fix is
version-agnostic so future ones are covered automatically.

*What*

- sync.py: add dbr_scalas(), which returns every Scala MAJOR.MINOR a page's System
  environment lists (one entry for a single-image page, both for a dual-image one),
  de-duped and in page order, with a fallback to the prior single-match. dbr_meta
  returns that list; sync_dbr and the ML path write one folder per Scala version off
  the shared "Installed Python libraries" table (only the Java/Scala tables split per
  image, which this repo doesn't consume).
- envgen.py: extend DROP_BY_ENV with the three 16.4.x...scala2.13 keys. The pandas
  1.5.x-on-cp312 problem (issue #18) is Scala-independent, so the 2.13 image needs the
  same drop as the 2.12 image -- without it the new folders re-break #18.
- Regenerated artifacts: dbr/16.4.x-scala2.13, 16.4.x-cpu-ml-scala2.13,
  16.4.x-gpu-ml-scala2.13. Byte-identical pin sets to their 2.12 siblings; all three
  pass full `uv sync`.
- Tests: new test_sync.py (dbr_scalas/dbr_meta on dual/single/missing/malformed
  input); extend the envgen pandas-drop test to the scala2.13 envs.

Co-authored-by: Isaac <no-reply@databricks.com>
Review hardening: dbr_scalas captured the raw HTML between 'Scala</strong>:' and
</li>, so a version-like number inside a tag (e.g. an href to a Spark-version doc
page) could be read as a Scala version and spawn a nonexistent environment. Strip
inline tags first -- the same treatment table_pkgs already applies -- so only the
visible version tokens count. No generated artifact changes (real pages carry no
such tag digits today); adds a regression test.

Co-authored-by: Isaac <no-reply@databricks.com>
…variant

Review follow-up. The previous parser read every version-like token in the Scala
field, so a trailing visible annotation (e.g. "2.12.15 or 2.13.10 (Apache Spark
3.5)") would add a bogus "3.5" and generate a nonexistent scala3.5 environment.
Match only the leading "VER (or VER)*" enumeration -- the Scala version, or the two
joined by "or" for a dual-image release -- and stop at any following text. Tag
stripping is kept so the enumeration survives the "<strong>or</strong>" markup.
Adds a regression test for the trailing-annotation case; no generated artifact
changes.

Also update README: the DBR sync description now notes that a dual-image release
produces one environment per Scala version off the page's single Python table.

Co-authored-by: Isaac <no-reply@databricks.com>
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.

1 participant