From 26e9a69feac927cb06d2b6f13092003291534dc5 Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Sat, 4 Apr 2026 13:32:39 -0700 Subject: [PATCH] CI: Free 35GB of unused files on the runner Free 35GB of unused files, mostly from unused development environments. This helps with the out of disk space problems we were seeing on FreeBSD runners. Reviewed-by: Brian Behlendorf Reviewed-by: George Melikov Signed-off-by: Tony Hutter Closes #18400 --- .github/workflows/scripts/qemu-1-setup.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/scripts/qemu-1-setup.sh b/.github/workflows/scripts/qemu-1-setup.sh index 3d1115612..9d6cc3c6d 100755 --- a/.github/workflows/scripts/qemu-1-setup.sh +++ b/.github/workflows/scripts/qemu-1-setup.sh @@ -6,6 +6,27 @@ set -eu +# The default runner has a bunch of development tools and other things +# that we do not need. Remove them here to free up a total of 35GB. +# +# First remove packages - this frees up ~10GB +echo "Disk space before purge:" +df -h / +sudo docker image prune --all --force +sudo docker builder prune -a +unneeded="microsoft-edge-stable|azure-cli|google-cloud|google-chrome-stable|"\ +"temurin|llvm|firefox|mysql-server|snapd|android|dotnet|haskell|ghcup|"\ +"powershell|julia|swift|miniconda|chromium" +sudo apt-get -y remove $(dpkg-query -f '${binary:Package}\n' -W | grep -E "'$unneeded'") +sudo apt-get -y autoremove + +# Next, remove unneeded files in /usr. This frees up an additional 25GB. +sudo rm -fr /usr/local/lib/android /usr/share/dotnet /usr/local/.ghcup \ + /usr/share/swift /usr/local/share/powershell /usr/local/julia* \ + /usr/share/miniconda /usr/local/share/chromium +echo "Disk space after:" +df -h / + # The default 'azure.archive.ubuntu.com' mirrors can be really slow. # Prioritize the official Ubuntu mirrors. #