From a30b9d46408672ef3b6353079b24d6fe5d17617c Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 11 Aug 2023 10:43:20 +0000 Subject: [PATCH 1/7] Free up additional disk space on GitHub runner Our releasebundle-ubuntu action occasionally failed for it ran out of disk space. (See https://github.com/model-checking/kani/actions/runs/5765091278/job/15630375703 for one such example. This additional build step cleans out binaries that we do not need, such as Haskell, .NET, or Android SDKs. This frees up 28 GB of memory (out of a total of 84 GB). --- .github/workflows/kani.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/kani.yml b/.github/workflows/kani.yml index beaebcc32842..688836d1c837 100644 --- a/.github/workflows/kani.yml +++ b/.github/workflows/kani.yml @@ -192,6 +192,12 @@ jobs: container: image: ubuntu:18.04 steps: + - name: Remove unnecessary software to free up disk space + run: | + # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml + df -h + sudo rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* + df -h # This is required before checkout because the container does not # have Git installed, so cannot run checkout action. The checkout # action requires Git >=2.18, so use the Git maintainers' PPA. From 7a40639faef9f0bfcdac26d156d1e3b57af9fe4b Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 11 Aug 2023 10:47:34 +0000 Subject: [PATCH 2/7] No sudo here --- .github/workflows/kani.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kani.yml b/.github/workflows/kani.yml index 688836d1c837..6d0a86cac1d2 100644 --- a/.github/workflows/kani.yml +++ b/.github/workflows/kani.yml @@ -196,7 +196,7 @@ jobs: run: | # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml df -h - sudo rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* + rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* df -h # This is required before checkout because the container does not # have Git installed, so cannot run checkout action. The checkout From 28c042f5cd0a3673f0e14705303efdb950f71577 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 18 Aug 2023 17:37:01 +0000 Subject: [PATCH 3/7] Move cleanup to common setup --- .github/actions/setup/action.yml | 7 +++++++ .github/workflows/kani.yml | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 940a8436da05..320a6ae028e3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -12,6 +12,13 @@ inputs: runs: using: composite steps: + - name: Remove unnecessary software to free up disk space + run: | + # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml + df -h + rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* + df -h + - name: Install dependencies run: cd ${{ inputs.kani_dir }} && ./scripts/setup/${{ inputs.os }}/install_deps.sh shell: bash diff --git a/.github/workflows/kani.yml b/.github/workflows/kani.yml index 6d0a86cac1d2..beaebcc32842 100644 --- a/.github/workflows/kani.yml +++ b/.github/workflows/kani.yml @@ -192,12 +192,6 @@ jobs: container: image: ubuntu:18.04 steps: - - name: Remove unnecessary software to free up disk space - run: | - # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml - df -h - rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* - df -h # This is required before checkout because the container does not # have Git installed, so cannot run checkout action. The checkout # action requires Git >=2.18, so use the Git maintainers' PPA. From 4ea8d587301865af3b82b89c90d97b1b4c1cc469 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 18 Aug 2023 17:39:23 +0000 Subject: [PATCH 4/7] Fix missing shell --- .github/actions/setup/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 320a6ae028e3..203359a5e491 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -13,6 +13,7 @@ runs: using: composite steps: - name: Remove unnecessary software to free up disk space + shell: bash run: | # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml df -h From f284945fa6e20943cd9b9ef229cc1dcd3138548b Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 18 Aug 2023 17:43:15 +0000 Subject: [PATCH 5/7] Re-add sudo --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 203359a5e491..fd72c3abf518 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,7 +17,7 @@ runs: run: | # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml df -h - rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* + sudo rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* df -h - name: Install dependencies From b4f3a202824e9dcfa9307f2678f3067e159da1db Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 18 Aug 2023 18:27:24 +0000 Subject: [PATCH 6/7] Restrict removal to dotnet, android, ghc --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index fd72c3abf518..c7e36269acd8 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,7 +17,7 @@ runs: run: | # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml df -h - sudo rm -rf /usr/share/dotnet /usr/local/lib/* /opt/* + sudo rm -rf /usr/share/dotnet /usr/local/lib/android and /opt/ghc df -h - name: Install dependencies From 0cb2b536ba5826726fc8fdfe2112aac41e61b0e9 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 18 Aug 2023 19:18:04 +0000 Subject: [PATCH 7/7] Remove spurious and --- .github/actions/setup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index c7e36269acd8..c727a63aa8a3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -17,7 +17,7 @@ runs: run: | # inspired by https://github.com/easimon/maximize-build-space/blob/master/action.yml df -h - sudo rm -rf /usr/share/dotnet /usr/local/lib/android and /opt/ghc + sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc df -h - name: Install dependencies