fix(ci): bound pkgcache _metadata growth to stop macmini disk-fill #110
1 changed files with 10 additions and 0 deletions
feat(build-all): trim pkgcache _metadata every 25 packages during full builds
commit
b53a24614b
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue