ci: Evaluate with a pool of nix-eval-jobs workers
CI / Check, build and cache nixfiles (push) Successful in 30m7s
Update docs / update (push) Failing after 1m9s

Each CI job ran in its own `nix build`, and its output path came from
a second `nix eval`. Every one of those evaluations paid ~15s and
~4 GiB to evaluate the flake before reaching its job, and import from
derivation stalled each job in turn. The final `ciDrv` evaluation
covered every job once more.

Evaluate everything once with `nix-eval-jobs` instead: workers keep
the shared evaluation for several jobs and wait on import from
derivation in parallel, and the worker count and memory bound cap
evaluation at 24 GiB of the 40 GiB `git` VM. Build every job in one
`nix build --keep-going`, push the results in one copy, and build the
profiled link farm from the known output paths, which makes `ciDrv`
unnecessary.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit was merged in pull request #9.
This commit is contained in:
jackos1998andClaude Opus 5.5 authored and Jack O'Sullivan committed 2026-11-26 22:07:15 +00:00
1 parent cc38f152be
commit d0eed3943d
6 files changed
+199 -51

No files matched your search

+3 -28
View File
@@ -52,31 +52,6 @@ jobs:
env:
HARMONIA_SSH_KEY: ${{ secrets.HARMONIA_SSH_KEY }}
CI_IFD_REQUIRED: ${{ steps.ifd.outputs.required }}
run: |
set -o pipefail
nix_options=(--option allow-import-from-derivation "$CI_IFD_REQUIRED")
echo "::group::Collect cache garbage"
ci/push-to-cache.sh --gc
echo "::endgroup::"
nix eval "${nix_options[@]}" --json --apply "builtins.attrNames" .#ci.x86_64-linux | jq -cr '.[]' | while read job; do
echo "::group::Build $job"
nix build "${nix_options[@]}" --no-link .#ci.x86_64-linux."$job"
echo "::endgroup::"
echo "::group::Cache $job"
ci/push-to-cache.sh "$(nix eval "${nix_options[@]}" --raw .#ci.x86_64-linux."$job")"
echo "::endgroup::"
done
if [[ "$CI_IFD_REQUIRED" == true ]]; then
echo "::group::Check flake"
# The target closures are available for the evaluation-time reference graphs.
nix flake check "${nix_options[@]}"
echo "::endgroup::"
fi
echo "Building and caching CI derivation"
nix build "${nix_options[@]}" --no-link .#ciDrv.x86_64-linux
UPDATE_PROFILE=1 ci/push-to-cache.sh "$(nix eval "${nix_options[@]}" --raw .#ciDrv.x86_64-linux)"
run: >-
nix shell .#nixpkgs.unstable.x86_64-linux.python3 .#nixpkgs.unstable.x86_64-linux.nix-eval-jobs
--command python3 ci/build-and-cache.py