Runners
The runner is its own binary, hod-runner. The Compose runners are the image's (hod-runner start): they start job containers on the host's Docker through its socket, and keep workspaces in /var/lib/hod-runner and /var/lib/hod-runner-unprotected. More runners can run on any Linux machine that reaches the server:
Runner trust
Every runner is protected or unprotected, as the registration token it joined with says. The server sends the jobs of default-branch and tag runs only to protected runners, and every other job (pull requests, other branches, manual runs of them) only to unprotected ones. Runners can't choose: the token decides.
Why: code on the default branch and tags has been reviewed, and those runs get the release secrets, OIDC identity and push rights. A pull request's code hasn't been reviewed yet. A job with docker: true runs a privileged container, and a privileged container can take over its machine. If a pull request's job could run where release jobs run, it could read their secrets and job tokens, or plant code in the caches they use. GitLab's protected runners and Buildkite's clusters keep the two apart the same way.
- Put unprotected runners on machines of their own: other VMs or hosts. Two runners in containers on one Docker host don't keep them apart, since both reach the same Docker. The Compose quick start runs both on one machine, so its unprotected runner doesn't allow
docker: true; those jobs wait, with a reason saying so, until an unprotected runner that allows Docker joins. - Protect the default branch and release tags on your forge (required reviews, no direct pushes, tag rules). Hod trusts what reaches them; if anyone can push to the default branch, its runs are no more trustworthy than a pull request's.
- Tokens.
HOD_RUNNER_TOKENregisters protected runners andHOD_RUNNER_TOKEN_UNPROTECTEDunprotected ones;hod runner tokens create --trust protected|unprotectedmakes more. A job that no online runner of its kind can take waits, and says why:no online unprotected runner offers capability dind: pull request and other-branch jobs run only on unprotected runners.
On a second machine, for pull requests:
Adding a runner
hod runner start runs hod-runner start with the rest of its arguments, and the server and TLS settings hod login saved. See hod runner start --help (or the runner reference) for --labels, --slots and --network host. A runner also reads HOD_GIT_PROTOCOLS (--git-protocols, https by default): the URL schemes it may fetch jobs' repositories with.
- Getting hod-runner.
hod runner startuses ahod-runneronPATH. Without one, it installs the server's own build into~/.local/share/hod/runners, after asking on a terminal; in scripts and services, runhod runner installfirst. Each server hands out the builds of its own version, for x86_64 and aarch64 Linux, atGET /api/v1/runner-downloads(no token needed). The image has them in/usr/share/hod/runners/<target>/hod-runner; pointHOD_RUNNER_DOWNLOADSat another directory laid out the same way. The release archives (hod-runner-<version>-<target>.tar.gz) and the image's/usr/local/bin/hod-runnerwork too, withhod-runner start --server URLdirectly. An installed runner doesn't update itself: after upgrading the server, restart it withhod runner startto install and run the new build. That asks on a terminal; a service runshod runner installbefore each start (systemd'sExecStartPre=-…, so a server that's down doesn't stop it), or it stops at the new version until someone does. - What runner machines need. Docker, for job containers. Not git: the runner checks out jobs' commits itself. Jobs on the host executor that call git need it there, like any other tool they use.
Registration and identity
- Registration tokens.
hod runner tokens create --trust protected|unprotected [--pool P] [--one-time] [--expires-in 7d]. - Identity. A runner registers once and keeps its identity, an Ed25519 key, in
--state-dir(~/.local/state/hod/runner), so it needs the registration token only the first time. An admin removes a runner withDELETE /api/v1/orgs/{org}/runners/{id}. - Ephemeral runners.
hod runner start --ephemeraltakes one job and exits, keeping its key in memory. With a one-time token, no long-lived secret stays on the machine.
Jobs on a runner
- Docker in jobs. Jobs with
docker: trueget a Docker daemon of their own in a privileged container, and only run on runners started with--allow-docker. The Compose protected runner allows it; allow it on an unprotected runner only on a machine of its own (Runner trust). - Lost jobs. If a runner crashes or loses its network, its job goes back to the queue once its lease expires (about a minute), up to three attempts.
- Host jobs and secrets. Jobs that run on the host (macOS and Windows runners,
runs-on: [macos]without an image) share the runner's OS user. A host job that has secrets runs alone on its runner, whatever its--slots. A host job without secrets can still run beside a Docker job that has some and reach its container through Docker: if that matters, keep host jobs on runners of their own (--labels).