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.

Bound the runner's image storage by age

3455902aa415e013b0e5525e3fd2271a2b1a4e9a · Keenan Nemetz · 3d ago · parent 1a9b3838

Bound the runner's image storage by age

The job cache and saved checkouts have caps, but image storage belonged to the
runtime and grew two ways: a changed `.vole/images` definition left a permanent
new digest tag behind, and a moved registry tag left the previous layers
dangling. `--disk-reserve` could not reclaim either; it stops a job instead.

Add `--image-max-age` (default 168h; 0 keeps every image), threaded through
agent.Options. At startup and on the cache trimmer's beat the runner asks the
runtime to prune unused images older than the age, using the filter docker,
podman, and nerdctl all express. A job holds an image guard from resolution
until its container is up, so a pass that races a lease gives way. A runner
with `--container-pull never` keeps every tagged image and prunes dangling
layers only, because it may have no network to fetch an evicted image again.
A runtime that will not prune is reported once and then left alone: the runner
keeps serving.

The primitive lives in ci/container so `vole workflow run` can use it later;
the policy and its beat live in ci/agent beside the two existing trimmers.

closes: 01M8CR0RN88JF14PKAZ0D387ND

ci/agent/sandbox.go +5

@@ -42,6 +42,10 @@ type runnerBox struct {
42 42 // image-file build it once. Nil means the caller never validated these options,
43 43 // which only a test does.
44 44 builds *imageBuilds
45 // images keeps a prune pass away from an image a job is resolving or starting.
46 // It is shared with the trimmer, which lives in Run, for the length of the
47 // process.
48 images *imageUse
45 49 }
46 50
47 51 // containerOptions validates the runner's container settings and fills in the
@@ -71,6 +75,7 @@ func containerOptions(opts Options, cache string) (runnerBox, error) {
71 75 id: fmt.Sprintf("%x", sum[:6]),
72 76 pid: os.Getpid(),
73 77 builds: &imageBuilds{},
78 images: &imageUse{},
74 79 }, nil
75 80 }
76 81