purposes/proposals/container-runner.md

17 KiB
Raw Permalink Blame History

Container Runner — Purpose proposal

Status: Accepted (D-100, 2026-11-10), implementation in progress. The user fixed the scope, defaults and channel; the package list is checked against the snapshot, but build and acceptance evidence are not claimed. D-055 allows exactly one Purpose per image, so this is a new optional Purpose (server/container-runner), not a change to Core, GNOME or KDE. No acceptance scenarios are required for this edition (explicit user decision); a separate build produces the ISO and the stable/container ref, and later updates follow the same cadence and publication principles as the other editions.

Goal

Turn an ordinary x86_64 server or spare PC into a managed container and virtual-machine host:

  • a stock container runtime with rootless use;
  • a mutable Arch Toolbx development environment, as on Desktop Purposes;
  • QEMU/KVM with libvirt so the stock Cockpit Machines page can run local guests;
  • a browser management surface (Cockpit) for containers, virtual machines, storage and logs;
  • a Mesh-network entry point (Tailscale) without shipping credentials;
  • the normal Archipelago guarantees: immutable /usr, persistent /var, OSTree update/rollback, the same Core checks and the same image identities.

The edition is a Purpose, so it inherits Core (D-052) and adds only its own package set, service activation and checks. It must not become a second distribution, a second updater or a mutable build.

Resolved proposal choices (2026-11-10, explicit user direction)

These settle the scope questions for this proposal. They are not an accepted release decision until the Purpose itself is approved.

  1. Cockpit exposure: LAN and tailnet. HTTPS on 9090 only; no AllowUnencrypted, no unauthenticated access. The certificate question is still open (self-signed vs Tailscale Serve vs operator-supplied).
  2. Tailscale is optional, not enabled by default. The package is part of the delivered image, tailscaled.service stays disabled, and the operator connects manually with systemctl enable --now tailscaled + tailscale up. There is no interactive first-boot onboarding, no auth key baked into the image and no automatic tailscale up.
  3. The updates page is our own Cockpit plugin, not PackageKit (D-095 still excludes PackageKit). See the design below.
  4. Storage: ext4 remains the default. btrfs is an explicit optional profile for hosts that need multi-device integrity, compression or btrfs send backups; it is not the default because OSTree already provides OS rollback, and container image churn plus qgroups/balance add failure modes without a proportional benefit on an unattended "spare PC" host. See "Storage recommendation".

Cockpit updates plugin — design and effort

A small, dependency-free Cockpit page is enough; no PackageKit and no C bridge:

  • files: /usr/share/cockpit/archipelago-updates/{manifest.json,index.html,updates.js,style.css}, shipped by the Container Runner Purpose adapter (builder/adapters/container-runner-package.sh), with a native Rust test enforcing the D-Bus-only contract in the frozen-source checks;
  • data path: cockpit.dbus('org.archipelago.System1', {bus: 'system', superuser: 'try'}) against the typed API that already exists in contracts/dbus/org.archipelago.System1.xml (GetStatus, Refresh, GetUpdateDetails, PrepareUpdate, Download, Stage, transaction properties/signals). No new daemon surface is needed;
  • UI: current deployment, available update, staged/pending and reboot-required state, progress and errors from the transaction object, plus a link to the retained transaction log. If the daemon is unavailable, the page states that explicitly instead of pretending the system is up to date;
  • authorization: Cockpit's superuser: "try" gates the page; note that this means the daemon sees the Cockpit-authorized admin (root) rather than the original user's per-operation polkit identity. That is a deliberate trade-off for the first version and must be documented; direct per-user polkit is a later refinement;
  • cockpit-packagekit is not installed, so this page is the only update UI.

Effort: one JS page plus manifest and packaging; medium, not large. It does require the container-runner Purpose and a real Cockpit session to verify, so it belongs after the base Purpose builds.

Storage recommendation

