edx-ora2
edx-ora2 copied to clipboard
feat: add Google Cloud Storage support (GCS)
TL;DR - This is to add support to GCS files backend by adding a new option (gcs
) to ORA2_FILEUPLOAD_BACKEND
JIRA: ---
What changed?
-
ORA2_FILEUPLOAD_BACKEND
environment variable accepts a new valuegcs
in addition to the existing options (s3
,filesystem
,swift
, anddjango
) - No changes to the requirements. It is assumed that you already installed
django-storages[google]
instead of the defaultdjango-storages
which will includegoogle-cloud-storages
Important to know!
Using GSC with ORA means that edx-platform
is already configured to use GCS instead of S3
- It is assumed that you already installed
django-storages[google]
instead of the defaultdjango-storages
which will includegoogle-cloud-storages
- It is assumed that
DEFAULT_FILE_STORAGE
is set tostorages.backends.gcloud.GoogleCloudStorage
in edx-platform. Other configurations might be needed too - It is assumed that
edx-platform
functions directly and seamlessly with GCS without a proxy like MinIO or boto3
Developer Checklist
- [x] Reviewed the release process
- [x] Translations and JS/SASS compiled~~ not needed
- [ ] Bumped version number in openassessment/__init__.py and package.json
Testing Instructions
Using tutor development:
- Prepare your GSC storage, make sure to have a dedicated bucket for file upload
- Configure
edx-platform
to use GCS, including the installation of django-storages[google] - Configure ORA2 to use GCS by setting
ORA2_FILEUPLOAD_BACKEND
togcs
- Configure the dedicated bucket by setting
FILE_UPLOAD_STORAGE_BUCKET_NAME
- Test uploading files from ORA2 and previewing them
- Test previewing uploaded files in ora2 MFE
- Verify that files exist in the dedicated storage
- Test deleting files
- Verify that files were deleted from the dedicated storage
Reviewer Checklist
Collectively, these should be completed by reviewers of this PR:
- [ ] I've done a visual code review
- [ ] I've tested the new functionality
FYI: @openedx/content-aurora
Thanks for the pull request, @shadinaif!
What's next?
Please work through the following steps to get your changes ready for engineering review:
:radio_button: Get product approval
If you haven't already, check this list to see if your contribution needs to go through the product review process.
- If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
- This process (including the steps you'll need to take) is documented here.
- If it doesn't, simply proceed with the next step.
:radio_button: Provide context
To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
- Dependencies
This PR must be merged before / after / at the same time as ...
- Blockers
This PR is waiting for OEP-1234 to be accepted.
- Timeline information
This PR must be merged by XX date because ...
- Partner information
This is for a course on edx.org.
- Supporting documentation
- Relevant Open edX discussion forum threads
:radio_button: Get a green build
If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.
:radio_button: Let us know that your PR is ready for review:
Who will review my changes?
This repository is currently maintained by @openedx/2u-aurora
. Tag them in a comment and let them know that your changes are ready for review.
Where can I find more information?
If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:
- Overview of Review Process for Community Contributions
- Pull Request Status Guide
- Making changes to your pull request
When can I expect my changes to be merged?
Our goal is to get community contributions seen and reviewed as efficiently as possible.
However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
- The size and impact of the changes that it introduces
- The need for product review
- Maintenance status of the parent repository
:bulb: As a result it may take up to several weeks or months to complete a review and merge your PR.
@shadinaif Thank you for this contribution! Let us know when the changes are ready for review.
Hey @shadinaif, just checking in to see if you're still planning to continue working on this PR?
Thank you for the reminder @itsjeyd . Yes, it's on production and working fine. I'll rebase and set to review soon
@shadinaif Sounds good, thanks for the update.
Hey @shadinaif, do you have any updates about when you'll be able to come back to this PR?
Thanks for the follow-up @itsjeyd , I'll get back to it and complete it on Tuesday, June 4, 2024 I promise. I've added it to my schedule. Sorry for the delay 🙏🏼
Sounds good, thanks for the update @shadinaif.
@shadinaif It looks like tests will need some further tweaking here. Could you have a look?
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 95.12%. Comparing base (
8b320d6
) to head (8fd1c39
). Report is 4 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #2193 +/- ##
==========================================
+ Coverage 95.09% 95.12% +0.02%
==========================================
Files 195 196 +1
Lines 21479 21584 +105
Branches 1931 1935 +4
==========================================
+ Hits 20425 20531 +106
Misses 787 787
+ Partials 267 266 -1
Flag | Coverage Δ | |
---|---|---|
unittests | 95.12% <100.00%> (+0.02%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hey @shadinaif, thanks for working on the tests.
It looks like some of them are still failing. Will you be taking another look?
Thanks for the reminder @itsjeyd , I'll do in a couple of days 👍🏼
@shadinaif Just checking in to see if you're still planning to continue working on this PR? If you don't think you'll get to it in the short term, it might make sense to close it for the time being.
@itsjeyd thank you for your patience on this. I've added the needed tests, and I also had to fix some linter errors not related to the PR. All green now
@shadinaif Great! I'm marking this PR as ready for review now.
Hi @openedx/2u-aurora team, this PR is ready for engineering review.
@feanil I can't formally request a review from the Aurora team, could you please update the team's permissions for this repo to make that possible?
Added the team to the repo and tagged them for review.