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

cmd-buildupload: Add flag for s3 server selection #2678

Merged
merged 1 commit into from
Feb 1, 2022

Conversation

wranders
Copy link
Contributor

Added --endpoint-url as an s3 sub-command flag under the buildupload command.

$ cosa buildupload --artifact=ostree s3 --endpointurl=http://s3host.internal builds/

This allows buildupload to use non-AWS storage servers like Minio. Useful for local development or environments where AWS S3 doesn't fit.

Tested with local external Minio server and credentials loaded automatically by boto3 client.

@openshift-ci
Copy link

openshift-ci bot commented Jan 31, 2022

Hi @wranders. Thanks for your PR.

I'm waiting for a coreos member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@dustymabe
Copy link
Member

It's a bit ridiculous to me that boto/boto3#2746 hasn't merged yet.

@dustymabe
Copy link
Member

/ok-to-test

dustymabe
dustymabe previously approved these changes Jan 31, 2022
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM, but also tagging in @jlebon for a lookover.

It seems like in a future iteration of this we could just create the boto client (s3 = boto3.client()..) at a higher level and pass down that object rather than all of the options.

@wranders
Copy link
Contributor Author

It's a bit ridiculous to me that boto/boto3#2746 hasn't merged yet.

My thoughts exactly. But after all this time, this seems to be the route AWS wants to go.

It seems like in a future iteration of this we could just create the boto client (s3 = boto3.client()..) at a higher level and pass down that object rather than all of the options.

I could get on that if you'd like.

@dustymabe
Copy link
Member

It's a bit ridiculous to me that boto/boto3#2746 hasn't merged yet.

My thoughts exactly. But after all this time, this seems to be the route AWS wants to go.

☹️

It seems like in a future iteration of this we could just create the boto client (s3 = boto3.client()..) at a higher level and pass down that object rather than all of the options.

I could get on that if you'd like.

Let's see what @jlebon's opinion is before you do any work. Thanks for offering.

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Thanks for the patch! Some minor comments but makes sense to me overall. Also good with the client rework mentioned above, though maybe let's do that in a separate PR instead?

Could you squash your indentation fix commits into the first commit?

For the commit title, s/Added/add/. And can you add what you wrote in the first PR comment as part of the commit body?

src/cmd-buildupload Outdated Show resolved Hide resolved
src/cmd-buildupload Outdated Show resolved Hide resolved
src/cmd-buildupload Outdated Show resolved Hide resolved
@wranders wranders changed the title cmd-buildupload: Added flag for s3 server selection cmd-buildupload: Add flag for s3 server selection Jan 31, 2022
@wranders wranders force-pushed the buildupload-endpoint-url branch 3 times, most recently from 518ba2e to 2442ff5 Compare January 31, 2022 17:12
@wranders
Copy link
Contributor Author

Changes made and squashed. Should be good to go now.

dustymabe
dustymabe previously approved these changes Jan 31, 2022
Copy link
Member

@dustymabe dustymabe left a comment

Choose a reason for hiding this comment

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

LGTM

jlebon
jlebon previously approved these changes Jan 31, 2022
Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Looks like the commit title lost the cmd-buildupload: prefix. Maybe cmd-buildupload: add --endpoint-url S3 flag ?

Otherwise, LGTM!

Added `--endpoint-url` as an `s3` sub-command flag under the
`buildupload` command.

This allows `buildupload` to use non-AWS storage servers like Minio.
Useful for local development or environments where AWS S3 doesn't fit.
@wranders wranders dismissed stale reviews from jlebon and dustymabe via fbc6f4c January 31, 2022 17:23
@wranders wranders force-pushed the buildupload-endpoint-url branch from 2442ff5 to fbc6f4c Compare January 31, 2022 17:23
@wranders
Copy link
Contributor Author

Looks like the commit title lost the cmd-buildupload: prefix. Maybe cmd-buildupload: add --endpoint-url S3 flag ?

🤦‍♂️ Let's try this again... lol

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Thanks!

@jlebon jlebon enabled auto-merge (rebase) January 31, 2022 17:25
@jlebon jlebon merged commit 7fd4fc6 into coreos:main Feb 1, 2022
@wranders wranders deleted the buildupload-endpoint-url branch February 2, 2022 01:31
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.

3 participants