Skip to content

Run AIR preflight validation in parallel with artifact staging - #7368

Merged
stevenchen-db merged 8 commits into
mainfrom
air/parallel-preflight
Nov 7, 2026
Merged

stevenchen-db merged 8 commits into
mainfrom
air/parallel-preflight

Conversation

@stevenchen-db

@stevenchen-db stevenchen-db commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Changes

databricks air run waited for the server-side config:validate call before staging launch artifacts. Validation doesn't read the uploaded files, so it now runs concurrently with mkdirs and the uploads (errgroup), and submit waits for both.

  • A rejected config is never submitted. The first failure cancels the other side and is the error reported; plain-tar snapshot packaging now stops on cancellation too.
  • Usage-policy lookup and the experiment directory now run after validation, so field errors keep precedence and a rejected config never creates the experiment directory.
  • Trade-off: a rejected config can leave an empty launch directory under .air/cli_launch/, and a bad usage_policy_name is reported after the upload.

Tests

  • New tests: validation overlaps staging; a validation failure cancels staging promptly; field errors beat usage-policy errors; cancelled plain-tar packaging stops.
  • go test ./cmd/air (touched tests with -race), TestAccept/air, lint pass.
  • e2-dogfood, minimal A10 run, 4 interleaved runs per build: uploads finish ~75ms sooner (median ~320ms vs ~395ms); total ~853ms vs ~944ms. Rejected configs (field error, field + bad policy, bad policy) behave as above with no run created.

This pull request and its description were written by Isaac.

`databricks air run` used to wait for the server-side config:validate
call before staging the launch artifacts. The backend check doesn't read
the uploaded files, so run it concurrently with usage-policy resolution,
the experiment directory check, mkdirs, and the uploads. Submission still
waits for both, and a failure on either side cancels the other, so an
invalid config is never submitted (it may now leave staged artifacts).

The "validation unavailable" warning is printed after staging so it
doesn't interleave with the staging spinner.

Co-authored-by: Isaac <no-reply@databricks.com>
@stevenchen-db
stevenchen-db requested review from a team as code owners November 5, 2026 00:09
@stevenchen-db
stevenchen-db requested a review from rclarey November 5, 2026 00:09
Co-authored-by: Isaac <no-reply@databricks.com>
@github-actions github-actions Bot added the AIR Databricks AI Runtime CLI label Nov 5, 2026
@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: c6b050c

Run: 42264716121

Env ✅​pass 🙈​skip Time
✅​ aws linux-2core-8gb 271 15 4:09
✅​ aws-windows-latest-4core-16gb 273 13 3:20
✅​ azure linux-2core-8gb 270 15 3:54
✅​ azure-windows-latest-4core-16gb 272 13 3:06
✅​ gcp linux-2core-8gb 271 15 3:55
✅​ gcp-windows-latest-4core-16gb 273 13 3:18
Top 3 slowest tests (at least 2 minutes):
duration env testname
3:13 aws-windows-latest-4core-16gb TestAccept
3:11 gcp-windows-latest-4core-16gb TestAccept
3:00 azure-windows-latest-4core-16gb TestAccept

stevenchen-db and others added 6 commits November 5, 2026 04:31
Start validation in a goroutine before staging and join it before submit,
instead of extracting staging into a helper, so the diff doesn't move
existing code.

Co-authored-by: Isaac <no-reply@databricks.com>
Validation and staging now share a cancellable context: a validation
failure cancels in-flight uploads and is reported instead of the
cancellation, and a staging failure cancels in-flight validation.

Co-authored-by: Isaac <no-reply@databricks.com>
Start validation right before the upload and run the usage policy lookup
and experiment directory creation after it, so validation field errors
keep precedence and a rejected config never creates the experiment
directory, as before.

Co-authored-by: Isaac <no-reply@databricks.com>
errgroup already returns the first error and cancels the other side, so
the manual goroutine, channel, and deferred error override are not needed.

