diff --git a/CHANGELOG-nightly.md b/CHANGELOG-nightly.md index 55903cf2678..3b2be0fdfdb 100644 --- a/CHANGELOG-nightly.md +++ b/CHANGELOG-nightly.md @@ -8,19 +8,3 @@ will be backported to the master branch at every major release. When backporting changes to master, we should keep only the entries that correspond to user- facing changes. --> -- [Improvement] Add the `-h` help option to all commands and subcommands. Previously, we could only use `--help`, which is quite long for lazy fingers. (by @regisb) -- 💥[Feature] Add an extensible `local/dev/k8s do ...` command to trigger custom job commands. These commands are used to run a series of bash scripts in designated containers. Any plugin can add custom jobs thanks to the `CLI_DO_COMMANDS` filter. This causes the following breaking changes: - - The "init", "createuser", "settheme", "importdemocourse" commands were all migrated to this new interface. For instance, `tutor local init` was replaced by `tutor local do init`. - - Plugin developers are encouraged to replace calls to the `COMMANDS_INIT` and `COMMANDS_PRE_INIT` filters by `CLI_DO_INIT_TASKS`. -- [Feature] Implement hook filter priorities, which work like action priorities. (by @regisb) -- 💥[Improvement] Remove the `local/dev bindmount` commands, which have been marked as deprecated for some time. The `--mount` option should be used instead. -- 💥[Bugfix] Fix local installation requirements. Plugins that implemented the "openedx-dockerfile-post-python-requirements" patch and that needed access to the edx-platform repo will no longer work. Instead, these plugins should implement the "openedx-dockerfile-pre-assets" patch. This scenario should be very rare, though. (by @regisb) -- 💥[Improvement] Rename the implementation of tutor quickstart to tutor launch. (by @Carlos-Muniz) -- 💥[Improvement] Remove the implementation of tutor dev runserver. (by @Carlos-Muniz) -- [Bugfix] Fix MongoDB replica set connection error resulting from edx-platform's pymongo (3.10.1 -> 3.12.3) upgrade ([edx-platform#30569](https://github.com/openedx/edx-platform/pull/30569)). (by @ormsbee) -- [Improvement] For Tutor Nightly (and only Nightly), official plugins are now installed from their nightly branches on GitHub instead of a version range on PyPI. This will allow Nightly users to install all official plugins by running ``pip install -e ".[full]"``. -- [Bugfix] Remove edX references from bulk emails ([issue](https://github.com/openedx/build-test-release-wg/issues/100)). -- [Bugfix] Update ``celery`` invocations for lms-worker and cms-worker to be compatible with Celery 5 CLI. -- [Improvement] Point CMS at its config file using ``CMS_CFG`` environment variable instead of deprecated ``STUDIO_CFG``. -- [Bugfix] Start MongoDB when running migrations, because a new data migration fails if MongoDB is not running - diff --git a/CHANGELOG.md b/CHANGELOG.md index 59fb3cf8253..bf14a78d9d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,17 @@ Every user-facing change should have an entry in this changelog. Please respect ## Unreleased +- 💥[Feature] Upgrade to Olive (by @regisb): + - Mypy type checking options were modified: developers are encouraged to add the `--implicit-reexport` option to their IDE. +- [Improvement] Add the `-h` help option to all commands and subcommands. Previously, we could only use `--help`, which is quite long for lazy fingers. (by @regisb) +- 💥[Feature] Add an extensible `local/dev/k8s do ...` command to trigger custom job commands. These commands are used to run a series of bash scripts in designated containers. Any plugin can add custom jobs thanks to the `CLI_DO_COMMANDS` filter. This causes the following breaking changes: + - The "init", "createuser", "settheme", "importdemocourse" commands were all migrated to this new interface. For instance, `tutor local init` was replaced by `tutor local do init`. + - Plugin developers are encouraged to replace calls to the `COMMANDS_INIT` and `COMMANDS_PRE_INIT` filters by `CLI_DO_INIT_TASKS`. +- [Feature] Implement hook filter priorities, which work like action priorities. (by @regisb) +- 💥[Improvement] Remove the `local/dev bindmount` commands, which have been marked as deprecated for some time. The `--mount` option should be used instead. +- 💥[Bugfix] Fix local installation requirements. Plugins that implemented the "openedx-dockerfile-post-python-requirements" patch and that needed access to the edx-platform repo will no longer work. Instead, these plugins should implement the "openedx-dockerfile-pre-assets" patch. This scenario should be very rare, though. (by @regisb) +- 💥[Improvement] Rename the implementation of tutor quickstart to tutor launch. (by @Carlos-Muniz) +- 💥[Improvement] Remove the implementation of tutor dev runserver. (by @Carlos-Muniz) - [Improvement] Enable CORS by default for both LMS and CMS by moving those settings to the `common_all` partial. (by @arbrandes) ## v14.2.0 (2022-11-21) diff --git a/docs/configuration.rst b/docs/configuration.rst index 3c03396627b..a3ad586b783 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -130,7 +130,7 @@ Open edX customisation This defines the git repository from which you install Open edX platform code. If you run an Open edX fork with custom patches, set this to your own git repository. You may also override this configuration parameter at build time, by providing a ``--build-arg`` option. -- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/nutmeg.1"``) +- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/olive.1"``) This defines the default version that will be pulled from all Open edX git repositories. @@ -150,7 +150,7 @@ These two configuration parameters define which Redis database to use for Open e .. _openedx_extra_pip_requirements: -- ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` (default: ``openedx-scorm-xblock<13.0.0,>=12.0.0``) +- ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` (default: ``openedx-scorm-xblock>=15.0.0,<16.0.0``) This defines extra pip packages that are going to be installed for Open edX. @@ -170,10 +170,6 @@ This configuration parameter sets the Django setting ``AWS_SECRET_ACCESS_KEY`` i This configuration parameter sets the name of the MySQL Database to be used by the Open edX Instance. -- ``OPENEDX_CSMH_MYSQL_DATABASE`` (default: ``"{{ OPENEDX_MYSQL_DATABASE }}_csmh"``) - -This configuration parameter allows you to configure the name of the separate Courseware Student-Module History (CSMH) database. - - ``OPENEDX_MYSQL_USERNAME`` (default: ``"openedx"``) This configuration parameter sets the username associated with the MySQL Database. @@ -402,14 +398,14 @@ If you don't create your fork from this tag, you *will* have important compatibi - Do not try to run a fork from an older (pre-Nutmeg) version of edx-platform: this will simply not work. - Do not try to run a fork from the edx-platform master branch: there is a 99% probability that it will fail. -- Do not try to run a fork from the open-release/nutmeg.master branch: Tutor will attempt to apply security and bug fix patches that might already be included in the open-release/nutmeg.master but which were not yet applied to the latest release tag. Patch application will thus fail if you base your fork from the open-release/nutmeg.master branch. +- Do not try to run a fork from the open-release/olive.master branch: Tutor will attempt to apply security and bug fix patches that might already be included in the open-release/olive.master but which were not yet applied to the latest release tag. Patch application will thus fail if you base your fork from the open-release/olive.master branch. .. _i18n: Adding custom translations ~~~~~~~~~~~~~~~~~~~~~~~~~~ -If you are not running Open edX in English (``LANGUAGE_CODE`` default: ``"en"``), chances are that some strings will not be properly translated. In most cases, this is because not enough contributors have helped translate Open edX into your language. It happens! With Tutor, available translated languages include those that come bundled with `edx-platform `__ as well as those from `openedx-i18n `__. +If you are not running Open edX in English (``LANGUAGE_CODE`` default: ``"en"``), chances are that some strings will not be properly translated. In most cases, this is because not enough contributors have helped translate Open edX into your language. It happens! With Tutor, available translated languages include those that come bundled with `edx-platform `__ as well as those from `openedx-i18n `__. Tutor offers a relatively simple mechanism to add custom translations to the openedx Docker image. You should create a folder that corresponds to your language code in the "build/openedx/locale" folder of the Tutor environment. This folder should contain a "LC_MESSAGES" folder. For instance:: @@ -430,9 +426,9 @@ Then, add a "django.po" file there that will contain your custom translations:: .. warning:: Don't forget to specify the file ``Content-Type`` when adding message strings with non-ASCII characters; otherwise a ``UnicodeDecodeError`` will be raised during compilation. -The "String to translate" part should match *exactly* the string that you would like to translate. You cannot make it up! The best way to find this string is to copy-paste it from the `upstream django.po file for the English language `__. +The "String to translate" part should match *exactly* the string that you would like to translate. You cannot make it up! The best way to find this string is to copy-paste it from the `upstream django.po file for the English language `__. -If you cannot find the string to translate in this file, then it means that you are trying to translate a string that is used in some piece of javascript code. Those strings are stored in a different file named "djangojs.po". You can check it out `in the edx-platform repo as well `__. Your custom javascript strings should also be stored in a "djangojs.po" file that should be placed in the same directory. +If you cannot find the string to translate in this file, then it means that you are trying to translate a string that is used in some piece of javascript code. Those strings are stored in a different file named "djangojs.po". You can check it out `in the edx-platform repo as well `__. Your custom javascript strings should also be stored in a "djangojs.po" file that should be placed in the same directory. To recap, here is an example. To translate a few strings in French, both from django.po and djangojs.po, we would have the following file hierarchy:: diff --git a/docs/dev.rst b/docs/dev.rst index d52457f3775..4ff7c933a66 100644 --- a/docs/dev.rst +++ b/docs/dev.rst @@ -92,7 +92,7 @@ The ``openedx-dev`` Docker image is based on the same ``openedx`` image used by - Additional Python and system requirements are installed for convenient debugging: `ipython `__, `ipdb `__, vim, telnet. -- The edx-platform `development requirements `__ are installed. +- The edx-platform `development requirements `__ are installed. If you are using a custom ``openedx`` image, then you will need to rebuild ``openedx-dev`` every time you modify ``openedx``. To so, run:: diff --git a/docs/faq.rst b/docs/faq.rst index cb6581debdc..045eaa550b1 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -38,7 +38,7 @@ The `devstack `_ is meant for development o Is Tutor officially supported by edX? ------------------------------------- -Yes: as of the Open edX Maple release (December 9th 2021), Tutor is the only officially supported installation method for Open edX: see the `official installation instructions `__. +Yes: as of the Open edX Maple release (December 9th 2021), Tutor is the only officially supported installation method for Open edX: see the `official installation instructions `__. What features are missing from Tutor? ------------------------------------- diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 5fb7f766fcd..695da1805e2 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -22,7 +22,7 @@ Yes :) This is what happens when you run ``tutor local launch``: 2. Configuration files are generated from templates. 3. Docker images are downloaded. 4. Docker containers are provisioned. -5. A full, production-ready Open edX platform (`Nutmeg `__ release) is run with docker-compose. +5. A full, production-ready Open edX platform (`Nutmeg `__ release) is run with docker-compose. The whole procedure should require less than 10 minutes, on a server with good bandwidth. Note that your host environment will not be affected in any way, since everything runs inside docker containers. Root access is not even necessary. diff --git a/requirements/plugins.txt b/requirements/plugins.txt index 2f6f675c3e8..7958312d7b4 100644 --- a/requirements/plugins.txt +++ b/requirements/plugins.txt @@ -1,13 +1,11 @@ -# For Tutor Nightly, we install plugins from their nightly branches instead of from PyPI -# (except tutor-license, for which we just want the latest version from PyPI). -tutor-android @ git+https://github.com/overhangio/tutor-android@nightly -tutor-discovery @ git+https://github.com/overhangio/tutor-discovery@nightly -tutor-ecommerce @ git+https://github.com/overhangio/tutor-ecommerce@nightly -tutor-forum @ git+https://github.com/overhangio/tutor-forum@nightly -tutor-license -tutor-mfe @ git+https://github.com/overhangio/tutor-mfe@nightly -tutor-minio @ git+https://github.com/overhangio/tutor-minio@nightly -tutor-notes @ git+https://github.com/overhangio/tutor-notes@nightly -tutor-webui @ git+https://github.com/overhangio/tutor-webui@nightly -tutor-xqueue @ git+https://github.com/overhangio/tutor-xqueue@nightly - +# change version ranges when upgrading from olive +tutor-android>=15.0.0,<16.0.0 +tutor-discovery>=15.0.0,<16.0.0 +tutor-ecommerce>=15.0.0,<16.0.0 +tutor-forum>=15.0.0,<16.0.0 +tutor-license>=15.0.0,<16.0.0 +tutor-mfe>=15.0.0,<16.0.0 +tutor-minio>=15.0.0,<16.0.0 +tutor-notes>=15.0.0,<16.0.0 +tutor-webui>=15.0.0,<16.0.0 +tutor-xqueue>=15.0.0,<16.0.0 diff --git a/tests/test_env.py b/tests/test_env.py index e74475d19dc..969ef81a8f0 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -258,6 +258,6 @@ def test_current_version_in_latest_env(self) -> None: ) as f: f.write(__version__) self.assertEqual(__version__, env.current_version(root)) - self.assertEqual("nutmeg", env.get_env_release(root)) + self.assertEqual("olive", env.get_env_release(root)) self.assertIsNone(env.should_upgrade_from_release(root)) self.assertTrue(env.is_up_to_date(root)) diff --git a/tutor/__about__.py b/tutor/__about__.py index be4248aab8f..e7c1701a812 100644 --- a/tutor/__about__.py +++ b/tutor/__about__.py @@ -2,7 +2,7 @@ # Increment this version number to trigger a new release. See # docs/tutor.html#versioning for information on the versioning scheme. -__version__ = "14.2.0" +__version__ = "15.0.0" # The version suffix will be appended to the actual version, separated by a # dash. Use this suffix to differentiate between the actual released version and @@ -10,7 +10,7 @@ # the nightly branch. # The suffix is cleanly separated from the __version__ in this module to avoid # conflicts when merging branches. -__version_suffix__ = "nightly" +__version_suffix__ = "" # The app name will be used to define the name of the default tutor root and # plugin directory. To avoid conflicts between multiple locally-installed diff --git a/tutor/commands/upgrade/k8s.py b/tutor/commands/upgrade/k8s.py index af970a0b19e..0ab49b63b6e 100644 --- a/tutor/commands/upgrade/k8s.py +++ b/tutor/commands/upgrade/k8s.py @@ -32,6 +32,10 @@ def upgrade_from(context: Context, from_release: str) -> None: upgrade_from_maple(context, config) running_release = "nutmeg" + if running_release == "nutmeg": + # Upgrade is a no-op + running_release = "olive" + def upgrade_from_ironwood(config: Config) -> None: if not config["RUN_MONGODB"]: diff --git a/tutor/commands/upgrade/local.py b/tutor/commands/upgrade/local.py index b92f78aaf35..068111c29aa 100644 --- a/tutor/commands/upgrade/local.py +++ b/tutor/commands/upgrade/local.py @@ -35,6 +35,10 @@ def upgrade_from(context: click.Context, from_release: str) -> None: upgrade_from_maple(context, config) running_release = "nutmeg" + if running_release == "nutmeg": + # Upgrade is a no-op + running_release = "olive" + def upgrade_from_ironwood(context: click.Context, config: Config) -> None: click.echo(fmt.title("Upgrading from Ironwood")) diff --git a/tutor/env.py b/tutor/env.py index 62060929356..b3e22995078 100644 --- a/tutor/env.py +++ b/tutor/env.py @@ -384,6 +384,7 @@ def get_release(version: str) -> str: "12": "lilac", "13": "maple", "14": "nutmeg", + "15": "olive", }[version.split(".", maxsplit=1)[0]] diff --git a/tutor/templates/apps/openedx/config/cms.env.yml b/tutor/templates/apps/openedx/config/cms.env.yml index 9aa9b152003..c062b2c2306 100644 --- a/tutor/templates/apps/openedx/config/cms.env.yml +++ b/tutor/templates/apps/openedx/config/cms.env.yml @@ -37,37 +37,4 @@ HTTPS: "{{ "on" if ENABLE_HTTPS else "off" }}" LANGUAGE_CODE: "{{ LANGUAGE_CODE }}" SESSION_COOKIE_DOMAIN: "{{ CMS_HOST }}" {{ patch("cms-env") }} -CACHES: - default: - KEY_PREFIX: "default" - VERSION: "1" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - general: - KEY_PREFIX: "general" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - mongo_metadata_inheritance: - KEY_PREFIX: "mongo_metadata_inheritance" - TIMEOUT: 300 - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - staticfiles: - KEY_PREFIX: "staticfiles_cms" - BACKEND: "django.core.cache.backends.locmem.LocMemCache" - LOCATION: "staticfiles_cms" - configuration: - KEY_PREFIX: "configuration" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - celery: - KEY_PREFIX: "celery" - TIMEOUT: "7200" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - course_structure_cache: - KEY_PREFIX: "course_structure" - TIMEOUT: "7200" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" {% include "apps/openedx/config/partials/auth.yml" %} diff --git a/tutor/templates/apps/openedx/config/lms.env.yml b/tutor/templates/apps/openedx/config/lms.env.yml index 81fcef88284..a1f93eb9a5f 100644 --- a/tutor/templates/apps/openedx/config/lms.env.yml +++ b/tutor/templates/apps/openedx/config/lms.env.yml @@ -21,7 +21,6 @@ FEATURES: ENABLE_PREREQUISITE_COURSES: true ENABLE_THIRD_PARTY_AUTH: true MILESTONES_APP: true - PERSISTENT_GRADES_ENABLED_FOR_ALL_TESTS: true LMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ LMS_HOST }}" CMS_ROOT_URL: "{{ "https" if ENABLE_HTTPS else "http" }}://{{ CMS_HOST }}" CMS_BASE: "{{ CMS_HOST }}" @@ -45,41 +44,4 @@ HTTPS: "{{ "on" if ENABLE_HTTPS else "off" }}" LANGUAGE_CODE: "{{ LANGUAGE_CODE }}" SESSION_COOKIE_DOMAIN: "{{ LMS_HOST }}" {{ patch("lms-env") }} -CACHES: - default: - KEY_PREFIX: "default" - VERSION: "1" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - general: - KEY_PREFIX: "general" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - mongo_metadata_inheritance: - KEY_PREFIX: "mongo_metadata_inheritance" - TIMEOUT: 300 - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - staticfiles: - KEY_PREFIX: "staticfiles_lms" - BACKEND: "django.core.cache.backends.locmem.LocMemCache" - LOCATION: "staticfiles_lms" - configuration: - KEY_PREFIX: "configuration" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - celery: - KEY_PREFIX: "celery" - TIMEOUT: "7200" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - course_structure_cache: - KEY_PREFIX: "course_structure" - TIMEOUT: "7200" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" - ora2-storage: - KEY_PREFIX: "ora2-storage" - BACKEND: "django_redis.cache.RedisCache" - LOCATION: "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}" {% include "apps/openedx/config/partials/auth.yml" %} diff --git a/tutor/templates/apps/openedx/settings/partials/common_all.py b/tutor/templates/apps/openedx/settings/partials/common_all.py index 7f4368d16fc..7c7e734628a 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_all.py +++ b/tutor/templates/apps/openedx/settings/partials/common_all.py @@ -41,8 +41,46 @@ "port": {{ ELASTICSEARCH_PORT }}, }] -CONTACT_MAILING_ADDRESS = "{{ PLATFORM_NAME }} - {% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" +# Common cache config +CACHES = { + "default": { + "KEY_PREFIX": "default", + "VERSION": "1", + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, + "general": { + "KEY_PREFIX": "general", + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, + "mongo_metadata_inheritance": { + "KEY_PREFIX": "mongo_metadata_inheritance", + "TIMEOUT": 300, + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, + "configuration": { + "KEY_PREFIX": "configuration", + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, + "celery": { + "KEY_PREFIX": "celery", + "TIMEOUT": 7200, + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, + "course_structure_cache": { + "KEY_PREFIX": "course_structure", + "TIMEOUT": 7200, + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", + }, +} +# Contact addresses +CONTACT_MAILING_ADDRESS = "{{ PLATFORM_NAME }} - {% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}" DEFAULT_FROM_EMAIL = ENV_TOKENS.get("DEFAULT_FROM_EMAIL", ENV_TOKENS["CONTACT_EMAIL"]) DEFAULT_FEEDBACK_EMAIL = ENV_TOKENS.get("DEFAULT_FEEDBACK_EMAIL", ENV_TOKENS["CONTACT_EMAIL"]) SERVER_EMAIL = ENV_TOKENS.get("SERVER_EMAIL", ENV_TOKENS["CONTACT_EMAIL"]) diff --git a/tutor/templates/apps/openedx/settings/partials/common_cms.py b/tutor/templates/apps/openedx/settings/partials/common_cms.py index d6093459204..c75fad74ed3 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_cms.py +++ b/tutor/templates/apps/openedx/settings/partials/common_cms.py @@ -4,6 +4,12 @@ STUDIO_NAME = u"{{ PLATFORM_NAME }} - Studio" +CACHES["staticfiles"] = { + "KEY_PREFIX": "staticfiles_cms", + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "staticfiles_cms", +} + # Authentication SOCIAL_AUTH_EDX_OAUTH2_SECRET = "{{ CMS_OAUTH2_SECRET }}" SOCIAL_AUTH_EDX_OAUTH2_URL_ROOT = "http://lms:8000" @@ -15,6 +21,12 @@ FRONTEND_LOGIN_URL = LMS_ROOT_URL + '/login' FRONTEND_REGISTER_URL = LMS_ROOT_URL + '/register' +# Disable blockstore-related xblocks +LIBRARY_BLOCK_TYPES = filter( + lambda b: b["component"] != "library_sourced", + LIBRARY_BLOCK_TYPES +) + # Create folders if necessary for folder in [LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE]: if not os.path.exists(folder): diff --git a/tutor/templates/apps/openedx/settings/partials/common_lms.py b/tutor/templates/apps/openedx/settings/partials/common_lms.py index 522d6f1a687..5461d65aa6e 100644 --- a/tutor/templates/apps/openedx/settings/partials/common_lms.py +++ b/tutor/templates/apps/openedx/settings/partials/common_lms.py @@ -21,10 +21,27 @@ # Email settings DEFAULT_EMAIL_LOGO_URL = LMS_ROOT_URL + "/theming/asset/images/logo.png" BULK_EMAIL_SEND_USING_EDX_ACE = True +FEATURES["ENABLE_FOOTER_MOBILE_APP_LINKS"] = False + +# Branding +MOBILE_STORE_ACE_URLS = {} +SOCIAL_MEDIA_FOOTER_ACE_URLS = {} # Make it possible to hide courses by default from the studio SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING = False +# Caching +CACHES["staticfiles"] = { + "KEY_PREFIX": "staticfiles_lms", + "BACKEND": "django.core.cache.backends.locmem.LocMemCache", + "LOCATION": "staticfiles_lms", +} +CACHES["ora2-storage"] = { + "KEY_PREFIX": "ora2-storage", + "BACKEND": "django_redis.cache.RedisCache", + "LOCATION": "redis://{% if REDIS_USERNAME and REDIS_PASSWORD %}{{ REDIS_USERNAME }}:{{ REDIS_PASSWORD }}{% endif %}@{{ REDIS_HOST }}:{{ REDIS_PORT }}/{{ OPENEDX_CACHE_REDIS_DB }}", +} + # Create folders if necessary for folder in [DATA_DIR, LOG_DIR, MEDIA_ROOT, STATIC_ROOT_BASE, ORA2_FILEUPLOAD_ROOT]: if not os.path.exists(folder): diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index 4e8dd8beccd..b6c633a8b73 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -73,7 +73,7 @@ RUN apt update && apt install -y software-properties-common libmysqlclient-dev l # https://pypi.org/project/setuptools/ # https://pypi.org/project/pip/ # https://pypi.org/project/wheel/ -RUN pip install setuptools==62.1.0 pip==22.0.4 wheel==0.37.1 +RUN pip install setuptools==65.5.1 pip==22.3.1. wheel==0.38.4 # Install base requirements COPY --from=code /openedx/edx-platform/requirements/edx/base.txt /tmp/base.txt @@ -85,7 +85,7 @@ RUN pip install django-redis==5.2.0 # Install uwsgi # https://pypi.org/project/uWSGI/ -RUN pip install uwsgi==2.0.20 +RUN pip install uwsgi==2.0.21 {{ patch("openedx-dockerfile-post-python-requirements") }} @@ -103,7 +103,8 @@ FROM python as nodejs-requirements ENV PATH /openedx/nodeenv/bin:/openedx/venv/bin:${PATH} # Install nodeenv with the version provided by edx-platform -RUN pip install nodeenv==1.6.0 +# https://github.com/openedx/edx-platform/blob/master/requirements/edx/base.txt +RUN pip install nodeenv==1.7.0 RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt # Install nodejs requirements diff --git a/tutor/templates/build/openedx/revisions.yml b/tutor/templates/build/openedx/revisions.yml index d75f161c43d..ecd9dcea730 100644 --- a/tutor/templates/build/openedx/revisions.yml +++ b/tutor/templates/build/openedx/revisions.yml @@ -1 +1 @@ -EDX_PLATFORM_REVISION: nutmeg +EDX_PLATFORM_REVISION: olive diff --git a/tutor/templates/config/defaults.yml b/tutor/templates/config/defaults.yml index b30e95d2338..dd90932a9f6 100644 --- a/tutor/templates/config/defaults.yml +++ b/tutor/templates/config/defaults.yml @@ -46,11 +46,10 @@ OPENEDX_CELERY_REDIS_DB: 0 OPENEDX_CMS_UWSGI_WORKERS: 2 OPENEDX_LMS_UWSGI_WORKERS: 2 OPENEDX_MYSQL_DATABASE: "openedx" -OPENEDX_CSMH_MYSQL_DATABASE: "{{ OPENEDX_MYSQL_DATABASE }}_csmh" OPENEDX_MYSQL_USERNAME: "openedx" -OPENEDX_COMMON_VERSION: "master" +OPENEDX_COMMON_VERSION: "open-release/olive.master" OPENEDX_EXTRA_PIP_REQUIREMENTS: - - "openedx-scorm-xblock<15.0.0,>=14.0.0" + - "openedx-scorm-xblock>=15.0.0,<16.0.0" MYSQL_HOST: "mysql" MYSQL_PORT: 3306 MYSQL_ROOT_USERNAME: "root"