ci: warm the nix store (persistent runner / binary cache) to cut the hermetic gate to ~2-4 min #33
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/coding-lab#33
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?
Problem
The hermetic
nix flake checkgate costs ~12–13 min/run because the Docker-backed forgejo-runner is ephemeral —/nixis wiped each job, so the full closure (Go toolchain, node, golangci-lint, ~160 MB npm deps, Go vendor modules) is re-downloaded + rebuilt cold every run. The nix install itself is only ~2 min (bump-nixos-pinis the natural control); the remaining ~10 min is pure cold-store cache misses. There is zero store reuse across runs.Even after #32 (split CI) skips this gate on most PRs, it still runs on every nix/dep change, on
bump-nixos-pin→test-configuration, and across the wholeCloonar/nixosfleet — so a warm store keeps standing value independent of #32.Options to weigh (not decided)
/nix, or bind-mount a persistent host/nix(+ Go/npm caches) into the job container via forgejo-runnerconfig.yml. Biggest win, no new service, most nix-native; needs a runner-config change inCloonar/nixos. Steady state ~2–4 min (incremental rebuilds only). Concurrency: a shared/nixwants the nix daemon to arbitrate (the host already runs one) rather than the daemonless--init noneinstall this repo's workflow uses.Cloonar/nixosfleet. More infra: a cache service + signing key (sops-managed) +extra-substituters/trusted-public-keyswiring on every consumer.dockerTools.buildLayeredImagecarrying the build closure, hosted on Forgejo's built-in container registry, rebuilt on pin bump) — stateless, but needs rebuild discipline and is strictly worse than (1) at steady state. This is the "make a docker image" idea; note it only helps by carrying the store, not just nix.Notes for triage
flake checkinto multiple jobs until the store is warm/shared — on cold ephemeral runners N jobs each re-pay the full cold tax (net-worse). Parallelism only pays after (1) or (2)./nix.Cloonar/nixosinfra) → candidateready-for-humanafter triage, not an AFK agent.bump-nixos-pindeploy path and any futurestore-postgresjob.nix flake checkonly on nix/dep changes #32