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

gha: add support for batch checking existing keys #4788

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

tonistiigi
Copy link
Member

In order to avoid getting rate limited when checking if previous cache already exists use the Github REST API that supports listing active keys.

This means additional GITHUB_TOKEN access is also
needed in addition to the RUNTIME_TOKEN needed for the cache API. The implementation is done with a fallback - if GITHUB_TOKEN is passed then it is used, if not then the old method checking individual cache records is still used.

Depends on tonistiigi/go-actions-cache#19

In order to avoid getting rate limited when checking
if previous cache already exists use the Github REST API
that supports listing active keys.

This means additional GITHUB_TOKEN access is also
needed in addition to the RUNTIME_TOKEN needed for the
cache API. The implementation is done with a fallback -
if GITHUB_TOKEN is passed then it is used, if not then
the old method checking individual cache records is still used.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Note for myself to have a follow-up in https://github.com/docker/actions-toolkit to set new attributes automatically when gha cache is used.

Comment on lines +130 to +132
func (ce *exporter) blobKeyPrefix() string {
return "buildkit-blob-" + version + "-"
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: could just be a const

@crazy-max crazy-max added this to the v0.14.0 milestone Mar 25, 2024
@tonistiigi tonistiigi merged commit cf45790 into moby:master Mar 26, 2024
72 checks passed
Comment on lines +40 to +41
attrRepository = "repository"
attrGHToken = "ghtoken"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants