Repository navigation
feat(cli): every put names its images <id>__<role>, as a bundle does - #70
Conversation
The put commands named their images with a prefix: mcp-server-<id>, website-backend-<id> and website-frontend-<id>, a2a-agent-<id>, gateway-<id>, service-db-, db-web- and db-mcp-<id>, and website-browser-<id>. Since derived ids keep their base's namespace, a prefix in front of an @Local id isn't one, so a put with an @Local --id was refused, after its docker build had run. Every put now derives its image ids with derive_id, using the roles a bundle uses for the same image: env_image, backend_image / frontend_image, agent_image, and db_image / db_web_image / db_mcp_image for the service-db. The GitHub builds the hub calls do the same. Each local build is tagged with the id's image repository, so an @Local id builds under a valid reference. Stored envs and agents keep resolving, since they name their images by id and version. A put of an existing env starts its image's versions again under the new id. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Verification on 40d684cReal puts and runs on macOS arm64 with Docker, from fresh state roots, on the local stores and the local sandbox provider.
No sandbox folder or container was left after any run. Not run locally: the GitHub build path (it needs a remote VM; its ids are covered by the unit test) and a registry other than the local one. |
| monkeypatch.setattr(DockerImageArtifact, "put", classmethod(lambda cls, id, *, description, image_name, **kwargs: ( | ||
| cls.put_tar(id, description=description, image_name=image_name, tar_gz_s3_url=tarball)))) |
There was a problem hiding this comment.
Local put test skips publication
The new @local put test replaces DockerImageArtifact.put with put_tar, so it skips the image store and registry path this change relies on. It checks build tags and artifact IDs, but not the saved image reference or the registered env or agent. Add checks for those results so a routing or publication mistake cannot pass unnoticed.
Knowledge Base Used: Container images and composition
Prompt To Fix With AI
This is a comment left during a code review.
Path: tst/unit/store/local_id_acceptance_test.py
Line: 285-286
Comment:
**Local put test skips publication**
The new `@local` put test replaces `DockerImageArtifact.put` with `put_tar`, so it skips the image store and registry path this change relies on. It checks build tags and artifact IDs, but not the saved image reference or the registered env or agent. Add checks for those results so a routing or publication mistake cannot pass unnoticed.
**Knowledge Base Used:** [Container images and composition](https://app.greptile.com/scale-ai/-/custom-context/knowledge-base/scaleapi/agentenv-framework/-/docs/container-images-and-composition.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.There was a problem hiding this comment.
Added in c08585c: the test now checks each saved image name and that the registered env or agent names the derived images. The real push to the local registry is covered by an end-to-end run, in the verification comment: the @Local mcp-server and a2a-agent puts write localhost:5000/local/… images, and a bundle deploys both.
…put registers An @Local id as long as one may be leaves no room for the image's suffix, and the image id was refused only once the image had been built. The building puts now check the env's or agent's id and each image id against the store they're written to before they build. The @Local put test now also checks the saved image names and the env or agent the put registers over its images. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Every put command now names the images it writes
<id>__<role>, the way a bundle names the same image, so a put with an@local--idworks.Why
The put commands named their images with a prefix in front of the env's or agent's id. A derived id has to keep its base's namespace, so a prefix in front of an
@localid is refused (id 'mcp-server-@local/…' contains an @local id but isn't one). The refusal came after the docker build had run. Bundles already name implied images withderive_id, so the same image had two names depending on how it was written.What changes
env mcp-server put --id crmmcp-server-crmcrm__env_imageenv website put --id shopwebsite-backend-shop,website-frontend-shopshop__backend_image,shop__frontend_imagea2a-agent put --id solvera2a-agent-solversolver__agent_imageenv gateway put --id defaultgateway-defaultdefault__env_imageenv service-db put --id default-dbservice-db-…,db-web-…,db-mcp-default-dbdefault-db__db_image,__db_web_image,__db_mcp_imageenv website-browser put --id website-browserwebsite-browser-website-browserwebsite-browser__env_imageMCPServerEnv.put_from_githubandWebsiteEnv.put_from_githubuse the same ids.image_repository), so an@localid builds under a valid reference. The infra builds keep their fixed tags.env_imagefor an env'simagekey,agent_imagefor an agent's, and the key itself for a website'sbackend_image/frontend_image.Compatibility
{id, version}, and a deploy uses the image's storedimage_name. Nothing re-derives an image id from an env id.a2a-agent-*match left is the agent-container fallback insandbox_utils, which matches container names, not image ids.Tests
a2a-agent put,env mcp-server putandenv website putwith an@local--id, through the real artifact store and namespace routing, with docker stubbed. Each builds underlocal/…tags and writes its images under ids derived from the@localid, all in the@localnamespace's store.Release
Hot path: images built through the GitHub build paths get the new names once consumers pin this release. It needs the
bump-versionlabel and the usual production smoke after the release.🤖 Generated with Claude Code
The PR appears safe to merge, though the local put test still skips image publication.
Fix with agent prompt
Summary
Put commands now name images by combining the owner id with the image’s role, matching bundle resolution. Local builds also use valid image tags for
@localids, and infra bootstrap uses the same role-based naming.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Put command] --> B[Derive image IDs] B --> C[Check owner and image IDs] C --> D[Build images] D --> E[Save image artifacts] E --> F[Register env or agent]Reviews (2) · Last reviewed commit: "fix(cli): check a put's ids before it bu..."