Repository navigation
ci(test-images): build and publish the archinstall test image - #253
Merged
Merged
Conversation
The owner created WitteShadovv/nails-test-images for the test images no upstream publishes. mirrors.nix now names its release-download root, so a pinned mirror entry is fetched from images-<family>/<asset> there. images.nix and ci/distro_images.py check a mirror pin: it needs its family, names its asset and its SRI sha256 together or neither, and can only be enabled once pinned. The weekly link check probes the asset a mirror entry pins, reading base and tagFor out of mirrors.nix, and lists an entry with no asset as not checked. repin moves a mirror entry to the newest build that its release's <family>-latest.json names. An entry can set firmware to uefi. distro-vm.nix then boots it with OVMF through nix-vm-test's QEMU_OPTS, in the sandboxed test and in the host drivers, so an image whose only boot loader is systemd-boot starts from its ESP's fallback loader. The arch-install entry sets it.
No upstream publishes an archinstall image, so the project builds it. nix/distro-tests/arch-install is the builder (the flake's arch-install-image-builder): it boots the kernel of the Arch ISO that inputs.json pins by hash under OVMF, with a blank disk on IDE as the harness boots it, and the ISO's automated-script hook runs install.sh. That pins the mirrorlist to the Arch Linux Archive snapshot of the ISO's day and runs the ISO's archinstall unattended with its own default btrfs layout (1 GiB ESP at /boot, @, @home, @log and @pkg, compress=zstd), systemd-boot loader entries, zram, a user arch and the ISO's network setup. It adds console=ttyS0 to the loader entries, empties the package cache, checks the layout, boots the result once to its login prompt and writes the compressed qcow2 with its sha256 and a manifest. test-images.yml runs it nightly and on dispatch, uploads each build under a name of its own to the release images-arch-install of WitteShadovv/nails-test-images, replaces arch-install-latest.json, prunes the old builds that no images.json of main, next or the commit pins, and checks the public download against the build's hash. Only its upload step reads NAILS_TEST_IMAGES_TOKEN, and no pull request publishes. inputs.json joins images.json in the detect-secrets exclusions: its hash is an SRI digest, not a secret.
GitHub dispatches a workflow that is not on the default branch only once it has run there, and a dispatch from the branch is how its first image gets published. A push to any branch but main and next that changes the builder or the workflow now runs the build alone, which also lets the branch be dispatched. It publishes nothing, as a pull request does not.
… live boot The first dispatch timed out after 90 minutes: the live initramfs found no IDE CD drive, waited for the ISO's UUID and dropped to its rescue shell, which never powers off. The ISO now goes on a virtio-scsi CD drive, as archiso's own run_archiso attaches it, and build.sh watches the serial log: it stops the VM at once when the initramfs gives up or the kernel panics, and after 90 minutes in any case.
Under OVMF on QEMU's default i440fx machine, Linux finds no drive on the PIIX IDE controller: ata_piix loads and its two ports stay empty, so the live system saw no target disk and a test VM would see no root disk. The build now runs on q35, where an IDE drive lands on the AHCI controller, and distro-vm.nix adds -machine q35 beside OVMF for a UEFI entry, which puts nix-vm-test's root drive on the same controller. The initramfs archinstall builds therefore holds the driver the test VMs need.
The second dispatch got as far as pacstrap, where the Arch Linux Archive stalled on one package: pacman gave up on it after ten seconds below a byte a second, skipped the server after a few such errors and failed the transaction. The live pacman.conf, which pacstrap uses, now sets DisableDownloadTimeout and three parallel downloads, and a failed archinstall run is tried again from a wiped disk, up to three times, with each failed run's log kept.
The nightly rebuild of the archinstall image needs the ISO and the package snapshot that its inputs.json pins, both on archive.archlinux.org. The weekly link check now probes them beside the published asset of a mirror entry whose family has a builder: the ISO and the snapshot's core.db, the first file pacman fetches from it.
Run 45604987470 of test-images.yml built, published and verified arch-install-2026.11.01-20261125-45604987470.qcow2 in the release images-arch-install of WitteShadovv/nails-test-images. `repin arch-install` pins the entry to it from arch-install-latest.json. The entry stays disabled until the Arch admission enables it; the probe and refusal suites boot it now, and docs/ci.md names it among the refusal's images.
distro-e2e.yml run 45608598475 ran the probe on the pinned archinstall image, booted with OVMF on q35 through the harness: kernel 7.2.11, systemd 262.1, the btrfs @, @home, @log and @pkg subvolumes with the ESP at /boot, zram swap, no failed unit at boot or after the soft reboot. The fixture is that run's record, and the README marks it recorded.
The prune deleted builds even when the images.json of main, next or the run's commit could not be read, which it only warned about, so a failed read could delete a pinned asset. The publish job now reads the three with its own read-only token through the API, counts only a branch that does not exist as pinning nothing, and deletes no build unless every read succeeded. A re-run of the publish job alone keeps the build's name and would replace the asset of that name. Every build's name now carries the run attempt as well, and the job refuses to replace an existing asset of its name when a read failed or an images.json pins it. The download-artifact pin is v8.0.2, not v6.0.0 as its comment said.
The commit the oracle nightly pins actions/download-artifact to is the tag v8.0.2; its comments said v6.0.0.
A firmware value that is no string, such as a list, made the image table check raise a TypeError instead of naming the entry. It is now a finding like an unknown name: firmware must be "bios" or "uefi".
…y one
The publish job counted a read of images.json as complete whenever jq
exited 0, and jq does that for an empty body, {} or a table of another
shape, which pins nothing in the old filter. A reshaped table on main or
next could then let the prune or a replace hit a build that branch pins.
Now every string in the table that names one of the family's builds
counts as a pin, wherever it stands, and an empty body or anything but a
non-empty object leaves the list incomplete, so nothing is pruned or
replaced. Also say exactly when an unpinned mirror entry names that in
its line, and that a branch that does not exist pins nothing.
WitteShadovv
force-pushed
the
feat/arch-install-image
branch
from
November 25, 2026 17:32
fd98a52 to
b2943cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This gives the archinstall test image a home and a nightly build.
mirrors.nix now points at WitteShadovv/nails-test-images, the repo I made for test images. The new workflow test-images.yml builds the archinstall image every night and publishes it to the release images-arch-install. Every build gets its own name with the ISO version, the date, the run ID and the attempt, so a nightly never replaces the file images.json pins. It also replaces arch-install-latest.json, deletes old builds beyond the newest three that no images.json on main, next or the run's commit pins, and downloads the asset again from the public URL to check the hash. If any of those three reads fails it deletes nothing, and it never replaces an asset that one of them pins.
The builder is nix/distro-tests/arch-install. It boots the kernel of the Arch ISO 2026.11.01, pinned by hash, under OVMF on q35, and the ISO's own automated script hook runs archinstall unattended. The mirrorlist points at the Arch Linux Archive snapshot of the same day, so the packages are pinned too. The layout is archinstall's own default for btrfs: 1 GiB ESP at /boot, the @ @home @log @pkg subvolumes with compress=zstd, systemd-boot with loader entries, zram, the minimal profile, and a user arch with password arch in wheel. I add console=ttyS0 to the loader entries for the test driver, empty the package cache, check the layout and boot the result once to a login prompt before anything is uploaded. The image is not bit for bit reproducible because the UUIDs and the keyring differ, so every build has its own hash.
Getting the first build green took three fixes. The live initramfs found no IDE CD drive, so the ISO is now a virtio scsi CD like archiso's own run_archiso uses. Under OVMF on the default i440fx machine Linux saw no IDE disk at all, so the build and the harness both use q35 now, where nix-vm-test's root drive becomes a SATA disk. And the archive stalled once during pacstrap, so pacman's download timeout is off and a failed install is retried up to three times.
The upload token NAILS_TEST_IMAGES_TOKEN is only read in the upload step of the publish job. That job runs for the schedule and for a dispatch from a branch, never for a pull request or a push, and it runs no code from the build. Pull requests and pushes that touch the builder only build.
images.json pins arch-install to arch-install-2026.11.01-20261125-45604987470.qcow2 with sha256-3CGFbdliAbfexsaY8XRETYrubAVMfH4dfnWL9aUmwLI= and stays disabled, the admission turns it on. The entry gets firmware uefi, and distro-vm.nix then boots it with OVMF on q35 through QEMU_OPTS. ci/distro_images.py checks mirror pins, the weekly link check probes the pinned asset plus the ISO and the snapshot the builder needs, and repin arch-install moves the pin to the newest build.
What I ran: just check and nix flake check on every commit. test-images run 45604987470 built, published and verified the pinned image. Before the rebase onto next with Fedora admitted, the probe (45621289769) and the refusal (45621294272) passed through the harness, and a build with publishing off (45621298394) passed too. On the head b2943cf, after that rebase, every commit passed just check again, the tip passed nix flake check, and these runs are green. E2E all https://github.com/WitteShadovv/nails/actions/runs/45665921847 Distro E2E all https://github.com/WitteShadovv/nails/actions/runs/45665937810 Distro E2E staged https://github.com/WitteShadovv/nails/actions/runs/45665958946 Oracle https://github.com/WitteShadovv/nails/actions/runs/45670916777 on the full image set.
Still open: the commits need my re-sign, since all but one are unsigned.