Repository navigation
refactor: build runtime images with Bake under image/ - #13507
Merged
Merged
Conversation
Move runtimes/vllm and runtimes/ollama to image/, beside the agent and proxy images, and build them with docker buildx bake instead of nemoclaw-build's runtime builder. A shared supervisor stage packages the runtime crate, vendors its locked dependencies, and compiles it offline; the vLLM and Ollama images retain that archive and their notices. Runtime images always build for the host's platform with fixed timestamps; agent images now default to the host's platform.
cv
enabled auto-merge (squash)
October 20, 2026 01:41
Contributor
gaveezy
added a commit
that referenced
this pull request
Oct 20, 2026
v1 moved the runtime images under image/ and builds them with Bake (#13507), deleting runtimes/vllm/Dockerfile and runtimes/ollama/Dockerfile. This branch had added the `nemoclaw-runtime-ready` symlink to both, so the merge takes the deletions and adds the same `RUN ln -s` line to image/vllm/Dockerfile and image/ollama/Dockerfile, right after the supervisor binary is copied. The contract test that checks the readiness command against the runtime images now reads them from image/. Co-Authored-By: Claude Opus 5.5 <[email protected]>
gaveezy
added a commit
that referenced
this pull request
Oct 20, 2026
…ices The base branch merged v1 up to 0bc2601. Resolutions: - SecretRef/FileRef split (#13222): `credential` on an inference provider is now a `SecretRef`. The cluster key keeps its description (the same key as the service's `kubernetes.keySecret`), and `InferenceTarget::Service` carries `Option<&SecretRef>`. The authored form, `credential: {env: …}`, is unchanged, so the examples and fixtures stay as they are. - context_advisory.rs was removed (#13485). This branch had only widened its `InferenceTarget::Service` pattern, so the merge takes the deletion and drops the call in `Deployment::run`, keeping the NetworkPolicy warning before it. - Runtime images now build with Bake under image/ (#13507), which removed nemoclaw-build's runtime_source.rs and tests/runtime_engine.rs. The merge takes both deletions. That also removes 05fb557's `--offline` packaging and its test: on Live/Docker runners, archived tests ran with a Cargo home that lacked the OpenShell git checkout, so offline packaging failed ("you are in the offline mode"). - The authoring journey count is 41: v1 removed one single-sandbox example and this branch adds two. - The schema and configuration reference are regenerated. Co-Authored-By: Claude Opus 5.5 <[email protected]>
cv
added a commit
that referenced
this pull request
Oct 20, 2026
## Failure `cargo images build` built each agent image twice. It baked the image under a temporary tag, ran `catalog.py --installed` in a container to read the installed Fabric catalog, then ran a second `docker build FROM` the temporary image to add the `io.nemoclaw.fabric.catalog` label that plan reads. So the image Bake built was never the image deployments used, and `docker buildx bake --push` would publish unlabeled images, which blocks publishing images from Bake to a registry. The label exists because plan reads the catalog from the image configuration: locally through Docker, and on Kubernetes from the exported metadata bundle, without pulling layers. Derived images inherit it through `FROM`. A Dockerfile can't set a label from something its own build computes, hence the relabel. ## Decision Compute the label inside the same Dockerfile and pass it between two cached Bake builds. - **`image/fabric/Dockerfile`** gains two stages, built on the harness stage that a global `STAGE` argument selects: - `catalog` runs `catalog.py --installed` offline and exports `/catalog.json`; - `labeled` takes it as the `CATALOG` build argument, sets the label, and fails the build unless `CATALOG` matches the installed catalog. A missing or wrong catalog fails with "CATALOG must be this image's installed catalog; build with cargo images build". - **`docker-bake.hcl`** passes `STAGE` for each agent and for the reference image. - **`cargo images build`:** - bakes `<name>` with `target=catalog` to `.build/catalog/<name>`; - applies its existing label checks (only the reference image lists the reference adapter); - bakes `<name>` with `target=labeled` and the catalog. The temporary tag, the metadata container, the relabel build, and `read_metadata` are gone. Tags come from Bake as for every other image. - **Unchanged:** a plain `docker buildx bake <agent>` still builds the unlabeled harness stage, so the Brev candidate build is unaffected. - **Also fixed:** an unused-function warning in the CI runner build, left by #13507. `target` is used only by the bundle, so it is gated on the `sdk` feature. ## Validation - **Prototype, on a DGX Spark (linux/arm64):** - the `catalog` and `labeled` builds of the reference image each took about 1 s from cache, and the label equaled the exported catalog; - a wrong or missing `CATALOG` failed the build with the message above; - a plain bake build stayed unlabeled. - **Real builds:** `cargo images build --platform linux/arm64 agents` built all ten images with labels in 227 s. - **Qualification:** CI's loop passed for every image (`cargo images qualify`, with the OpenClaw, Hermes and Pi lifecycles, plus `image/test_image.py` against each label), and `cargo images qualify nc-fabric:dummy --lifecycle dummy` passed. - **Checks:** - `docker buildx bake --check dummy agents ollama-proxy` and `docker buildx bake check` passed; - `cargo ci` passed, including the bundle and lifecycle steps; - `cargo ci live-docker` passed (9 tests), building its Pi and reference images through this path and deploying them. - **Tests:** the live image test now expects each agent's catalog bake and labeled bake. The Docker fake writes the exported catalog.
This was referenced Oct 20, 2026
10 tasks
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.
Failure
NemoClaw built its images two ways. Agent and proxy images used
docker buildx bake(docker-bake.hcl). The vLLM and Ollama runtime images, underruntimes/, used a separate runtime builder innemoclaw-build:cargo run -p nemoclaw-build -- runtime runtimes/<name>/build.json, about 780 lines plus abuild.jsonper runtime and its own tests. That builder staged and vendored the supervisor's sources, compiled the supervisor on the host, downloaded licenses by checksum, wrotesupervisor.json, exported an OCI archive, loaded it, and checked its digest.Decision
One build path, and the images in one place.
Layout:
runtimes/vllmandruntimes/ollamabecomeimage/vllmandimage/ollama, besideimage/fabricandimage/ollama-proxy.image/supervisor/Dockerfile(on pinnedrust:1.99.1-bookworm):cargo package;--offlinefrom that archive.Bookworm's glibc 2.36 is older than both bases' 2.39, so the supervisor stays dynamically linked as before.
The vLLM and Ollama Dockerfiles stay thin: each copies the supervisor and its source archive from the shared stage and keeps its notice, its Dockerfile, and the supervisor's Dockerfile under
/opt/nemoclaw/source/. The Ollama license comes in byADD --checksum.docker-bake.hclgainssupervisor,vllm,ollamaand theruntimesgroup:BAKE_LOCAL_PLATFORM), so the supervisor never compiles under emulation;unpack=false; Docker unpacks on first run.Small behavior change:
AGENT_PLATFORMnow defaults to the host's platform instead of being required, still validated tolinux/arm64orlinux/amd64.cargo images buildand CI keep passing it explicitly.Removed from
nemoclaw-build:runtimecommand,source_archive, and its dependency onnemoclaw-runtime;live-dockerfilter.The test that the CI builder doesn't pull in the SDK moves to
builder_dependencies.rs.Dropped:
supervisor.jsonand the runtime-only source version. Nothing read them; the retained archive is the source record, and the runtime contract stays checked throughnemoclaw_runtime::SPEC_VERSIONand the image labels.CI path rules: runtime image directories keep out of
CI / Images, asruntimes/did, and still trigger the live, bundle and lifecycle checks throughimage/**.Docs and examples use
docker buildx bake vllmorollamaanddocker image inspectfor the digest.Validation
cargo cipassed, including the bundle and lifecycle steps, after rebasing onto refactor: remove the Qwen3.8 recipe image #13506.fern checkreported 0 errors.docker buildx bake runtimesbuilt both images. The vLLM image keeps its four NemoClaw labels, and both supervisors run.Cargo.lockwith no SDK, provider, OpenShell, Fabric, Bollard or Tonic packages, the vendored sources (about 19,700 entries), and the vendoring config.--no-cacheproduced the same digest (sha256:6d776313…).cargo ci live-dockerpassed (9 tests: the previous 11 minus the two builder tests).uname -mand repliedaarch64. The deployment was destroyed and its objects removed.