From 6ae4264f678a908b46b02db8dde213fd826094a0 Mon Sep 17 00:00:00 2001 From: "David J. Gardner" Date: Fri, 24 Jan 2025 15:33:31 -0800 Subject: [PATCH] add action to free up disk space for cuda test --- .github/actions/free-space-ubuntu/action.yml | 47 ++++++++++++++++++++ .github/workflows/cuda-ci.yml | 2 + 2 files changed, 49 insertions(+) create mode 100644 .github/actions/free-space-ubuntu/action.yml diff --git a/.github/actions/free-space-ubuntu/action.yml b/.github/actions/free-space-ubuntu/action.yml new file mode 100644 index 000000000..3f9196743 --- /dev/null +++ b/.github/actions/free-space-ubuntu/action.yml @@ -0,0 +1,47 @@ +name: Free space on Ubuntu VMs +description: Frees disk space on GitHub Actions Ubuntu VMs + +runs: + using: composite + steps: + - id: show-space-initial + run: df -h + shell: bash + - id: list-largest-packages + run: | + dpkg-query -W --showformat='${Package} ${Installed-Size}\n' | sort -k2 -n -r | awk 'NR <= 20' + shell: bash + - id: uninstall-packages + run: | + sudo apt-get purge -y azure-cli --fix-missing + sudo apt-get purge -y microsoft-edge-stable --fix-missing + sudo apt-get purge -y google-cloud-sdk --fix-missing + sudo apt-get purge -y google-cloud-cli --fix-missing + sudo apt-get purge -y '^dotnet-sdk-.*' --fix-missing + sudo apt-get purge -y google-chrome-stable --fix-missing + sudo apt-get purge -y '^temurin-.*' --fix-missing + sudo apt-get purge -y hhvm --fix-missing + sudo apt-get purge -y '^mongodb-.*' --fix-missing + sudo apt-get purge -y 'llvm-.*' --fix-missing + sudo apt-get purge -y esl-erlang --fix-missing + sudo apt-get purge -y '^mysql-.*' --fix-missing + sudo apt-get purge -y powershell --fix-missing + sudo apt-get autoremove -y + sudo apt-get update + sudo apt-get clean + sudo docker image prune --all --force || true + shell: bash + - id: list-largest-packages-remaining + run: | + dpkg-query -W --showformat='${Package} ${Installed-Size}\n' | sort -k2 -n -r | awk 'NR <= 20' + shell: bash + - id: remove-directories + run: | + sudo rm -rf /opt/ghc + sudo rm -rf /usr/local/.ghcup + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + shell: bash + - id: show-space-final + run: df -h + shell: bash diff --git a/.github/workflows/cuda-ci.yml b/.github/workflows/cuda-ci.yml index 567e51186..149a01eb8 100644 --- a/.github/workflows/cuda-ci.yml +++ b/.github/workflows/cuda-ci.yml @@ -33,6 +33,8 @@ jobs: - uses: actions/checkout@v4 with: submodules: true + - name: Free up disk space + uses: ./.github/actions/free-space-ubuntu - name: Prepare CUDA environment run: Submodules/AMReX/.github/workflows/dependencies/dependencies_nvcc.sh ${{matrix.cuda_ver}} - name: Install CCache