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/deploy/runner.md −204
| @@ -1,204 +0,0 @@ | |||
| 1 | # Set up a CI runner | ||
| 2 | |||
| 3 | Run CI on a separate machine from the forge. A runner executes repository code | ||
| 4 | and can read every secret its jobs declare, so it should not share storage or | ||
| 5 | credentials with the account database and SSH host key. | ||
| 6 | |||
| 7 | You need a running Vole instance, an instance-admin SSH key, and an Ubuntu 24.04 | ||
| 8 | or Debian 13 machine that can reach the instance's SSH port: 2222 with Vole's own | ||
| 9 | listener, or 22 with the [sshd front door](index.md#put-sshd-in-front-of-vole). | ||
| 10 | These instructions install the same Vole package as the server but enable only | ||
| 11 | `vole-runner.service`. | ||
| 12 | |||
| 13 | ## Create a runner with cloud-init | ||
| 14 | |||
| 15 | From a Vole source checkout on your computer: | ||
| 16 | |||
| 17 | ### 1. Render the runner's first-boot configuration | ||
| 18 | |||
| 19 | ```sh | ||
| 20 | cd deploy/cloud-init | ||
| 21 | FORGE_HOST=forge.example.com \ | ||
| 22 | SSH_PORT=22 \ | ||
| 23 | VOLE_PACKAGE_URL=https://rodent.software/vole/releases/v0.2.0/artifacts/vole_0.2.0-1_amd64.deb \ | ||
| 24 | ./render.sh runner > runner-user-data.yaml | ||
| 25 | ``` | ||
| 26 | |||
| 27 | Use the same `SSH_PORT` as the forge: `22` for its sshd front door, `2222` for | ||
| 28 | Vole's own listener. The rendered runner takes its remote and its `ssh-keyscan` | ||
| 29 | from it, so a mismatch fails the first lease. | ||
| 30 | |||
| 31 | `render.sh` requires `envsubst`, provided by `gettext-base` on Debian and Ubuntu | ||
| 32 | or `gettext` on other distributions. Inspect the rendered file before using it. | ||
| 33 | |||
| 34 | ### 2. Create the machine | ||
| 35 | |||
| 36 | Create a machine with your provider and paste `runner-user-data.yaml` into its | ||
| 37 | user-data or cloud-config field. Use the same Ubuntu or Debian image and package | ||
| 38 | architecture. Allow inbound shell SSH on port 22 only from your addresses; the | ||
| 39 | runner makes outbound connections to the forge and container registries. | ||
| 40 | |||
| 41 | Size memory for `RUNNER_JOBS × RUNNER_MEMORY`. Leave additional room for the | ||
| 42 | runner and host, and size disk for saved checkouts, caches, and OCI images. | ||
| 43 | Image storage is bounded by the runtime's own prune: `--image-max-age` (default | ||
| 44 | `168h`) sets the age, `0` keeps every image, and `--container-pull never` keeps | ||
| 45 | every tagged image because that runner cannot fetch one again. | ||
| 46 | |||
| 47 | ### 3. Wait for first boot | ||
| 48 | |||
| 49 | Setup output is in `/var/log/vole-runner-first-boot.log` on the runner. The | ||
| 50 | configuration creates an unprivileged `ci-runner` user, installs rootless Podman, | ||
| 51 | generates the runner's SSH key, pins the forge's host key, and enables the | ||
| 52 | service. | ||
| 53 | |||
| 54 | First boot pins the first host key returned by `ssh-keyscan`. Before allowing | ||
| 55 | production jobs, compare `/etc/vole/runner_known_hosts` with the forge's host key | ||
| 56 | fingerprint through a trusted channel. Replace the file if it does not match. | ||
| 57 | |||
| 58 | ### Runner cloud-init settings | ||
| 59 | |||
| 60 | | Variable | Default | Purpose | | ||
| 61 | |---|---|---| | ||
| 62 | | `FORGE_HOST` | required | Forge DNS name; `SSH_PORT` decides what SSH means | | ||
| 63 | | `SSH_PORT` | `2222` | `22` reaches the instance through its sshd, with no port in the remote | | ||
| 64 | | `VOLE_PACKAGE_URL` | required | Debian package URL from the [current stable release](https://rodent.software/vole/channels/stable) | | ||
| 65 | | `RUNNER_HOSTNAME` | `vole-runner` | Machine host name | | ||
| 66 | | `RUNNER_RUNTIME` | `podman` | OCI runtime | | ||
| 67 | | `RUNNER_NETWORK` | `bridge` | Maximum network offered to jobs | | ||
| 68 | | `RUNNER_DIR` | `/var/lib/vole-runner` | Checkouts, caches, and runner home | | ||
| 69 | | `RUNNER_LABEL_NAMES` | `linux` | Space-separated labels matched by `runs-on` | | ||
| 70 | | `RUNNER_JOBS` | `1` | Concurrent job slots | | ||
| 71 | | `RUNNER_MEMORY` | `4G` | Memory limit per job container | | ||
| 72 | | `RUNNER_PIDS` | `2048` | Process limit per job container | | ||
| 73 | | `RUNNER_TMPFS` | `1G` | Memory-backed `/tmp` size per job | | ||
| 74 | | `RUNNER_DISK_RESERVE` | `2G` | Free space preserved below `RUNNER_DIR` | | ||
| 75 | |||
| 76 | The unit's `MemoryMax=90%` is a host-level backstop, not a replacement for | ||
| 77 | per-job limits. [Running several jobs at once](../runner.md#running-several-jobs-at-once) | ||
| 78 | explains how to size concurrent slots. | ||
| 79 | |||
| 80 | ## Use an existing machine | ||
| 81 | |||
| 82 | Install Vole with the | ||
| 83 | [Debian or Ubuntu package repository](../install.md#debian-or-ubuntu). Then | ||
| 84 | install rootless Podman and create a dedicated account: | ||
| 85 | |||
| 86 | ```sh | ||
| 87 | sudo apt install podman slirp4netns fuse-overlayfs uidmap | ||
| 88 | sudo useradd --create-home --home-dir /var/lib/vole-runner \ | ||
| 89 | --shell /usr/sbin/nologin ci-runner | ||
| 90 | sudo usermod --add-subuids 100000-165535 \ | ||
| 91 | --add-subgids 100000-165535 ci-runner | ||
| 92 | sudo install -d -o ci-runner -g ci-runner -m 0700 \ | ||
| 93 | /var/lib/vole-runner/.ssh | ||
| 94 | sudo -u ci-runner ssh-keygen -q -t ed25519 -N '' \ | ||
| 95 | -f /var/lib/vole-runner/.ssh/id_ed25519 | ||
| 96 | ``` | ||
| 97 | |||
| 98 | Pin the forge's host key. Confirm the fingerprint through a trusted channel | ||
| 99 | before relying on it. Without the front door Vole's own listener answers on 2222; | ||
| 100 | with it, sshd answers on 22 and the entry is a plain host name: | ||
| 101 | |||
| 102 | ```sh | ||
| 103 | ssh-keyscan -p 2222 forge.example.com \ | ||
| 104 | | sudo tee /etc/vole/runner_known_hosts | ||
| 105 | ``` | ||
| 106 | |||
| 107 | ```sh | ||
| 108 | ssh-keyscan forge.example.com \ | ||
| 109 | | sudo tee /etc/vole/runner_known_hosts | ||
| 110 | ``` | ||
| 111 | |||
| 112 | Write `/etc/vole/runner.env`. Drop the port from `--remote` on a front-door | ||
| 113 | instance: | ||
| 114 | |||
| 115 | ```sh | ||
| 116 | sudo tee /etc/vole/runner.env >/dev/null <<'EOF' | ||
| 117 | VOLE_RUNNER_ARGS=--remote ssh://git@forge.example.com:2222 --container-runtime podman --container-network bridge --container-memory 4G --container-tmpfs 1G --disk-reserve 2G --dir /var/lib/vole-runner --known-hosts /etc/vole/runner_known_hosts --label linux | ||
| 118 | EOF | ||
| 119 | sudo systemctl daemon-reload | ||
| 120 | sudo systemctl enable --now vole-runner | ||
| 121 | ``` | ||
| 122 | |||
| 123 | Add `--jobs <n>` for concurrent jobs and size the machine for that many | ||
| 124 | containers. The file is split at spaces, so keep all arguments on one line. | ||
| 125 | `systemctl status vole-runner` and `journalctl -u vole-runner` report runtime | ||
| 126 | probe and connection failures. | ||
| 127 | |||
| 128 | ## What the package configures in the container runtime | ||
| 129 | |||
| 130 | The package installs two system-level Podman drop-ins for the runner: | ||
| 131 | |||
| 132 | | File | Purpose | | ||
| 133 | |---|---| | ||
| 134 | | `/etc/containers/registries.conf.d/50-vole-runner.conf` | Resolves short image names through `docker.io`; the image digest still pins the content | | ||
| 135 | | `/etc/containers/containers.conf.d/50-vole-runner.conf` | Uses `cgroupfs` because a system service has no systemd user manager for rootless Podman | | ||
| 136 | |||
| 137 | A site can override these with a later file such as `99-site.conf`. The runner | ||
| 138 | unit permits setuid user-mapping helpers with `NoNewPrivileges=false`; rootless | ||
| 139 | runtimes need them. Job isolation comes from the container, while the rest of the | ||
| 140 | unit's hardening remains in place. | ||
| 141 | |||
| 142 | These settings describe the shipped system unit. A custom user unit needs a | ||
| 143 | systemd user session and a different cgroup and runtime-directory arrangement; | ||
| 144 | do not combine its assumptions with the packaged unit. | ||
| 145 | |||
| 146 | ## Register and authorize the runner | ||
| 147 | |||
| 148 | Copy the runner's public key into a new bot account on the forge: | ||
| 149 | |||
| 150 | ```sh | ||
| 151 | ssh root@<runner-address> cat /var/lib/vole-runner/.ssh/id_ed25519.pub \ | ||
| 152 | | vole admin --remote ssh://git@forge.example.com:2222 \ | ||
| 153 | account create ci-runner-1 --bot --key - | ||
| 154 | ``` | ||
| 155 | |||
| 156 | Authorize that bot for each repository it should build: | ||
| 157 | |||
| 158 | ```sh | ||
| 159 | vole admin --remote ssh://git@forge.example.com:2222 \ | ||
| 160 | acl set-role demo ci-runner-1 runner | ||
| 161 | ``` | ||
| 162 | |||
| 163 | The runner role lets it lease jobs, report checks that count, and publish the | ||
| 164 | repository's site and declared artifacts. It is above `reader` and `contributor`, | ||
| 165 | so the bot can clone the repository and use its own contributor branch. It is | ||
| 166 | below `maintainer`: it cannot move a shared branch, triage, or approve. Maintainers and | ||
| 167 | admins are runners implicitly, so they need no separate entry. Repeat the command | ||
| 168 | for additional repositories; registration alone does not authorize every | ||
| 169 | repository. | ||
| 170 | |||
| 171 | A repository whose workflow declares `pages:` or `artifacts:` needs this role for | ||
| 172 | the runner that builds it. The old `acl runners` allowlist is gone; an existing | ||
| 173 | entry moves to the runner role when the rules are read. | ||
| 174 | |||
| 175 | A bot cannot sign in to the browser or become an instance admin. This prevents a | ||
| 176 | runner key from acquiring the implicit trust granted to admins. | ||
| 177 | |||
| 178 | ## Verify the runner | ||
| 179 | |||
| 180 | 1. Open **Admin → Runners** on the forge. The runner's slots should appear as | ||
| 181 | connected. | ||
| 182 | 2. Push a commit that triggers a workflow. The run page should name this runner | ||
| 183 | and show whether its result counts. | ||
| 184 | 3. If the job remains queued, check that its `runs-on` labels and `network:` | ||
| 185 | request match this runner, then inspect `journalctl -u vole-runner`. | ||
| 186 | |||
| 187 | The first `systemctl stop vole-runner` stops new leases and waits for active jobs | ||
| 188 | to report, up to the unit's 60-second stop timeout. See | ||
| 189 | [Stopping a runner](../runner.md#stopping-a-runner) before changing that limit. | ||
| 190 | |||
| 191 | ## Upgrade | ||
| 192 | |||
| 193 | Upgrade the forge first, then each runner: | ||
| 194 | |||
| 195 | ```sh | ||
| 196 | sudo apt install ./vole-<new-version>.deb | ||
| 197 | sudo systemctl restart vole-runner | ||
| 198 | ``` | ||
| 199 | |||
| 200 | ## Next | ||
| 201 | |||
| 202 | - [Runner reference](../runner.md) — execution isolation, network, cache, logs, | ||
| 203 | and queue behavior. | ||
| 204 | - [Workflows](../workflows.md) — define jobs that use this runner. | ||