From 35845fac6e52b7af510dc57f15d2a50070ee1490 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Tue, 21 May 2024 08:43:59 -0700 Subject: [PATCH] Add justification about per-day gvisor-buildkite-bazel-cache. PiperOrigin-RevId: 635819579 --- .buildkite/hooks/pre-command | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.buildkite/hooks/pre-command b/.buildkite/hooks/pre-command index 79581106d..392f4504b 100644 --- a/.buildkite/hooks/pre-command +++ b/.buildkite/hooks/pre-command @@ -1,6 +1,9 @@ set -euo pipefail -# Use a per-day bazel remote cache. +# Use a per-day bazel remote cache. As the cache object's TTL expires, they are +# deleted on an ongoing basis. Such partial deletion can break the cache state. +# Using per day cache will ensure that builds triggered on a certain day have +# the full bazel remote cache to use. TTL of the cache must be >1 day. export BAZEL_REMOTE_CACHE="--remote_cache=https://storage.googleapis.com/gvisor-buildkite-bazel-cache/$(date +%Y-%m-%d) --google_default_credentials" if POSIXLY_CORRECT=true df --local --output=pcent,ipcent,target | grep -vE '/snap/' | grep -qE '9[4-9]%|100%'; then