fix(ci): bound pkgcache _metadata growth to stop macmini disk-fill #110

Merged
pat-s merged 5 commits from t3code/smarter-disk-pruning-macmini into main 2026-07-13 09:31:29 +00:00
Showing only changes of commit b53a24614b - Show all commits

feat(build-all): trim pkgcache _metadata every 25 packages during full builds

Patrick Schratz 2026-07-03 09:24:02 +02:00
Signed by: pat-s
GPG key ID: 3C6318841EF78925

View file

@ -96,6 +96,10 @@ s3_cache <- readRDS("/mnt/cache/packages/s3_cache.rds")
sprintf("S3 cache: %s files", length(s3_cache))
n <- nrow(chunk)
# Every `trim_every` packages, bound the pkgcache _metadata dir so a full-platform
# run does not accumulate thousands of ~70 MB snapshots and fill the host disk.
# No-op on amd64 (R_PKG_CACHE_DIR is empty / cache not persisted).
trim_every <- 25L
mapply(
function(pkg, ver, sens, i) {
cat(sprintf("[%d/%d] %s_%s (r_minor_sensitive=%s)\n", i, n, pkg, ver, sens))
@ -120,6 +124,12 @@ mapply(
upload = TRUE,
store_build_metadata = TRUE
)
if (i %% trim_every == 0L) {
removed <- trim_pkgcache_metadata()
if (removed > 0L) {
cat(sprintf(" [pkgcache trim] removed %d stale _metadata entries\n", removed))
}
}
},
chunk$Package,
chunk$Version,