Default: ext4, with a separate /var (container data under /var/lib/containers). Reasons: predictable performance for overlay/image-extraction churn, no COW fragmentation or qgroup/balance failure modes, mature recovery on cheap or failing hardware, and no real loss of capability because OS rollback comes from OSTree, not from filesystem snapshots.

Optional profile: btrfs for users who want raid1 integrity without mdadm, zstd compression on small SSDs, per-subvolume quotas, or btrfs send backups of container volumes. If btrfs is used, /var/lib/containers should be its own subvolume and the trade-offs (balance, ENOSPC on metadata, snapshot retention) must be explicit. Snapshots of live container/database volumes are not automatically consistent and are not a substitute for application-level backups. XFS is a reasonable third option for very large hosts, but there is no reason to make it the default now.

Build evidence (2026-11-17)

The regular ISO cycle 20261117T101510Z built Container Runner from the same run's Core (snapshot 2026-11-17) and published it:

  • image commit 67cf7abde6d19e9d021923045daa21ef268abfe02daf809ab8459f6009577144;
  • Core layer commit 57d43af39bfde5dfd2c4c78181801bfeeaa0d802c8178af09b5730092711f04c;
  • Container Runner purpose layer e18aa07967f670958cfea88da8b4edf63b3862604ff3335e341c8ed4608b72c9;
  • ISO archipelago-container.iso, 3043661824 bytes, sha256 c2375ca22d487d4ca417bb0a4ae237a127ce8b34929b8d99ffb1c11fcd11f4bd;
  • stable/container and purpose/server/container-runner are published and served with a signed summary; the ISO URL returns 200 with a matching .sha256;
  • installed-package evidence confirms cockpit-machines 360-1, libvirt 12.9.0, libvirt-dbus 1.4.1, qemu-system-x86/qemu-img 11.1.3, edk2-ovmf, swtpm, virt-install, dnsmasq, dmidecode, toolbox 0.3-2 and podman 6.2.0;
  • D-100 still waives acceptance scenarios; hardware boot, Cockpit Machines and Toolbx checks remain manual.

Build evidence (2026-11-09)

A separate, non-pipeline build from the cycle's Core produced the first image and installation medium. This is execution evidence, not acceptance:

  • build 20261109T222253Z, Core input copied from run 20261109T212500Z;
  • image commit 2a12b124e44de80b732ab3924aa3bdb899691aabb81ff0d407e06af5cb3e0dc7;
  • Core layer commit 51bbe76eba5f9b435daaf4d67659d549d09bf9b3dfb8f0e9338ef5b90aeffcd2;
  • Container Runner purpose layer 6bfca36477e32e90df1e5468e342aa39344eaf41542d7cc2abe3af638809fd19;
  • ISO archipelago-container-runner.iso, 2352359424 bytes, sha256 a91862999f3e349125a0243112fb41b76164645dc0ba978672008f08c64c6d2d;
  • public refs: stable/container (image and layers) and purpose/server/container-runner; signature verified by pulling the image commit with gpg-verify-summary;
  • ISO reachable at https://mirror.nw-sys.ru/archipelago/iso/container/20261109T222253Z/archipelago-container-runner.iso with a matching .sha256;
  • image checks: os-release reports Archipelago Container Runner Tesseract, purpose identity and /etc/archipelago/update.json are present, cockpit.socket is enabled, tailscaled and firewalld are installed but not enabled, binfmt registrations and both podman/tailscale binaries exist;
  • ostree fsck found no errors.

The ISO catalog (v1/releases.json) and the existing Core/GNOME/KDE refs were not modified. The scheduled release driver now builds this variant as a fourth regular edition (container_variant in the coordinator configuration): every OSTree cycle publishes stable/container, and day-30 cycles also publish its ISO. The edition keeps the same cadence, signing and retention principles as Core/GNOME/KDE; its ISO is recorded in v1/container-runner.json rather than the desktop ISO catalog.

Verified package inputs

