Skip to content

feat(ami): add calque ami bake/list/delete to pre-bake docker images (calque#144) - #184

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/calque-144-ami-bake
Aug 15, 2026
Merged

feat(ami): add calque ami bake/list/delete to pre-bake docker images (calque#144)#184
scttfrdmn merged 1 commit into
mainfrom
feat/calque-144-ami-bake

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

  • Adds calque ami bake, calque ami list, and calque 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.
  • bake acquires an instance via the existing plan.Acquirer/plan.SpawnLauncher path, runs a minimal bootstrap that pulls the target image and writes an S3 done-marker, calls spawnaws.Client.CreateAMI+WaitForAMI, then explicitly terminates the source instance (using OnComplete: "stop", not empty/"terminate", since SpawnLauncher.Build() defaults an empty OnComplete to "terminate" — which would race CreateAMI and destroy the instance before it could be snapshotted).
  • list/delete are thin wrappers over spawnaws.Client.ListAMIs/DeleteAMI, filtered to calque's own calque:baked-image tag.
  • Zero changes to internal/exec/bootstrap.go or 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 --ami flag; nothing auto-selects a baked AMI.
  • Model weights (--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 pass
  • golangci-lint run ./... — 0 issues
  • ruff check . — all checks passed
  • New cmd/calque/ami_test.go flag-parsing tests (no live AWS) — all pass
  • Manual real-AWS verification (billable, small): bake a real AMI, confirm via aws ec2 describe-images, run calque real --ami <id> ... and confirm faster bootstrap, clean up via calque 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.

…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.
@scttfrdmn
scttfrdmn merged commit 1ac00c9 into main Aug 15, 2026
7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/calque-144-ami-bake branch August 15, 2026 04:43
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