From 52af6adb578716c0951c30f0fe394c9f7e653538 Mon Sep 17 00:00:00 2001 From: Zia Fazal Date: Fri, 10 Nov 2023 11:39:46 +0500 Subject: [PATCH] feat: upgrade to quince --- .gitlab-ci.yml | 2 +- CHANGELOG.md | 7 +++++ README.rst | 10 ++----- changelog.d/20230908_095220_regis_nightly.md | 1 - changelog.d/20230909_160414_i_atlas.md | 1 - setup.py | 4 +-- tutordiscovery/__about__.py | 2 +- tutordiscovery/plugin.py | 1 + .../apps/settings/partials/common.py | 1 + .../discovery/build/discovery/Dockerfile | 26 +++++++++---------- 10 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 changelog.d/20230908_095220_regis_nightly.md delete mode 100644 changelog.d/20230909_160414_i_atlas.md diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4efbf80..5846bc7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: TUTOR_PLUGIN: discovery TUTOR_IMAGES: discovery TUTOR_PYPI_PACKAGE: tutor-discovery - OPENEDX_RELEASE: palm + OPENEDX_RELEASE: quince GITHUB_REPO: overhangio/tutor-discovery include: diff --git a/CHANGELOG.md b/CHANGELOG.md index 7544ff3..5b0971d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,13 @@ instructions, because git commits are used to generate release notes: + +## v17.0.0 (2023-12-09) + +- 💥 [Feature] Upgrade to Quince. (by @ziafazal) +- [Bugfix] Fix missing pkg-config during image build. (by @regisb) +- [Feature] Pull translations via `atlas` during Docker build. (by @OmarIthawi) + ## v16.0.2 (2023-12-09) diff --git a/README.rst b/README.rst index 15d684f..c32c34d 100644 --- a/README.rst +++ b/README.rst @@ -14,15 +14,9 @@ Then, to enable this plugin, run:: tutor plugins enable discovery -You will have to re-generate the environment:: +Restart and initialize your platform with:: - tutor config save - -Then, run migrations:: - - tutor local init - -This last step is unnecessary if you run instead ``tutor local launch``. + tutor local launch Operations ---------- diff --git a/changelog.d/20230908_095220_regis_nightly.md b/changelog.d/20230908_095220_regis_nightly.md deleted file mode 100644 index 954a6ea..0000000 --- a/changelog.d/20230908_095220_regis_nightly.md +++ /dev/null @@ -1 +0,0 @@ -- [Bugfix] Fix missing pkg-config during image build. (by @regisb) diff --git a/changelog.d/20230909_160414_i_atlas.md b/changelog.d/20230909_160414_i_atlas.md deleted file mode 100644 index d0fa4a7..0000000 --- a/changelog.d/20230909_160414_i_atlas.md +++ /dev/null @@ -1 +0,0 @@ -- [Feature] Pull translations via `atlas` during Docker build. (by @OmarIthawi) diff --git a/setup.py b/setup.py index 79ac5da..df41c83 100644 --- a/setup.py +++ b/setup.py @@ -34,8 +34,8 @@ setup( long_description_content_type="text/x-rst", packages=find_packages(exclude=["tests*"]), include_package_data=True, - install_requires=["tutor>=16.0.0,<17.0.0"], - extras_require={"dev": "tutor[dev]>=16.0.0,<17.0.0"}, + install_requires=["tutor>=17.0.0,<18.0.0"], + extras_require={"dev": "tutor[dev]>=17.0.0,<18.0.0"}, python_requires=">=3.8", entry_points={"tutor.plugin.v1": ["discovery = tutordiscovery.plugin"]}, classifiers=[ diff --git a/tutordiscovery/__about__.py b/tutordiscovery/__about__.py index eabf3d3..a08b09c 100644 --- a/tutordiscovery/__about__.py +++ b/tutordiscovery/__about__.py @@ -1 +1 @@ -__version__ = "16.0.2" +__version__ = "17.0.0" diff --git a/tutordiscovery/plugin.py b/tutordiscovery/plugin.py index 58b297e..a889c12 100644 --- a/tutordiscovery/plugin.py +++ b/tutordiscovery/plugin.py @@ -32,6 +32,7 @@ config: t.Dict[str, t.Dict[str, t.Any]] = { "OAUTH2_KEY_SSO_DEV": "discovery-sso-dev", "CACHE_REDIS_DB": "{{ OPENEDX_CACHE_REDIS_DB }}", "ATLAS_PULL": False, + "DEFAULT_PRODUCT_SOURCE_SLUG": "edx", "EXTRA_PIP_REQUIREMENTS": [], "REPOSITORY": "https://github.com/openedx/course-discovery.git", "REPOSITORY_VERSION": "{{ OPENEDX_COMMON_VERSION }}", diff --git a/tutordiscovery/templates/discovery/apps/settings/partials/common.py b/tutordiscovery/templates/discovery/apps/settings/partials/common.py index ae2ef61..4cd4758 100644 --- a/tutordiscovery/templates/discovery/apps/settings/partials/common.py +++ b/tutordiscovery/templates/discovery/apps/settings/partials/common.py @@ -47,6 +47,7 @@ PARLER_LANGUAGES[1][0]["code"] = LANGUAGE_CODE PARLER_LANGUAGES["default"]["fallbacks"] = [PARLER_DEFAULT_LANGUAGE_CODE] EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" +DEFAULT_PRODUCT_SOURCE_SLUG = "{{ DISCOVERY_DEFAULT_PRODUCT_SOURCE_SLUG }}" EMAIL_HOST = "{{ SMTP_HOST }}" EMAIL_PORT = "{{ SMTP_PORT }}" EMAIL_HOST_USER = "{{ SMTP_USERNAME }}" diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index e7cfc4a..dbc66e8 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -1,10 +1,10 @@ -{% if is_buildkit_enabled() %}# syntax=docker/dockerfile:1.4{% endif %} +# syntax=docker/dockerfile:1.4 ###### Minimal image with base system requirements for most stages FROM docker.io/ubuntu:20.04 as minimal ENV DEBIAN_FRONTEND=noninteractive -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/var/cache/apt,sharing=locked \ - --mount=type=cache,target=/var/lib/apt,sharing=locked{% endif %} \ +RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ + --mount=type=cache,target=/var/lib/apt,sharing=locked \ apt update && \ apt install -y curl git-core gettext language-pack-en python3 python3-dev python3-pip python3-venv \ build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \ @@ -31,14 +31,14 @@ ENV DISCOVERY_CFG /openedx/config.yml RUN python3 -m venv ../venv/ ENV PATH "/openedx/venv/bin:$PATH" -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install \ +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install \ # https://pypi.org/project/setuptools/ # https://pypi.org/project/pip/ # https://pypi.org/project/wheel/ - setuptools==67.7.2 pip==23.1.2. wheel==0.40.0 + setuptools==68.2.2 pip==23.2.1. wheel==0.41.2 # Install a recent version of nodejs -RUN pip install nodeenv==1.7.0 +RUN pip install nodeenv==1.8.0 # nodejs version picked from https://github.com/openedx/course-discovery/blob/master/Dockerfile RUN nodeenv /openedx/nodeenv --node=16.14.2 --prebuilt ENV PATH /openedx/nodeenv/bin:${PATH} @@ -47,21 +47,21 @@ ENV PATH /openedx/nodeenv/bin:${PATH} # This is identical to "make production-requirements" but it was split in multiple # instructions to benefit from docker image caching # Install base requirements -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install -r requirements.txt -{% for extra_requirement in DISCOVERY_EXTRA_PIP_REQUIREMENTS %}RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install '{{ extra_requirement }}' +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install -r requirements.txt +{% for extra_requirement in DISCOVERY_EXTRA_PIP_REQUIREMENTS %}RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install '{{ extra_requirement }}' {% endfor %} # Install npm, bower requirements ARG NPM_REGISTRY='{{ NPM_REGISTRY }}' -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.npm/,sharing=shared,uid=${APP_USER_ID} {% endif %}npm clean-install --verbose --no-audit --registry=$NPM_REGISTRY --production -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/bower,sharing=shared,uid=${APP_USER_ID} {% endif %}./node_modules/.bin/bower install --allow-root --production +RUN --mount=type=cache,target=/openedx/.npm/,sharing=shared,uid=${APP_USER_ID} npm clean-install --verbose --no-audit --registry=$NPM_REGISTRY --production +RUN --mount=type=cache,target=/openedx/.cache/bower,sharing=shared,uid=${APP_USER_ID} ./node_modules/.bin/bower install --allow-root --production # Install extra requirements -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install \ +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install \ # Use redis as a django cache https://pypi.org/project/django-redis/ - django-redis==5.2.0 \ + django-redis==5.4.0 \ # uwsgi server https://pypi.org/project/uWSGI/ - uwsgi==2.0.21 + uwsgi==2.0.22 {% if DISCOVERY_ATLAS_PULL %} # Pull translations. Support the OEP-58 proposal behind a feature flag until it's fully implemented.