deploy: keep the locally built CI image when pruning !568

merged merged by cmc on 2026-10-04 06:31 UTC · krz/gitbay:runner-prune-keep-ci-image into main

3 files changed, +11 −3

Layout: unified · split

.gitbay/wiki/Admin.org +3
@@ -1295,6 +1295,9 @@ refused to start would stop every build.
12951295=gitbay-runner-prune.timer= prunes unused images weekly, as the runner's
12961296user: rootless storage belongs to that user, and root's prune would not
12971297see it. An unpruned image store on a 40GB host is a slow outage.
1298Images labelled =org.gitbay.keep=true= are skipped, since a locally
1299built =localhost/= image cannot be pulled back; =deploy/Containerfile.ci=
1300sets it.
12981301
12991302* LFS storage
13001303
deploy/Containerfile.ci +4
@@ -15,6 +15,10 @@
1515# .gitbay/ci.yml rather than a silent change under a running branch.
1616FROM docker.io/library/golang:1.27-trixie
1717
18# gitbay-runner-prune.service skips images carrying this label. A localhost/
19# image cannot be pulled back, so pruning it fails every job that names it.
20LABEL org.gitbay.keep=true
21
1822# The suite drives real git, ssh, sshd and gpg rather than mocking them,
1923# and asserts they are present before running. git-lfs has its own tests;
2024# sshd must be the binary at /usr/sbin/sshd that the tests exec.
deploy/gitbay-runner-prune.service +4 −3
@@ -10,7 +10,8 @@ User=ci-runner
1010# Rootless podman reads storage.conf under HOME; a User= unit does not
1111# set it.
1212Environment=HOME=/var/lib/gitbay-runner
13# Images not used by a container and older than a week. A build that
14# names an image again re-pulls it; the cost is one pull, not a failure.
15ExecStart=/usr/bin/podman image prune --all --force --filter until=168h
13# Images not used by a container and created more than a week ago. A
14# registry image is pulled again on next use. A locally built image cannot
15# be, so one labelled org.gitbay.keep=true (deploy/Containerfile.ci) is kept.
16ExecStart=/usr/bin/podman image prune --all --force --filter until=168h --filter label!=org.gitbay.keep=true
1617ExecStart=/usr/bin/podman container prune --force