Files
computer-playbook/scripts/tests/install/make.sh
T
kevinveenbirkenbachandClaude Opus 5 962c3d550d refactor(images): build FROM the distribution base image, not a pkgmgr one
The container this project builds installs its own python, ansible and docker
CLI, so the package manager riding along in the image it built FROM was never
used. That layer now lives in its own repository, which publishes one
multi-platform image per distribution, and meta/distros.yml points at it:
`base` replaces `pkgmgr_virgin`, and utils.distros grows base_image() where
pkgmgr_virgin_image() stood. The pkgmgr image itself stays, because the
`pkgmgr install` test still boots it.

Three references carried the pkgmgr-era tag `stable`, which base-images does
not publish: it pushes `latest` and the major release, and for a rolling
distribution only `latest`, so `latest` is the one value that exists for all
five. INFINITO_PARENT_IMAGE_TAG and the two install tests move to it.

The guard that keeps image references inside the SPOT only matched
`pkgmgr-[{$]`. Renaming the family made it blind to exactly half its surface,
which is how scripts/tests/install/make.sh kept `base-${d}:stable` while
pkgmgr.sh was caught. It now matches `base-` too.

INFINITO_ARCHITECTURE and INFINITO_ARCHITECTURES appear here because
default.env is shared with the architecture axis that follows. They are empty
and inert until it lands; the alternative was a commit whose build fails by
construction, with `base-` declared and `stable` still requested.

From here nothing builds until base-images has published: `docker pull` of the
parent answers `manifest unknown`, and every make target that depends on
build-dependency fails there.

Verified: tests/lint/repository/test_distros_spot.py passes, and the widened
pattern is shown to catch the line the old one missed rather than merely not
breaking.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-19 06:50:45 +02:00

66 lines
1.9 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Install & test Infinito via the Makefile in every distro's base
# container, all distros in parallel inside a single CI job (one runner
# instead of a matrix). Each distro gets its own copy of the checkout so
# the concurrent in-container installs never race on the shared tree.
#
# Inputs via env:
# NIX_CONFIG nix access-tokens block (job env).
# INFINITO_SRC_DIR checkout mount point inside the container.
# INFINITO_VENV_DIR venv path inside the container (from default.env).
# RUNNER_TEMP runner scratch dir for the per-distro copies.
# GITHUB_WORKSPACE the checkout to install and test.
#
# The distro set comes from INFINITO_DISTROS, which the env layer generates
# from the meta/distros.yml SPOT.
set -uo pipefail
: "${NIX_CONFIG:?}"
: "${INFINITO_SRC_DIR:?}"
: "${INFINITO_VENV_DIR:?}"
: "${RUNNER_TEMP:?}"
: "${GITHUB_WORKSPACE:?}"
# shellcheck source=scripts/meta/env/load.sh
source "${GITHUB_WORKSPACE}/scripts/meta/env/load.sh"
: "${INFINITO_DISTROS:?INFINITO_DISTROS must be resolved by scripts/meta/env/load.sh}"
read -r -a distros <<<"${INFINITO_DISTROS}"
declare -A pid
for d in "${distros[@]}"; do
src="${RUNNER_TEMP}/src-${d}"
cp -a "${GITHUB_WORKSPACE}/." "${src}"
docker run --rm \
-e NIX_CONFIG="${NIX_CONFIG}" \
-e INFINITO_SRC_DIR="${INFINITO_SRC_DIR}" \
-e INFINITO_VENV_DIR="${INFINITO_VENV_DIR}" \
-v "${src}:${INFINITO_SRC_DIR}" \
-w "${INFINITO_SRC_DIR}" \
"ghcr.io/kevinveenbirkenbach/base-${d}:latest" \
bash -lc '
set -euo pipefail
make install
make setup
source "${INFINITO_VENV_DIR}/bin/activate"
infinito --help
' >"/tmp/install-${d}.log" 2>&1 &
pid["${d}"]=$!
done
rc_total=0
for d in "${distros[@]}"; do
rc=0
wait "${pid[${d}]}" || rc=$?
echo "::group::${d} (exit ${rc})"
cat "/tmp/install-${d}.log"
echo "::endgroup::"
if [[ "${rc}" -ne 0 ]]; then
echo "::error::make install failed for ${d}"
rc_total=1
fi
done
exit "${rc_total}"