Repository navigation
ci: build the live images once per platform and share them - #12995
Merged
Merged
Conversation
Contributor
Collaborator
Author
|
Measured in this PR's run, 38137587218, against
In AMD64
Each platform now builds its images once instead of twice, which also saves runner time. A layer cache in the image job would now save up to about 130 s on AMD64, by letting the live jobs start when the bundle is ready. That trade-off is different from the one in the description, so it would be a separate change. |
This was referenced Oct 11, 2026
cv
added a commit
that referenced
this pull request
Oct 11, 2026
…ts (#13001) ## Failure Linux AMD64's `Live / Docker` job decides how long required checks take. In #12995's run ([38137587218](https://github.com/NVIDIA/NemoClaw/actions/runs/38137587218)), its tests took 313 s. One test, `runtime::tests::retained_runtime_rebuilds_offline_without_protobuf_or_a_dependency_cache`, took 163 s of that on AMD64 and 113 s of 232 s on ARM64. The `live-docker` profile runs one test at a time because the tests share one Docker engine. That test uses no engine at all: it compiles the runtime in release mode from its retained source archive, offline, with an empty `CARGO_HOME` and no `protoc`. It's in this profile only because it needs Linux, yet every Docker test waits behind it. ## Decision - **Test group:** a `docker-engine` nextest group that allows one test at a time. An override for the `live-docker` profile puts every test except the rebuild in it. - **Threads:** the profile runs two tests at once. The Docker tests still run one at a time, and the rebuild compiles alongside them. - **Docs:** updated `testing.md` to say so. The runner's later commands each select one gateway test, so they're unchanged. On AMD64, the first command should drop from about 250 s to roughly the rebuild's 163 s plus however much the compile slows the Docker tests on a 4-CPU runner. This PR's own run measures that, because `.config/nextest.toml` is a live input. This doesn't depend on #12995, which shares the live images. ## Validation - **Groups:** `cargo nextest show-config test-groups --profile live-docker --run-ignored only` puts the other nine tests in `docker-engine` and leaves the rebuild outside it. - **Local run:** `cargo ci live-docker` passed all 10 tests on Linux ARM64 in 258 s. In its JUnit report, the rebuild ran from 0 to 39 s while the Docker tests ran one after another, and the first command took 143 s instead of 178 s. This machine compiles much faster than a hosted runner, so CI should save more. - **`cargo ci`** passed in 472 s: 1,336 workspace tests and 127 lifecycle tests. Afterwards, the documentation tests passed again with the `testing.md` change.
cv
added a commit
that referenced
this pull request
Oct 11, 2026
Part of #12876: its last criterion, "the testing guide describes the layers and budgets". ## Failure `docs/contributing/testing.md` listed the step budgets but didn't describe the unit, contract, system, and live layers, or which crates and binaries belong to each. `docs/contributing/integration-tests.md` had grown one fixture at a time, and some of its text no longer matched the code: - it named tests that no longer exist: `harness_codex`, the OpenClaw interface lifecycle, and Hermes interface modes; - it described ten Fabric harness tests, but `fabric_deployment` has two (OpenClaw and Pi); - its Docker tests are part of the `live-docker` suite, not the fixture layers. ## Decision - `testing.md` now has sections for the layers (what each checks, its binaries, and what belongs there), how to run each layer with the one `NEMOCLAW_TEST_BUNDLE` input, budgets and per-test limits (where each is enforced and how to change one), timing reports, and how CI runs each layer: jobs, partitions, archives, the Windows relay, and live suites on pull requests. The dependency, image, schema, CLI, cache, and coverage sections are unchanged. - `integration-tests.md` now covers the contract and system layers: the shared harness, each provider's contract binary by module, and the system modules, built from the current test names. - The four sections that need a real Docker engine move to `live-tests.md` under a new Docker Live Suite section, next to the Docker gateway tests already there. Their two inbound links are updated. Other anchors are kept. - After merging `v1` (#12995, #12996, #12998, #12999, #13000), the guide describes what moved: the system layer's `nemoclaw-sdk` tests are now only the Helm recovery tests, the OpenShell and Fabric backends' fake-gateway tests (formerly `nemoclaw-e2e/tests/openshell.rs`) are provider unit tests, the Kind suite runs `nemoclaw-e2e`'s `kubernetes_live` and `kubernetes_chart`, and `Build live images` builds the live images once and decides whether the live suites run. - The `kubernetes_lifecycle` contract tests' `#[ignore]` reason named `NEMOCLAW_TEST_TOFU` and `NEMOCLAW_TEST_PROVIDER`; it now names `NEMOCLAW_TEST_BUNDLE`, which the tests read. - Every statement was checked against `run_ci.rs`, `ci/timing.rs`, `.config/`, the workflows, the `v1` ruleset, and the tests. ### Budget enforcement audit Every budget in `.config/test-budgets.yaml` is enforced on the Linux runners. In run [38136353545](https://github.com/NVIDIA/NemoClaw/actions/runs/38136353545) (linux_amd64), the `test`, `Lifecycle / 1`, `Live / Docker`, `Live / Kind`, and `Lifecycle timing` logs each print their budget and "Within budget." with no "reported only" note. The three binary budgets appear in the `Lifecycle timing` table. No budget is recorded but unenforced. These gaps remain: - When `changes live` skips the live suites on a pull request, their budgets aren't checked for that PR. - The `test` wall budget covers the nextest run, not the doctests. - `.config/test-budgets.yaml` isn't checked in the other direction. A step key that names no step, or a binary budget whose binary has no lifecycle tests (renamed, or every partition missing its report), passes silently. `Lifecycle timing` names a partition with no report but doesn't fail on it. ## Validation - `cargo run --locked -p nemoclaw-build -- fern check`: 0 errors. Its one warning is also on `v1`. - `git diff --check` - `cargo test -p nemoclaw-build --test integration ci::`: 15 passed. - I ran the documented commands against a `linux_arm64` bundle: - the nextest `lifecycle` command filtered to `openshell-provider::contract` (44 passed); - `nemoclaw-sdk --lib -- --ignored helm_recovery` (5 passed); - `nemoclaw-e2e sandbox_readiness::` (1 passed); - `nemoclaw-provider --test contract service_readiness::` (2 passed); - `lifecycle-timing` on an empty directory. - After the merge, against a rebuilt `linux_arm64` bundle: the same commands again, plus `kubernetes_lifecycle::` (2 passed) and the providers' `fake_gateway_tests` (3 and 9 passed); `cargo fmt --all --check` and `cargo clippy --workspace --all-targets -- -D warnings`. - No behavior changes: the only code change is an `#[ignore]` reason string.
cv
added a commit
that referenced
this pull request
Oct 20, 2026
## Failure Releases need the exact images CI checked (#13516), but `CI / Images` discarded every image it built and checked. A release workflow would have to rebuild them, and agent images are not reproducible byte for byte, so the published digests would differ from the checked ones. ## Decision Build once per commit, and let releases promote what was checked. - **`image-build.yml` (new, reusable):** - it has the image job's steps, unchanged; - it takes the validation plan's result, the image decision, and a `push` switch; - the calling job is named `Build` and its own job is named after the platform, so the required checks keep their names (`Build / linux_arm64`, `Build / linux_amd64`). - **`images.yml`** calls it, with `push` only for pushes to `v1`. Pull requests, stacked branches, and pushes that skip image work push nothing. - **When pushing,** after the existing checks pass, each agent image and the Ollama proxy is pushed to `ghcr.io/nvidia/nemoclaw/v1-ci/<image>:<commit>-<arch>` with the workflow's own token: - Docker's containerd store pushes the manifest it built, so the digest doesn't change; - the job summary lists each digest and its push time; - the job fails if any of those packages turns out public, since nothing must be public before a release. - **Left alone:** the live suites' `live-images` path, which is tuned to stay behind the bundle on the critical path (#12995, #13188, #13239). Later: the tag workflow that promotes these digests (#13516), and a cleanup schedule for old per-commit tags. ## Validation - `actionlint` reports nothing for both workflows. - This pull request runs the same steps through the reusable workflow, without pushing. - **Not yet run:** the push step, which runs only on a `v1` push that builds images. I'll watch the first one for push time and the new packages' visibility; earlier, a package pushed with a personal token started `internal`.
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
Since #12970, Linux AMD64's live suites decide how long required checks take. In
v1run 38132223890, required checks finished at 1,001 s, waiting forlinux_amd64 / Live / Docker; Windows and macOS were done by about 610 s.Each live job builds its platform's agent image from scratch: OpenClaw on AMD64, Pi on ARM64. The Docker job also builds two proxy images. Docker and Kind each build the same agent image, so each platform builds it twice. On AMD64, that build took 300–303 s of each live job.
An experiment on hosted AMD64 runners (since deleted) measured the alternatives:
Decision
Build each Linux platform's live images once, in a job that starts with the run, and have both live jobs load them:
cargo ci live-images: an opt-in step that builds the agent image and both proxy images undernc-live-images. It streamsdocker savethrough thezstdcommand into.build/ci/live-images.tar.zst; uncompressed, the AMD64 images take 4.5 GB.--images FILE:ci live-dockerandci live-kindload the archive and retag each image under the run's own fresh prefix. Digests and cleanup work as before: each run removes only the names it created. Without--images, both build as before.Build live imagesjob: runs alongsideBuild and testandBuild bundle. It now makes the live decision, which moves fromBuild and test, so a pull request that can't affect the live suites builds no images and skips both live jobs..github/actions/containerd-store, which the image job and the live jobs both use. The image job builds under that store too, so saved images load the same way.A layer cache would cut the image job further, but live jobs also wait for the bundle, ready at about 190–270 s on Linux. It would save at most about a minute, for 229 s of cache export on
v1pushes and 1.7 GB of cache per image, so this PR doesn't add one.On AMD64, this PR's own run (38137587218) finished the image job at +382 s, and both live jobs started at +384 s instead of +261 s. Each skipped its image build, so required checks finished at +926 s instead of +1,001 s. That's 75 s, less than the 3 minutes I estimated: see the comment below.
Validation
dockerandzstdcommands. One more adds--imagescases to the option-rejection test.ci live-imagesbuilds Pi and both proxy images with the shared prefix and saves them in onedocker savethroughzstd.ci live-docker --imagesloads the archive, retags all three images under its ownnc-live-prefix, and builds nothing.cargo ci live-imageswrote a 177 MB archive with Docker's local build cache.cargo ci live-docker --imagespassed all 10 Docker tests in 277 s, with no image builds and nonc-live-images left afterwards.docker image save. A loaded image exports the same metadata as a freshly built one; only the blob key, which is each image's own digest, differs.cargo cipassed in 464 s: 1,333 workspace tests and 129 lifecycle tests.actionlintpasses.