From f71ab6109c2435013ec1318fefa1d0e24f36a5f8 Mon Sep 17 00:00:00 2001 From: Mikhail Malyshev Date: Sun, 29 Mar 2026 10:59:40 +0000 Subject: [PATCH] =?UTF-8?q?GHA:=20targeted=20cleanup=20=E2=80=94=20preserv?= =?UTF-8?q?e=20BuildKit=20ccache=20across=20runs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace nuclear 'docker system prune -af' and 'docker volume prune -af' with targeted removal of only the image we just built - Add clean-gcc/clean-clang Makefile targets that remove specific image from both linuxkit cache and docker - Add BuildKit cache pruning with configurable quota via BUILDX_KEEP_STORAGE_MB env var (defaults to 20000 MB) to prevent unbounded disk growth - Print BuildKit disk usage before pruning for diagnostics - Use buildctl inside linuxkit-builder container for cache management - Switch pr-build.yml from pull_request_target to pull_request - Remove unnecessary Docker Hub login from PR builds Signed-off-by: Mikhail Malyshev (cherry picked from commit 04d922430698ff01ed1c746418743514e2cfdf50) --- Makefile.eve | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile.eve b/Makefile.eve index b0af41f53fc00..862881848900b 100644 --- a/Makefile.eve +++ b/Makefile.eve @@ -84,7 +84,10 @@ docker-tag-clang: docker-tag-generate-clang push-gcc: push-image-gcc push-clang: push-image-clang -.PHONY: kernel-gcc kernel-clang docker-tag-gcc docker-tag-clang push-gcc push-clang +clean-gcc: clean-image-gcc +clean-clang: clean-image-clang + +.PHONY: kernel-gcc kernel-clang docker-tag-gcc docker-tag-clang push-gcc push-clang clean-gcc clean-clang docker-tag-generate-%: @echo "docker.io/$(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$*" @@ -93,6 +96,10 @@ push-image-%: $(if $(DIRTY), $(error "Not pushing since the repo is dirty")) $(LK) cache push $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)-$* +clean-image-%: + $(LK) cache rm $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$* 2>/dev/null || true + docker rmi $(IMAGE_REPOSITORY):$(BRANCH)-$(VERSION)$(DIRTY)-$* 2>/dev/null || true + .PHONY: clean clean: - echo "Cleaning" + $(LK) cache clean