gateway-image: the installer-base bake re-copies ~2.2 GB the warm golden base already carries — 88% of the rebuild (36m50s of 41m54s measured) is redundant since #1102 changed the base #1108
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1108
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The measurement
#1102 landed (
adb83d58) and works: the rebuild now rebases on the warm golden store and times every phase. First measured rebuild under it,build=adb83d58ad94 base=idss-gateway-953c92800329:The phase that was the cost (
nixos-install, ~45–50 min from stock Ubuntu) is now under three minutes. The installer-base bake is now 88% of the rebuild and the only thing standing between the drive and a ~5-minute snapshot refresh.Why the bake is now redundant work
scripts/lib/gateway-image-installer-base-lib.sh:92-101, on the build droplet:Under #1102 the box is installed from the previous golden snapshot, which already carries both halves — that is exactly what #1048 bakes in and what the staleness gate's installer-base marker axis (#1050) reads back. So on a rebase the sequence deletes the cache the base supplied, re-sends ~2.2 GB over the network, and re-imports store paths that are already valid.
This was correct and necessary when every build started from stock Ubuntu with an empty store. #1102 changed the base; the bake never learned.
Corroborating: the marker has been identical on every rebuild through the whole #854 arc —
/nix/store/g9z22mi6…-nixos-system-nixos-installer-kexec-26.05pre-git,1355 store paths, eleven rebuilds between 2026-08-31T10:20Z and 2026-09-01T06:07Z. Not once did the closure actually change; it was re-copied every time.Fix
Make the bake present-check before it copies, using the probe the file already has as a post-condition (
:106,nix path-info '${marker}'):$markerand${OC_GWIB_CACHE}exists and holds a usable cache, skip therm -rf/scp -r/nix copyentirely and go straight to re-pinning the GC root and the existing post-condition proof.phase=installer-base … reused-base-closurevs… copied).Expected effect: rebuild TOTAL from ~42 min to ~5 min, on top of #1102's 60→42. Combined with the honest staleness gate (#1096/#1100), a snapshot refresh stops being a thing the drive lane has to plan around at all.
Acceptance
installer-basein seconds; TOTAL is minutes.nix path-info $markerruns and fails loud in every branch — a base that turns out NOT to carry the closure must red the build, never produce a snapshot whose seed contract is broken.Filed by the watching session from the #854 arc (ADR 0174) — measurement only, no code change from me; the bake has a real correctness surface (GC root, marker validity, the seed's no-op contract) where the existing tests should drive the change.
swarm-claim host=elitebook-distributed-server-03 run=15727
(automated multi-host claim — lowest live claim id works this ticket)
close-report for #1108 — status
success⛔ close-report gates REFUSED this close — the following claims did not verify:
1d239200b1is not reachable from origin/main (not landed)envelope
close-report for #1108 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope
Measured live — the reuse branch fires and the saving is real. First rebuild after this landed (
build=ae94e1e21b3e base=idss-gateway-adb83d58ad94, triggered by #1114 touchinginternal/provision):So the rebuild tax across both tickets: ~60 min → 15 m 43 s, and the post-condition still ran (
nix path-infoon the marker) in the reuse branch, which is what makes the skip safe to take.A further saving remains, noted rather than filed. The 10 m 51 s that is left is almost entirely local work on the executor that happens before the present-check: building the base kexec tarball, enumerating 1355 valid store paths, and staging them into
/tmp/…/installer-base-cacheas afile://cache — all so a marker can be computed and a cache prepared that the reuse branch then does not send. Hoisting the marker resolution ahead of the staging (or caching the staged tree across builds, keyed on the marker) would cut most of that too.I have not filed it: 15 minutes is no longer in the drive lane's way, and the remaining work has a sharper edge (the marker is what the present-check tests, so resolving it more cheaply must not weaken that test). Worth doing when someone is next in this file, or if rebuild frequency rises again.