Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Rewrite documentation around reader tasks

d1f44d838966c0a4762073f12375ec7562582fdf · Keenan Nemetz · 21h ago · parent 9103f6a8

docs/runner.md +141−70

@@ -1,103 +1,149 @@
1 # Runner reference
1 # Runners
2 2
3 A runner leases jobs over SSH, executes their steps in OCI containers, and
4 reports results to the instance. Use [Set up a runner](deploy/runner.md) for the
5 installation procedure and [Workflows](workflows.md) for job definitions. This
6 page defines the runner's execution, trust, storage, and queue behavior.
3 A runner leases jobs over SSH and executes repository code in containers on its
4 own host. Keep the runner separate from the forge server: the forge queues and
5 records work, while the runner owns the container runtime, job caches, and
6 trusted checkouts.
7 7
8 ## Start a runner
8 ## Set up a runner {: #start-a-runner }
9 9
10 A runner needs Docker, rootless Podman, or nerdctl and network access to the
11 instance's SSH listener. Rootless Podman is preferred because Docker-group
12 membership is effectively host root.
10 You need:
11
12 - Docker, rootless Podman, or nerdctl on the runner host;
13 - network access to the instance's SSH listener;
14 - an SSH key readable only by the runner's service user;
15 - a bot account with the `runner` role on each repository it builds.
16
17 Rootless Podman is preferred because Docker-group membership is effectively host
18 root. For the packaged service, start with
19 [Set up a runner on Linux](deploy/linux.md#set-up-a-runner-on-linux), then use
20 this page for verification and operation.
21
22 ### Register and authorize the runner
23
24 Create a bot account and grant the role per repository:
13 25
14 26 ```sh
15 vole runner --remote ssh://git@host:2222 --container-runtime podman
16 vole runner --remote ssh://git@host:2222 --container-runtime podman --once
17 vole runner --remote ssh://git@host:2222 --label linux --label arm64
18 vole runner --remote ssh://git@host:2222 --repos demo --repos docs
27 vole admin account create ci-runner-1 --bot --key ci-runner-1.pub
28 vole admin acl set-role demo ci-runner-1 runner
19 29 ```
20 30
21 These examples use Vole's own SSH listener on 2222. On an instance with the
22 [sshd front door](deploy/index.md#put-sshd-in-front-of-vole) the remote has no
23 port — `--remote ssh://git@host` — and nothing else about these commands changes.
31 If the public key is on the runner host, copy it through standard input instead:
24 32
25 `--label` advertises machine labels; a job must find every label in its
26 `runs-on`. `--repos` narrows the repositories the account may already serve and
27 cannot grant access. `--dir` selects checkout and cache storage, and `--once`
28 exits after the selected jobs finish.
33 ```sh
34 ssh root@<runner-address> cat /var/lib/vole-runner/.ssh/id_ed25519.pub \
35 | vole admin --remote ssh://git@forge.example.com:2222 \
36 account create ci-runner-1 --bot --key -
37 ```
29 38
30 At startup, the runner executes `<runtime> info` and refuses to serve if the
31 runtime cannot run containers. This prevents a broken machine from consuming a
32 job attempt before the first step. The probe does not pull an image and runs
33 again only when the runner restarts.
39 Repeat `acl set-role` for every repository the runner should build. Creating the
40 bot alone grants no repository access.
34 41
35 The [CLI reference](cli.md#runner) lists every runtime, resource, cache, and host
36 key option and its default.
42 The `runner` role lets the bot clone the repository, lease jobs, report checks
43 that count, and publish declared sites and artifacts. It cannot push shared
44 branches, triage, or approve requests. Maintainers and admins are runners
45 implicitly. Bots cannot sign in to the browser or become instance admins.
37 46
38 ## The runner's account
47 Keep one long-lived key per machine. Remove the key or retire the account to
48 revoke the machine. A job using `acts-as:` receives a separate per-run credential
49 that cannot lease work; uploads after the steps still use the runner account.
39 50
40 The SSH account behind a runner is its identity in logs, run records, and the
41 runner role. Create a bot and grant it the role per repository:
51 !!! warning "The runner receives declared secrets"
52 Every job can read the repository secrets it declares. Granting the runner
53 role trusts both the machine and the people controlling it, not only its
54 container runtime.
55
56 ### Host key verification
57
58 The runner refuses unknown or changed instance host keys. Run these commands as
59 the runner's service user so `~/.ssh/known_hosts` is the file it reads:
42 60
43 61 ```sh
44 vole admin account create ci-runner-1 --bot --key ci-runner-1.pub
45 vole admin acl set-role demo ci-runner-1 runner
62 ssh-keyscan -p 2222 forge.example.com >> ~/.ssh/known_hosts
63 ssh-keygen -lf ~/.ssh/known_hosts
46 64 ```
47 65
48 The runner role authorizes the account's results, lets it lease jobs, and lets it
49 publish the site and artifacts its jobs declare. It is above `reader` and
50 `contributor`, so the bot can clone a private repository and use its own
51 contributor branch. It is below `maintainer`, so it cannot move a shared branch,
52 triage, or approve. Maintainers and admins are runners implicitly, but bots
53 cannot be instance admins, preventing a runner key from acquiring instance-wide
54 trust.
66 Compare the fingerprint with the instance's public host key before starting the
67 runner. With the system sshd on port 22, scan without `-p`:
55 68
56 A repository whose workflow declares `pages:` or `artifacts:` requires this role
57 for the runner that builds it. The old `acl runners` allowlist is gone; an
58 existing entry moves to the runner role when the rules are read.
69 ```sh
70 ssh-keyscan forge.example.com >> ~/.ssh/known_hosts
71 ```
59 72
60 Keep one long-lived key per runner machine, readable only by its service user.
61 Remove the key or retire the account to revoke the machine. This key belongs to
62 the runner process. A job using `acts-as:` receives a separate per-run credential
63 that cannot lease work. The site, artifact, and release writes after the steps run
64 in the runner process, so they use the runner account's role; the `acts-as`
65 credential covers the job's own steps, not those uploads.
73 The resulting entry is `forge.example.com`, not `[forge.example.com]:2222`. Pin
74 the endpoint the runner will actually use.
66 75
67 A runner can read every secret declared by its jobs. Granting the runner role
68 therefore trusts both the machine and the people controlling it, not only its
69 container runtime.
76 `--known-hosts <path>` selects another readable file.
77 `--insecure-host-key` accepts any key and is only for throwaway tests.
78 `VOLE_KNOWN_HOSTS` and `VOLE_INSECURE_HOST_KEY` apply the corresponding policy to
79 other Vole remote commands. The runner applies its policy to both the control
80 channel and Git commands; a caller-provided `GIT_SSH_COMMAND` cannot disable it.
70 81
71 ## Host key verification
82 ### Start the runner
72 83
73 The runner verifies the instance against `known_hosts` and rejects unknown or
74 changed host keys. Pin the host out of band before starting it:
84 Start with one job slot and a machine label:
75 85
76 86 ```sh
77 ssh-keyscan -p 2222 host >> ~/.ssh/known_hosts
78 vole runner --remote ssh://git@host:2222 --known-hosts ~/.ssh/known_hosts
87 vole runner --remote ssh://git@forge.example.com:2222 \
88 --container-runtime podman \
89 --known-hosts ~/.ssh/known_hosts \
90 --label linux
79 91 ```
80 92
81 When sshd is the front door the port is sshd's, and neither the scan nor the
82 remote names one:
93 With sshd on port 22, use `--remote ssh://git@forge.example.com` instead.
94
95 At startup, the runner executes `<runtime> info` and refuses to serve if the
96 runtime cannot run containers. The probe does not pull an image and runs again
97 when the runner restarts.
98
99 Useful variations:
83 100
84 101 ```sh
85 ssh-keyscan host >> ~/.ssh/known_hosts
86 vole runner --remote ssh://git@host --known-hosts ~/.ssh/known_hosts
102 # Let jobs request bridge networking for downloads and services.
103 vole runner --remote ssh://git@forge.example.com:2222 --container-network bridge
104
105 # Advertise an ARM machine and restrict the repositories it serves.
106 vole runner --remote ssh://git@forge.example.com:2222 \
107 --label linux --label arm64 --repos demo --repos docs
108
109 # Run one job and exit.
110 vole runner --remote ssh://git@forge.example.com:2222 --once
87 111 ```
88 112
89 The entry for that is a plain `host`; the `[host]:2222` form belongs to Vole's own
90 listener and is unused in front-door mode. Pin the form the instance actually
91 answers on: a runner that scanned the wrong one refuses to connect rather than
92 trusting it.
113 A job with `runs-on` must find every label it requests. `--repos` only narrows
114 access the account already has. The default network offering is `none`; bridge
115 networking lets repository code reach anything the runner can reach.
116 `--dir` selects checkout and cache storage. The
117 [CLI reference](cli.md#runner) lists every runtime and resource option.
118
119 ### Verify the runner
120
121 1. Open **Admin → Runners**. The runner's slots should appear as connected.
122 2. Push a commit that triggers a workflow. The run page should name this runner
123 and show whether its result counts.
124 3. From a clone, inspect the result with `vole run list` and
125 `vole run show <run-id>`.
126 4. If the job remains queued, check its `runs-on` labels and `network:` request,
127 then inspect `journalctl -u vole-runner` on the packaged host.
128
129 The first `systemctl stop vole-runner` stops new leases and waits for active jobs
130 to report, up to the unit's 60-second stop timeout. See
131 [Stopping a runner](#stopping-a-runner) before changing that limit.
93 132
94 `--known-hosts` selects another file. `--insecure-host-key` accepts any host and
95 is only for throwaway tests. `VOLE_KNOWN_HOSTS` and `VOLE_INSECURE_HOST_KEY`
96 apply the corresponding policy to other Vole remote commands too.
133 ### Upgrade a runner
134
135 Upgrade the forge first, then each runner with the same package repository used
136 to install it. For Debian or Ubuntu:
137
138 ```sh
139 sudo apt update && sudo apt upgrade vole
140 sudo systemctl restart vole-runner
141 ```
97 142
98 The runner applies its host-key policy to both the control channel and Git
99 commands. A caller-provided `GIT_SSH_COMMAND` cannot disable verification because
100 the runner's own SSH options take precedence.
143 For other package managers, see
144 [Upgrade an installed server](install.md#upgrade-an-installed-server). Runners do
145 not share the forge's database, so the instance migration procedure does not
146 apply to them.
101 147
102 148 ## Running several jobs at once
103 149
@@ -215,7 +261,25 @@ accordingly.
215 261
216 262 Image definitions execute code on the runner. Pin base images by digest and
217 263 review contributor changes to `.vole/images/` before allowing CI. See the
218 [image reference](reference/image-reference.md).
264 [image reference](workflows.md#image-reference).
265
266 ## What the package configures in the container runtime
267
268 The package installs two system-level Podman drop-ins for the runner:
269
270 | File | Purpose |
271 |---|---|
272 | `/etc/containers/registries.conf.d/50-vole-runner.conf` | Resolves short image names through `docker.io`; the image digest still pins the content |
273 | `/etc/containers/containers.conf.d/50-vole-runner.conf` | Uses `cgroupfs` because a system service has no systemd user manager for rootless Podman |
274
275 A site can override these with a later file such as `99-site.conf`. The runner
276 unit permits setuid user-mapping helpers with `NoNewPrivileges=false`; rootless
277 runtimes need them. Job isolation comes from the container, while the rest of the
278 unit's hardening remains in place.
279
280 These settings describe the shipped system unit. A custom user unit needs a
281 systemd user session and a different cgroup and runtime-directory arrangement;
282 do not combine its assumptions with the packaged unit.
219 283
220 284 ## What a job may consume
221 285
@@ -360,3 +424,10 @@ Deleting `data/instance.db` loses CI history, queued work, in-flight attempts,
360 424 contributor CI allow decisions, accounts, access rules, and stored secrets.
361 425 Current refs can be queued again from Git, but only a backup restores finished
362 426 history. Back up this database with the rest of the instance.
427
428 ## Related
429
430 - [Set up a runner on Linux](deploy/linux.md#set-up-a-runner-on-linux) — the packaged service.
431 - [Set up a runner with cloud-init](deploy/cloud-init.md#set-up-a-runner-with-cloud-init) — a first-boot runner host.
432 - [Workflows](workflows.md) — job definitions and the event model.
433 - [Workflow reference](workflows.md#workflow-reference) — every job field.