fix(ci): bound pkgcache _metadata growth to stop macmini disk-fill #110
Loading…
Reference in a new issue
No description provided.
Delete branch "t3code/smarter-disk-pruning-macmini"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The arm64
build-allpipeline fills the macmini (gaia) host disk despite an 8h prune.Root cause is not images or job volumes: it is the persistent dep-cache volume, specifically
pkgcache/R/pkgcache/_metadata, which grew to ~165 GB.{pkgcache}mints a new content hash for the "patched" binaries repo on every PACKAGES change, so each per-package build writes a fresh ~70 MBpkgs-<hash>.rds(+patched-<hash>/) that is never evicted (2407 snapshots observed).When the disk hits 100% OrbStack stops and the on-host prune can no longer connect to the daemon, so it never self-heals.
Change (Workstream A of the disk-fill fix)
trim_pkgcache_metadata()tolocal/r-minor-helpers.R: keeps the newestkeep(default 20)patched-*/pkgs-*.rdsentries under_metadata, deleting only entries older thanmin_age_secs(default 600s) so it never races the up-to-4 concurrent split-jobs sharing the volume.Preserves
pkg/downloads and the stable CRAN/BioC/INLA repo dirs.No-op when
R_PKG_CACHE_DIRis empty (amd64) or_metadatais absent (first run).local/build-all.R._metadata/patched-*+pkgs-*.rdsto the two workflows that mount the persistent volume (build-all-versions.yaml,build-all-versions-install-deps.yaml).Only these paths are touched;
process-updates.yaml/weekly-rebuild-missing.yaml(no persistent volume) are unchanged.Follow-ups (separate workstreams): on-host self-healing prune watcher + OrbStack disk cap (ansible), and Prometheus/Grafana alerting (k8s-talos).
Upstream: bincraft patched-repo hash churn is the true source fix.
New unit tests (6) for the helper; full suite 24/24 green.