Checked against the mirror snapshot used on 2026-11-10 (extra/core DB). Versions are evidence for that snapshot only; the real list is pinned through the normal snapshot/lock mechanism (D-042, D-043).

Area Packages Note
Runtime podman 6.1.4, conmon 2.2.1, crun 1.30.1, containers-common 0.69.2 Stock Arch stack; no Docker daemon
Networking netavark 2.1.0, aardvark-dns 2.1.0, slirp4netns 1.3.7, passt, catatonit Rootless and bridge networking
Storage fuse-overlayfs 1.18 Rootless overlay on the persistent /var
Tooling podman-compose 1.6.0, podman-docker 6.1.4, buildah, skopeo podman-docker conflicts with a real Docker install by design
Multi-arch qemu-user-static, qemu-user-static-binfmt Optional at build; enables foreign-arch images
Rootless IDs shadow 4.20 (newuidmap, newgidmap) Requires subuid/subgid allocation at account creation (D-028)
Development toolbox 0.3, podman 6.x Same upstream Arch Toolbx default as Desktop Purposes (D-118); containers persist in the user's home
Management cockpit 371, cockpit-podman 133, cockpit-machines 360, cockpit-storaged 371, cockpit-files 47 All present in the snapshot
Virtualisation qemu-system-x86, qemu-img, qemu-hw-display-virtio-gpu, qemu-hw-display-virtio-vga, qemu-hw-uefi-vars, libvirt, libvirt-dbus, dnsmasq, dmidecode, edk2-ovmf, swtpm, virt-install Cockpit Machines dependency is libvirt-dbus; UEFI, TPM 2.0 and NAT networking included (D-117)
Network UI networkmanager 1.58 Needed by Cockpit's network page; Core currently uses networkd
Firewall nftables, firewalld (or ufw) Policy decision below
Mesh tailscale 1.104.5 Stock package; needs tun, state directory and onboarding
Operations openssh, chrony, polkit, sudo; optionally pcp pcp exists but the Cockpit PCP plugin is not packaged

Not shippable as-is:

  • cockpit-packagekit is excluded by D-095. Cockpit's Software Updates page has no compliant backend yet. Either implement a Cockpit plugin on top of archipelagod's typed D-Bus API (the same engine as GNOME Software) or hide the page. This is a real contract gap, not a cosmetic one.
  • cockpit-networkmanager and cockpit-pcp are not in the current snapshot repo. Upstream Cockpit ships them as separate subpackages; on Arch they must be verified or built as Archipelago packaging. Do not promise a "full plugin set" until that is resolved. cockpit-sosreport and cockpit-session-recording are likewise absent and are not required for the goal.
  • Docker Engine is not included. podman-docker provides the CLI shim; a real Docker daemon would be a second, unmanaged runtime.

Services and defaults

  • cockpit.socket enabled, reached over HTTPS on 9090 from the LAN and from the tailnet. No unauthenticated access, no AllowUnencrypted. TLS details are still open (see below).
  • libvirtd.service enabled; Cockpit Machines talks to libvirt through libvirt-dbus. libvirt's stock NAT network is autostarted and uses dnsmasq. Guest disks and machine definitions live under /var/lib/libvirt, which is workload state: OS updates and rollback must not remove them. /dev/kvm and membership in the kvm group are operator prerequisites; without KVM, libvirt can still run emulated guests slowly.
  • tailscaled.service is installed but disabled by default; state lives in /var/lib/tailscale and the socket under /run/tailscale. No auth key, node key or account identity is baked into the image. The operator enables and connects it manually (systemctl enable --now tailscaled, then tailscale up); there is no interactive onboarding and no automatic connection. The tun module must be present and autoloaded; --accept-dns is an explicit operator choice because MagicDNS interacts with systemd-resolved.
  • Subnet-router and exit-node roles are supported but off by default; enabling them requires net.ipv4.ip_forward/IPv6 forwarding and firewall rules, which are a deliberate operator action.
  • Rootful podman.socket/Docker API is off by default; it is root-equivalent. Rootless Podman plus Quadlet user units are the normal path.
  • Toolbx uses the upstream quay.io/toolbx/arch-toolbox:latest image from Core's shared default, so toolbox create provides a mutable Arch environment without changing the host. Containers and their home data persist across updates and rollback; the image does not delete or recreate them.
  • Container data lives in /var/lib/containers (root) and the user's home (rootless). It is workload state, not OS payload: updates and rollback must not delete it.
  • No automatic podman system prune, image GC, or restart of user containers without explicit configuration.

