docker ci: aggressive runner disk reclaim before image builds

A staging run of the studio image build died with ENOSPC during the
Studio venv install: the hosted runners' default free space does not
fit the base image plus buildkit state plus the Studio layer. Drop all
unused preinstalled toolchains and the runner's preloaded docker
images in both build jobs.
This commit is contained in:
Daniel Han 2026-06-12 06:11:15 +00:00
commit 3d563794af

View file

@ -90,8 +90,19 @@ jobs:
# arm64 image lacks /usr/share/dotnet, hence `|| true`.
- name: Reclaim disk
run: |
# The hosted runners keep ~14-20 GB free, which is not enough for
# the image plus buildkit state (empirically confirmed: the Studio
# layer install died with ENOSPC on a staging run before this list
# was extended). None of these preinstalled toolchains are used
# here; some paths differ between the amd64 and arm64 runner
# images, hence `|| true`.
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL "$AGENT_TOOLSDIRECTORY" || true
/opt/hostedtoolcache "$AGENT_TOOLSDIRECTORY" \
/usr/local/.ghcup /usr/share/swift \
/usr/local/share/powershell /usr/local/lib/node_modules \
/usr/local/julia* /opt/microsoft /usr/share/miniconda \
/opt/az /usr/local/share/boost /usr/local/share/chromium || true
sudo docker image prune -af >/dev/null 2>&1 || true
df -h /
- uses: docker/setup-buildx-action@v3
@ -277,8 +288,19 @@ jobs:
- name: Reclaim disk
run: |
# The hosted runners keep ~14-20 GB free, which is not enough for
# the image plus buildkit state (empirically confirmed: the Studio
# layer install died with ENOSPC on a staging run before this list
# was extended). None of these preinstalled toolchains are used
# here; some paths differ between the amd64 and arm64 runner
# images, hence `|| true`.
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL "$AGENT_TOOLSDIRECTORY" || true
/opt/hostedtoolcache "$AGENT_TOOLSDIRECTORY" \
/usr/local/.ghcup /usr/share/swift \
/usr/local/share/powershell /usr/local/lib/node_modules \
/usr/local/julia* /opt/microsoft /usr/share/miniconda \
/opt/az /usr/local/share/boost /usr/local/share/chromium || true
sudo docker image prune -af >/dev/null 2>&1 || true
df -h /
- uses: docker/setup-buildx-action@v3