Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bazel cache trimming for rules_oci blobs. #1371

Merged
merged 1 commit into from
Dec 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ jobs:
with:
cache-version: 1

# This is a hack to utilize the undocumented relatively large empty
# scratch disk mounted at /mnt. It's currently needed to work around
# bazel-contrib/rules_oci#439 as that's what is pushing our usage over the
# limit. The alternative is to use a runner with more disk space.
- name: Mount scratch disk
env:
BAZEL_CACHE_PATH: ${{ steps.get-cache-params.outputs.cache-path }}
Expand Down Expand Up @@ -160,12 +164,15 @@ jobs:
name: cluster-logs
path: ${{ env.CLUSTER_LOGS_PATH }}

# Delete large files that are cheap to re-create.
# Delete large files that are relatively cheap to re-create.
- name: Trim Bazel cache
if: github.event_name == 'push'
run: |
bazel_out="$(bazelisk info output_path)"
find "${bazel_out}" -type f \( -iname '*.tar' -o -iname '*.tar.gz' \) -delete
find "${bazel_out}" -type d -name blobs -exec chmod -R +w "{}" \;
find "${bazel_out}" -type f -path '*/blobs/*' -delete


- name: Save Bazel cache
if: github.event_name == 'push'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/push-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
steps:
- uses: actions/checkout@v3

- uses: ./.github/actions/free-disk-space

- id: get-image-tag
name: Get image tag
run: |
Expand Down