fix(cache-warm): build each target's initrd before its toplevel closure #73

Open
hermes wants to merge 1 commit from hermes/t-d497f1e2-cachewarm-initrd into main AGit
Contributor
No description provided.
fix(cache-warm): build each target's initrd before its toplevel closure
Some checks failed
nix flake check / flake-check (pull_request) Failing after 4m32s
ad737eff3c
Author
Contributor

Why this change: live halo cache-warm.service 01.11 00:42/00:43 UTC bursted

error: unable to download .../nar/hl37....nar: HTTP 200 (curl error: Transferred a partial file)
error: path ... hl37...-initrd-linux-6.18.60 is required, but there is no substituter that can build it

and the same for sgx's 1856... initrd, during the attic and sgx targets. Both attics copies verify live now: full narinfo + accepted nix path-info --store, NAR decompresses to exactly NarSize with matching NarHash; repeated and 16-concurrent downloads from halo complete. The nix build still built the initrds locally and the attic/sgx targets pushed, so the rc=1 of that night came from the unrelated llama-cpp target; but the substitute line is what the acceptance wants gone.

Mechanism: a fresh-kernel initrd arrives as a bare reference of the target toplevel being substituted; in a store that never built it there is no attached drv, so a failed NAR fetch cannot fall back (the existing nix module's fallback comment documents this class from the 31.07 sgx open-webui NAR). Warming the target's initialRamdisk attr in its own nix build first attaches that drv and makes its output local before the toplevel closure walk. Measured 1.7 s with the path already local; a healthy cache makes it a substitution.

Verification: nix fmt, deadnix --fail, generated cache-warm script sh -n for halo/amd/sgx, and real builds of sgx and attic initialRamdisk plus sgx toplevel from this tree all green. CI flake-check pending.

Why this change: live halo `cache-warm.service` 01.11 00:42/00:43 UTC bursted error: unable to download .../nar/hl37....nar: HTTP 200 (curl error: Transferred a partial file) error: path ... hl37...-initrd-linux-6.18.60 is required, but there is no substituter that can build it and the same for sgx's 1856... initrd, during the attic and sgx targets. Both attics copies verify live now: full narinfo + accepted `nix path-info --store`, NAR decompresses to exactly NarSize with matching NarHash; repeated and 16-concurrent downloads from halo complete. The `nix build` still built the initrds locally and the attic/sgx targets pushed, so the rc=1 of that night came from the unrelated llama-cpp target; but the substitute line is what the acceptance wants gone. Mechanism: a fresh-kernel initrd arrives as a bare reference of the target toplevel being substituted; in a store that never built it there is no attached drv, so a failed NAR fetch cannot fall back (the existing nix module's fallback comment documents this class from the 31.07 sgx open-webui NAR). Warming the target's initialRamdisk attr in its own `nix build` first attaches that drv and makes its output local before the toplevel closure walk. Measured 1.7 s with the path already local; a healthy cache makes it a substitution. Verification: `nix fmt`, `deadnix --fail`, generated `cache-warm` script `sh -n` for halo/amd/sgx, and real builds of sgx and attic initialRamdisk plus sgx toplevel from this tree all green. CI flake-check pending.
hermes force-pushed hermes/t-d497f1e2-cachewarm-initrd from ad737eff3c
Some checks failed
nix flake check / flake-check (pull_request) Failing after 4m32s
to 16a08e59a1
All checks were successful
nix flake check / flake-check (pull_request) Successful in 4m23s
2026-11-01 18:48:40 +01:00
Compare
Author
Contributor

CI on head 16a08e59 is green (nix flake check, run #75, 4m23s; local run also all checks passed!). The head differs from the first push only in treefmt: systems/x86_64-linux/amd/default.nix's virbr-rialo port list came in on base 89c31315 unformatted and the treefmt check rejected it, so nix fmt . (0 changed elsewhere) was committed alongside the module change. Diff vs origin/main: module 21 additions, amd 5 (one line reshaped). PR awaits Harald's merge.

CI on head 16a08e59 is green (`nix flake check`, run #75, 4m23s; local run also `all checks passed!`). The head differs from the first push only in treefmt: `systems/x86_64-linux/amd/default.nix`'s `virbr-rialo` port list came in on base 89c31315 unformatted and the treefmt check rejected it, so `nix fmt .` (0 changed elsewhere) was committed alongside the module change. Diff vs origin/main: module 21 additions, amd 5 (one line reshaped). PR awaits Harald's merge.
All checks were successful
nix flake check / flake-check (pull_request) Successful in 4m23s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/73/head:hermes/t-d497f1e2-cachewarm-initrd
git switch hermes/t-d497f1e2-cachewarm-initrd
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
harald/nixcfg!73
No description provided.