From 8ec8ce280bdc33155a87d673dda0f64e4ce81a35 Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 27 Jun 2023 11:34:34 -0400 Subject: [PATCH 1/5] Free up space on github actions runners for all jobs. --- .github/workflows/gatk-tests.yml | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gatk-tests.yml b/.github/workflows/gatk-tests.yml index 58d074abacc..a0d7a68d8b4 100644 --- a/.github/workflows/gatk-tests.yml +++ b/.github/workflows/gatk-tests.yml @@ -39,6 +39,12 @@ jobs: name: build and push gatk docker to artifacts runs-on: ubuntu-latest steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - name: checkout gatk uses: actions/checkout@v3 @@ -84,6 +90,12 @@ jobs: SCALA_VERSION: ${{ matrix.scalaVersion }} name: Java ${{ matrix.Java }} build and test ${{ matrix.testType }} steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -157,6 +169,12 @@ jobs: name: Java ${{ matrix.Java }} test on docker ${{matrix.testType}} steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: fetch-depth: 0 #TODO make this shallow @@ -247,6 +265,12 @@ jobs: runs-on: ubuntu-latest name: Validate script WDLs using womtools steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -267,6 +291,12 @@ jobs: runs-on: ubuntu-latest name: Validate generated WDLs using womtools steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -293,7 +323,7 @@ jobs: name: WDL test ${{ matrix.wdlTest }} on cromwell steps: #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image + #https://github.com/actions/runner-images/issues/2840 - name: Reclaim some runner disk space run: | sudo rm -rf /usr/share/dotnet From 99ea4becb5dbd93804dd9c56abc7539ac89e3c74 Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 27 Jun 2023 14:55:59 -0400 Subject: [PATCH 2/5] Add purge-runner-disk as a github action. --- .github/actions/purge-runner-disk/action.yml | 11 +++++ .github/workflows/gatk-tests.yml | 42 +++----------------- 2 files changed, 17 insertions(+), 36 deletions(-) create mode 100644 .github/actions/purge-runner-disk/action.yml diff --git a/.github/actions/purge-runner-disk/action.yml b/.github/actions/purge-runner-disk/action.yml new file mode 100644 index 00000000000..f003f42a62d --- /dev/null +++ b/.github/actions/purge-runner-disk/action.yml @@ -0,0 +1,11 @@ +name: 'purge-runner-disk' +description: 'Free up space on the runner image to prevent out-of-space errors during CI tests' +runs: + using: "composite" + steps: + #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. + #https://github.com/actions/runner-images/issues/2840 + - name: Reclaim some runner disk space + run: | + sudo rm -rf /usr/share/dotnet + sudo rm -rf "$AGENT_TOOLSDIRECTORY" diff --git a/.github/workflows/gatk-tests.yml b/.github/workflows/gatk-tests.yml index a0d7a68d8b4..0475f6f2836 100644 --- a/.github/workflows/gatk-tests.yml +++ b/.github/workflows/gatk-tests.yml @@ -39,12 +39,7 @@ jobs: name: build and push gatk docker to artifacts runs-on: ubuntu-latest steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/install-cromwell - name: checkout gatk uses: actions/checkout@v3 @@ -90,12 +85,7 @@ jobs: SCALA_VERSION: ${{ matrix.scalaVersion }} name: Java ${{ matrix.Java }} build and test ${{ matrix.testType }} steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -169,12 +159,7 @@ jobs: name: Java ${{ matrix.Java }} test on docker ${{matrix.testType}} steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 #TODO make this shallow @@ -265,12 +250,7 @@ jobs: runs-on: ubuntu-latest name: Validate script WDLs using womtools steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -291,12 +271,7 @@ jobs: runs-on: ubuntu-latest name: Validate generated WDLs using womtools steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 @@ -322,12 +297,7 @@ jobs: continue-on-error: true name: WDL test ${{ matrix.wdlTest }} on cromwell steps: - #Reclaim some disk space on the runner to prevent the WDL tasks from running out of space on the docker. - #https://github.com/actions/runner-images/issues/2840 - - name: Reclaim some runner disk space - run: | - sudo rm -rf /usr/share/dotnet - sudo rm -rf "$AGENT_TOOLSDIRECTORY" + - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 From 14a6babe5304012331af0770e74907254ebe23b0 Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 27 Jun 2023 15:07:51 -0400 Subject: [PATCH 3/5] Order matters. --- .github/workflows/gatk-tests.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/gatk-tests.yml b/.github/workflows/gatk-tests.yml index 0475f6f2836..252c481645e 100644 --- a/.github/workflows/gatk-tests.yml +++ b/.github/workflows/gatk-tests.yml @@ -85,10 +85,10 @@ jobs: SCALA_VERSION: ${{ matrix.scalaVersion }} name: Java ${{ matrix.Java }} build and test ${{ matrix.testType }} steps: - - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: ./.github/actions/purge-runner-disk - name: 'Set up java ${{ matrix.Java }}' uses: actions/setup-java@v3 with: @@ -159,11 +159,12 @@ jobs: name: Java ${{ matrix.Java }} test on docker ${{matrix.testType}} steps: - - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 #TODO make this shallow + - uses: ./.github/actions/purge-runner-disk + - name: 'Set up java ${{ matrix.Java }}' uses: actions/setup-java@v3 with: @@ -250,10 +251,10 @@ jobs: runs-on: ubuntu-latest name: Validate script WDLs using womtools steps: - - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: ./.github/actions/purge-runner-disk - name: Set up java 17 uses: actions/setup-java@v3 with: @@ -271,10 +272,10 @@ jobs: runs-on: ubuntu-latest name: Validate generated WDLs using womtools steps: - - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: ./.github/actions/purge-runner-disk - name: Set up java 17 uses: actions/setup-java@v3 with: @@ -297,10 +298,10 @@ jobs: continue-on-error: true name: WDL test ${{ matrix.wdlTest }} on cromwell steps: - - uses: ./.github/actions/purge-runner-disk - uses: actions/checkout@v3 with: fetch-depth: 0 + - uses: ./.github/actions/purge-runner-disk - name: pull lfs files run: git lfs pull - name: Set up java 17 From 6a24cf0cbbe501327a5c7e8b924fa62919a291eb Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 27 Jun 2023 15:11:24 -0400 Subject: [PATCH 4/5] Specify a shell. --- .github/actions/purge-runner-disk/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/purge-runner-disk/action.yml b/.github/actions/purge-runner-disk/action.yml index f003f42a62d..d9bd987bbe9 100644 --- a/.github/actions/purge-runner-disk/action.yml +++ b/.github/actions/purge-runner-disk/action.yml @@ -9,3 +9,4 @@ runs: run: | sudo rm -rf /usr/share/dotnet sudo rm -rf "$AGENT_TOOLSDIRECTORY" + shell: bash From f43870abf1482463208c43fd2a9d6eb8c2d4e803 Mon Sep 17 00:00:00 2001 From: Chris Norman Date: Tue, 27 Jun 2023 15:17:26 -0400 Subject: [PATCH 5/5] Also use the correct order. --- .github/workflows/gatk-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gatk-tests.yml b/.github/workflows/gatk-tests.yml index 252c481645e..2f97d560b65 100644 --- a/.github/workflows/gatk-tests.yml +++ b/.github/workflows/gatk-tests.yml @@ -39,10 +39,11 @@ jobs: name: build and push gatk docker to artifacts runs-on: ubuntu-latest steps: - - uses: ./.github/actions/install-cromwell - name: checkout gatk uses: actions/checkout@v3 + - uses: ./.github/actions/purge-runner-disk + - name: Extract metadata (tags, labels) for Docker id: meta uses: docker/metadata-action@v4