Offer only what this machine can deliver
The installer knew one distribution: Debian, with docker, on a new enough release. Everything else it would have offered and then failed at. Three facts now decide what the matrix offers, and each is read from the machine rather than assumed: - The container runtime. Docker where the machine has one, podman on the Red Hat family, which ships no docker at all. Both go through the same compose plugin: compose speaks the Docker API and podman serves it, so there is one compose file and one deployment path, not two. Telling a Fedora operator to add Docker's own repository to a machine that already has a container runtime would have been the wrong trade. - glibc. The server binary is downloaded, not built here, and it is linked against 2.39. Rocky 9 (2.34), Debian 12 and Ubuntu 22.04 cannot run it, so the host shape is refused there with the version found and the container shape named as the answer -- rather than installing a file that cannot start. - The operating system itself. This compiles for macOS and Windows because Go compiles anything, and on either it would read no os-release, find no systemd, and describe a machine that does not exist. It now says what it is and exits. Two bugs the other distributions found, both of which Debian could not have: - The survey reported the first thing in the way and stopped, so on Fedora it asked to start podman.socket, and then -- having done it -- asked for the compose plugin. Needs are named now, not described, and reported together. - apply used the survey taken before dependencies were installed, so on a machine that had no runtime at all it installed podman and then reached for docker. It re-surveys after resolving, and stops if containers still are not usable. The lab takes DISTRO now: debian13, debian12, ubuntu2404, fedora, rocky9, arch, each with its own disk and ssh port so several can be up at once. The cases no longer say "docker" either. install-local passes on Debian 13, Fedora 43 and Rocky 9 -- 20 checks each, ending with a sign-in to the webmail the installer put there.
This commit is contained in:
+40
-1
@@ -2,7 +2,11 @@
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
#
|
||||
# Shared by the four scripts beside it: how the lab machine is started,
|
||||
# stopped and talked to. Sourced, never run.
|
||||
# stopped and talked to, and which distribution it runs. Sourced, never run.
|
||||
#
|
||||
# One lab per distribution, each with its own directory, disk and ssh port,
|
||||
# so Fedora and Debian can be up at once and a case can be run against both
|
||||
# without either noticing the other.
|
||||
#
|
||||
# One machine at a time, identified by its pid file. qemu is given a monitor
|
||||
# on a unix socket so a stop is a clean powerdown rather than pulling the
|
||||
@@ -13,6 +17,41 @@
|
||||
# the machine resets in a loop at "Booting Debian GNU/Linux" forever. -display
|
||||
# none is what makes it headless; the adapter has to be there.
|
||||
|
||||
# The distributions this installer claims to support: Debian and Red Hat and
|
||||
# Arch, and the derivatives people actually run. Each is the distribution's
|
||||
# own cloud image, which is cloud-init seeded and needs no interaction.
|
||||
#
|
||||
# Fedora and Rocky are here because they are where the interesting
|
||||
# differences live: podman instead of docker, firewalld on by default, and --
|
||||
# on Rocky -- a glibc older than the server binary needs.
|
||||
distro_image() {
|
||||
case "${1:-debian13}" in
|
||||
debian13) echo "https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2" ;;
|
||||
debian12) echo "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2" ;;
|
||||
ubuntu2404) echo "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img" ;;
|
||||
# Fedora's image name carries a build number that changes with every
|
||||
# release, so this is pinned rather than guessed; check the mirror index
|
||||
# when moving it.
|
||||
fedora) echo "https://dl.fedoraproject.org/pub/fedora/linux/releases/43/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-43-1.6.x86_64.qcow2" ;;
|
||||
rocky9) echo "https://download.rockylinux.org/pub/rocky/9/images/x86_64/Rocky-9-GenericCloud.latest.x86_64.qcow2" ;;
|
||||
arch) echo "https://geo.mirror.pkgbuild.com/images/latest/Arch-Linux-x86_64-cloudimg.qcow2" ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Each lab gets its own ssh port, so several can be up at once.
|
||||
distro_port() {
|
||||
case "${1:-debian13}" in
|
||||
debian13) echo 2222 ;;
|
||||
debian12) echo 2223 ;;
|
||||
ubuntu2404) echo 2224 ;;
|
||||
fedora) echo 2225 ;;
|
||||
rocky9) echo 2226 ;;
|
||||
arch) echo 2227 ;;
|
||||
*) echo 2222 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
vm_running() {
|
||||
[ -f "$PIDFILE" ] && kill -0 "$(cat "$PIDFILE")" 2>/dev/null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user