-
Notifications
You must be signed in to change notification settings - Fork 205
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
Clean broken entries from the Bazel cache #8668
Conversation
@garyverhaegen-da do we have delete permissions on the gcp token? if not, we probably need a new token for this. |
This is hopefully a somewhat reasonable workaround for the "output not created" errors that keep annoying us. For now, this is just part of the hourly cronjob but we could move it somewhere else if desired. changelog_begin changelog_end
01076f6
to
c62758c
Compare
Obligatory note that while I tested this locally, I couldn’t test deletions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thanks for digging into this!
Yes, CI has full access to the bazel cache, because I was apparently not able to remove its delete permission. |
azure-cron.yml
Outdated
./bazel-bin/ci/cron/cron bazel-cache --age 90 --delete | ||
env: | ||
AWS_ACCESS_KEY_ID: $(AWS_ACCESS_KEY_ID) | ||
AWS_SECRET_ACCESS_KEY: $(AWS_SECRET_ACCESS_KEY) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are not the keys you're looking for.
You want:
env:
GCRED: $(GOOGLE_APPLICATION_CREDENTIALS_CONTENT)
and you also need to replicate the logic from bash-lib, either in the Bash script here or in your Haskell code. (Or call Bash from Haskell, but some people find that messy.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duh, I clearly should have taken a look at the credentials instead of blindly copying the docs cron. Thanks for catching it!
azure-cron.yml
Outdated
# 90 minutes should provide enough overlap for an hourly | ||
# cronjob. | ||
./bazel-bin/ci/cron/cron bazel-cache --age 90 --delete | ||
gcs ./bazel-bin/ci/cron/cron bazel-cache --age 90 --delete |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As it stands this would end up running gsutil ./bazel-bin/ci/cron bazel-cache --age 90 --delete
, but I like the idea. Perhaps it's worth changing bash-lib
so that gcs
really is the with-gcs-credentials
type of wrapper you're going for here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I just realized that, I copied the logic for now instead of calling gcs. Do you want to align them in this PR or separately?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separately is fine, I've made a note of it. I don't want to delay this.
changelog_begin changelog_end
cf6bd51
to
c2c6c49
Compare
This is hopefully a somewhat reasonable workaround for the "output not
created" errors that keep annoying us.
For now, this is just part of the hourly cronjob but we could move it
somewhere else if desired.
changelog_begin
changelog_end
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.