From 1691e9c75c185859978b2b2ee498883fdc62803c Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Tue, 17 Oct 2023 11:01:00 -0400 Subject: [PATCH] Reduce disk usage on bootstrap cache miss (#29799) --- .../actions/checkout-submodules-and-bootstrap/action.yaml | 8 ++++++++ .restyled.yaml | 2 +- scripts/setup/environment.json | 2 +- pigweed.json => scripts/setup/pigweed.json | 0 4 files changed, 10 insertions(+), 2 deletions(-) rename pigweed.json => scripts/setup/pigweed.json (100%) diff --git a/.github/actions/checkout-submodules-and-bootstrap/action.yaml b/.github/actions/checkout-submodules-and-bootstrap/action.yaml index 160e4fac5a5562..f7db541c9f2140 100644 --- a/.github/actions/checkout-submodules-and-bootstrap/action.yaml +++ b/.github/actions/checkout-submodules-and-bootstrap/action.yaml @@ -28,6 +28,14 @@ runs: uses: ./.github/actions/bootstrap with: platform: ${{ inputs.platform }} + - name: Remove CIPD cache directory + # If there is a bootstrap-cache miss, and bootstrap installs CIPD itself, + # there is roughly 1.4GB that remains in this cache that is useless from + # this point onwards. + shell: bash + run: | + du -sh $HOME/.cipd-cache-dir/ || true + rm -rf $HOME/.cipd-cache-dir/ || echo "Removing cipd cache dir failed" - name: Dump disk info after checkout submodule & Bootstrap shell: bash run: scripts/dump_diskspace_info.sh diff --git a/.restyled.yaml b/.restyled.yaml index 66e9f6028345f7..06180a098228e9 100644 --- a/.restyled.yaml +++ b/.restyled.yaml @@ -82,7 +82,7 @@ exclude: - "src/controller/java/zap-generated/**/*" # not formatted: generated files - "scripts/setup/bootstrap.sh" # tries to quote loop variable - "integrations/docker/build-all.sh" # tries to quote loop variable - - "pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff. + - "scripts/setup/pigweed.json" # TODO(#29547). This file is temporary copy from pigweed repo that has minor edits. No restyle help in diff. changed_paths: maximum: 100000 diff --git a/scripts/setup/environment.json b/scripts/setup/environment.json index 833ffe4fa8d922..23b4bb20a019f8 100644 --- a/scripts/setup/environment.json +++ b/scripts/setup/environment.json @@ -1,7 +1,7 @@ { "cipd_package_files": [ "third_party/pigweed/repo/pw_env_setup/py/pw_env_setup/cipd_setup/arm.json", - "pigweed.json", + "scripts/setup/pigweed.json", "scripts/setup/python.json", "scripts/setup/zap.json" ], diff --git a/pigweed.json b/scripts/setup/pigweed.json similarity index 100% rename from pigweed.json rename to scripts/setup/pigweed.json