feat(ops): self-heal disk pressure instead of only alerting
CI / check (push) Successful in 2m36s
CI / deploy (push) Successful in 1m28s
CI / publish-container (push) Successful in 46s

The 5-minute disk probe now reclaims storage automatically: from 85% it runs the gentle age-windowed Docker prune, from 90% it drops the age windows (docker-prune.sh --force: all unused build cache and unreferenced images, all stopped containers) so a mount can never silently max out. Alerts still fire at 85/90/95% and their hint now points at non-Docker growth when reclaiming is not enough. Force mode is reserved for the worker; deploys keep the gentle mode. Volumes are off-limits in every path.
This commit is contained in:
openhands committed 2026-09-13 13:18:00 +02:00
1 parent fe26ca3ff3
commit 1caef76f82
4 files changed
+73 -18

No files matched your search

+6
View File
@@ -36,6 +36,12 @@ it("preserves production runtime configuration and recent cache", () => {
);
expect(prune).toContain('docker image prune -af --filter "until=168h"');
expect(prune).toContain('docker container prune -f --filter "until=24h"');
// Emergency `--force` mode drops every age window to reclaim unused bytes,
// but even then volumes are off-limits.
expect(prune).toContain('== "--force" ]]');
expect(prune).toContain("FORCE=1");
expect(prune).toContain("(( FORCE ))");
expect(deploy).not.toContain("--force");
expect(deploy).not.toContain("docker volume prune");
expect(prune).not.toContain("docker volume prune");
});
+1 -1
View File
@@ -306,7 +306,7 @@ export function diskPressure(usage: {
used: formatBytes(usage.usedBytes),
total: formatBytes(usage.totalBytes),
available: formatBytes(usage.availableBytes),
hint: "Docker prune runs nightly; run scripts/docker-prune.sh to reclaim cache sooner.",
hint: "Docker cache reclaim auto-fired with this alert; if the disk is still filling, the growth is outside Docker (check Gamedata/uploads/storage).",
},
});
}