Skip to content

cmd/air: probe a relaunch's staged dir while SCIM Me is in flight - #7891

Open
stevenchen-db wants to merge 4 commits into
schen/ll3-launch-dir-cachefrom
schen/ll3-me-probe-overlap
Open

stevenchen-db wants to merge 4 commits into
schen/ll3-launch-dir-cachefrom
schen/ll3-me-probe-overlap

Conversation

@stevenchen-db

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

Copy link
Copy Markdown
Contributor

Changes

  • Stacked on cmd/air: reuse a relaunch's launch dir when its files are already staged #7860. A relaunch probes its remembered launch dir and runs the config:validate dry run under the user name that staged it, concurrently with GET scim/v2/Me.
  • Me then confirms or refutes that name. A match uses the probe result; a mismatch discards it and takes today's path under the real home. A Me failure returns the same error as before. Every write (mkdirs, imports, the index entry, the experiment directory) and the submit wait for Me.
  • The launch index key drops the home ({host, content}), so the entry can be found before Me; the entry records the base path, which Me must confirm before the dir is used.

Why

On a relaunch the pre-submit path was serial: Me (~60 ms on e2-dogfood, first request, carries the TLS handshake), then the probes (~45–50 ms). The probes and the dry run only need a name the cache already holds.

Tests

Interleaved A/B against the #7860 head, same YAML, each run cancelled after submit; pre-submit = last pre-submit response before the submit request, from process start.

Scenario n (7860 / this) Pre-submit p50 (ms) Difference (ms), bootstrap 95% CI
e2-dogfood relaunch 20 / 20 124 / 83 −40.6 [−47.6, −32.4]
azure-dogfood relaunch 20 / 20 286 / 194 −91.9 [−121.2, −59.0]
e2-dogfood first launch 11 / 11 255 / 250 −5.2 [−55.8, +12.5]

Unit tests: a confirmed relaunch makes no write before Me; a mismatched name discards the speculative reads, uploads under the real home and re-points the index; a Me failure writes nothing. acceptance/air/run-relaunch passes unchanged; ./task fmt, ./task checks, ./task lint pass.

Safety: before Me returns, only read-only calls run, with the caller's own credentials: get-status on the staged files and the config:validate dry run (no server-side writes). The remembered name comes from this user's own local cache. If it is wrong (re-login as another user, rename), the reads are discarded and nothing is written or submitted under it.

Not covered: azure-dogfood first launch had too few samples to rule out a small regression (two runs were slowed by a 2.5 s import-file on the unchanged write path); the first-launch code path is unchanged.

This pull request and its description were written by Isaac.

stevenchen-db and others added 2 commits November 23, 2026 19:41
A relaunch used to wait for Me to learn the user's home before it could look
up the staged launch dir. The remembered dir is now probed and validated under
the user name that staged it, concurrently with Me. Me then confirms or refutes
that name: a match uses the probe result, a mismatch discards it and takes the
unchanged path under the real home. Every write, the upload, and the submit wait
for Me.

The index key drops the home so the entry can be found before Me; the entry
records the home and user name and is checked against Me.

Co-authored-by: Isaac <no-reply@databricks.com>
Co-authored-by: Isaac <no-reply@databricks.com>
@stevenchen-db
stevenchen-db requested review from a team as code owners November 23, 2026 20:23
Co-authored-by: Isaac <no-reply@databricks.com>
@stevenchen-db
stevenchen-db deployed to test-trigger-is November 23, 2026 20:24 — with GitHub Actions Active
@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Commit: 752cf1276 | Workflow run

Regression test report

Selected 1 changed tests (limit=20, 0 not selected)

1 tests: regression=1 unreleased=0 coverage=0 failing=0
test branch main (4cbd133) latest (v1.27.0)
TestAccept/air/run-relaunch ✅ ❌ ❌
TestAccept/air/run-relaunch: branch ✅ | main (4cbd133) ❌ | latest (v1.27.0) ❌

main (4cbd133):

