feat: upgrade to Palm

Among other changes: ORA2 file uploads were stored in a folder named
"SET-ME-PLEASE (ex.  bucket-name)" (sigh). With this change, the folder
should be automatically renamed to "openedxuploads". This issue has been
occuring since June 2019... (sigh²)

Close #707
This commit is contained in:
Régis Behmo 2023-04-12 10:35:00 +02:00
parent 253b69ffe3
commit b3c3c4a2cc
24 changed files with 146 additions and 104 deletions

View File

@ -0,0 +1,2 @@
- 💥[Feature] Upgrade to Palm. (by @regisb)
- [Bugfix] Rename ORA2 file upload folder from "SET-ME-PLEASE (ex. bucket-name)" to "openedxuploads". This has the effect of moving the corresponding folder from the `<tutor root>/data/lms/ora2` directory. MinIO users were not affected by this bug.

View File

@ -67,11 +67,13 @@ This configuration parameter defines the name of the Docker image to run for the
This configuration paramater defines the name of the Docker image to run the development version of the lms and cms containers. By default, the Docker image tag matches the Tutor version it was built with.
.. https://hub.docker.com/r/devture/exim-relay/tags
- ``DOCKER_IMAGE_CADDY`` (default: ``"docker.io/caddy:2.6.2"``)
This configuration paramater defines which Caddy Docker image to use.
- ``DOCKER_IMAGE_ELASTICSEARCH`` (default: ``"docker.io/elasticsearch:7.10.1"``)
- ``DOCKER_IMAGE_ELASTICSEARCH`` (default: ``"docker.io/elasticsearch:7.17.9"``)
This configuration parameter defines which Elasticsearch Docker image to use.
@ -79,15 +81,21 @@ This configuration parameter defines which Elasticsearch Docker image to use.
This configuration parameter defines which MongoDB Docker image to use.
- ``DOCKER_IMAGE_MYSQL`` (default: ``"docker.io/mysql:5.7.35"``)
.. https://hub.docker.com/_/mysql/tags?page=1&name=8.0
- ``DOCKER_IMAGE_MYSQL`` (default: ``"docker.io/mysql:8.0.33"``)
This configuration parameter defines which MySQL Docker image to use.
- ``DOCKER_IMAGE_REDIS`` (default: ``"docker.io/redis:6.2.6"``)
.. https://hub.docker.com/_/redis/tags
- ``DOCKER_IMAGE_REDIS`` (default: ``"docker.io/redis:7.0.11"``)
This configuration parameter defines which Redis Docker image to use.
- ``DOCKER_IMAGE_SMTP`` (default: ``"docker.io/devture/exim-relay:4.95-r0-2``)
.. https://hub.docker.com/r/devture/exim-relay/tags
- ``DOCKER_IMAGE_SMTP`` (default: ``"docker.io/devture/exim-relay:4.96-r1-0``)
This configuration parameter defines which Simple Mail Transfer Protocol (SMTP) Docker image to use.
@ -130,7 +138,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/olive.4"``)
- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/palm.master"``)
This defines the default version that will be pulled from all Open edX git repositories.
@ -150,7 +158,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>=15.0.0,<16.0.0"]``)
- ``OPENEDX_EXTRA_PIP_REQUIREMENTS`` (default: ``["openedx-scorm-xblock>=16.0.0,<17.0.0"]``)
This defines extra pip packages that are going to be installed for Open edX.
@ -404,14 +412,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-Olive) 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/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.
- Do not try to run a fork from the open-release/palm.master branch: Tutor will attempt to apply security and bug fix patches that might already be included in the open-release/palm.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/palm.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 <https://github.com/openedx/edx-platform/tree/open-release/olive.master/conf/locale>`__ as well as those from `openedx-i18n <https://github.com/openedx/openedx-i18n/tree/master/edx-platform/locale>`__.
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 <https://github.com/openedx/edx-platform/tree/open-release/palm.master/conf/locale>`__ as well as those from `openedx-i18n <https://github.com/openedx/openedx-i18n/tree/master/edx-platform/locale>`__.
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::
@ -432,9 +440,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 <https://github.com/openedx/edx-platform/blob/open-release/olive.master/conf/locale/en/LC_MESSAGES/django.po>`__.
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 <https://github.com/openedx/edx-platform/blob/open-release/palm.master/conf/locale/en/LC_MESSAGES/django.po>`__.
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 <https://github.com/openedx/edx-platform/blob/open-release/olive.master/conf/locale/en/LC_MESSAGES/djangojs.po>`__. 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 <https://github.com/openedx/edx-platform/blob/open-release/palm.master/conf/locale/en/LC_MESSAGES/djangojs.po>`__. 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::

View File

@ -128,7 +128,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 <https://ipython.org/>`__, `ipdb <https://pypi.org/project/ipdb/>`__, vim, telnet.
- The edx-platform `development requirements <https://github.com/openedx/edx-platform/blob/open-release/olive.master/requirements/edx/development.in>`__ are installed.
- The edx-platform `development requirements <https://github.com/openedx/edx-platform/blob/open-release/palm.master/requirements/edx/development.in>`__ 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::

View File

@ -38,7 +38,7 @@ The `devstack <https://github.com/openedx/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 <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/open-release-olive.master/installation/index.html>`__.
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 <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/open-release-palm.master/installation/index.html>`__.
What features are missing from Tutor?
-------------------------------------

View File

@ -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 (`Olive <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/open-release-olive.master/platform_releases/olive.html>`__ release) is run with docker-compose.
5. A full, production-ready Open edX platform (`Palm <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/open-release-palm.master/platform_releases/palm.html>`__ 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.

View File

@ -7,10 +7,10 @@ Plugin indexes are a great way to have your plugins discovered by other users. P
Index file paths
================
A plugin index is a yaml-formatted file. It can be stored on the web or on your computer. In both cases, the index file location must end with "<current release name>/plugins.yml". For instance, the following are valid index locations if you run the Open edX "Olive" release:
A plugin index is a yaml-formatted file. It can be stored on the web or on your computer. In both cases, the index file location must end with "<current release name>/plugins.yml". For instance, the following are valid index locations if you run the Open edX "Palm" release:
- https://overhang.io/tutor/main/olive/plugins.yml
- ``/path/to/your/local/index/olive/plugins.yml``
- https://overhang.io/tutor/main/palm/plugins.yml
- ``/path/to/your/local/index/palm/plugins.yml``
To add either indexes, run the ``tutor plugins index add`` command without the suffix. For instance::
@ -106,9 +106,9 @@ Manage plugins in development
Plugin developers and maintainers often want to install local versions of their plugins. They usually achieve this with ``pip install -e /path/to/tutor-plugin``. We can improve that workflow by creating an index for local plugins::
# Create the plugin index directory
mkdir -p ~/localindex/olive/
mkdir -p ~/localindex/palm/
# Edit the index
vim ~/localindex/olive/plugins.yml
vim ~/localindex/palm/plugins.yml
Add the following to the index::

View File

@ -7,7 +7,6 @@ Tutor can be used on ARM64 systems, although no official ARM64 docker images are
.. note:: There are generally two ways to run Tutor on an ARM system - using emulation (via qemu or Rosetta 2) to run x86_64 images or running native ARM images. Since emulation can be noticeably slower (typically 20-100% slower depending on the emulation method), this tutorial aims to use native images where possible.
Building the images
-------------------
@ -27,30 +26,14 @@ Then, build the "openedx" and "permissions" images::
tutor images build openedx permissions
.. TODO we don't want this instruction anymore
If you want to use Tutor as an Open edX development environment, you should also build the development images::
tutor dev dc build lms
Change the database server
--------------------------
The version of MySQL that Open edX uses by default (5.7) does not support the ARM architecture. You need to tell Tutor to use MySQL 8.0, which does support the ARM architecture and which has been supported by Open edX since the "Nutmeg" release.
Configure Tutor to use MySQL 8::
tutor config save --set DOCKER_IMAGE_MYSQL=docker.io/mysql:8.0
(If you need to run an older release of Open edX on ARM64, you can try using `mariadb:10.4` although it's not officially supported nor recommended for production.)
Finish setup and start Tutor
----------------------------
From this point on, use Tutor as normal. For example, start Open edX and run migrations with::
tutor local start -d
tutor local do init
tutor local launch
Or for a development environment::
tutor dev start -d
tutor dev do init
tutor dev launch

View File

@ -1,11 +1,11 @@
# 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
# change version ranges when upgrading from palm
tutor-android>=16.0.0,<17.0.0
tutor-discovery>=16.0.0,<17.0.0
tutor-ecommerce>=16.0.0,<17.0.0
tutor-forum>=16.0.0,<17.0.0
tutor-license>=16.0.0,<17.0.0
tutor-mfe>=16.0.0,<17.0.0
tutor-minio>=16.0.0,<17.0.0
tutor-notes>=16.0.0,<17.0.0
tutor-webui>=16.0.0,<17.0.0
tutor-xqueue>=16.0.0,<17.0.0

View File

@ -49,7 +49,7 @@ class ImagesTests(PluginsTestCase, TestCommandMixin):
self.assertIsNone(result.exception)
self.assertEqual(0, result.exit_code)
# Note: we should update this tag whenever the mysql image is updated
image_pull.assert_called_once_with("docker.io/mysql:5.7.35")
image_pull.assert_called_once_with("docker.io/mysql:8.0.33")
def test_images_printtag_image(self) -> None:
result = self.invoke(["images", "printtag", "openedx"])

View File

@ -259,7 +259,7 @@ class CurrentVersionTests(unittest.TestCase):
) as f:
f.write(__version__)
self.assertEqual(__version__, env.current_version(root))
self.assertEqual("olive", env.get_env_release(root))
self.assertEqual("palm", env.get_env_release(root))
self.assertIsNone(env.should_upgrade_from_release(root))
self.assertTrue(env.is_up_to_date(root))

View File

@ -2,7 +2,7 @@ import os
# Increment this version number to trigger a new release. See
# docs/tutor.html#versioning for information on the versioning scheme.
__version__ = "15.3.7"
__version__ = "16.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

View File

@ -4,7 +4,7 @@ import click
from tutor import config as tutor_config
from tutor import env as tutor_env
from tutor import exceptions, fmt, hooks
from tutor import fmt, hooks
from tutor import interactive as interactive_config
from tutor import utils
from tutor.commands import compose
@ -73,15 +73,7 @@ def launch(
mounts: tuple[list[compose.MountParam.MountType]],
) -> None:
compose.mount_tmp_volumes(mounts, context.obj)
try:
utils.check_macos_docker_memory()
except exceptions.TutorError as e:
fmt.echo_alert(
f"""Could not verify sufficient RAM allocation in Docker:
{e}
Tutor may not work if Docker is configured with < 4 GB RAM. Please follow instructions from:
https://docs.tutor.overhang.io/install.html"""
)
utils.warn_macos_docker_memory()
click.echo(fmt.title("Interactive platform configuration"))
config = tutor_config.load_minimal(context.obj.root)

View File

@ -6,7 +6,7 @@ import click
from tutor import config as tutor_config
from tutor import env as tutor_env
from tutor import exceptions, fmt, hooks
from tutor import fmt, hooks
from tutor import interactive as interactive_config
from tutor import utils
from tutor.commands import compose
@ -77,18 +77,7 @@ def launch(
pullimages: bool,
) -> None:
compose.mount_tmp_volumes(mounts, context.obj)
try:
utils.check_macos_docker_memory()
except exceptions.TutorError as e:
fmt.echo_alert(
f"""Could not verify sufficient RAM allocation in Docker:
{e}
Tutor may not work if Docker is configured with < 4 GB RAM. Please follow instructions from:
https://docs.tutor.overhang.io/install.html"""
)
utils.warn_macos_docker_memory()
run_upgrade_from_release = tutor_env.should_upgrade_from_release(context.obj.root)
if run_upgrade_from_release is not None:

View File

@ -1,2 +1,10 @@
# Note: don't forget to change this when we upgrade from olive
OPENEDX_RELEASE_NAMES = ["ironwood", "juniper", "koa", "lilac", "maple", "nutmeg"]
# Note: don't forget to change this when we upgrade from palm
OPENEDX_RELEASE_NAMES = [
"ironwood",
"juniper",
"koa",
"lilac",
"maple",
"nutmeg",
"olive",
]

View File

@ -39,3 +39,11 @@ def upgrade_from_nutmeg(context: click.Context, config: Config) -> None:
context.obj.job_runner(config).run_task(
"lms", "./manage.py lms compute_grades -v1 --all_courses"
)
PALM_RENAME_ORA2_FOLDER_COMMAND = """
if stat '/openedx/data/ora2/SET-ME-PLEASE (ex. bucket-name)' 2> /dev/null; then
echo "Renaming ora2 folder..."
mv '/openedx/data/ora2/SET-ME-PLEASE (ex. bucket-name)' /openedx/data/ora2/openedxuploads
fi
"""

View File

@ -38,6 +38,10 @@ def upgrade_from(context: click.Context, from_release: str) -> None:
common_upgrade.upgrade_from_nutmeg(context, config)
running_release = "olive"
if running_release == "olive":
upgrade_from_olive(context.obj, config)
running_release = "palm"
def upgrade_from_ironwood(config: Config) -> None:
if not config["RUN_MONGODB"]:
@ -173,3 +177,19 @@ def upgrade_from_maple(context: Context, config: Config) -> None:
k8s.kubectl_exec(
config, "cms", ["sh", "-e", "-c", "./manage.py cms simulate_publish"]
)
def upgrade_from_olive(context: Context, config: Config) -> None:
# Note that we need to exec because the ora2 folder is not bind-mounted in the job
# services.
k8s.kubectl_apply(
context.root,
"--selector",
"app.kubernetes.io/name=lms",
)
k8s.wait_for_deployment_ready(config, "lms")
k8s.kubectl_exec(
config,
"lms",
["sh", "-e", "-c", common_upgrade.PALM_RENAME_ORA2_FOLDER_COMMAND],
)

View File

@ -39,6 +39,10 @@ def upgrade_from(context: click.Context, from_release: str) -> None:
common_upgrade.upgrade_from_nutmeg(context, config)
running_release = "olive"
if running_release == "olive":
upgrade_from_olive(context)
running_release = "palm"
def upgrade_from_ironwood(context: click.Context, config: Config) -> None:
click.echo(fmt.title("Upgrading from Ironwood"))
@ -146,6 +150,17 @@ def upgrade_from_maple(context: click.Context, config: Config) -> None:
)
def upgrade_from_olive(context: click.Context) -> None:
# Note that we need to exec because the ora2 folder is not bind-mounted in the job
# services.
context.invoke(compose.start, detach=True, services=["lms"])
context.invoke(
compose.execute,
args=["lms", "sh", "-e", "-c", common_upgrade.PALM_RENAME_ORA2_FOLDER_COMMAND],
)
context.invoke(compose.stop)
def upgrade_mongodb(
context: click.Context,
config: Config,

View File

@ -161,7 +161,7 @@ class Renderer:
try:
patches.append(self.render_str(patch))
except exceptions.TutorError:
fmt.echo_error(f"Error rendering patch '{name}': {patch}")
fmt.echo_error(f"Error rendering patch '{name}':\n{patch}")
raise
rendered = separator.join(patches)
if rendered:
@ -169,7 +169,10 @@ class Renderer:
return rendered
def render_str(self, text: str) -> str:
template = self.environment.from_string(text)
try:
template = self.environment.from_string(text)
except jinja2.exceptions.TemplateSyntaxError as e:
raise exceptions.TutorError(f"Template syntax error: {e.args[0]}")
return self.__render(template)
def render_template(self, template_name: str) -> t.Union[str, bytes]:
@ -450,6 +453,7 @@ def get_release(version: str) -> str:
"13": "maple",
"14": "nutmeg",
"15": "olive",
"16": "palm",
}[version.split(".", maxsplit=1)[0]]

View File

@ -118,8 +118,10 @@ GRADES_DOWNLOAD = {
},
}
# ORA2
ORA2_FILEUPLOAD_BACKEND = "filesystem"
ORA2_FILEUPLOAD_ROOT = "/openedx/data/ora2"
FILE_UPLOAD_STORAGE_BUCKET_NAME = "openedxuploads"
ORA2_FILEUPLOAD_CACHE_NAME = "ora2-storage"
# Change syslog-based loggers which don't work inside docker containers
@ -135,18 +137,21 @@ LOGGING["handlers"]["tracking"] = {
"formatter": "standard",
}
LOGGING["loggers"]["tracking"]["handlers"] = ["console", "local", "tracking"]
# Silence some loggers (note: we must attempt to get rid of these when upgrading from one release to the next)
# Silence some loggers (note: we must attempt to get rid of these when upgrading from one release to the next)
LOGGING["loggers"]["blockstore.apps.bundles.storage"] = {"handlers": ["console"], "level": "WARNING"}
# These warnings are visible in simple commands and init tasks
import warnings
from django.utils.deprecation import RemovedInDjango40Warning, RemovedInDjango41Warning
warnings.filterwarnings("ignore", category=RemovedInDjango40Warning)
warnings.filterwarnings("ignore", category=RemovedInDjango41Warning)
warnings.filterwarnings("ignore", category=DeprecationWarning, module="lms.djangoapps.course_wiki.plugins.markdownedx.wiki_plugin")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="wiki.plugins.links.wiki_plugin")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="boto.plugin")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="botocore.vendored.requests.packages.urllib3._collections")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="storages.backends.s3boto")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="openedx.core.types.admin")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="pkg_resources")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="fs")
warnings.filterwarnings("ignore", category=DeprecationWarning, module="fs.opener")
SILENCED_SYSTEM_CHECKS = ["2_0.W001", "fields.W903"]
# Email

View File

@ -36,11 +36,6 @@ CACHES["staticfiles"] = {
"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]:

View File

@ -15,9 +15,11 @@ RUN apt update && \
apt install -y libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
ARG PYTHON_VERSION=3.8.12
# https://github.com/pyenv/pyenv/releases
# https://www.python.org/downloads/
ARG PYTHON_VERSION=3.8.15
ENV PYENV_ROOT /opt/pyenv
RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.2.2 --depth 1
RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.17 --depth 1
RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION
RUN $PYENV_ROOT/versions/$PYTHON_VERSION/bin/python -m venv /openedx/venv
@ -38,12 +40,9 @@ RUN git config --global user.email "tutor@overhang.io" \
{{ patch("openedx-dockerfile-git-patches-default") }}
{%- else %}
# Patch edx-platform
# Fix broken Circuit Schematic Builder problem template
# https://github.com/openedx/edx-platform/pull/31365
RUN curl -fsSL https://github.com/openedx/edx-platform/commit/20b93b8b01276edadddfbbb67f15714fddd81c31.patch | git am
{%- endif %}
{# Example: RUN curl -fsSL https://github.com/openedx/edx-platform/commit/<GITSHA1> | git am #}
{# Example: RUN curl -fsSL https://github.com/openedx/edx-platform/commit/<GITSHA1>.patch | git am #}
{{ patch("openedx-dockerfile-post-git-checkout") }}
###### Download extra locales to /openedx/locale/contrib/locale
@ -67,7 +66,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==65.5.1 pip==22.3.1. wheel==0.38.4
RUN pip install setuptools==67.6.1 pip==23.0.1. wheel==0.40.0
# Install base requirements
COPY --from=code /openedx/edx-platform/requirements/edx/base.txt /tmp/base.txt
@ -98,6 +97,7 @@ ENV PATH /openedx/nodeenv/bin:/openedx/venv/bin:${PATH}
# Install nodeenv with the version provided by edx-platform
# https://github.com/openedx/edx-platform/blob/master/requirements/edx/base.txt
# https://github.com/pyenv/pyenv/releases
RUN pip install nodeenv==1.7.0
RUN nodeenv /openedx/nodeenv --node=16.14.0 --prebuilt
@ -224,7 +224,7 @@ USER app
RUN pip install -r requirements/edx/development.txt
# https://pypi.org/project/ipdb/
# https://pypi.org/project/ipython
RUN pip install ipdb==0.13.9 ipython==8.7.0
RUN pip install ipdb==0.13.13 ipython==8.12.0
# Add ipdb as default PYTHONBREAKPOINT
ENV PYTHONBREAKPOINT=ipdb.set_trace

View File

@ -1 +1 @@
EDX_PLATFORM_REVISION: olive
EDX_PLATFORM_REVISION: palm

View File

@ -12,13 +12,13 @@ DOCKER_COMPOSE_VERSION: "3.7"
DOCKER_REGISTRY: "docker.io/"
DOCKER_IMAGE_OPENEDX: "{{ DOCKER_REGISTRY }}overhangio/openedx:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_OPENEDX_DEV: "openedx-dev:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_CADDY: "docker.io/caddy:2.6.3"
DOCKER_IMAGE_ELASTICSEARCH: "docker.io/elasticsearch:7.10.1"
DOCKER_IMAGE_CADDY: "docker.io/caddy:2.6.4"
DOCKER_IMAGE_ELASTICSEARCH: "docker.io/elasticsearch:7.17.9"
DOCKER_IMAGE_MONGODB: "docker.io/mongo:4.2.24"
DOCKER_IMAGE_MYSQL: "docker.io/mysql:5.7.35"
DOCKER_IMAGE_MYSQL: "docker.io/mysql:8.0.33"
DOCKER_IMAGE_PERMISSIONS: "{{ DOCKER_REGISTRY }}overhangio/openedx-permissions:{{ TUTOR_VERSION }}"
DOCKER_IMAGE_REDIS: "docker.io/redis:6.2.6"
DOCKER_IMAGE_SMTP: "docker.io/devture/exim-relay:4.95-r0-2"
DOCKER_IMAGE_REDIS: "docker.io/redis:7.0.11"
DOCKER_IMAGE_SMTP: "docker.io/devture/exim-relay:4.96-r1-0"
EDX_PLATFORM_REPOSITORY: "https://github.com/openedx/edx-platform.git"
EDX_PLATFORM_VERSION: "{{ OPENEDX_COMMON_VERSION }}"
ELASTICSEARCH_HOST: "elasticsearch"
@ -51,9 +51,9 @@ OPENEDX_CMS_UWSGI_WORKERS: 2
OPENEDX_LMS_UWSGI_WORKERS: 2
OPENEDX_MYSQL_DATABASE: "openedx"
OPENEDX_MYSQL_USERNAME: "openedx"
OPENEDX_COMMON_VERSION: "open-release/olive.4"
OPENEDX_COMMON_VERSION: "open-release/palm.master"
OPENEDX_EXTRA_PIP_REQUIREMENTS:
- "openedx-scorm-xblock>=15.0.0,<16.0.0"
- "openedx-scorm-xblock>=16.0.0,<17.0.0"
MYSQL_HOST: "mysql"
MYSQL_PORT: 3306
MYSQL_ROOT_USERNAME: "root"

View File

@ -261,6 +261,19 @@ def check_output(*command: str) -> bytes:
raise exceptions.TutorError(f"Command failed: {literal_command}") from e
def warn_macos_docker_memory() -> None:
try:
check_macos_docker_memory()
except exceptions.TutorError as e:
fmt.echo_alert(
f"""Could not verify sufficient RAM allocation in Docker:
{e}
Tutor may not work if Docker is configured with < 4 GB RAM. Please follow instructions from:
https://docs.tutor.overhang.io/install.html"""
)
def check_macos_docker_memory() -> None:
"""
Try to check that the RAM allocated to the Docker VM on macOS is at least 4 GB.