Skip to content

air: add convert-to-dabs (run YAML -> Databricks Asset Bundle) - #6111

Open
vinchenzo-db wants to merge 2 commits into
air-code-source-dir-rebasefrom
air-convert-to-dabs-main
Open

air: add convert-to-dabs (run YAML -> Databricks Asset Bundle)#6111
vinchenzo-db wants to merge 2 commits into
air-code-source-dir-rebasefrom
air-convert-to-dabs-main

Conversation

@vinchenzo-db

Copy link
Copy Markdown

Adds air convert-to-dabs, which translates an AIR CLI run YAML into a deployable Databricks Asset Bundle so a workload authored for air run can be managed and deployed with the standard DABs workflow (validate/deploy/run).

The emitted bundle is schema-valid: the ai_runtime_task maps to the SDK jobs.AiRuntimeTask (experiment + deployments[].{command_path,compute} + code_source_path), with framework fields (retries, timeout, budget policy) on the surrounding task and the runtime environment in environments[].

Snapshotting is owned by the deploy-time aicode mutator, not by convert: code_source_path points at a local directory staged inside the bundle, and bundle deploy (aicode.PackageAndUpload) packages it into a content-addressed tarball and uploads it. convert only lays down the source bytes — copying the working tree (honoring .gitignore) or materializing a pinned git commit into the directory. requirements.yaml is likewise not emitted: aicode.SynthesizeRequirements regenerates it from the environments[] spec, so convert folds the whole dependency set (inline or requirements-file) into that spec instead.

env_variables / secrets / parameters have no native ai_runtime_task field, so they ride as env_vars.json / secret_env_vars.json / hyperparameters.yaml sidecars (same as air run), and a "Notes:" section tells a migrating user what was transformed or staged out-of-band.

This is the top of a 2-PR stack: it builds on the aicode deploy-time packaging mutator so the two compose end-to-end.

Co-authored-by: Isaac

Changes

Why

Tests

@github-actions

github-actions Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/experimental/air/ - needs approval

8 files changed
Suggested: @riddhibhagwat-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

/experimental/air/ - needs approval

5 files changed
Suggested: @riddhibhagwat-db
Also eligible: @apeforest, @bfontain, @lu-wang-dl, @panchalhp-db, @maggiewang-db, @ben-hansen-db, @pardis-beikzadeh-db

Any maintainer (@andrewnester, @anton-107, @denik, @pietern, @shreyas-goenka, @simonfaltum, @renaudhartert-db, @janniklasrose, @lennartkats-db) can approve all areas.
See OWNERS for ownership rules.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: fd0ab4a

Run: 30637915347

Env 🟨​KNOWN 🔄​flaky 💚​RECOVERED 🙈​SKIP ✅​pass 🙈​skip Time
🟨​ aws linux 3 1 4 322 1068 7:50
🟨​ aws windows 3 1 4 324 1066 9:02
🟨​ azure linux 2 1 1 4 322 1067 7:50
🟨​ azure windows 3 1 4 324 1065 9:10
💚​ gcp linux 1 5 321 1069 5:12
💚​ gcp windows 1 5 323 1067 4:51
8 interesting tests: 4 SKIP, 3 KNOWN, 1 RECOVERED
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
🙈​ TestAccept/bundle/invariant/no_drift 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_endpoints/drift/recreated_same_name 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/bundle/resources/vector_search_indexes/recreate/embedding_dimension 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🙈​ TestAccept/ssh/connection 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S 🙈​S
🟨​ TestFetchRepositoryInfoAPI_FromRepo 🟨​K 🟨​K 🟨​K 🟨​K 🙈​S 🙈​S
🟨​ TestFetchRepositoryInfoAPI_FromRepo/root 🟨​K 🟨​K 🟨​K 🟨​K
🟨​ TestFetchRepositoryInfoAPI_FromRepo/subdir 🟨​K 🟨​K 🔄​f 🟨​K
Top 3 slowest tests (at least 2 minutes):
duration env testname
5:26 aws windows TestAccept
5:25 azure windows TestAccept
3:11 gcp windows TestAccept

@vinchenzo-db
vinchenzo-db force-pushed the air-convert-to-dabs-main branch 2 times, most recently from 4703d56 to a81002a Compare July 31, 2026 13:46
Adds `air convert-to-dabs`, which translates an AIR CLI run YAML into a
deployable Databricks Asset Bundle so a workload authored for `air run` can be
managed and deployed with the standard DABs workflow (validate/deploy/run).

The emitted bundle is schema-valid: the ai_runtime_task maps to the SDK
jobs.AiRuntimeTask (experiment + deployments[].{command_path,compute} +
code_source_path), with framework fields (retries, timeout, budget policy) on
the surrounding task and the runtime environment in environments[].

Snapshotting is owned by the deploy-time aicode mutator, not by convert:
code_source_path points at a local *directory* staged inside the bundle, and
`bundle deploy` (aicode.PackageAndUpload) packages it into a content-addressed
tarball and uploads it. convert only lays down the source bytes — copying the
working tree (honoring .gitignore) or materializing a pinned git commit into the
directory. requirements.yaml is likewise not emitted: aicode.SynthesizeRequirements
regenerates it from the environments[] spec, so convert folds the whole dependency
set (inline or requirements-file) into that spec instead.

env_variables / secrets / parameters have no native ai_runtime_task field, so they
ride as env_vars.json / secret_env_vars.json / hyperparameters.yaml sidecars (same
as `air run`), and a "Notes:" section tells a migrating user what was transformed
or staged out-of-band.

This is the top of a 2-PR stack: it builds on the aicode deploy-time packaging
mutator so the two compose end-to-end.

Co-authored-by: Isaac
The Windows CI job failed the convert-to-dabs acceptance test with
"tar (child): Cannot connect to C: resolve failed": the system tar reads the
`C:` in an absolute archive path as a remote host:path.

Two fixes:
- createPlainTarball now passes the archive as a bare basename with cmd.Dir set
  to the output directory (and an absolute parent), so no `C:\...` path reaches
  tar's -f argument. Mirrors how git archive is invoked; safe on GNU tar and
  bsdtar. (This helper is shared with the `air run` snapshot path.)
- extractTarball is rewritten in pure Go (archive/tar + compress/gzip) instead of
  shelling out to `tar -xzf`, eliminating the same drive-letter hazard on the
  extract side and dropping the external-tar dependency for extraction. It rejects
  entries that would escape the destination (path traversal, absolute/escaping
  symlinks) and bounds each file copy to its header size.

Adds unit tests for extractTarball (happy path incl. nested dirs + in-tree
symlink; traversal + escaping-symlink rejection).

Co-authored-by: Isaac
@vinchenzo-db
vinchenzo-db force-pushed the air-convert-to-dabs-main branch from a81002a to fd0ab4a Compare July 31, 2026 14:14
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.

2 participants