diff --git a/.gitea/workflows/image.yml b/.gitea/workflows/image.yml index a943a50..32f1b4d 100644 --- a/.gitea/workflows/image.yml +++ b/.gitea/workflows/image.yml @@ -87,7 +87,7 @@ jobs: dockerfile: Dockerfile job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db - name: ci - version: 0.2.35 + version: 0.2.36 subpath: "" dockerfile: images/ci/Dockerfile job_image: ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25c30c4..a776fd6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -68,7 +68,7 @@ repos: # --offline: no network audits, so a run needs no token and gives the same result everywhere. # Overriding args drops the hook's default, so --no-progress is repeated here. - repo: https://github.com/zizmorcore/zizmor-pre-commit - rev: 0eb9e4a60caf04df64b499ed1e8bef55f4440eae # frozen: v1.33.0 + rev: c7d31dc612dffdd4d3b2f2b88b9660d3ab057ee8 # frozen: v1.33.1 hooks: - id: zizmor args: [--no-progress, --offline] diff --git a/changelogs/fragments/gitea-runner-docker-prune-count-threshold.yml b/changelogs/fragments/gitea-runner-docker-prune-count-threshold.yml new file mode 100644 index 0000000..af9bb56 --- /dev/null +++ b/changelogs/fragments/gitea-runner-docker-prune-count-threshold.yml @@ -0,0 +1,9 @@ +--- +minor_changes: + - >- + gitea_runner - The Docker prune can bound the image cache by count and by disk use. With + ``gitea_runner_docker_prune_keep_per_repository`` above 0 the weekly prune keeps the newest N image IDs of each + repository and removes every other image no container uses. With ``gitea_runner_docker_prune_disk_threshold_percent`` + set, a timer (``gitea_runner_docker_prune_disk_check_schedule``, hourly by default) runs the count prune and a builder + prune capped at ``gitea_runner_docker_prune_builder_keep_storage`` when the filesystem holding the Docker root is + fuller than that, behind the same job gate as the weekly prune. Both are off by default. diff --git a/roles/gitea_runner/README.md b/roles/gitea_runner/README.md index 6f7b766..f908d26 100644 --- a/roles/gitea_runner/README.md +++ b/roles/gitea_runner/README.md @@ -53,6 +53,10 @@ Ubuntu 24.04 (noble), the image the molecule scenario runs on. The role uses `an | `gitea_runner_docker_prune_schedule` | `Sun *-*-* 04:30:00` | `OnCalendar` of the prune timer. | | `gitea_runner_docker_prune_container_age`, `_image_age` | `24h`, `168h` | `until` filters (creation time) for containers, and for images and build cache. | | `gitea_runner_docker_prune_job_max_age` | `21600` | Seconds; the prune skips while a younger container runs and ignores older ones as leaked job containers. | +| `gitea_runner_docker_prune_keep_per_repository` | `0` (off) | Newest image IDs kept per repository by the weekly and pressure prunes; every other image no container uses is removed. A multi-tag image counts once. | +| `gitea_runner_docker_prune_disk_threshold_percent` | `0` (off) | Use % of the Docker root's filesystem above which the pressure prune runs the count prune and a capped builder prune, behind the job gate. 1 to 99; needs the count above 0. | +| `gitea_runner_docker_prune_disk_check_schedule` | `hourly` | `OnCalendar` of the pressure prune timer. | +| `gitea_runner_docker_prune_builder_keep_storage` | `10GB` | `--keep-storage` of the builder prune under pressure. | | `gitea_runner_molecule_enabled` | `false` | Install molecule tooling and add the host label. | | `gitea_runner_molecule_label` | `molecule` | Host-executor label name, registered as `