Skip to content

ci: build installer & appliance in parallel matrix legs - #52

Closed
phorcys420 wants to merge 1 commit into
mainfrom
ci/per-kind-matrix
Closed

phorcys420 wants to merge 1 commit into
mainfrom
ci/per-kind-matrix

Conversation

@phorcys420

Copy link
Copy Markdown
Member

What

Splits the test workflow's Images job so the installer and appliance ISOs build on separate runners in parallel, instead of sequentially on a single runner.

Why

Previously the Images matrix had one leg per system (x86_64 / aarch64), and each leg ran build_kind installer then build_kind appliance sequentially on the same runner. When both kinds build full, that roughly doubles wall-clock — and because each ISO's squashfs (full system closure at the chosen compression) is an inherently per-host derivation, the two kinds can't dedup that work even with a warm store. Running them on separate runners makes the doubled cost parallel, so wall-clock stays ~1×.

How

  • plan job: now emits a compact JSON build matrix (jq -c) of one entry per kind × system — each carrying kind, system, runner, full (ISO vs drv-only), and an ISO/DRV suffix — instead of the installer_full / appliance_full / kinds outputs. The label/event logic that decides full-vs-drv is unchanged.
  • Images job: matrix: ${{ fromJSON(needs.plan.outputs.matrix) }} (4 legs: installer/appliance × 2 arches). Each leg builds exactly one kind (make <kind>/iso or <kind>/drv), names itself Build <kind> <ISO|DRV> (<system>), and uploads a single per-kind artifact still bundling the ISO with its .sha256 sidecar.

Net behavior (which kinds build full, per-kind artifacts, fast verification compression) is unchanged; only the job topology changes from per-system (sequential kinds) to per-kind×system (parallel).

Notes / trade-offs

  • Total CPU/runner-minutes is roughly the same; this trades an extra concurrent runner for halved wall-clock.
  • The Nix store cache key stays per-os/arch (not per-kind), so installer and appliance legs on the same arch still share one cache lane and stay within the repo's 10G cache budget.

Validation

  • test.yml YAML parses.
  • Simulated the plan matrix shell/jq for both-full and mixed (installer ISO / appliance DRV) cases — emits the expected 4-leg JSON with correct full/suffix.
  • No leftover references to the removed INSTALLER_FULL/APPLIANCE_FULL job env or outputs.kinds.
  • Could not run a real nix build in the sandbox (unwritable store); runtime build behavior will be confirmed by this PR's CI.

The test Images job previously ran a single matrix leg per system that built
the installer and appliance ISOs sequentially on one runner, doubling
wall-clock when both kinds build full. Restructure so the plan job emits a
JSON matrix of one leg per (kind x system); each Images leg builds exactly one
kind on its own runner, so installer and appliance build in parallel.

- plan: output a compact JSON matrix (kind, system, runner, full, suffix)
  instead of installer_full/appliance_full/kinds.
- Images: matrix: fromJSON(needs.plan.outputs.matrix); per-leg name
  'Build <kind> <ISO|DRV> (<system>)'; single-kind build + one ISO artifact
  per leg (still bundling the ISO with its .sha256 sidecar).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant