Skip to content

experimental/air: content-address the plain_tar upload - #6578

Draft
ben-hansen-db wants to merge 2 commits into
mainfrom
air-plain-tar-content-addressed
Draft

experimental/air: content-address the plain_tar upload#6578
ben-hansen-db wants to merge 2 commits into
mainfrom
air-plain-tar-content-addressed

Conversation

@ben-hansen-db

@ben-hansen-db ben-hansen-db commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes the plain_tar upload content-addressed so an unchanged working tree skips packaging and upload — the mechanism git_archive already used, now generalized to both modes. Standalone; independent of the parallel-gzip change (#6571).

Today git_archive names its tarball by (commit, include_paths) and, if that object is already uploaded, reuses it and moves no bytes. plain_tar (dirty working tree / no ref — the normal iterate-and-resubmit loop) used a timestamped name, so it re-packaged and re-uploaded the full tarball on every submission, even when nothing changed.

This change:

  • snapshotFiles returns each file's size + mtime (captured free from the Lstat it already did) instead of just paths.
  • computePlainTarKey hashes the sorted path+size+mtime set into a working-tree fingerprint (namespaced with its own version tag).
  • snapshotTarName names plain_tar <dir>_<fingerprint>.tar.gz (was <dir>_<timestamp>.tar.gz) and returns the file listing so packaging reuses it — the tree is walked once, not twice.
  • uploadSnapshotViaDABs runs the existing snapshotExists skip for both modes: if the object already exists, it reuses the remote path and uploads nothing.

Validation

  • experimental/air/cmd package tests pass; vet and gofmt clean. The old "unique timestamped name" test is now a "content-addressed + dedup on unchanged" test (mirrors the git_archive caching test); added computePlainTarKey property tests.

  • End-to-end on df1, with this branch's binary. Submitting an unchanged universe tree twice: the second run logs snapshot upload skipped; reusing …<fingerprint>.tar.gz, returns the identical remote code_source_path, and skips packaging + upload. Both runs launched (1×A10):

    code source first submit (package + upload) second submit (unchanged → skipped)
    research (~27 MB) 5.7 s 4.9 s
    research + js + spark (~97 MB) 37.6 s 4.8 s

    The win is proportional to what would otherwise be re-uploaded: negligible for a tiny tree (the submit is dominated by fixed API/MLflow/auth overhead), ~8× once the tarball is non-trivial. The slow first submit reflects this branch's single-threaded shell tar -czf — parallel gzip is the separate experimental/air: parallel gzip for the plain_tar snapshot packer #6571; the two are complementary (this PR speeds the unchanged resubmit, experimental/air: parallel gzip for the plain_tar snapshot packer #6571 speeds the first/changed one).

Notes / trade-offs

  • Fingerprint is size+mtime, not content — the same trade-off DABs file-sync makes — so an edit that preserves both size and mtime is not detected. The version tag is the invalidation lever.
  • Remote objects accumulate (one per distinct tree state), same as git_archive — no eviction here.

This pull request and its description were written by Isaac.

@eng-dev-ecosystem-bot

eng-dev-ecosystem-bot commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Integration test report

Commit: 5362b47

Run: 34383190377

Env 💚​RECOVERED ✅​pass 🙈​skip Time
💚​ aws linux 1 275 15 9:16
💚​ aws windows 1 277 13 6:06
💚​ azure linux 1 274 15 11:26
💚​ azure windows 1 276 13 8:04
💚​ gcp linux 1 275 15 14:10
💚​ gcp windows 1 277 13 7:31
Test Name aws linux aws windows azure linux azure windows gcp linux gcp windows
💚​ TestAccept 💚​R 💚​R 💚​R 💚​R 💚​R 💚​R
Top 14 slowest tests (at least 2 minutes):
duration env testname
3:55 gcp linux TestFilerReadWrite/workspace_files_extensions
3:50 aws windows TestAccept
3:48 gcp windows TestAccept
3:47 azure linux TestFilerWorkspaceFilesExtensionsStat
3:47 azure windows TestAccept
3:46 azure linux TestExportDir
3:44 azure windows TestImportDirDoesNotOverwrite
2:25 azure windows TestFilerWorkspaceFilesExtensionsReadDir
2:12 gcp linux TestFilerWorkspaceFilesExtensionsStat
2:12 gcp windows TestFilerRecursiveDelete/workspace_files_extensions
2:09 azure linux TestFilerWorkspaceFilesExtensionsDelete
2:08 aws linux TestAccept
2:05 azure linux TestAccept
2:03 gcp linux TestAccept

git_archive snapshots are already content-addressed: a repeat submission at the
same commit reuses the uploaded tarball and skips packaging + upload. plain_tar
(dirty working tree) used a timestamped name, so it re-packaged and re-uploaded
the full tarball on every submission, even when nothing changed.

Name the plain_tar tarball by a working-tree fingerprint (sha256 over each file's
path, size and mtime) and run the same snapshotExists skip for both modes. An
unchanged resubmit now reuses the remote object and moves no bytes. The listing
is captured once and threaded into packaging, so the tree is walked only once.
The fingerprint is size+mtime, not content, matching DABs file-sync.

Verified on df1: a second submission of an unchanged tree logs
"snapshot upload skipped; reusing ..." and returns the identical remote path.

Co-authored-by: Isaac <no-reply@databricks.com>
@ben-hansen-db
ben-hansen-db force-pushed the air-plain-tar-content-addressed branch from 9f7d8be to b9aa788 Compare September 9, 2026 16:03
@ben-hansen-db
ben-hansen-db changed the base branch from air-plain-tar-pgzip to main September 9, 2026 16:03
- Strengthen the dedup test: count import-file calls and assert the second
  (unchanged) submit adds zero, instead of asserting a path-keyed set has one
  entry. The set couldn't distinguish a skipped submit from a re-upload to the
  same content-addressed name; the counter can (verified it fails when the skip
  is disabled).
- Fold snapshotPackagingVersion into computePlainTarKey so a packaging-logic
  bump invalidates plain_tar keys too, not just plainTarKeyVersion.
- Fix stale comments now that plain_tar is content-addressed: modePlainTar
  ("not cacheable") and snapshotExists ("git_archive" only).

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.

2 participants