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.

Put job execution behind an interface

de3eec162f93a697575c8bc756bd496fe4020376 · Keenan Nemetz · 2h ago · parent f784d769

Put job execution behind an interface

Job execution was container-shaped all the way into the runner: ci/agent
created the network, started the services and the job container, and held
*container.Container and *container.Network values directly, and
`vole workflow run` kept its own copy of the same orchestration. The only
abstraction was Config.Runtime, a string naming one of three flag-compatible
CLIs, which is enough for docker, podman and nerdctl and nothing else.

ci/execute is that seam. An Executor prepares the job's image, starts its
environment, runs one step while the caller keeps the lease alive, stops it,
reclaims what a killed runner left behind, and bounds its own storage. A
Sandbox is one job's environment: the job, the services beside it, and the
network they share. Capabilities is what a backend can honour, so a job that
asks for a network or for services is refused before it starts rather than
quietly given less.

ci/container implements it and takes over the orchestration that was in
ci/agent and cmd/vole: the per-attempt network, the service containers and
their log collection, the stale-container and stale-network reclamation, and
the image build and prune coordination. The isolation flags are unchanged.

This is the boundary a virtual-machine backend needs: a macOS guest behind
Tart (#356), a Windows guest, or a Linux microVM disagree with a container
about pids limits, user namespaces, tmpfs, capabilities and mounts, so they
cannot be expressed as another runtime string. Nothing about the image or
workflow schema changes here.

closes: 01M8Z2M9PVKPNH923S3VJ5FR5E

docs/runner.md +24

@@ -207,6 +207,30 @@ mode-`0600` `secrets.env` beside it. The runner sources that file before each
207 207 step, keeping values out of container arguments. It removes the directory with
208 208 the job.
209 209
210 ## Execution backends
211
212 The container is one implementation of the job's environment, not the definition
213 of it. `vole runner` asks for an executor, the executor states what it can honour,
214 and the runner refuses a job that asks for more before anything starts. The
215 container backend offers a network (`--container-network bridge`), services beside
216 the job, and memory and CPU limits.
217
218 The interface is `ci/execute.Executor`, and its contract is the whole of what
219 varies between a container and a guest: preparing an image, starting the
220 environment, running one step, stopping it, reclaiming what a killed runner left
221 behind, and bounding its own storage. A runner reports the backend it used in the
222 attempt record.
223
224 This is what a job that needs a macOS or Windows guest is built on: a virtual
225 machine is another executor rather than a second workflow or a second runner. The
226 same seam is what makes a Linux microVM possible, where the safety of the job
227 rests on a guest kernel rather than on the container's mount set.
228
229 Nothing guarantees feature parity across backends, and the interface does not hide
230 that. A backend without a network, or without service containers, refuses such a
231 job; it does not run it with less. [Run CI on a Mac](https://rodent.software/vole/n/356)
232 tracks the first guest backend.
233
210 234 ## Network
211 235
212 236 `--container-network` states the most networking this runner offers: `none` by