mkosi-based Gitea runner OS and job image
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
33 files changed
+529
No files matched your search
@@ -0,0 +1,32 @@
|
||||
# The runner's configuration (gitea-runner.service).
|
||||
# Every option: `gitea-runner config generate`.
|
||||
runner:
|
||||
# Parallel jobs, asked at first boot (stored in /etc/gitea-runner/runner.env).
|
||||
capacity: ${GITEA_RUNNER_CAPACITY}
|
||||
# On stop (before an update reboot), take no new jobs and give running ones this long to finish.
|
||||
shutdown_timeout: 30m
|
||||
envs:
|
||||
# podman in jobs: the job's own storage plus the shared base images (see volumes below).
|
||||
CONTAINERS_STORAGE_CONF: /usr/lib/gitea-runner/job/storage.conf
|
||||
labels:
|
||||
# Our job image (job/Containerfile): git, node, skopeo and podman.
|
||||
- "linux:docker://git.plabble.org/job79/git-runner-mkosi-job:latest"
|
||||
# Plain Fedora; our own build workflows use it, so a broken job image can't block its own fix.
|
||||
- "fedora:docker://quay.io/fedora/fedora:45"
|
||||
container:
|
||||
# Jobs build OS images, which needs root: they run privileged on root's podman.
|
||||
privileged: true
|
||||
# podman can't keep its storage, or build contexts, on the job's own overlay root.
|
||||
options: --volume /var/lib/containers --volume /var/tmp
|
||||
# Jobs run their own podman, never the runner's.
|
||||
docker_host: "-"
|
||||
volumes:
|
||||
# Base images, pulled at boot by gitea-runner-images.service; podman in jobs uses them read-only.
|
||||
- /var/lib/containers/base-images:/var/lib/base-images:ro
|
||||
# podman storage settings for jobs (see the file).
|
||||
- /usr/lib/gitea-runner/job:/usr/lib/gitea-runner/job:ro
|
||||
force_pull: true
|
||||
cache:
|
||||
# Jobs reach the cache on the host through their bridge; the firewall allows this port.
|
||||
host: host.containers.internal
|
||||
port: 8088
|
||||
@@ -0,0 +1,22 @@
|
||||
# Firewall: drop all incoming traffic except replies, loopback, ICMP and DHCPv6.
|
||||
# Loaded by nftables.service. Jobs live on podman bridges (podman*): they may reach the
|
||||
# internet, DNS on their bridge, and the runner's cache server (config.yaml), nothing else here.
|
||||
destroy table inet firewall
|
||||
table inet firewall {
|
||||
chain input {
|
||||
type filter hook input priority filter; policy drop;
|
||||
ct state established,related accept
|
||||
ct state invalid drop
|
||||
iif lo accept
|
||||
meta l4proto { icmp, ipv6-icmp } accept
|
||||
ip6 saddr fe80::/10 udp dport 546 accept
|
||||
iifname "podman*" meta l4proto { tcp, udp } th dport 53 accept
|
||||
iifname "podman*" tcp dport 8088 accept
|
||||
}
|
||||
chain forward {
|
||||
type filter hook forward priority filter; policy drop;
|
||||
ct state established,related accept
|
||||
ct state invalid drop
|
||||
iifname "podman*" accept
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
# podman storage in jobs (CONTAINERS_STORAGE_CONF). The job's own images go to the /var/lib/containers
|
||||
# volume; the base images the host pulls at boot are shared read-only, so jobs don't download them.
|
||||
[storage]
|
||||
driver = "overlay"
|
||||
graphroot = "/var/lib/containers/storage"
|
||||
runroot = "/run/containers/storage"
|
||||
|
||||
[storage.options]
|
||||
additionalimagestores = ["/var/lib/base-images"]
|
||||
Reference in new issue
Block a user