Skip to content

Adds swift and s3 settings required for upstream configuration changes

Jillian Vogel requested to merge jill/add-openstack-vars into master
  • Adds COMMON_EDXAPP_SETTINGS, which is required since https://github.com/edx/configuration/pull/3601 merged.
  • Keeps EDXAPP_SETTINGS for backwards compatibility.
  • Adds COMMON_ENABLE_OPENSTACK_INTEGRATION and COMMON_ENABLE_AWS_INTEGRATION, which are required once https://github.com/edx/configuration/pull/3522 merges.
  • Also sets EDXAPP_DEFAULT_FILE_STORAGE for s3 storage when AWS credentials are provided, since this was missing and defaulting to local file storage.

Testing instructions:

To verify the issue:

  1. Using opencraft:master on your opencraft devstack, try to spawn an appserver using edx-platform:master and configuration:master + open-craft:mtyaka/optional-aws-opencraft-roles.

  2. Note that the provisioning fails here, because the manage.py tasks use --settings=aws:

    TASK [demo : import demo course] ***********************************************
     fatal: [149.202.160.134]: FAILED! => {"changed": true, "cmd": "/edx/app/edxapp/venvs/edxapp/bin/python ./manage.py cms --settings=aws import /edx/var/edxapp/data /edx/app/demo/edx-demo-course", "delta": "0:00:08.019431", "end": "2017-01-10 06:49:11.611849", "failed": true, "rc": 1, "start": "2017-01-10 06:49:03.592418", "stderr": "Traceback (most recent call last):\n  File \"./manage.py\", line 112, in <module>\n    startup.run()\n  File \"/edx/app/edxapp/edx-platform/cms/startup.py\", line 39, in run\n    django.setup()\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/__init__.py\", line 18, in setup\n    apps.populate(settings.INSTALLED_APPS)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/apps/registry.py\", line 108, in populate\n    app_config.import_models(all_models)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/apps/config.py\", line 198, in import_models\n    self.models_module = import_module(models_module_name)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/user_tasks/models.py\", line 226, in <module>\n    class UserTaskArtifact(TimeStampedModel):\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/user_tasks/models.py\", line 237, in UserTaskArtifact\n    file = models.FileField(null=True, blank=True, storage=settings.USER_TASKS_ARTIFACT_STORAGE,\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/user_tasks/conf.py\", line 43, in USER_TASKS_ARTIFACT_STORAGE\n    return get_storage_class(import_path)()\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/core/files/storage.py\", line 328, in get_storage_class\n    return import_string(import_path or settings.DEFAULT_FILE_STORAGE)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/django/utils/module_loading.py\", line 26, in import_string\n    module = import_module(module_path)\n  File \"/usr/lib/python2.7/importlib/__init__.py\", line 37, in import_module\n    __import__(name)\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/swift/storage.py\", line 51, in <module>\n    class SwiftStorage(Storage):\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/swift/storage.py\", line 52, in SwiftStorage\n    api_auth_url = setting('SWIFT_AUTH_URL')\n  File \"/edx/app/edxapp/venvs/edxapp/local/lib/python2.7/site-packages/swift/storage.py\", line 33, in setting\n    raise ImproperlyConfigured('The {} setting is required'.format(name))\ndjango.core.exceptions.ImproperlyConfigured: The SWIFT_AUTH_URL setting is required", "stdout": "", "stdout_lines": [], "warnings": []}

To verify this change:

  1. Using this branch, spawn a new appserver with edx-platform:master and configuration:master.
  2. Note that the above error does not occur, and provisioning succeeds.
  3. Alternately, compare ficus test AppServer 3 vs AppServer 4.

Reviewers

Merge request reports