From 3b71c9b38b4fc32f558326c71cc8b89fcc11dfb8 Mon Sep 17 00:00:00 2001 From: Jayant Shrivastava Date: Thu, 20 Nov 2025 16:33:58 -0500 Subject: [PATCH 1/2] free up disk space in CI runners This change copies a script from :wq --- .github/actions/setup/action.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 101ea138..bd26be47 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,6 +12,29 @@ inputs: runs: using: 'composite' steps: + - name: Free up disk space + shell: bash + run: | + # Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh + echo "==============================================================================" + echo "Freeing up disk space on CI system" + echo "==============================================================================" + echo "Listing 100 largest packages" + dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 + df -h + echo "Removing large packages" + sudo apt-get remove -y '^ghc-8.*' + sudo apt-get remove -y '^dotnet-.*' + sudo apt-get remove -y '^llvm-.*' + sudo apt-get remove -y 'php.*' + sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel + sudo apt-get autoremove -y + sudo apt-get clean + df -h + echo "Removing large directories" + # deleting 15GB + rm -rf /usr/share/dotnet/ + df -h - shell: bash run: | echo $HOME From 0a1ea57a506d776a0be0d9b0e15a1e4f5d0802b6 Mon Sep 17 00:00:00 2001 From: Jayant Shrivastava Date: Thu, 20 Nov 2025 16:38:23 -0500 Subject: [PATCH 2/2] free disk space on CI runners This change adds a script to significantly free up space on CI runners. Before: ``` === df -h === Filesystem Size Used Avail Use% Mounted on /dev/root 72G 66G 5.8G 93% / tmpfs 7.9G 84K 7.9G 1% /dev/shm tmpfs 3.2G 1.2M 3.2G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock /dev/sda16 881M 62M 758M 8% /boot /dev/sda15 105M 6.2M 99M 6% /boot/efi /dev/sdb1 74G 4.1G 66G 6% /mnt tmpfs 1.6G 12K 1.6G 1% /run/user/1001 ``` After: ``` `` --- .github/actions/setup/action.yml | 22 +--------------------- .github/actions/setup/free_disk_space.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 21 deletions(-) create mode 100755 .github/actions/setup/free_disk_space.sh diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index bd26be47..e7969434 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -14,27 +14,7 @@ runs: steps: - name: Free up disk space shell: bash - run: | - # Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh - echo "==============================================================================" - echo "Freeing up disk space on CI system" - echo "==============================================================================" - echo "Listing 100 largest packages" - dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 - df -h - echo "Removing large packages" - sudo apt-get remove -y '^ghc-8.*' - sudo apt-get remove -y '^dotnet-.*' - sudo apt-get remove -y '^llvm-.*' - sudo apt-get remove -y 'php.*' - sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel - sudo apt-get autoremove -y - sudo apt-get clean - df -h - echo "Removing large directories" - # deleting 15GB - rm -rf /usr/share/dotnet/ - df -h + run: ${{ github.action_path }}/free_disk_space.sh - shell: bash run: | echo $HOME diff --git a/.github/actions/setup/free_disk_space.sh b/.github/actions/setup/free_disk_space.sh new file mode 100755 index 00000000..15524194 --- /dev/null +++ b/.github/actions/setup/free_disk_space.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Script to free up disk space on CI systems +# Source: https://github.com/apache/flink/blob/02d30ace69dc18555a5085eccf70ee884e73a16e/tools/azure-pipelines/free_disk_space.sh + +echo "Freeing up disk space on CI system" + +echo "Listing 100 largest packages" +dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n | tail -n 100 +df -h + +echo "Removing large packages" +sudo apt-get remove -y '^ghc-8.*' +sudo apt-get remove -y '^dotnet-.*' +sudo apt-get remove -y '^llvm-.*' +sudo apt-get remove -y 'php.*' +sudo apt-get remove -y azure-cli google-cloud-sdk hhvm google-chrome-stable firefox powershell mono-devel +sudo apt-get autoremove -y +sudo apt-get clean +df -h + +echo "Removing large directories" +rm -rf /usr/share/dotnet/ +df -h \ No newline at end of file