Acceptance criteria (candidate, for D-051/D-052)

Core checks run first on the full Core + Container Runner image; then:

  1. Boot to a working console/SSH session on real hardware; no desktop session.
  2. Rootless podman run --rm hello-world as the primary user, with subuid/subgid allocated; rootful path via sudo/polkit also works.
  3. podman-compose up on a two-service example; containers appear in cockpit-podman and survive a reboot when configured with a restart policy.
  4. podman-docker shim answers docker ps without a Docker daemon installed.
  5. Cockpit loads over HTTPS, authenticates through PAM/polkit, and the available pages render (containers, storage, logs). The updates page is either functional through the Archipelago D-Bus plugin or explicitly absent.
  6. Cockpit Machines starts a KVM guest from an ISO or an existing disk image, the guest reaches the libvirt NAT network, and its definition/disk survives a reboot and an OSTree update. UEFI (OVMF) and TPM 2.0 (swtpm) guests can be created when the host exposes /dev/kvm.
  7. tailscale up completes, tailscale status reports the node, and a ping/SSH over the tailnet succeeds; a reboot keeps the node identity.
  8. An OSTree update to a new deployment preserves images, volumes and containers; a rollback does the same.
  9. Optional: a foreign-architecture image runs through binfmt.

Each of these is a manual or automated check with recorded identities; none of them is claimed by this proposal.

Open questions that need decisions first

  1. Storage profile details. ext4 is chosen, but the server layout (separate /var size, encryption, btrfs opt-in mechanics) is still open; D-065 only covers the VM Core profile.
  2. Cockpit TLS. Self-signed certificate, Tailscale Serve, or user-provided certificate?
  3. Firewall defaults. Which ports are open on which zone by default (9090, SSH), and is firewalld or plain nftables the Purpose default?
  4. Network manager conflict. Core uses systemd-networkd; the Cockpit network page needs NetworkManager. The Purpose must switch networks explicitly and keep existing connections on update.
  5. Multi-arch by default. binfmt/qemu-user-static enlarges the image and widens the attack surface; ship it by default or as an opt-in Host Extension?
  6. Cockpit plugin authorization. First version relies on Cockpit's admin escalation; do we later require per-user polkit identity and a dedicated action for every update operation?
  7. Channel name. stable/container (or another ref) is not yet agreed; it is a publication contract, not an implementation detail.

Suggested implementation order

  1. Accept (or reject) the Purpose and settle questions 1–3; the rest can follow.
  2. Add proposals/container-runner.yaml to the explicit build inputs, with pinned snapshot and package closure (D-023, D-042).
  3. Purpose adapters: Cockpit units/firewall, tailscale service + onboarding, Podman storage and subuid/subgid handling, NetworkManager handoff, os-release variant.
  4. Build Core + Container Runner, export layers/images, assemble an ISO and verify install/boot.
  5. Run the acceptance list above manually and record evidence; only then consider a publication channel.
  6. Write the reproducibility evidence separately (D-050); tests do not prove it.

Non-goals

  • No desktop environment, no Flatpak, no Toolbx requirement (D-076 is scoped to Desktop Purposes), no PackageKit.
  • No virt-manager/GTK desktop application and no SPICE/remote-viewer stack: Cockpit Machines is the management surface, and VNC is enough for a server console.
  • No second package manager, no mutable /usr, no Docker daemon by default.
  • No cloud-init or remote provisioning contract in this proposal.