From ea3839eb74f981addfca7c7215d71c0bfd9dce40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 3 Sep 2020 17:33:25 +0200 Subject: [PATCH] Introduce the `OPENEDX_COMMON_VERSION` setting --- CHANGELOG.md | 1 + docs/configuration.rst | 5 +++++ tutor/templates/build/forum/Dockerfile | 2 +- tutor/templates/build/openedx/Dockerfile | 2 +- tutor/templates/config.yml | 1 + tutor/templates/hooks/cms/importdemocourse | 2 +- 6 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index adb3bbb..562ff92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Note: Breaking changes between versions are indicated by "💥". ## Unreleased +- [Improvement] Introduce the `OPENEDX_COMMON_VERSION` setting - [Bugfix] Make it possible to run init jobs without starting the entire platform - [Improvement] Reduce "openedx" Docker image size with static asset de-duplication diff --git a/docs/configuration.rst b/docs/configuration.rst index 48b0533..5245c03 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -81,11 +81,16 @@ You may want to pull/push images from/to a custom docker registry. For instance, Open edX customisation ~~~~~~~~~~~~~~~~~~~~~~ +- ``OPENEDX_COMMON_VERSION`` (default: ``"open-release/juniper.3"``) + +This defines the default version that will be pulled from all Open edX git repositories. + - ``OPENEDX_CMS_GUNICORN_WORKERS`` (default: ``2``) - ``OPENEDX_LMS_GUNICORN_WORKERS`` (default: ``2``) By default there are 2 `gunicorn worker processes `__ to serve requests for the LMS and the CMS. However, each workers requires upwards of 500 Mb of RAM. You should reduce this value to 1 if your computer/server does not have enough memory. + Vendor services ~~~~~~~~~~~~~~~ diff --git a/tutor/templates/build/forum/Dockerfile b/tutor/templates/build/forum/Dockerfile index fc2d38d..c8ce370 100644 --- a/tutor/templates/build/forum/Dockerfile +++ b/tutor/templates/build/forum/Dockerfile @@ -30,7 +30,7 @@ RUN gem install bundler -v $BUNDLER_VERSION RUN gem install rake -v $RAKE_VERSION # Install forum -RUN git clone https://github.com/edx/cs_comments_service.git --branch open-release/juniper.3 --depth 1 /openedx/cs_comments_service +RUN git clone https://github.com/edx/cs_comments_service.git --branch {{ OPENEDX_COMMON_VERSION }} --depth 1 /openedx/cs_comments_service WORKDIR /openedx/cs_comments_service RUN bundle install --deployment diff --git a/tutor/templates/build/openedx/Dockerfile b/tutor/templates/build/openedx/Dockerfile index ead920f..c0b2787 100644 --- a/tutor/templates/build/openedx/Dockerfile +++ b/tutor/templates/build/openedx/Dockerfile @@ -28,7 +28,7 @@ RUN curl -L -o /tmp/dockerize.tar.gz https://github.com/jwilder/dockerize/releas ###### Checkout edx-platform code FROM minimal as code ARG EDX_PLATFORM_REPOSITORY=https://github.com/edx/edx-platform.git -ARG EDX_PLATFORM_VERSION=open-release/juniper.3 +ARG EDX_PLATFORM_VERSION={{ OPENEDX_COMMON_VERSION }} RUN mkdir -p /openedx/edx-platform && \ git clone $EDX_PLATFORM_REPOSITORY --branch $EDX_PLATFORM_VERSION --depth 1 /openedx/edx-platform WORKDIR /openedx/edx-platform diff --git a/tutor/templates/config.yml b/tutor/templates/config.yml index 50a943c..5f09585 100644 --- a/tutor/templates/config.yml +++ b/tutor/templates/config.yml @@ -64,6 +64,7 @@ OPENEDX_LMS_GUNICORN_WORKERS: 2 OPENEDX_MYSQL_DATABASE: "openedx" OPENEDX_CSMH_MYSQL_DATABASE: "{{ OPENEDX_MYSQL_DATABASE }}_csmh" OPENEDX_MYSQL_USERNAME: "openedx" +OPENEDX_COMMON_VERSION: "open-release/juniper.3" MYSQL_HOST: "mysql" MYSQL_PORT: 3306 MYSQL_ROOT_USERNAME: "root" diff --git a/tutor/templates/hooks/cms/importdemocourse b/tutor/templates/hooks/cms/importdemocourse index 7a7602f..c3297d8 100644 --- a/tutor/templates/hooks/cms/importdemocourse +++ b/tutor/templates/hooks/cms/importdemocourse @@ -1,7 +1,7 @@ echo "Loading settings $DJANGO_SETTINGS_MODULE" # Import demo course -git clone https://github.com/edx/edx-demo-course --branch open-release/juniper.3 --depth 1 ../edx-demo-course +git clone https://github.com/edx/edx-demo-course --branch {{ OPENEDX_COMMON_VERSION }} --depth 1 ../edx-demo-course python ./manage.py cms import ../data ../edx-demo-course # Re-index courses