Rewrite on the layout of agentos
os / os (push) Failing after 29s

Start again from agentos: a read-only, verity-checked /usr with A/B
updates, and a TPM-encrypted btrfs root made at first boot that holds
/etc and /var. On top of that the runner: gitea-runner from gitea.com,
a path unit that starts it once registered, and a drain before update
reboots. Jobs run in plain Fedora on root's podman.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Job79andClaude Opus 5.5 committed 2026-11-22 15:59:36 +00:00
1 parent 0569bce676
commit 0733ff55f3
49 files changed
+492 -509

No files matched your search

+23 -18
View File
@@ -1,29 +1,29 @@
# git-runner OS image
# os.yml builds the OS image and publishes it as version "latest". VMs fetch
# the built images as updates (mkosi.extra/usr/lib/sysupdate.d). It runs on
# every push, weekly for package updates, and by hand for critical CVEs.
#
# Builds the OS image, with the job image inside, and publishes it as version "latest" of the
# generic package git-runner, where runners fetch their updates (mkosi.extra/usr/lib/sysupdate.d).
# Runs on every push, weekly for Fedora updates, and by hand, on our own job image: if a change
# breaks it, build the fix locally (see README.md).
# Required values:
# - SECUREBOOT_KEY repository secret: the private key of mkosi.crt, written
# to mkosi.key.
# - SIGNING_KEY repository secret: the armored private gpg key whose
# public half is mkosi.extra/usr/lib/systemd/
# import-pubring.pgp, which systemd-sysupdate checks.
name: os
on:
push:
branches: [main]
schedule:
- cron: "0 2 * * 0" # weekly (Sunday), picks up Fedora updates
workflow_dispatch: # run by hand, e.g. for a CVE
- cron: "0 2 * * 0"
workflow_dispatch:
jobs:
os:
runs-on: linux
env:
PKG: ${{ github.server_url }}/api/packages/${{ github.repository_owner }}/generic/git-runner/latest
AUTH: "Authorization: token ${{ github.token }}"
steps:
- name: Install tools
run: dnf install -yq mkosi sbsigntools
run: dnf install -yq mkosi git-core zstd qemu-img
- name: Check out
uses: builtin:checkout
# Signs systemd-boot and the UKI for Secure Boot (mkosi.conf, [Validation]).
- name: Build
env:
KEY: ${{ secrets.SECUREBOOT_KEY }}
@@ -33,10 +33,10 @@ jobs:
- name: Compress
working-directory: mkosi.output
run: |
zstd -q --rm -T0 -19 git-runner_*.root-*.raw
qemu-img convert -c -O qcow2 "$(basename git-runner_*.efi .efi).raw" git-runner.qcow2
sha256sum git-runner_*.efi git-runner_*.root-*.raw.zst > SHA256SUMS
# Signs SHA256SUMS with the key whose public half is mkosi.extra/usr/lib/systemd/import-pubring.pgp.
zstd -q --rm -9 runneros_*.usr-*.raw
- name: Checksum
working-directory: mkosi.output
run: sha256sum runneros_*.efi runneros_*.usr-*.raw.zst > SHA256SUMS
- name: Sign
working-directory: mkosi.output
env:
@@ -45,11 +45,16 @@ jobs:
export GNUPGHOME=$(mktemp -d)
gpg -q --batch --import <<< "$KEY"
gpg -q --batch -o SHA256SUMS.gpg --detach-sign SHA256SUMS
# Replaces the previous version. SHA256SUMS goes last: until it's there, runners find no update.
- name: Build qcow2
working-directory: mkosi.output
run: qemu-img convert -c -O qcow2 "$(basename runneros_*.efi .efi).raw" runneros.qcow2
- name: Publish
working-directory: mkosi.output
env:
PKG: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/runneros/latest
AUTH: "Authorization: token ${{ gitea.token }}"
run: |
curl -fsS -H "$AUTH" -X DELETE "$PKG" || true
for f in git-runner_*.efi git-runner_*.root-*.raw.zst git-runner.qcow2 SHA256SUMS.gpg SHA256SUMS; do
for f in runneros_*.efi runneros_*.usr-*.raw.zst runneros.qcow2 runneros_*.manifest SHA256SUMS.gpg SHA256SUMS; do
curl -fsS -o /dev/null -H "$AUTH" --upload-file "$f" "$PKG/$f"
done