feat: enable age-bounded NC01 BuildKit GC

This commit is contained in:
pikastech
2026-07-21 07:58:35 +02:00
parent 3c4eff6c53
commit a476203737
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -1192,7 +1192,7 @@ def collect_candidates(observed_at):
if system_df["exitCode"] == 0:
cache = parse_docker_build_cache(system_df["stdout"])
if cache is not None and cache["reclaimableBytes"] > 0:
until = str(OPTIONS.get("buildCacheUntil") or "24h")
until = str(OPTIONS.get("buildCacheUntil") or host_docker_gc_section("buildCachePrune").get("until") or "24h")
candidates.append({
"id": "docker-builder:prune",
"kind": "docker-build-cache-prune",
@@ -1588,7 +1588,7 @@ def execute(candidate):
if kind == "docker-build-cache-prune":
if not host_docker_gc_enabled("buildCachePrune"):
raise RuntimeError(host_docker_gc_reason("buildCachePrune", "refusing Docker builder prune on this provider"))
until = str(OPTIONS.get("buildCacheUntil") or "24h")
until = str(OPTIONS.get("buildCacheUntil") or host_docker_gc_section("buildCachePrune").get("until") or "24h")
result = command(["docker", "builder", "prune", "--all", "--force", "--filter", "until=%s" % until], 45)
if result["exitCode"] != 0:
raise RuntimeError((result["stderr"] or "docker builder prune failed").strip())
+1 -1
View File
@@ -47,7 +47,7 @@ const DEFAULT_REMOTE_OPTIONS: RemoteGcOptions = {
dockerLogs: true,
dockerLogMaxBytes: 50 * 1024 * 1024,
buildCache: true,
buildCacheUntil: "24h",
buildCacheUntil: "",
tmp: true,
tmpMinAgeHours: 24,
toolCaches: false,