feat(ami): add calque ami bake/list/delete to pre-bake docker images (calque#144) - #184
Merged
Conversation
…s (calque#144) Every real-AWS run pulls vllm/vllm-openai:latest fresh from Docker Hub on every single boot. A pre-baked AMI's local docker layer cache makes the existing unconditional `docker pull` line fast automatically, so this adds only the AMI lifecycle orchestration spawn doesn't provide (spawn's own CreateAMI/WaitForAMI/ListAMIs/DeleteAMI snapshot an already-running instance but never launch/wait/terminate one) — purely additive, manual --ami consumption only, no changes to bootstrap.go or any run command.
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.
Summary
calque ami bake,calque ami list, andcalque ami delete(cmd/calque/ami.go), addressing the clean, non-conflicting slice of calque#144: baking the docker image (not model weights) into a custom AMI so real-AWS runs skip a fresh multi-GB Docker Hub pull on every boot.bakeacquires an instance via the existingplan.Acquirer/plan.SpawnLauncherpath, runs a minimal bootstrap that pulls the target image and writes an S3 done-marker, callsspawnaws.Client.CreateAMI+WaitForAMI, then explicitly terminates the source instance (usingOnComplete: "stop", not empty/"terminate", sinceSpawnLauncher.Build()defaults an emptyOnCompleteto"terminate"— which would raceCreateAMIand destroy the instance before it could be snapshotted).list/deleteare thin wrappers overspawnaws.Client.ListAMIs/DeleteAMI, filtered to calque's owncalque:baked-imagetag.internal/exec/bootstrap.goor any existing run command — by design. Baking is opt-in and manual: the operator passes the resulting AMI id to any run command's existing--amiflag; nothing auto-selects a baked AMI.--model, a free-form HF repo id) are explicitly out of scope — baking specific weights would conflict with--model's free-form design, calque#144's own flagged open question, left unresolved.Test plan
go build ./... && go vet ./... && gofmt -l . && go test -count=1 ./...— all passgolangci-lint run ./...— 0 issuesruff check .— all checks passedcmd/calque/ami_test.goflag-parsing tests (no live AWS) — all passaws ec2 describe-images, runcalque real --ami <id> ...and confirm faster bootstrap, clean up viacalque ami delete— not yet run in this PR; can be verified post-merge before broader use.This PR leaves calque#144 OPEN — it closes only the image-only-baking slice; the issue's own weight-baking policy question is still unresolved.