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 region support #2153

Merged
merged 8 commits into from
Jul 27, 2017
Merged

S3 region support #2153

merged 8 commits into from
Jul 27, 2017

Conversation

zachmullen
Copy link
Member

Depends on #2132 , only the last commit here is for this topic.

@zachmullen
Copy link
Member Author

I've verified this by creating a bucket in us-west-1. Prior to this change, it was not possible to upload into that bucket via Girder, and after the change, it worked.

@zachmullen
Copy link
Member Author

This is now ready for review.

@@ -62,10 +62,13 @@
span.g-access-key-id #{assetstore.get('accessKeyId')}
div
b Secret access key:
span.g-secret-key #{assetstore.get('secret')}
span.g-secret-key #{assetstore.get('secret') && '[hidden]'}
Copy link
Member Author

Choose a reason for hiding this comment

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

This line is an unrelated change -- I just figured the secret key should be redacted from the list display page.

Copy link
Member

@danlamanna danlamanna left a comment

Choose a reason for hiding this comment

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

If the user doesn't type in the region correctly (or at all and they're using a bucket not in us-east-1), creating the assetstore throws no errors and it's not until upload that the user gets an No 'Access-Control-Allow-Origin' header is present on the requested resource in their console.

Additionally, I'm wondering if we should change the region field to be an option field instead of a text field, using the return value of boto.s3.regions.

input.input-sm.form-control#g-new-s3-service(type="text", placeholder="default: s3.amazonaws.com")
.form-group
label.control-label(for="g-new-s3-region") Region
input.input-sm.form-control#g-new-s3-region(type="text", placeholder="default: us-east-1")
Copy link
Member

Choose a reason for hiding this comment

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

adding "default: " to the start of each placeholder is inconsistent with the rest of the form (and most of Girder).

@@ -92,11 +92,13 @@ def find(self, limit, offset, sort, params):
'Do not include the bucket name here.', required=False, default='')
.param('readOnly', 'If this assetstore is read-only, set this to true.',
required=False, dataType='boolean', default=False)
.param('region', 'The AWS region to which the S3 bucket belongs, if not in "us-east-1".',
Copy link
Member

Choose a reason for hiding this comment

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

should default be used here?

:returns: boto connection parameter dictionary.
"""
region = region or 'us-east-1'
Copy link
Member

Choose a reason for hiding this comment

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

depending on how often we start using this string, we might just want to make it a constant (DEFAULT_S3_REGION) or something.

@zachmullen
Copy link
Member Author

I've addressed your inline feedback.

f the user doesn't type in the region correctly (or at all and they're using a bucket not in us-east-1), creating the assetstore throws no errors and it's not until upload that the user gets an No 'Access-Control-Allow-Origin' header is present on the requested resource in their console.

Unless I'm misunderstanding, this is a problem in general, and doesn't have to do with what region is selected. I'd defer addressing this issue to a future PR if so.

Additionally, I'm wondering if we should change the region field to be an option field instead of a text field, using the return value of boto.s3.regions.

Good idea, but I'd also want to defer that to a future PR.

@zachmullen
Copy link
Member Author

To clarify my first point, I think addressing #2186 as a whole would also address any region-related configuration problems.

Copy link
Member

@danlamanna danlamanna left a comment

Choose a reason for hiding this comment

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

ooc, why do you think removing default : in front of placeholders is a bad idea? To me it just seems redundant.

@zachmullen
Copy link
Member Author

Oh, I don't care much about whether the word "default" appears or not, but I would definitely be in favor of a global change where the placeholders actually contain the default value rather than just repeating the field name.

@zachmullen zachmullen merged commit 8ea4f7b into master Jul 27, 2017
@zachmullen zachmullen deleted the s3-region-support branch July 27, 2017 22:34
@danlamanna
Copy link
Member

danlamanna commented Jul 27, 2017 via email

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.

2 participants