tl deploy: build function images via sandbox-image builder (drop v2/v3)#683
Draft
diptanu wants to merge 4 commits into
Draft
tl deploy: build function images via sandbox-image builder (drop v2/v3)#683diptanu wants to merge 4 commits into
diptanu wants to merge 4 commits into
Conversation
Adds `--image-builder-version sandbox` to `tl deploy`. When selected, every unique function image is built via the SDK's existing `build_sandbox_image()` instead of the Image Builder Service, which registers each image as a sandbox template and gives back a template id. A new `image_ref: ImageRef | None` field on FunctionManifest carries that template id to the platform — kind="sandbox_template", id=template_id — so the dataplane can resolve the function's image to a pre-built ext4 snapshot and boot a Firecracker VM from it directly, instead of importing an OCI rootfs at runtime. When `image_ref` is absent (the v2/v3 paths, unchanged), the platform falls through to its legacy implicit image lookup, preserving existing behavior. The plumbing is one parameter, `image_refs: dict[Image._id, ImageRef]`, threaded from `cli.deploy._prepare_images_sandbox` through `deploy_applications` → `create_application_manifest` → `create_function_manifest`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The dataplane resolves function images through the same internal
`/projects/{ns}/sandbox-templates/by-name/{name}` endpoint sandbox
allocations already use, so the manifest's image_ref must carry the
template name. Falls back to `image.name` if the platform response stops
echoing the template name.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The dataplane no longer resolves function images through the Image Builder Service. The SDK's v2/v3 builder clients post to an endpoint that's been removed downstream, so they cannot produce a working deployment. - Deletes ImageBuilderV2Client, ImageBuilderV3Client, log_events, the builder/ package shell, ApplicationBuildRequest / collect_application_build_request, ApplicationImageBuildError, and the tests/builder/ suite. - Drops the --image-builder-version and --build-env flags from tl deploy. The Rust CLI's BuildImages command keeps its local --build-env (for the local Docker workflow), but the deploy help text no longer references it. - tl build-images loses its --image-builder-version flag; it now only emits image definitions for the local Docker workflow. - tests/cli/test_deploy.py rewritten to cover the sandbox path (dedupes images by Image._id, falls back to image.name when the platform omits it, surfaces SandboxImageBuildError as build_failed) plus the original helper tests. 11 deploy tests pass; 15 application-manifest tests pass; Rust CLI compiles clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- .github/workflows/integration_test.yaml: drop the --build-env flags from the `tl deploy` step. The flag no longer exists on the Python argparse since the v2/v3 paths were removed; `tl build-images` keeps its --build-env (used by the local Docker workflow only). - black + isort: reflow deploy.py and test_deploy.py to match the formatter's expected style. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c6dfff0 to
c271ebb
Compare
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.
Draft PR to trigger CI on the branch. Not ready for review yet.
Summary
`tl deploy` now builds every function image through the SDK's existing sandbox image builder (`build_sandbox_image`), registers each as a sandbox template, and ships the template name on the function manifest as `image_ref`. The legacy `v2` / `v3` Image Builder Service paths are removed entirely.
Companion dataplane PR
https://github.com/tensorlakeai/compute-engine-internal/pull/919
Test plan