Skip to content

Commit

Permalink
feat: upgrade to quince
Browse files Browse the repository at this point in the history
  • Loading branch information
ziafazal authored and regisb committed Dec 11, 2023
1 parent 1d63a93 commit c5aef92
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ instructions, because git commits are used to generate release notes:

<!-- scriv-insert-here -->

<a id='changelog-17.0.0'></a>
## v17.0.0 (2023-12-09)

- 💥 [Feature] Upgrade to Quince. (by @ziafazal)

<a id='changelog-16.0.4'></a>
## v16.0.4 (2023-12-11)

Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
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"]},
extras_require={"dev": ["tutor[dev]>=17.0.0,<18.0.0"]},
entry_points={"tutor.plugin.v1": ["ecommerce = tutorecommerce.plugin"]},
classifiers=[
"Development Status :: 5 - Production/Stable",
Expand Down
2 changes: 1 addition & 1 deletion tutorecommerce/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "16.0.4"
__version__ = "17.0.0"
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
26 changes: 13 additions & 13 deletions tutorecommerce/templates/ecommerce/build/ecommerce/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

Expand All @@ -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}

Expand All @@ -62,21 +62,21 @@ 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
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") }}
Expand Down

0 comments on commit c5aef92

Please sign in to comment.