# git-runner-mkosi A [Gitea Actions](https://docs.gitea.com/usage/actions/overview) runner packaged as a minimal Fedora VM image, built with [mkosi](https://github.com/systemd/mkosi). It builds and publishes its own OS image, and keeps itself up to date. - **Small:** Fedora with podman, networking and zram swap, for VMs only: no firmware or drivers for real hardware, no package manager or sshd. - **Stateless:** container storage is wiped on every boot. - **Isolated jobs:** each job runs in a container of its own (privileged, so it can build OS images), with its own podman; jobs never get the runner's podman. The job image ships with the OS, and common base images are shared read-only, so jobs don't download them. - **Self-updating:** images are rebuilt weekly and on every push. Hosts download updates with systemd-sysupdate into a second /usr partition (A/B) and reboot into them daily at about 04:10, after letting running jobs finish. - **Read-only /usr:** systemd-boot starts a UKI that mounts /usr from a read-only erofs partition, checked by dm-verity. /etc and /var live on the root partition, which updates keep. - **Hardened:** a firewall that drops all incoming traffic, and KSPP sysctls and kernel arguments. ## Install Download [the disk image](https://git.plabble.org/Job79/git-runner-mkosi/releases/download/latest/git-runner.qcow2) (built weekly by the `os` workflow), resize it to the disk size you want (the root partition grows to fill it) and boot it with UEFI. The console asks for a root password, hostname, Gitea URL, registration token and number of parallel jobs; the runner then registers itself. ## Images | `runs-on` | Image | |---|---| | `linux` | Our job image (`mkosi.images/job/`): git, Node.js, skopeo, dnf and podman (also as `docker`) | | `fedora` | Plain Fedora, used by our own build so a broken job image can't block its fix | ## Development `mkosi.conf` defines the OS (`mkosi.extra/` is copied to `/`, `mkosi.repart/` is the disk layout), `mkosi.images/job/` the job image. ```sh mkosi build mkosi vm ``` `mkosi.output/` then holds the disk image, and the UKI and /usr partitions that the `os` workflow publishes as an update.