diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 93ff2b38e..649eb3c5b 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -479,6 +479,26 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Free Docker disk space + run: | + set -x + # build.sh retags sgl-kernel-deps:cuda${CUDA_VERSION}-${PY_TAG}-${ARCH} + # on every run, leaving the previous image as a dangling : + # entry (~16-23 GB each). Prune them before building so the runner + # doesn't fill up. The local buildx cache at ~/.cache/sgl-kernel/buildx + # and the tagged sgl-kernel-deps image are not affected. + # `until=12h` avoids racing with a sibling matrix cell (cuda 12.9 vs + # 13.0) that may have just orphaned an image seconds ago. + docker image prune -f --filter "until=12h" + # Drop orphaned buildx builder volumes from past `docker buildx create` + # invocations. The active `sgl-kernel-builder` volume is held open and + # would fail to remove anyway, but skip it explicitly for clarity. + for v in $(docker volume ls -q | grep '^buildx_buildkit_' | grep -v '^buildx_buildkit_sgl-kernel-builder' || true); do + echo "Removing orphan buildx volume: $v" + docker volume rm "$v" || true + done + df -h / + - name: Build wheel for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }} run: | cd sgl-kernel @@ -545,6 +565,17 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Free Docker disk space + run: | + set -x + # See sgl-kernel-build-wheels above for the rationale. + docker image prune -f --filter "until=12h" + for v in $(docker volume ls -q | grep '^buildx_buildkit_' | grep -v '^buildx_buildkit_sgl-kernel-builder' || true); do + echo "Removing orphan buildx volume: $v" + docker volume rm "$v" || true + done + df -h / + - name: Build wheel for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }} run: | cd sgl-kernel