From 213e4dbc0d4b61041f343c36aecebb8f4761ce6b Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Thu, 14 Mar 2024 13:12:07 +0500 Subject: [PATCH 1/7] enhancement: upgrade python version to 3 .12.2 --- .../discovery/build/discovery/Dockerfile | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index d983f11..da238be 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -6,7 +6,7 @@ ENV DEBIAN_FRONTEND=noninteractive 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 \ + apt install -y curl git-core gettext language-pack-en \ build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \ pkg-config ENV LC_ALL en_US.UTF-8 @@ -27,15 +27,26 @@ WORKDIR /openedx/discovery RUN echo "{}" > /openedx/config.yml ENV DISCOVERY_CFG /openedx/config.yml -# Install python venv -RUN python3 -m venv ../venv/ +# Install pyenv +# https://www.python.org/downloads/ +# https://github.com/pyenv/pyenv/releases +ARG PYTHON_VERSION=3.12.2 +ENV PYENV_ROOT /opt/pyenv +USER root +RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1 +# Install Python +RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION +USER app + +# Create virtualenv +RUN $PYENV_ROOT/versions/$PYTHON_VERSION/bin/python -m venv /openedx/venv ENV PATH "/openedx/venv/bin:$PATH" 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==68.2.2 pip==23.2.1. wheel==0.41.2 + setuptools==69.1.1 pip==24.0 wheel==0.43.0 # Install a recent version of nodejs RUN pip install nodeenv==1.8.0 @@ -61,7 +72,7 @@ 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.4.0 \ # uwsgi server https://pypi.org/project/uWSGI/ - uwsgi==2.0.22 + uwsgi==2.0.24 {% if DISCOVERY_ATLAS_PULL %} # Pull translations. Support the OEP-58 proposal behind a feature flag until it's fully implemented. From 2f9effded9eeecdc7822320f92d38317135076ec Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Thu, 14 Mar 2024 13:13:16 +0500 Subject: [PATCH 2/7] add changelog entry --- .../20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md diff --git a/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md b/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md new file mode 100644 index 0000000..ac6d392 --- /dev/null +++ b/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md @@ -0,0 +1 @@ +- 💥[Feature] Upgrade Python version to 3.12.2. (by @Faraz32123) \ No newline at end of file From d27b7523e1efd982bb96a8e94af2291b65e2e26c Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Mon, 18 Mar 2024 12:09:06 +0500 Subject: [PATCH 3/7] fix: fix compile messages error ModuleNotFoundError: No module named '_sqlite3' fixed above error on line >>> RUN python manage.py compilemessages --- tutordiscovery/templates/discovery/build/discovery/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index da238be..a864a03 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -8,7 +8,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ apt update && \ apt install -y curl git-core gettext language-pack-en \ build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \ - pkg-config + pkg-config libsqlite3-dev ENV LC_ALL en_US.UTF-8 ARG APP_USER_ID=1000 From 34691b58e2a1bb1f51f84989a4b2a3af5f7ff193 Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Mon, 8 Apr 2024 13:20:10 +0500 Subject: [PATCH 4/7] docs: add a comment explaining the need of root user => [minimal 7/19] RUN echo "{}" > /openedx/config.yml 0.2s => ERROR [minimal 8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1 0.4s ------ > importing cache manifest from docker.io/overhangio/openedx-discovery:17.0.0-nightly-cache: ------ ------ > [minimal 8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1: 0.341 fatal: could not create work tree dir '/opt/pyenv': Permission denied ------ Dockerfile:36 -------------------- 34 | ENV PYENV_ROOT /opt/pyenv 35 | # USER root 36 | >>> RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1 37 | # Install Python 38 | RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION -------------------- ERROR: failed to solve: process "/bin/sh -c git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1" did not complete successfully: exit code: 128 --- tutordiscovery/templates/discovery/build/discovery/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index a864a03..45d41ef 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -32,6 +32,7 @@ ENV DISCOVERY_CFG /openedx/config.yml # https://github.com/pyenv/pyenv/releases ARG PYTHON_VERSION=3.12.2 ENV PYENV_ROOT /opt/pyenv +# root user is required for below 2 steps, as app user gets permission denied. USER root RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1 # Install Python From f4ccdf0f957750517253eb82be85d1dc186c11af Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Tue, 14 May 2024 14:00:23 +0500 Subject: [PATCH 5/7] feat: upgrade to redwood --- changelog.d/20240514_135854_faraz.maqsood_redwood.md | 1 + setup.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/20240514_135854_faraz.maqsood_redwood.md diff --git a/changelog.d/20240514_135854_faraz.maqsood_redwood.md b/changelog.d/20240514_135854_faraz.maqsood_redwood.md new file mode 100644 index 0000000..b63f78c --- /dev/null +++ b/changelog.d/20240514_135854_faraz.maqsood_redwood.md @@ -0,0 +1 @@ +- 💥[Feature] Upgrade to Redwood. (by @Faraz32123) diff --git a/setup.py b/setup.py index df41c83..1117874 100644 --- a/setup.py +++ b/setup.py @@ -34,8 +34,8 @@ long_description_content_type="text/x-rst", packages=find_packages(exclude=["tests*"]), include_package_data=True, - install_requires=["tutor>=17.0.0,<18.0.0"], - extras_require={"dev": "tutor[dev]>=17.0.0,<18.0.0"}, + install_requires=["tutor>=18.0.0,<19.0.0"], + extras_require={"dev": "tutor[dev]>=18.0.0,<19.0.0"}, python_requires=">=3.8", entry_points={"tutor.plugin.v1": ["discovery = tutordiscovery.plugin"]}, classifiers=[ From e63be4fcc3372c81f0c2acde2cc7a72060af648b Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Tue, 14 May 2024 14:02:26 +0500 Subject: [PATCH 6/7] fix: wrong mime type by adding mime-support The admin's stylesheets e.g.https://{{DISCOVERY_HOST}}/static/admin/css/base.css, were not loaded because its MIME type appears to be "text/plain", It should be "text/css". --- changelog.d/20240514_140102_faraz.maqsood_redwood.md | 1 + tutordiscovery/templates/discovery/build/discovery/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20240514_140102_faraz.maqsood_redwood.md diff --git a/changelog.d/20240514_140102_faraz.maqsood_redwood.md b/changelog.d/20240514_140102_faraz.maqsood_redwood.md new file mode 100644 index 0000000..92cac76 --- /dev/null +++ b/changelog.d/20240514_140102_faraz.maqsood_redwood.md @@ -0,0 +1 @@ +- [BugFix] wrong mime type by adding mime-support dependency. (by @Faraz32123) diff --git a/tutordiscovery/templates/discovery/build/discovery/Dockerfile b/tutordiscovery/templates/discovery/build/discovery/Dockerfile index 45d41ef..b2210d8 100644 --- a/tutordiscovery/templates/discovery/build/discovery/Dockerfile +++ b/tutordiscovery/templates/discovery/build/discovery/Dockerfile @@ -8,7 +8,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ apt update && \ apt install -y curl git-core gettext language-pack-en \ build-essential libcairo2 libffi-dev libmysqlclient-dev libxml2-dev libxslt-dev libjpeg-dev libssl-dev \ - pkg-config libsqlite3-dev + pkg-config libsqlite3-dev mime-support ENV LC_ALL en_US.UTF-8 ARG APP_USER_ID=1000 From 48c13d710535620a8df14de3bf5f95b8cf1c2b1d Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Tue, 14 May 2024 14:07:25 +0500 Subject: [PATCH 7/7] v18.0.0 --- CHANGELOG.md | 7 +++++++ ...40314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md | 1 - changelog.d/20240514_135854_faraz.maqsood_redwood.md | 1 - changelog.d/20240514_140102_faraz.maqsood_redwood.md | 1 - tutordiscovery/__about__.py | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) delete mode 100644 changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md delete mode 100644 changelog.d/20240514_135854_faraz.maqsood_redwood.md delete mode 100644 changelog.d/20240514_140102_faraz.maqsood_redwood.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 058501a..faf3be1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,13 @@ instructions, because git commits are used to generate release notes: + +## v18.0.0 (2024-05-14) + +- 💥[Feature] Upgrade to Redwood. (by @Faraz32123) +- 💥[Feature] Upgrade Python version to 3.12.2. (by @Faraz32123) +- [BugFix] Fix wrong mime type by adding mime-support dependency. (by @Faraz32123) + ## v17.0.1 (2024-04-25) diff --git a/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md b/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md deleted file mode 100644 index ac6d392..0000000 --- a/changelog.d/20240314_131222_faraz.maqsood_python_upgrade_to_v3_12_2.md +++ /dev/null @@ -1 +0,0 @@ -- 💥[Feature] Upgrade Python version to 3.12.2. (by @Faraz32123) \ No newline at end of file diff --git a/changelog.d/20240514_135854_faraz.maqsood_redwood.md b/changelog.d/20240514_135854_faraz.maqsood_redwood.md deleted file mode 100644 index b63f78c..0000000 --- a/changelog.d/20240514_135854_faraz.maqsood_redwood.md +++ /dev/null @@ -1 +0,0 @@ -- 💥[Feature] Upgrade to Redwood. (by @Faraz32123) diff --git a/changelog.d/20240514_140102_faraz.maqsood_redwood.md b/changelog.d/20240514_140102_faraz.maqsood_redwood.md deleted file mode 100644 index 92cac76..0000000 --- a/changelog.d/20240514_140102_faraz.maqsood_redwood.md +++ /dev/null @@ -1 +0,0 @@ -- [BugFix] wrong mime type by adding mime-support dependency. (by @Faraz32123) diff --git a/tutordiscovery/__about__.py b/tutordiscovery/__about__.py index dba3a77..c6a8b8e 100644 --- a/tutordiscovery/__about__.py +++ b/tutordiscovery/__about__.py @@ -1 +1 @@ -__version__ = "17.0.1" +__version__ = "18.0.0"