[CI] sgl-kernel: prune dangling images before each wheel build (#23723)

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kangyan-Zhou
2026-04-25 10:44:47 -07:00
committed by GitHub
co-authored by Claude Opus 4.7
parent e0a4522370
commit acaa35664d
+31
View File
@@ -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 <none>:<none>
# 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