From 0b9c0d3902a92a119ff618863c5c7a5b05c327b5 Mon Sep 17 00:00:00 2001 From: Zia Fazal Date: Fri, 10 Nov 2023 11:39:02 +0500 Subject: [PATCH] feat: upgrade to quince --- .gitlab-ci.yml | 2 +- CHANGELOG.md | 5 ++++ setup.py | 6 ++--- tutorecommerce/__about__.py | 2 +- .../build/ecommerce-worker/Dockerfile | 10 +++---- .../ecommerce/build/ecommerce/Dockerfile | 26 +++++++++---------- 6 files changed, 28 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5d69e491..6d133ad7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ variables: TUTOR_IMAGES: ecommerce ecommerce-worker orders-dev payment-dev TUTOR_PYPI_PACKAGE: tutor-ecommerce TUTOR_EXTRA_ENABLED_PLUGINS: discovery mfe - OPENEDX_RELEASE: palm + OPENEDX_RELEASE: quince GITHUB_REPO: overhangio/tutor-ecommerce include: diff --git a/CHANGELOG.md b/CHANGELOG.md index e18493f9..6b4cf36b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,11 @@ instructions, because git commits are used to generate release notes: + +## v17.0.0 (2023-12-09) + +- 💥 [Feature] Upgrade to Quince. (by @ziafazal) + ## v16.0.4 (2023-12-11) diff --git a/setup.py b/setup.py index 5d8abd2c..0748f33a 100644 --- a/setup.py +++ b/setup.py @@ -34,9 +34,9 @@ include_package_data=True, python_requires=">=3.8", install_requires=[ - "tutor>=16.0.0,<17.0.0", - "tutor-discovery>=16.0.0,<17.0.0", - "tutor-mfe>=16.0.0,<17.0.0", + "tutor>=17.0.0,<18.0.0", + "tutor-discovery>=17.0.0,<18.0.0", + "tutor-mfe>=17.0.0,<18.0.0", ], extras_require={"dev": ["tutor[dev]>=16.0.0,<17.0.0"]}, entry_points={"tutor.plugin.v1": ["ecommerce = tutorecommerce.plugin"]}, diff --git a/tutorecommerce/__about__.py b/tutorecommerce/__about__.py index 08d1d510..a08b09c5 100644 --- a/tutorecommerce/__about__.py +++ b/tutorecommerce/__about__.py @@ -1 +1 @@ -__version__ = "16.0.4" +__version__ = "17.0.0" diff --git a/tutorecommerce/templates/ecommerce/build/ecommerce-worker/Dockerfile b/tutorecommerce/templates/ecommerce/build/ecommerce-worker/Dockerfile index 0c764a97..7cc825e7 100644 --- a/tutorecommerce/templates/ecommerce/build/ecommerce-worker/Dockerfile +++ b/tutorecommerce/templates/ecommerce/build/ecommerce-worker/Dockerfile @@ -1,9 +1,9 @@ -{% 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 -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 git-core language-pack-en python3 python3-pip python3-venv @@ -18,12 +18,12 @@ WORKDIR /openedx/ecommerce_worker # Install python venv 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 -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared {% endif %}pip install -r requirements/production.txt +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared pip install -r requirements/production.txt ENV WORKER_CONFIGURATION_MODULE ecommerce_worker.settings.production CMD celery worker --app=ecommerce_worker.celery_app:app --loglevel=info --maxtasksperchild 100 --queue=fulfillment,email_marketing diff --git a/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile b/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile index 4399be0e..b4f56b92 100644 --- a/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile +++ b/tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile @@ -1,9 +1,9 @@ -{% 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 -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 language-pack-en @@ -28,8 +28,8 @@ COPY --from=checkout /openedx/ecommerce / ###### Install python and virtual environment FROM minimal as python -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 libmysqlclient-dev libssl-dev python3 python3-pip python3-venv @@ -44,15 +44,15 @@ RUN mkdir /openedx/.cache # Create python venv RUN python3 -m venv /openedx/venv/ ENV PATH "/openedx/venv/bin:$PATH" -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} {% endif %}pip install \ +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} 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 # https://pypi.org/project/nodeenv -RUN pip install nodeenv==1.7.0 +RUN pip install nodeenv==1.8.0 RUN nodeenv /openedx/nodeenv --node=16.20.0 --prebuilt ENV PATH /openedx/nodeenv/bin:${PATH} @@ -62,13 +62,13 @@ WORKDIR /openedx/ecommerce # 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 -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 +RUN --mount=type=cache,target=/openedx/.npm/,sharing=shared,uid=${APP_USER_ID} npm clean-install --verbose --no-audit --registry=$NPM_REGISTRY +RUN --mount=type=cache,target=/openedx/.cache/bower,sharing=shared,uid=${APP_USER_ID} node_modules/.bin/bower install --allow-root # python requirements -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} {% endif %}pip install -r requirements.txt +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install -r requirements.txt # https://pypi.org/project/uWSGI/ -RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} {% endif %}pip install uwsgi==2.0.21 +RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install uwsgi==2.0.21 # Install private requirements: this is useful for installing custom payment processors. COPY --chown=app:app ./requirements/ /openedx/requirements @@ -76,7 +76,7 @@ RUN cd /openedx/requirements/ \ && touch ./private.txt \ && pip install -r ./private.txt -{% for extra_requirement in ECOMMERCE_EXTRA_PIP_REQUIREMENTS %}RUN {% if is_buildkit_enabled() %}--mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} {% endif %}pip install '{{ extra_requirement }}' +{% for extra_requirement in ECOMMERCE_EXTRA_PIP_REQUIREMENTS %}RUN --mount=type=cache,target=/openedx/.cache/pip,sharing=shared,uid=${APP_USER_ID} pip install '{{ extra_requirement }}' {% endfor %} {{ patch("ecommerce-dockerfile-pre-assets") }}