Add AI Runtime Task Code Source Support#5917
Draft
ben-hansen-db wants to merge 5 commits into
Draft
Conversation
Contributor
Approval status: pending
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
Why
Tests