ci: give Nova two builds with sixteen threads each #380
No reviewers
Labels
No labels
area:authentication
area:flake-utilities
area:performance
area:tbd
host:chaos
host:cosmos
host:electra
host:fleet
host:lena
host:lyra
host:mass-storage
host:media1
host:nimmog-de
host:nova
host:pangolin
host:pangolin-vps
host:phone
host:router
host:vega
investigation
phase:cutover
phase:deploy
phase:mcp
phase:module
phase:packaging
phase:prep
phase:validation
priority:high
priority:medium
project:attic-postgres-lyra-rollout
project:auto-update-reliability
project:auto-update-remediation
project:declarative-purity-cleanup
project:external-review
project:fleet-boundary-cleanup
project:host-facts-refactor
project:lyra-nixos-deploy
project:lyra-service-stack-migration
project:nebula-mesh-network
project:nix-idioms-hygiene
project:nixos-build-deployment-pipeline
project:security-hardening
project:service-stack-migration
project:vega-sillytavern-cutover
project:wiki-rebuild
repo:numtide/flake-utils
repo:numtide/nix-auth
repo:numtide/nixos-passthru-cache
repo:numtide/nix-relay
service:auto-update
service:gitlab
service:hermes
service:mem0
service:nix
service:sillytavern
service:slskd
service:synthseek
service:tdarr
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nimmo/nixos-config!380
Loading…
Reference in a new issue
No description provided.
Delete branch "ci/nova-full-core-builds"
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?
Set Nova's Attic build, remediation and pin-lifecycle jobs to two concurrent derivations with sixteen compiler threads each, aligning explicit CLI flags and NIX_CONFIG with the operator's chosen starting budget.
Fix OOM backoff to reduce concurrent derivations first while preserving per-derivation threads, then halve threads once only one derivation remains. An OOM allows four total attempts: 2×16 → 1×16 → 1×8 → 1×4. Neither limit increases during backoff. Add regression coverage and document the dated memory measurement and advisory limits.
Validation after the final adjustment: ShellCheck, Actionlint, both Forgejo workflow schemas, guarded remediation integration/regression tests, pin-lifecycle integration/regression tests, and git diff --check passed. Attic CI is queued behind active run #1381, which retains its original configuration. New settings apply to future runs.
Closes #379.
Automated code review
Reviewed commit:
fff1536fa88de61d96a3d9c766770a594fa7c8fdVerdict: Requires further work
Resolve the blocking or important findings and investigate failed deterministic checks before merging.
Overall assessment
Re-validated the two candidate findings against the checked-out code. Both are supported by supplied evidence: (1) the new ATTIC_NIX_MAX_JOBS=2 / ATTIC_NIX_CORES=16 seed the unchanged reduce_nix_build_limits() in scripts/attic-cache-build.sh into a non-monotonic, single-threaded retry sequence, contradicting the new documentation's claim that 'the existing OOM retry logic lowers build parallelism'; (2) the new docs/nova-remote-builder.md paragraph cites a 125 GiB host while the baseline section in the same file records 62 GiB. All three NIX_CONFIG blocks and the build job's ATTIC_* variables agree at 2/16, and the README anchor target exists, so no wiring/syntax defect is reported.
Blocking findings
None.
Important findings
ATTIC_NIX_MAX_JOBS: "2" / ATTIC_NIX_CORES: "16" (attic-cache.yml lines 189-190) seed NIX_BUILD_MAX_JOBS/NIX_BUILD_CORES via set_nix_build_limits (scripts/attic-cache-build.sh lines 397-408) and initialise_nix_build_limits (lines 410-414). reduce_nix_build_limits (lines 429-449) then computes jobs=$((2/2))=1, applies the floor '[ "$jobs" -lt 4 ] && jobs=4' -> 4, takes the branch '[ "$jobs" -ge "$current_jobs" ] && [ "$current_jobs" -gt 1 ]' -> jobs=1, and clamps cores to jobs -> cores=1. On the next OOM, current_jobs=1 fails the 'current_jobs > 1' guard, so jobs stays 4 and cores stays 1. With the previous values (3/9) the sequence was 2/2 then 1/1.
Impact: After the first OOM the retry runs with --max-jobs 1 --cores 1, i.e. no per-derivation parallelism at all, which is the worst case for the large uncached closures the build job's long time ceiling exists for; the third attempt then uses --max-jobs 4, above the configured 2, so the new documentation's statement that 'the existing OOM retry logic lowers build parallelism' is not monotonic and can re-introduce memory pressure.
Suggested fix: Either keep the initial max-jobs at or above the reduction floor in reduce_nix_build_limits so halving stays monotonic, or change the floor to derive from the configured value (e.g. floor at max(1, current_jobs/2)) and stop clamping cores to jobs, so a single surviving derivation keeps useful compiler threads. Re-run the guarded remediation and pin-lifecycle regression suites after any change.
Suggestions
The added paragraph states 'The operator selected this starting budget after reducing memory pressure on the 125 GiB host' (line 76), while the 'Baseline recorded on 2026-09-19' section in the same file states '32 logical CPUs, 62 GiB memory (47 GiB available during the check)' (line 86).
Impact: The host RAM figure is the stated justification for doubling per-job threads on a machine with unchanged min-free = 32212254720 (30 GiB); an internally inconsistent figure weakens the rationale and may mislead a reader sizing systemd cgroup limits or min-free from this page.
Suggested fix: State one measured figure with its date and source (e.g. 'free -h' output on the current host), or note explicitly that the RAM figure was re-measured after the 2026-09-19 baseline check, so the two sections agree.
Tests and validation
Questions
Review limitations
Diff coverage
.forgejo/workflows/attic-cache.yml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchdocs/nova-remote-builder.md: reviewed — included in a context-limited batchReview metadata
Addressed the current-head review before the next push:
free -hon Nova on 2026-10-21 reports 125 GiB total and 112 GiB available. The 62 GiB value is explicitly the historical September baseline.Validation after these changes: Actionlint and ShellCheck passed; Forgejo runner validated both workflows; guarded remediation and pin-lifecycle integration/regression suites passed; git diff --check passed. Upstream stdenv.isDarwin/isLinux deprecation warnings appeared during pin evaluation and do not affect this scoped change; they are a separate upstream cleanup. Attic MR CI remains queued behind run #1381. Publishing these fixes next for a fresh current-head review.
Operator refinement to the OOM fallback: preserve compiler threads while reducing concurrent derivations first, then halve threads once only one derivation remains. The exact requested sequence is now 2×16 → 1×16 → 1×8 → 1×4, covered by production-function assertions and repeated-reduction monotonicity checks. An OOM extends the build's attempt limit from three to four so the final 1×4 stage is reachable; non-OOM failures alone retain the three-attempt limit. Documentation updated accordingly.
Post-change validation passed: ShellCheck, Actionlint, both Forgejo workflow schemas, guarded remediation integration/regression tests, pin-lifecycle integration/regression tests, git diff --check. Publishing next for a fresh current-head review.
Automated code review
Reviewed commit:
23f7b13467f0f677c19afd52ff211308e5de1504Verdict: Ready to merge
No blocking or important findings were retained, and deterministic checks passed. Suggestions remain advisory.
Overall assessment
I re-derived the reducer and the retry budget against the checked-out code.
reduce_nix_build_limits(scripts/attic-cache-build.sh:429-446) now halvesNIX_BUILD_MAX_JOBSwith a floor of 1 and halvesNIX_BUILD_CORESonly whencurrent_jobs -le 1, which reproduces exactly the sequence asserted by the new regression block in tests/nixos-update-remediation-regressions.sh: fromset_nix_build_limits 2 16it yields--max-jobs 1 --cores 16, then--max-jobs 1 --cores 8, then--max-jobs 1 --cores 4. The monotonicity fixtures ('2 16', '3 9', '1 1', '32 32') are also non-increasing under this code: for '1 1' the cores halving is clamped back to 1, and for '32 32' cores stay pinned until jobs reach 1.max_attemptsis raised to 4 only on an exit-137/OOM-classified attempt (line 513-515), which is exactly the budget needed for the 4-step fallback, and the loop guard at line 466/539 uses the same variable, so the documented 'four total build attempts' matches the code. The three workflow jobs (lines 195/196, 279/280, 605/606) all setmax-jobs = 2/cores = 16, and only the build job (lines 189/190) exportsATTIC_NIX_MAX_JOBS/ATTIC_NIX_CORES, matching the docs statement that the CLI flags agree withNIX_CONFIGfor the main build only; the remediation and pin-lifecycle jobs do not runscripts/attic-cache-build.sh(they invoke other commands per .forgejo/workflows/attic-cache.yml:246-377/591+), so the reducer'snprocfallback is not reachable from those jobs. The README link resolves to the new## CI build parallelismheading anchor. I found no defect demonstrated by the supplied evidence.Blocking findings
None.
Important findings
None.
Suggestions
None.
Tests and validation
Questions
NIX_CONFIGblock (.forgejo/workflows/attic-cache.yml:601-607) setsmax-jobs/cores/max-substitution-jobsbut omitsdownload-buffer-size,min-free,max-freeandgc-reserved-spacethat the build and remediation blocks set (lines 191-199, 275-283). This omission is unchanged by the PR; confirming that the lifecycle job intentionally relies on daemon defaults for those settings would close the ambiguity, since it now shares the same 2x16 parallelism override as the other two jobs.Review limitations
nixos_update_classify_build_failureand the pin-lifecycle Python controller were not part of the supplied diff, so I did not verify their interaction with the raisedmax_attemptsbudget beyond the shell retry loop shown at scripts/attic-cache-build.sh:448-550.limits.buildRetries == 1policy (remediation/nova-policy.json:14, asserted at tests/nixos-update-remediation-regressions.sh:19) governs a different retry path fromnix_build_with_retry'smax_attempts; I did not assess whether the two budgets are intended to be reconciled.Diff coverage
.forgejo/workflows/attic-cache.yml: reviewed — included in a context-limited batchREADME.md: reviewed — included in a context-limited batchdocs/nova-remote-builder.md: reviewed — included in a context-limited batchscripts/attic-cache-build.sh: reviewed — included in a context-limited batchtests/nixos-update-remediation-regressions.sh: reviewed — included in a context-limited batchReview metadata
Current-head review for
23f7b13467says Ready to merge with no findings. CI test passed; remaining Attic jobs were skipped as expected for this pull request. The review's question concerns unchanged pin-lifecycle storage/download settings: those remain inherited from the daemon; this change aligns only the requested parallelism overrides. The remediation controller retains its separate bounded retry policy. Neither is needed to implement the operator-selected main build OOM sequence. Merging with the validated 2×16 → 1×16 → 1×8 → 1×4 behavior.