Files
Job79andClaude Opus 5.5 018f15172d Ask for the registration and capacity at first boot
gitea-runner-setup asks on the console for the number of parallel jobs,
the Gitea URL and a registration token, and registers the runner. It runs
until the runner is registered, and logins wait for it, as for
systemd-firstboot. The capacity goes to a drop-in of gitea-runner.service,
which passes it to the config as CAPACITY, so the config stays read-only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-23 18:57:23 +00:00

29 lines
1.3 KiB
Desktop File

# gitea-runner.service runs the Gitea Actions runner, which runs each job in a
# container on root's podman. gitea-runner.path starts it once it is
# registered. It runs as root: whoever has podman's socket is root anyway.
#
# TimeoutStopSec is a bit longer than runner.shutdown_timeout in
# /etc/gitea-runner/config.yaml, so running jobs can finish on stop.
[Unit]
Description=Gitea Actions runner
Wants=network-online.target
After=network-online.target podman.socket
Requires=podman.socket
[Service]
# CAPACITY is the number of parallel jobs. gitea-runner-setup writes a drop-in
# that overrides it, which `systemctl edit gitea-runner` changes.
Environment=CAPACITY=1
# HOME holds the cache of actions/cache, next to the registration.
Environment=HOME=/var/lib/gitea-runner
Environment=DOCKER_HOST=unix:///run/podman/podman.sock
# ExecStartPre loads the job image (mkosi.images/job/) from /usr into podman,
# whose storage is wiped at every boot, under the name that the linux label in
# /etc/gitea-runner/config.yaml uses. podman names nothing it pulls from an
# OCI directory, hence the tag.
ExecStartPre=/bin/sh -c 'podman tag "$(podman pull -q oci:/usr/lib/runneros/job)" localhost/runneros-job'
ExecStart=/usr/bin/gitea-runner -c /etc/gitea-runner/config.yaml daemon
Restart=on-failure
RestartSec=10s
TimeoutStopSec=65min