ci(sgl-kernel-build): actually reclaim disk in the wheel-build cleanup step (#25206)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -83,21 +83,24 @@ jobs:
|
|||||||
- name: Free Docker disk space
|
- name: Free Docker disk space
|
||||||
run: |
|
run: |
|
||||||
set -x
|
set -x
|
||||||
# build.sh retags sgl-kernel-deps:cuda${CUDA_VERSION}-${PY_TAG}-${ARCH}
|
# `-f` only (no `-a`): drops dangling <none>:<none> layers from
|
||||||
# on every run, leaving the previous image as a dangling <none>:<none>
|
# prior runs but keeps the tagged sgl-kernel-deps:* base images.
|
||||||
# entry (~16-23 GB each). Prune them before building so the runner
|
docker image prune -f
|
||||||
# doesn't fill up. The local buildx cache at ~/.cache/sgl-kernel/buildx
|
# Reap orphan buildx builders from interrupted prior runs. Must
|
||||||
# and the tagged sgl-kernel-deps image are not affected.
|
# `buildx rm` (not `volume rm`) — the volume is held open by the
|
||||||
# `until=12h` avoids racing with a sibling matrix cell (cuda 12.9 vs
|
# buildkit helper container; removing the builder frees both.
|
||||||
# 13.0) that may have just orphaned an image seconds ago.
|
# `sgl-kernel-builder` and `default` are skipped on purpose.
|
||||||
docker image prune -f --filter "until=12h"
|
for b in $(docker buildx ls --format '{{.Name}}' | grep -E '^builder-' || true); do
|
||||||
# Drop orphaned buildx builder volumes from past `docker buildx create`
|
echo "Removing orphan buildx builder: $b"
|
||||||
# invocations. The active `sgl-kernel-builder` volume is held open and
|
docker buildx rm "$b" || true
|
||||||
# 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
|
done
|
||||||
|
# Trim the persistent local buildx cache (--cache-to mode=max grows
|
||||||
|
# unbounded). Cache-hit imports rewrite the blob, so mtime tracks
|
||||||
|
# "last carried forward by a build" — 14d is well past the freshest
|
||||||
|
# CI cycle.
|
||||||
|
if [ -d "$HOME/.cache/sgl-kernel/buildx/blobs" ]; then
|
||||||
|
find "$HOME/.cache/sgl-kernel/buildx/blobs" -type f -mtime +14 -delete
|
||||||
|
fi
|
||||||
df -h /
|
df -h /
|
||||||
|
|
||||||
- name: Build wheel for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }}
|
- name: Build wheel for Python ${{ matrix.python-version }} and CUDA ${{ matrix.cuda-version }}
|
||||||
|
|||||||
Reference in New Issue
Block a user