Co-authored-by: Isaac <no-reply@databricks.com>
# Conflicts:
#	cmd/air/validateconfig_test.go
A failed config validation now cancels artifact staging, but plain-tar
packaging ignored its context and archived the whole tree before the
validation error surfaced. Fail tar writes once the context is done.

Also bound the cancellation test so a regression fails instead of
hanging, and update the submitWorkload doc comment for the new order.

Co-authored-by: Isaac <no-reply@databricks.com>
@stevenchen-db
stevenchen-db added this pull request to the merge queue Nov 7, 2026
Merged via the queue into main with commit 21db1be Nov 7, 2026
28 checks passed
@stevenchen-db
stevenchen-db deleted the air/parallel-preflight branch November 7, 2026 05:19
deco-sdk-tagging Bot added a commit that referenced this pull request Nov 9, 2026
## Release v1.25.0

### CLI

 * `databricks aitools install --output json` now reports a more specific `error_category` (`MANIFEST_NOT_FOUND`, `PERMISSION_DENIED`, `FILESYSTEM`) for some failures it reported as `UNCATEGORIZED`. ([#7380](#7380))
 * Suggest `databricks auth logout --profile <profile-name> --delete` when multiple profiles match the same workspace in `databricks auth docker` commands. ([#7363](#7363))
 * Fix `%pip` in Jupyter notebooks opened over `databricks ssh connect` on serverless environment versions 5 and 6 and on dedicated clusters running recent Databricks Runtime versions, which fell back to the stock IPython magic instead of the Databricks one. ([#7263](#7263))

### AI Runtime

 * `databricks air run` now validates the config server-side while it uploads the run artifacts, instead of before, which shortens submission. ([#7368](#7368))
 * Remove `CRITICAL` as a valid `compute.priority_class` value; the AI Runtime API no longer accepts it. ([#7371](#7371))

### Bundles

 * Built-in templates add the workspace ID to `workspace.host` (`?w=<id>`) when the profile or an environment variable sets it, so generated bundles select the right workspace on hosts shared by several workspaces. Welcome messages show the same URL, and `dbt-sql` also adds `?o=<id>` to the HTTP path it suggests for `dbt init`. ([#7350](#7350))
 * Fix grants of a renamed or recreated catalog, schema, volume or other UC resource staying recorded under the old name, which made the next `bundle plan` propose to apply them again. ([#7345](#7345))
 * Fix permissions of a recreated pipeline, app, dashboard, model serving endpoint or other resource staying recorded under the old ID, which made every later `bundle plan` propose to apply them again. ([#7361](#7361))
 * Add the `postgres_data_apis` resource (Private Preview) for enabling and configuring the Data API of a Lakebase Postgres database. ([#7160](#7160))
 * Fixes [#4012](#4012): registered model `aliases` are now set in Unity Catalog on deploy instead of being silently ignored. A model without an `aliases` section keeps the aliases set outside the bundle (for example by MLflow), and `aliases: []` removes them. ([#7163](#7163))
 * Include variable declarations and the source of each resolved value in the `--include-locations` output of `bundle validate` and `bundle summary`. ([#7351](#7351))
 * Add `.workspace.URLID` to bundle templates: the workspace ID that `.workspace.URL` adds, or empty, so templates can use it without failing when the ID is unknown. ([#7388](#7388))
 * Expose the workspace of the selected profile to bundle templates as `.workspace`, with `Hostname`, `ID`, and `URL`, so templates can address a workspace on a host shared by several workspaces. A template input named `workspace` takes precedence. ([#7349](#7349))

### Dependency Updates

 * Bump dependencies with known vulnerabilities. ([#7394](#7394))
 * Upgrade `github.com/mattn/go-runewidth` to v0.0.31, which removes ~30ms of startup time from every command. ([#7391](#7391))
 * Update the Go SDK to [v0.194.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.194.0). ([#7371](#7371))
 * Update the Go SDK to [v0.195.0](https://github.com/databricks/databricks-sdk-go/releases/tag/v0.195.0). ([#7384](#7384))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIR Databricks AI Runtime CLI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants