Plan: one VM per car, a scheduled release job
Status
Done (2026-11-10) — U1 only; U2–U5 superseded by plan ci-dev-loop (#3042)
Issues: #3029 is the plan issue (epic &122); U1 #3030, U2 #3031, U3 #3032, U4 #3033, U5 #3034. Related: #2968 (the
shared 4xlarge pool), #3025 and #3026 (upstream fetches on fresh VMs), #3028 (an advisory MR check still joins the
train), #2779 (the floating tag split), #3017 (release by retag). U2 closes #3028 and #3026 (unmerged, moot); U3
closes #2779 and #3017; U4 closes #3025 only if its tool-image pull goes (D4), else it stays.
Branches: chore/ci-one-vm-car-u<N>.
Tree: this plan is written against origin/main (2026-11-08), which carries plans ci-compile-once
and ci-battery-ahead (--await-images, await_images.rs, --skip-unit, CRAIG_CHECK_FLAG,
Stage::dials_the_stack). A checkout of an older branch lacks those names; read the paths below from main.
Erratum (2026-11-08): release-profile images carry no devstack features, so `ci release’s smoke (D3) brings up locally built devstack images, not the pushed release bytes; U3 settles whether the smoke builds a devstack-featured release variant or smokes the release images through a minimal profile.
A Design + Scope plan: GitLab owns tracking; the plan freezes when U1 starts. The maintainer chose this direction on
2026-11-08 after canopy adopted the same shape (its plan ci-one-vm-car, approved the same day; findings shared on
the cicd channel, no shared components).
Context
The car today
A car runs six jobs across up to four VMs at once (.gitlab-ci.yml, .car-rules): ci-image → xtask → {check,
build, docs, battery} → e2e. build pushes the tree’s devstack images to the registry under
ci/<repo>:<tree>-<tag>; battery and e2e each bring a stack up on their own VM by pulling those images
(ci devstack-up --await-images). Measured on 2026-11-08 (train pipeline 3041356027, the cook cache warm):
| Job | minutes | slot | what it does |
|---|---|---|---|
|
2.0 |
1 |
pulls or builds craig-ci |
|
1.5 |
1 |
compiles xtask, craig-config-fetch, craig-seed |
|
7.8 |
1 of 4 |
lint, clippy (on a train no unit) |
|
12.6 |
2 of 4 |
the devstack images, pushed by digest |
|
2.3 |
3 of 4 |
Antora |
|
26.3 |
4 of 4 |
|
|
16.0 |
1 |
|
68.5 runner-minutes, about 34 minutes of wall once a slot is held, four slots at peak. On the shared pool
(about 12 concurrent jobs, canopy’s train beside ours) the queue, not the work, set the pace on 2026-11-08: the head
car’s first job waited 74 minutes for a slot at 07:00 UTC, and cars sat pending for most of the night.
What the shape costs beyond slots
-
Every job is a fresh VM, so every car fetches from upstream: the gitleaks release from GitHub (#3025), buildkit through the dependency proxy (#3026), the Hub bases. A GitHub 504 and a proxy rate limit each dropped cars on 2026-11-08.
-
The registry hand-off is plumbing with no other purpose:
images --publish-digests,tree_image_refs,--await-imageswith its bounded wait,registry_probe, thecache/<group>BuildKit tags and--write-cache(xtask/src/cmd/ci/{images,buildx,await_images}.rs, plan ci-compile-once D3, plan ci-battery-ahead D1). -
A car pushes to the registry under its own namespace, which is what #3008 was about; the maintainer closed that as over-engineering, and a car that pushes nothing closes the class without a rule.
-
docker-promoteruns on every main merge (about 8.5 minutes a merge, release images rebuilt per merge). The release itself needs only the tag pipeline.
What stays true
-
cargo xtask validatealready runs the whole battery on one machine in one order (ci::full_plan: lint, clippy, unit, images, devstack-up, build-tests, battery, e2e, aux), on one target directory, against a stack it builds and holds itself. The one-VM car is that plan on a 4xlarge, not a new pipeline. -
The battery and e2e stages already run inside craig-tools on the project network (
Stage::dials_the_stack), so a job that holds the stack can run them; nothing dialslocalhost. -
The merge train stays the gate (ADR-086). A car still blocks on every stage; nothing becomes advisory.
Design
D1. One car, one job, one VM
The car DAG becomes ci-image → xtask → {car, docs}. ci-image and xtask stay as they are (the craig-ci
toolchain image pulled by its input hash; the one xtask compile shipped as an artifact, with the docs' content
lints). docs stays its own job: it runs in the Antora image (Node, Chromium, .antora), which craig-ci is not, and
it needs no stack. car is one job on $CI_RUNNER_TAG, extends: [.xtask-bin, .test-results, .stack-teardown,
.test-debuginfo], needs: [{job: xtask, artifacts: true}], running:
xtask ci car --json
ci car is a new CiCommand that runs full_plan(false, false) with CI’s stage settings, in this order and with
these changes from today’s stages:
-
lint,clippy,unit(today’sci check; on a train still--skip-unit, the battery runs those tests). -
images --local: builds the devstack images into the VM’s own Docker daemon and pushes nothing. The BuildKit builder is the daemon’s default (dockerdriver, nocraig-cicontainer builder, so no buildkit pull: #3026 is moot). The cook layer still lives in the image (ADR-039 § Amendment #3003), so the compile inside the build is the same as today’s; the registry cache import goes (D4). -
devstack-up --local: brings the stack up from the images just built (no--await-images, no pull). This is today’s localdevstack-uppath. The CI purge of a stack a previous job left on the VM (#2946: the 4xlarge reuses VMs) moves to the first step ofci car, beforeimages --local, so a stale stack never holds a port or a volume while the build runs. -
build-testsruns after the stack is up, in craig-tools on the project network, once: the re-exec that today compiles the inventory twice (478 s then 602 s, the two argv shapes differing only by--network) collapses to one compile, because there is no stack-less phase to overlap. -
battery --profile ci-integration,e2e,aux, each as today.
Teardown is the job’s after_script, as .stack-teardown does today (container logs on failure, dev clean).
The stage code is today’s: xtask/src/cmd/ci/{check,images,devstack_up,build_tests,battery,e2e,aux}.rs; ci car
adds the command and the two --local flags, and takes nothing away until U4.
D2. Expected cost
Serial sum of today’s measured stages with the two removed waits: lint+clippy 7.8, images 12.6 (the build, no push),
devstack-up about 2.2 (today’s 4.7 minus the 151 s image wait), build-tests about 8 (one compile, not two), nextest
7.4, e2e about 14 (today’s 16 minus its own devstack pull), aux about 1: about 53 minutes of wall and 53
runner-minutes on one slot, with docs (2.3) beside it on a second slot for its first three minutes. Against
68.5 runner-minutes over four slots and 34 minutes of wall today.
So a car is slower end to end by about 20 minutes and cheaper by about 13 runner-minutes, and the train runs up to three times as many cars at once on the same pool (two slots at peak, for three minutes, then one). The target is written as a bound, not a promise: U2’s first train run records the real table on the plan issue, and a car over 75 minutes of wall sends the plan back (§ Risks).
The job gets timeout: 2h, like .scheduled-stack, and interruptible: true.
D3. One release job, protected, scheduled
A new job release-build replaces docker-promote and sbom:
xtask ci release --json
It runs on three triggers and nowhere else: a tag ($CI_COMMIT_TAG), the weekly schedule
($CI_PIPELINE_SOURCE == "schedule", the existing "Weekly main" schedule 4540282), and when: manual on a main
pipeline. It extends: [.xtask-bin, .stack-teardown], needs xtask only, timeout: 2h. Its stages, each a step
with its own report:
-
images --push: build the release-profile images (today’sdocker-promotebuild,CARGO_PROFILE=release, thereleasecache group) and push them as:<sha8>(every run) and:<tag>(a tag run), moving:latestonly on a tag run (this settles #2779 for the release job::latesttracks releases; the weekly run gives a dated:<sha8>and nothing floating). -
sbom:xtask sbomandxtask changelog notes --images(the lines today’ssbomjob runs, #3012/#3016), on every run; the artifact keepsexpire_in: neveron a tag run. -
smoke:devstack-up --localfrom the release images just built, thenperf --profile smokeandsecurity --phase public-api. A release that fails its own smoke publishes no Release.
Today’s release job stays as it is (the release-cli image, needs: [{job: release-build, artifacts: true}],
rules: if $CI_COMMIT_TAG, the one release-cli create line with the notes and the job-based SBOM link, #3016):
it cannot run in craig-ci, and a tag run whose release-build fails publishes nothing because its need is red.
Main’s per-merge pipeline therefore builds no release image. A deployer who wants a built image of a specific main
commit runs the job by hand on that commit’s pipeline. The protected-variables question (#3015: an unprotected tag
pipeline receives no CRAIG_CI_AGE_KEY) is unchanged by this plan; the maintainer left it as is on 2026-11-08, and
secrets-policy keeps its own job and its own verdict.
D4. Retire the registry plumbing
Once U2 and U3 are on main, the following have no caller and go, with their tests and docs (paths on main):
-
xtask/src/cmd/ci/images.rs:--publish-digests,tree_image_refs, theimages.jsonmanifest;xtask/src/cmd/ci/await_images.rswhole, anddevstack_up.rs’s `--await-images/--from-digestsflags. -
The BuildKit registry cache in
xtask/src/cmd/ci/buildx.rs:--write-cache, thecache/<group>tags and their import,ensure_builder’s `craig-cicontainer builder (the daemon’s default builder is used instead), andregistry_probewhere only the cache used it. #3026’s mirror never lands (its branch closes unmerged). -
tools/craig-toolsin the registry (buildx::tools_input_hashand its push): the car builds craig-tools once per VM asvalidatedoes. If U2’s measurement shows that build costing more than two minutes per car, this item moves to the plan issue as a follow-up and the pull stays. #3025’s tool-image pull (craig-gitleaks, craig-devtools, inxtask/src/devtools.rs) is kept on the same condition: it is one fetch fewer than a GitHub download per car. -
.gitlab-ci.yml:CRAIG_IMAGES_CACHE_FLAG,.stack-cache-writer,.main-cache-writer,.stack-rules(a plain MR’s manual stack jobs become its blockingcar, D5),CRAIG_CHECK_FLAG(the train/MR difference isci car’s one flag, `--skip-unit), and thedocker-promotejob.
What stays: ci-image and the craig-ci input hash (one toolchain image per toolchain, pulled by every job),
xtask’s artifact (the release job and the leaf jobs still take it), the leaf jobs (`cargo-deny, secrets-policy,
feature-matrix, fuzz-smoke, pentest, perf-load, perf-stress, cluster-tests, identity-multibackend,
policy-drift, pages, stop_review) with their rules unchanged, except that the scheduled stacks switch from
--await-images to --local (they build their own images on their own VM, as the car does).
D5. The plain MR pipeline
Today a plain MR runs check (advisory, #3028), docs, and the stack jobs by hand. Under this plan a plain MR runs
car blocking whenever .car-rules’ `changes: match (the same list as today), so the train never admits a
red car it could have seen (#3028 closes). A docs-only MR runs docs alone, as today. The cost is one slot for
about 53 minutes per MR push, the same as a car; interruptible: true cancels a superseded push.
D6. What a developer sees
cargo xtask validate is unchanged. ci car is validate --profile full with CI’s reporting; the dry-run test
that pins validate’s stage order to the DAG (`the_car_dag_runs_validate_fulls_stages_in_its_order) becomes the
test that ci car’s plan is `full_plan. The pre-push hook is unchanged.
Scope
Five units, each an MR on the train, each with its own issue. U1 is the only one that can run before the pool frees.
| Unit | Delivers | Proof |
|---|---|---|
U1 (#3030, |
|
Unit tests: |
U2 (#3031, |
|
Contract tests ( |
U3 (#3032, |
|
Contract tests:
|
U4 (#3033, |
Retire the plumbing (D4): code, tests, docs, the |
|
U5 (#3034, |
Docs: |
|
Out of scope: the compile cache between cars (canopy’s #3276 shape; CRAIG files its own issue once U2 has measured
the cold compile, since the cook layer already caches dependencies inside the image build); the pool size (#2968);
sccache in CI; any change to the pre-push hook or validate.
Risks
| Risk | Mode | Mitigation | Test |
|---|---|---|---|
The car is slower than D2’s bound: the serial sum assumes today’s stage times hold on one VM. |
fail-open (a slow car still merges) |
U2’s first train run is the measurement; a car over 75 minutes of wall sends the plan back
before U3. The likely saving: run |
the stage table on the U2 issue |
A reused VM carries a stale stack or stale images (#2946). |
fail-closed |
the purge is |
a plan test: the
purge step precedes |
The daemon’s own BuildKit lacks a feature the container builder had. |
fail-closed (the build errors) |
the
release build needs |
U1’s local run of both commands, before any YAML change |
The weekly release run has no smoke baseline on a dedicated host. |
silent (a noisy run could mask a regression) |
the smoke stage judges against the perf verdict’s pressure window ( |
the plan issue records the first three weekly results |
A plain MR’s car blocks and costs a slot per push. |
fail-closed |
that is the point (#3028); |
the U2 contract test on the rule |
Serialisation drift between an in-process harness and a service path (canopy’s caution). |
silent |
CRAIG’s
|
the byte pins already in the battery |
Decisions
-
One job, not two with a local hand-off. A two-job car (build on one VM, test on another) still needs the registry or an artifact of the images; the artifact is gigabytes per car. One job removes the hand-off entirely.
-
Release images rebuilt in the release job, not retagged from a car. Cars build devstack-profile images; the release needs release-profile bytes. #3017 (release by retag) closes as moot: there is no promoted
:<sha8>from main to retag oncedocker-promotegoes. -
The scheduled run publishes
:<sha8>and nothing floating. A weekly image with no release is a build for staging, not a release;:latestis whatdocker pull craig-casesgives a stranger, so it tracks tags only. -
Keep
ci-imageseparate. One toolchain image per toolchain, built once and pulled by every job, is cheap (2 minutes, mostly a pull) and lets every job, leaf jobs included, start from the same image. -
Keep the leaf jobs where they are. They run on schedules and main, not on cars; moving them into
ci carwould make every car pay for them.