Skip to content

Add AI Runtime Task Code Source Support#5917

Draft
ben-hansen-db wants to merge 5 commits into
mainfrom
air-cli-dabs-code-source
Draft

Add AI Runtime Task Code Source Support#5917
ben-hansen-db wants to merge 5 commits into
mainfrom
air-cli-dabs-code-source

Conversation

@ben-hansen-db

Copy link
Copy Markdown

Changes

Why

Tests

@ben-hansen-db ben-hansen-db marked this pull request as draft July 14, 2026 03:12
@github-actions

Copy link
Copy Markdown
Contributor

Approval status: pending

/acceptance/bundle/ - needs approval

14 files changed
Suggested: @denik
Also eligible: @janniklasrose, @shreyas-goenka, @pietern, @anton-107, @andrewnester, @lennartkats-db

/bundle/ - needs approval

14 files changed
Suggested: @denik
Also eligible: @janniklasrose, @shreyas-goenka, @pietern, @anton-107, @andrewnester, @lennartkats-db

General files (require maintainer)

Files: .github/OWNERS, NEXT_CHANGELOG.md
Based on git history:

  • @denik -- recent work in bundle/phases/, ./

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

Drop the git-archive path (HEAD-only archive + (commit, include_paths)
cache) since the SDK ai_runtime_task exposes only a plain code_source_path
string with no way to select a git ref, so the cache added complexity for
little value. code_source_path now always packages the local directory as a
plain tar (.git and gitignored files excluded) and uploads it to the user's
~/.air/repo_snapshots directory.

Co-authored-by: Isaac
Replace the shell-out `tar -czf` (which read only the top-level .gitignore
via a lossy --exclude translation) with an in-process archive/tar+gzip
builder over libs/git.NewFileSet. This honors nested/parent/global gitignore
the same way bundle file sync does, so a large tree only packages the tracked
payload instead of venvs, caches, and build outputs.

Entries use a fixed mtime and are sorted, making the archive reproducible; it
is named by its SHA-256 (<dir>_<hash>.tar.gz) and the upload is skipped when a
content-identical archive already exists. Unchanged code no longer re-uploads
or accumulates snapshots. The reproducibility technique mirrors
bundle/deploy/snapshot/path.go.

Co-authored-by: Isaac
Make a plain bundle deploy produce a runnable AI Runtime job end to end:

- Translate ai_runtime_task.deployments[].command_path to its absolute synced
  workspace path (via TranslatePaths), matching notebook_path/python_file. The
  backend rejects a relative command_path.
- Record code_source_path in the legacy /Users/... form (no /Workspace prefix)
  that the AI Runtime snapshot fetcher expects, while still uploading via the
  /Workspace filer.
- Synthesize a requirements.yaml next to command_path from the job's serverless
  environments[] spec. The entry script reads it from command_path's directory
  to set up the workload environment; without it the run fails during setup.
- Build the code snapshot from the bundle sync file list so it honors .gitignore
  plus the top-level sync.include/sync.exclude globs, not just a single
  top-level .gitignore.

Verified end to end on a live workspace: deploy of a plain bundle (no
hand-authored files) yields a job whose run terminates SUCCESS; sync.exclude and
.gitignore entries are absent from the uploaded snapshot.

Co-authored-by: Isaac
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