acceptance_test.go:1402: Diff:
        --- air/run-relaunch/output.txt
        +++ /tmp/TestAcceptairrun-relaunch4059101585/002/output.txt
        @@ -27,8 +27,9 @@
           databricks air logs 555 --follow
         
         >>> print_requests.py --get //api/2.0/workspace --oneline --sort
        -{"method": "GET", "path": "/api/2.0/workspace/get-status", "q": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/command.sh"}}
        -{"method": "GET", "path": "/api/2.0/workspace/get-status", "q": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/training_config.yaml"}}
        +{"method": "POST", "path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/command.sh", "q": {"overwrite": "true"}, "raw_body": "python train.py"}
        +{"method": "POST", "path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/training_config.yaml", "q": {"overwrite": "true"}, "raw_body": "experiment_name: relaunch-smoke\ncommand: python train.py\ncompute:\n    accelerator_type: GPU_1xH100\n    num_accelerators: 1\nenvironment:\n    version: 5\n    dependencies: []\n"}
        +{"method": "POST", "path": "/api/2.0/workspace/mkdirs", "body": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]"}}
         
         === a relaunch after the staged dir is deleted uploads again
         
        @@ -42,8 +43,6 @@
           databricks air logs 555 --follow
         
         >>> print_requests.py --get //api/2.0/workspace --oneline --sort
        -{"method": "GET", "path": "/api/2.0/workspace/get-status", "q": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/command.sh"}}
        -{"method": "GET", "path": "/api/2.0/workspace/get-status", "q": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/training_config.yaml"}}
         {"method": "POST", "path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/command.sh", "q": {"overwrite": "true"}, "raw_body": "python train.py"}
         {"method": "POST", "path": "/api/2.0/workspace-files/import-file/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]/training_config.yaml", "q": {"overwrite": "true"}, "raw_body": "experiment_name: relaunch-smoke\ncommand: python train.py\ncompute:\n    accelerator_type: GPU_1xH100\n    num_accelerators: 1\nenvironment:\n    version: 5\n    dependencies: []\n"}
         {"method": "POST", "path": "/api/2.0/workspace/mkdirs", "body": {"path": "/Workspace/Users/[USERNAME]/.air/cli_launch/relaunch-smoke/relaunch-smoke_[RUN_ID]"}}
        
FAIL

latest (v1.27.0): same output as main (4cbd133)

…y's user name

A deferred abort stops and waits for the speculative probe and validation on
any early return after they start, not only on a Me failure or mismatch.

launchIndexEntry no longer stores the Me user name: Base already carries the
home that Me must confirm, so speculation is gated on having an entry and no
workspace-dir override.

Co-authored-by: Isaac <no-reply@databricks.com>
@eng-dev-ecosystem-bot

Copy link
Copy Markdown
Collaborator

✅ Integration test report

Commit: 752cf12

Run: 45262257621

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux-2core-8gb 1 272 20 14:34
💚​ aws-windows-latest-4core-16gb 1 274 18 10:53
💚​ azure linux-2core-8gb 1 271 20 14:33
💚​ azure-windows-latest-4core-16gb 1 273 18 13:05
💚​ gcp linux-2core-8gb 1 272 20 15:07
💚​ gcp-windows-latest-4core-16gb 1 274 18 10:08
Test Name aws linux-2core-8gb aws-windows-latest-4core-16gb azure linux-2core-8gb azure-windows-latest-4core-16gb gcp linux-2core-8gb gcp-windows-latest-4core-16gb
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 41 slowest tests (at least 2 minutes):
duration env testname
5:14 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
5:05 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
4:10 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
4:10 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
4:04 gcp linux-2core-8gb TestAccept
3:59 gcp-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
3:57 gcp linux-2core-8gb TestFilerWorkspaceNotebook/pyNb.py
3:56 aws-windows-latest-4core-16gb TestAccept
3:55 gcp-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
3:52 gcp linux-2core-8gb TestImportDirDoesNotOverwrite
3:43 azure-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
3:42 azure-windows-latest-4core-16gb TestFilerReadWrite/workspace_files_extensions
3:33 aws-windows-latest-4core-16gb TestSyncFullFileSync
3:25 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsDelete
3:25 aws-windows-latest-4core-16gb TestImportDir
3:18 gcp-windows-latest-4core-16gb TestAccept
3:18 aws-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
3:18 azure linux-2core-8gb TestAccept
3:14 aws linux-2core-8gb TestAccept
3:08 azure-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsRead
3:04 azure-windows-latest-4core-16gb TestAccept
2:46 aws-windows-latest-4core-16gb TestFilerRecursiveDelete/workspace_files_extensions
2:40 aws-windows-latest-4core-16gb TestFilerWorkspaceNotebook/pythonJupyterNb.ipynb
2:37 aws linux-2core-8gb TestFilerReadWrite/workspace_files_extensions
2:31 azure linux-2core-8gb TestLock
2:29 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsDelete
2:28 gcp linux-2core-8gb TestImportDir
2:28 gcp linux-2core-8gb TestFilerRecursiveDelete/workspace_files
2:25 gcp-windows-latest-4core-16gb TestFilerWorkspaceFilesExtensionsReadDir
2:17 aws linux-2core-8gb TestFilerWorkspaceFilesExtensionsRead
2:11 aws-windows-latest-4core-16gb TestFilerWorkspaceNotebook/sqlNb.sql
2:10 azure linux-2core-8gb TestSyncFullFileSync
2:10 gcp-windows-latest-4core-16gb TestFilerReadDir/workspace_files_extensions
2:10 gcp linux-2core-8gb TestFilerWorkspaceFilesExtensionsReadDir
2:08 gcp linux-2core-8gb TestExportDir
2:06 aws linux-2core-8gb TestFilerReadDir/workspace_files_extensions
2:05 aws linux-2core-8gb TestImportDir
2:03 azure-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:03 azure linux-2core-8gb TestFilerWorkspaceFilesExtensionsDelete
2:02 aws-windows-latest-4core-16gb TestImportDirWithOverwriteFlag
2:00 azure linux-2core-8gb TestFilerRecursiveDelete/workspace_files

This branch was successfully deployed

1 active (outdated) deployment
test-trigger-is — ef5d9fb9 Deployed Nov 23, 2026 by stevenchen-db via trigger-tests #42073
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