From fdb54886fe0f30045d89691bca36286cbadaaff2 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Mon, 12 Sep 2022 07:14:23 +0300 Subject: [PATCH 1/4] [fix][CI] Don't run "Pulsar CI checks completed" too early - "if: always()" caused the job to run also when something failed --- .github/workflows/pulsar-ci.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index c9c57f549e27a..6c150029bed95 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -844,7 +844,6 @@ jobs: 'system-tests', 'macos-build' ] - if: always() steps: - name: checkout if: ${{ needs.changed_files_job.outputs.docs_only != 'true' }} From 13bf4af1b05546a31b427505e1e12a20583da6ef Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Mon, 12 Sep 2022 08:05:27 +0300 Subject: [PATCH 2/4] Clean up disk space in "Build Pulsar docker image" --- .github/workflows/pulsar-ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index 6c150029bed95..b9eddf31ec076 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -555,6 +555,15 @@ jobs: -Pmain,docker -Dmaven.test.skip=true -Ddocker.squash=true \ -Dspotbugs.skip=true -Dlicense.skip=true -Dcheckstyle.skip=true -Drat.skip=true + - name: Clean up disk space + run: | + # release disk space since saving docker image consumes local disk space + # + # clean build directories + git clean -fdx + # delete maven repository + rm -rf ~/.m2/repository + - name: save docker image apachepulsar/pulsar-test-latest-version:latest to Github artifact cache run: | $GITHUB_WORKSPACE/build/pulsar_ci_tool.sh docker_save_image_to_github_actions_artifacts apachepulsar/pulsar-test-latest-version:latest pulsar-test-latest-version-image From add4e218d3050667e0a2270534bdc34ef5ac1b6b Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Mon, 12 Sep 2022 08:15:51 +0300 Subject: [PATCH 3/4] Show disk space before and after cleaning --- .github/workflows/pulsar-ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index b9eddf31ec076..4315b2e99500b 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -559,10 +559,18 @@ jobs: run: | # release disk space since saving docker image consumes local disk space # + echo "::group::Available diskspace before cleaning" + time df -BM / /mnt + echo "::endgroup::" + echo "::group::Delete files" # clean build directories git clean -fdx # delete maven repository rm -rf ~/.m2/repository + echo "::endgroup::" + echo "::group::Available diskspace after cleaning" + time df -BM / /mnt + echo "::endgroup::" - name: save docker image apachepulsar/pulsar-test-latest-version:latest to Github artifact cache run: | From 28aa9ff8f787fa27fad40975c1fcece8add1a827 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Mon, 12 Sep 2022 09:14:31 +0300 Subject: [PATCH 4/4] Fix deleting files --- .github/workflows/pulsar-ci.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pulsar-ci.yaml b/.github/workflows/pulsar-ci.yaml index 4315b2e99500b..3f60f6f381537 100644 --- a/.github/workflows/pulsar-ci.yaml +++ b/.github/workflows/pulsar-ci.yaml @@ -562,13 +562,20 @@ jobs: echo "::group::Available diskspace before cleaning" time df -BM / /mnt echo "::endgroup::" - echo "::group::Delete files" + echo "::group::Clean build directory" + # docker build changes some files to root ownership, fix this before deleting files + sudo chown -R $USER:$GROUP . # clean build directories - git clean -fdx + time git clean -fdx + echo "::endgroup::" + echo "::group::Available diskspace after cleaning build directory" + time df -BM / /mnt + echo "::endgroup::" + echo "::group::Delete maven repository" # delete maven repository - rm -rf ~/.m2/repository + time rm -rf ~/.m2/repository echo "::endgroup::" - echo "::group::Available diskspace after cleaning" + echo "::group::Available diskspace after cleaning maven repository" time df -BM / /mnt echo "::endgroup::"