This is an automated email from the ASF dual-hosted git repository.

MartijnVisser pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/master by this push:
     new c46e3aef836 [FLINK-39884][ci] Free up additional disk space for CI runs
c46e3aef836 is described below

commit c46e3aef83672d51d00d1706dbf6d90dc66fe602
Author: Martijn Visser <[email protected]>
AuthorDate: Mon Jun 8 10:08:22 2026 +0200

    [FLINK-39884][ci] Free up additional disk space for CI runs
    
    The existing free_disk_space.sh frees ~28GB, but several large toolchains
    shipped with the Azure Ubuntu runner image are left in place. Remove the
    ones that are unused by a Flink Java/e2e build to give CI more headroom and
    reduce disk-pressure flakiness:
    
    - Hosted tool caches: CodeQL, go, node, Ruby and PyPy. The Python tool cache
      is intentionally kept, because the e2e job's UsePythonVersion task runs
      after this script and relies on it.
    - Other language/SDK directories: swift, miniconda, microsoft (Edge) and 
ghc.
    - Preloaded Docker base images, via "docker image prune". Flink restores its
      cached testcontainers images later in the pipeline, so this does not evict
      anything the build needs.
    
    Generated-by: Claude Code (Opus 4.8)
---
 tools/azure-pipelines/free_disk_space.sh | 36 ++++++++++++++++++++++++++++----
 1 file changed, 32 insertions(+), 4 deletions(-)

diff --git a/tools/azure-pipelines/free_disk_space.sh 
b/tools/azure-pipelines/free_disk_space.sh
index a4b64ebd3b6..0f01f8919fa 100755
--- a/tools/azure-pipelines/free_disk_space.sh
+++ b/tools/azure-pipelines/free_disk_space.sh
@@ -17,14 +17,19 @@
 
 #
 # The Azure provided machines typically have the following disk allocation:
-# Total space: 85GB
-# Allocated: 67 GB
-# Free: 17 GB
-# This script frees up 28 GB of disk space by deleting unneeded packages and 
+# Total space: 72GB
+# Allocated: 56 GB
+# Free: 16 GB
+# This script frees up roughly 34 GB of disk space (leaving ~50 GB free) by
+# deleting unneeded packages, language toolchains, preloaded Docker images and
 # large directories.
 # The Flink end to end tests download and generate more than 17 GB of files,
 # causing unpredictable behavior and build failures.
 #
+# Note: the Python hosted tool cache (/opt/hostedtoolcache/Python) and the JDKs
+# under /usr/lib/jvm are intentionally preserved, because downstream pipeline
+# steps rely on them (UsePythonVersion task and the JAVA_HOME_<jdk>_X64 vars).
+#
 echo 
"=============================================================================="
 echo "Freeing up disk space on CI system"
 echo 
"=============================================================================="
@@ -51,4 +56,27 @@ sudo rm -rf /usr/local/share/powershell
 sudo rm -rf /usr/local/share/chromium
 sudo rm -rf /usr/local/lib/android
 sudo rm -rf /usr/local/lib/node_modules
+
+# Remove large hosted tool caches that are unused by a Flink Java/e2e build.
+# Keep /opt/hostedtoolcache/Python: the e2e job's UsePythonVersion task runs
+# after this script and relies on the pre-provisioned Python tool cache.
+sudo rm -rf /opt/hostedtoolcache/CodeQL
+sudo rm -rf /opt/hostedtoolcache/go
+sudo rm -rf /opt/hostedtoolcache/node
+sudo rm -rf /opt/hostedtoolcache/Ruby
+sudo rm -rf /opt/hostedtoolcache/PyPy
+
+# Remove other large language/SDK directories not needed by the build.
+sudo rm -rf /usr/share/swift
+sudo rm -rf /usr/share/miniconda
+sudo rm -rf /opt/microsoft
+sudo rm -rf /opt/ghc
+df -h
+
+echo "Pruning preloaded Docker images"
+# Flink restores its cached testcontainers images later in the pipeline, so the
+# preloaded base images shipped with the runner image can be removed here.
+if command -v docker >/dev/null 2>&1; then
+  sudo docker image prune --all --force || true
+fi
 df -h

Reply via email to