# 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