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

s3 cache client-side support #1294

Merged
merged 1 commit into from
Sep 8, 2022
Merged

s3 cache client-side support #1294

merged 1 commit into from
Sep 8, 2022

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Aug 25, 2022

follow-up moby/buildkit#2824
fixes docker/build-push-action#647

s3 cache client-side support.

cc @bpaquet

Signed-off-by: CrazyMax [email protected]

@crazy-max crazy-max requested a review from tonistiigi August 25, 2022 19:24
ci.Attrs["secret_access_key"] = v
}
}
if _, ok := ci.Attrs["session_token"]; !ok {
Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -202,15 +206,17 @@ More info about cache exporters and available attributes: https://github.com/mob
```

Export build cache to an external cache destination. Supported types are
`registry`, `local`, `inline` and `gha`.
`registry`, `local`, `inline`, `gha` and `s3`.
Copy link
Collaborator

@jedevc jedevc Aug 26, 2022

Choose a reason for hiding this comment

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

🎉 Good to have some more docs! I think we probably want to update the README.md as well alongside this? It doesn't seem to have a bullet point under https://github.com/moby/buildkit#export-cache.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah yes looks like it's missing

if ci.Type != "s3" {
return
}
if _, ok := ci.Attrs["access_key_id"]; !ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be done automatically by the AWS SDK. Are you sure we really need to do this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean we the SDK should be able to configure itself without any manual mapping, For example it's working with AWS IAM Profile. We should look on how to do the same with these env variables.

Copy link
Member Author

Choose a reason for hiding this comment

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

Only BuildKit daemon vendor and uses the AWS SDK. The CLI (buildx) does not atm so we rely on aws credentials env vars when available and pass them through as attributes to the daemon. Maybe in a follow-up we could move and expose credentials config retrieval in BuildKit and use it in buildx so we are aligned. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Spent some time to think about it.
Your solution will work only for simple authent (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). The SDK offers plenty of solutions to authent (example by using AWS_PROFILE), but I do not think there is a simple way to authenticate inside the client and forward creds to the server. Or it do not worth it. So dealing only with simple authent is fine for me, if it's clear in the doc.

@crazy-max crazy-max force-pushed the s3-cache branch 3 times, most recently from 056a6bb to f381a1a Compare August 30, 2022 14:52
@crazy-max
Copy link
Member Author

Using the sdk just to load default config brings a lot 😟

image

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.

using s3 cache with the action
4 participants