-
Notifications
You must be signed in to change notification settings - Fork 195
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
fix: Added region and signature for S3 bucket #1928
fix: Added region and signature for S3 bucket #1928
Conversation
Thanks for the pull request, @farhaanbukhsh! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1928 +/- ##
=======================================
Coverage 94.98% 94.98%
=======================================
Files 154 154
Lines 17056 17058 +2
Branches 1611 1611
=======================================
+ Hits 16201 16203 +2
Misses 641 641
Partials 214 214
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
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.
👍
- I tested this: Tested upload file to S3 works in sandbox
- I read through the code
- I checked for accessibility issues
- Includes documentation
- I made sure any change in configuration variables is reflected in the corresponding client's
configuration-secure
repository.
Thanks @farhaanbukhsh and @kaustavb12! Looks like this PR is ready for engineering review. I changed its status on the contributions board accordingly. |
Hi @mattcarter, if you could help get this PR lined up for engineering review by the Aurora team, that would be great! |
@mattcarter Gentle ping on the PR. |
label: core contributor |
Hi @mattcarter, just checking in to see if you had a chance to line this PR up for engineering review by Aurora? |
@farhaanbukhsh, we may also want to bump the version in openassessment/__init__.py and package.json. |
Thank you for the review @Agrendalath will make the changes :) |
@farhaanbukhsh It looks like we'll be able to proceed with a CC review here soon (Slack ref). Could you please address @Agrendalath's comments in the coming days to get ready for that? |
2310f09
to
b4a0601
Compare
@itsjeyd @Agrendalath Thank you for the feedback, I have made the changes and pushed the commit, :) please have a look. |
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.
The changes look good to me 👍🏻
@pomegranited Following confirmation from the Aurora team (@mattcarter) that this PR could be merged after CC review I'm assigning this PR to you. For additional context, a decision was made recently on how to use the assignee field in the context of OSPR management going forward -- see 1b in this section on the Open edX wiki. Thanks for volunteering! 🙂 CC @mphilbrick211 @hurtstotouchfire @nedbat @farhaanbukhsh @Agrendalath |
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.
Thanks for this fix @farhaanbukhsh !
I left a few minor suggestions, but I've tested this in both scenarios below, and it works fine. So I'll approve when the nits are addressed.
- uploading to bucket in
us-east-1
with defaults left atNone
- uploading to bucket in
us-east-2
withsignature_version = "s3v4"
,region_name = "us-east-2"
openassessment/__init__.py
Outdated
@@ -1,4 +1,4 @@ | |||
""" | |||
Initialization Information for Open Assessment Module | |||
""" | |||
__version__ = '5.0.4' | |||
__version__ = '5.0.5' |
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.
nit: master
is currently at '5.1.0'
, so:
__version__ = '5.0.5' | |
__version__ = '5.1.1' |
b4a0601
to
9330bd3
Compare
For a region based bucket boto3 needs to know about region and signature which edx-ora2 doesn't know about. Signed-off-by: Farhaan Bukhsh <[email protected]>
9330bd3
to
0318118
Compare
@pomegranited I have updated the code with your suggestions. Thanks a lot for the review :) |
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.
👍 perfect, thank you @farhaanbukhsh !
Since I've got permission from Aurora to merge, I'll do that now, and tag a new release.
- I tested this on my devstack:
- left defaults at None, and tested file uploads to a bucket in
us-east-1
. - set signature_version = "s3v4", region_name = "us-east-2" and tested file uploads to a bucket in that region.
- left defaults at None, and tested file uploads to a bucket in
- I read through the code
-
I checked for accessibility issuesN/A -
Includes documentationN/A
@farhaanbukhsh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
For a region based bucket boto3 needs to know about region and signature which edx-ora2 doesn't know about. Signed-off-by: Farhaan Bukhsh <[email protected]>
For a region based bucket boto3 needs to know about region and signature which edx-ora2 doesn't know about.
TL;DR - Currently edx-ora2 doesn't pick up AWS region or aws signature version and because of that boto3 generates a faulty S3 URL. The boto3 documentation for s3 signature v4 also shows the boto3 client need to know the signature version.
JIRA: None
What changed?
When I was trying to upload the file in S3 bucket in the me-south-1 region, I kept on getting
The reason was boto3 client doesn't use S3_SIGNATURE=
s3v4
and region value here in edx-ora2 while the same config was working properly on discussions.Developer Checklist
Testing Instructions
Reviewer Checklist
Collectively, these should be completed by reviewers of this PR: