Set the MEDIA_ROOT and MEDIA_URL settings in the cms.envs.aws module - #15005
Conversation
|
Thanks for the pull request, @replaceafill! It looks like you're a member of a company that does contract work for edX. If you're doing this work as part of a paid contract with edX, you should talk to edX about who will review this pull request. If this work is not part of a paid contract with edX, then you should ensure that there is an OSPR issue to track this work in JIRA, so that we don't lose track of your pull request. |
There was a problem hiding this comment.
👍 Makes sense to me.
- I tested this: Tested import and export using https://github.com/open-craft/demo-courses/archive/drag-and-drop-v2.tar.gz on https://studio-pr15005.sandbox.opencraft.hosting/ (which is an OpenStack sandbox using this branch and provisioned with
EDXAPP_IMPORT_EXPORT_BUCKET: !!null) - I read through the code
-
I checked for accessibility issues: n/a -
Includes documentation: n/a for bugfix
|
@gsong Can you please help us create an OSPR for this PR from OpenCraft? We're seeing an error: "This bot does not have permissions for repo 'edx/edx-platform'.\n\nPlease manually make an OSPR ticket on JIRA." Also, CI tests have not yet run for this PR so we need to make sure that we test the jenkins build. |
|
Thanks for the pull request, @replaceafill! I've created OSPR-1764 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information. |
|
If we're going to import MEDIA_ROOT from lms common, we should remove the override in cms/envs/devstack.py (especially since they should be the same setting). Please also make a configuration PR so that step 2 is unnecessary. That should never have been needed, the default should have been local storage. Changing the ansible to pass an empty string with a comment explaining that you can set it to a bucket name would be great. It's unfortunate that this code hardcodes S3Storage in aws.py but that's a fix for another day. |
|
@replaceafill Do these changes sound good? |
|
@jibsheet @macdiesel The changes sound good. I'll work on this as soon as possible. |
|
@jibsheet @macdiesel I implemented the changes. The configuration PR is here: https://github.com/edx/configuration/pull/3906 |
|
@jibsheet I'm going to leave this to you to merge. |
|
A note - as I'm out next week, if there are issues with this on devstacks, @macdiesel will help coordinate. |
|
EdX Release Notice: This PR has been deployed to the staging environment in preparation for a release to production on Monday, June 12, 2017. |
|
EdX Release Notice: This PR has been deployed to the production environment. |
|
@jibsheet @macdiesel I opened https://github.com/edx/edx-platform/pull/15360 to fix the bok choy tests broken by this PR. Could you please take a look at https://github.com/edx/edx-platform/pull/15360#issuecomment-309800619 and let me know what I'm missing about running those tests? Thanks! |
In a sandbox setup, the course export functionality throws this error if the file system is used as storage:

This is caused because the
MEDIA_ROOTandMEDIA_URLsettings are not set explicitly in the cms configuration and their default values (empty strings) are used to calculate the base location of the storage, breaking the Celery task.This PR reuses both settings from the
lms.envs.commonmodule and allows to override them throughENV_TOKENSfixing this permission issue.Sandbox URL:
LMS: https://pr15005.sandbox.opencraft.hosting/
Studio: https://studio-pr15005.sandbox.opencraft.hosting/
Testing instructions
COURSE_IMPORT_EXPORT_BUCKETto null in the/edx/app/edxapp/cms.env.jsonfile. This will make the sandbox to use the file system as storage for the course exports./edx/app/edxapp/edx-platformReviewers