From f9fcbf26f4f30466033ded80c04c12cc27d8b4d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 17 Oct 2024 08:35:13 +0200 Subject: [PATCH 1/6] docs: *.local.edly.io -> *.local.openedx.io The default URL to run a local platform switched from local.edly.io to local.openedx.io. This changes makes it clearer for everyone that Tutor is to run Open edX. See: https://github.com/overhangio/tutor/issues/1120 --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 88efce5..33f9c67 100644 --- a/README.rst +++ b/README.rst @@ -23,7 +23,7 @@ Then, to make migrations & tasks:: You should beware that the ``notes.`` domain name should exist and point to your server. For instance, if your LMS is hosted at http://myopenedx.com, the notes service should be found at http://notes.myopenedx.com. -If you would like to host the notes service at a different domain name, you can set the ``NOTES_HOST`` configuration variable (see below). When testing Tutor on a local computer, this will be automatically set to notes.local.edly.io. +If you would like to host the notes service at a different domain name, you can set the ``NOTES_HOST`` configuration variable (see below). When testing Tutor on a local computer, this will be automatically set to notes.local.openedx.io. To enable student notes for a specific course, you should go to the course advanced settings in the studio, and set "Enable Student Notes" to "true". Then, hit "save changes". From fdf73b62e3a3931578f5236c21e5f2e1f51fe6c6 Mon Sep 17 00:00:00 2001 From: Jhony Avella Date: Tue, 22 Oct 2024 16:07:32 -0500 Subject: [PATCH 2/6] Ubuntu 24.04 Upgrade (#39) * chore: notes service now uses ubuntu 24.04 as base image * chore: using 1000 UID. Updating setuptools * chore: adding changelog entry --- ...241022_103249_jhony.avella_ubuntu_24_04.md | 1 + .../templates/notes/build/notes/Dockerfile | 23 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md diff --git a/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md b/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md new file mode 100644 index 0000000..e9b30a6 --- /dev/null +++ b/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md @@ -0,0 +1 @@ +- 💥[Feature] Update Notes Image to use Ubuntu 24.04 as base OS. (by @jfavellar90) diff --git a/tutornotes/templates/notes/build/notes/Dockerfile b/tutornotes/templates/notes/build/notes/Dockerfile index 4fea8b4..7bd90db 100644 --- a/tutornotes/templates/notes/build/notes/Dockerfile +++ b/tutornotes/templates/notes/build/notes/Dockerfile @@ -1,21 +1,24 @@ # syntax=docker/dockerfile:1.4 -FROM docker.io/python:3.12-slim-bookworm +FROM docker.io/ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive + +# Delete default UID=1000 `ubuntu` user to ensure we can use id 1000 for app user +RUN userdel -r ubuntu + RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ --mount=type=cache,target=/var/lib/apt,sharing=locked \ apt update && \ apt upgrade -y && \ apt install -y \ - locales \ + language-pack-en \ git \ - python3-dev \ - build-essential \ - default-libmysqlclient-dev \ - pkg-config && \ - sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ - locale-gen -ENV LC_ALL=en_US.UTF-8 + python3 \ + python3-pip \ + python3-venv \ + libmysqlclient-dev \ + pkg-config +RUN ln -s /usr/bin/python3 /usr/bin/python ###### Git-clone Notes repo ###### ARG APP_USER_ID=1000 @@ -31,7 +34,7 @@ ENV PATH=/app/venv/bin:${PATH} # https://pypi.org/project/setuptools/ # https://pypi.org/project/pip/ # https://pypi.org/project/wheel/ -RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install setuptools==69.2.0 pip==24.0 wheel==0.43.0 +RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install setuptools==75.2.0 pip==24.2 wheel==0.44.0 RUN --mount=type=cache,target=/app/.cache/pip,sharing=shared pip install -r requirements/base.txt EXPOSE 8000 From e5fedc2d83ec5d17dfb25bb1411f8dcbeb375b12 Mon Sep 17 00:00:00 2001 From: jfavellar90 Date: Thu, 24 Oct 2024 08:34:35 -0500 Subject: [PATCH 3/6] feat: upgrade to sumac --- CHANGELOG.md | 9 +++++++++ README.rst | 4 ++-- changelog.d/20240621_170044_regis.md | 1 - changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md | 1 - setup.py | 4 ++-- tutornotes/__about__.py | 2 +- 6 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 changelog.d/20240621_170044_regis.md delete mode 100644 changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md diff --git a/CHANGELOG.md b/CHANGELOG.md index d189b79..0dfe56b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,15 @@ instructions, because git commits are used to generate release notes: + +## v19.0.0 (2024-10-24) + +- [Bugfix] Fix legacy warnings during Docker build. (by @regisb) + +- 💥[Feature] Update Notes Image to use Ubuntu 24.04 as base OS. (by @jfavellar90) + +- 💥[Feature] Upgrade to Sumac. (by @jfavellar90) + ## v18.0.0 (2024-05-09) diff --git a/README.rst b/README.rst index 239c3c9..fa15a85 100644 --- a/README.rst +++ b/README.rst @@ -1,9 +1,9 @@ Students notes plugin for `Tutor `_ =================================================================== -This is a plugin for `Tutor `_ to easily add the `Open edX note-taking app `_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation `_). +This is a plugin for `Tutor `_ to easily add the `Open edX note-taking app `_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation `_). -.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-redwood.master/_images/SFD_SN_bodyexample.png +.. image:: https://docs.openedx.org/en/latest/_images/SFD_SN_bodyexample.png :alt: Notes in action Installation diff --git a/changelog.d/20240621_170044_regis.md b/changelog.d/20240621_170044_regis.md deleted file mode 100644 index d7d2eb7..0000000 --- a/changelog.d/20240621_170044_regis.md +++ /dev/null @@ -1 +0,0 @@ -- [Bugfix] Fix legacy warnings during Docker build. (by @regisb) diff --git a/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md b/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md deleted file mode 100644 index e9b30a6..0000000 --- a/changelog.d/20241022_103249_jhony.avella_ubuntu_24_04.md +++ /dev/null @@ -1 +0,0 @@ -- 💥[Feature] Update Notes Image to use Ubuntu 24.04 as base OS. (by @jfavellar90) diff --git a/setup.py b/setup.py index 00ddcff..a122e8c 100644 --- a/setup.py +++ b/setup.py @@ -33,8 +33,8 @@ packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.9", - install_requires=["tutor>=18.0.0,<19.0.0"], - extras_require={"dev": ["tutor[dev]>=18.0.0,<19.0.0"]}, + install_requires=["tutor>=19.0.0,<20.0.0"], + extras_require={"dev": ["tutor[dev]>=19.0.0,<20.0.0"]}, entry_points={"tutor.plugin.v1": ["notes = tutornotes.plugin"]}, classifiers=[ "Development Status :: 5 - Production/Stable", diff --git a/tutornotes/__about__.py b/tutornotes/__about__.py index c6a8b8e..0122a6f 100644 --- a/tutornotes/__about__.py +++ b/tutornotes/__about__.py @@ -1 +1 @@ -__version__ = "18.0.0" +__version__ = "19.0.0" From a61e09c11e5202dabde25d51341233741097ae96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 17 Oct 2024 22:59:42 +0200 Subject: [PATCH 4/6] fix: actually mount notes directory Notes directory could be added via `tutor mounts add ./edx-notes-api`, but it was not actually being mounted. --- changelog.d/20241017_233457_regis_meilisearch.md | 1 + tutornotes/patches/local-docker-compose-jobs-services | 3 +++ tutornotes/patches/local-docker-compose-services | 3 +++ tutornotes/templates/notes/apps/settings/tutor.py | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog.d/20241017_233457_regis_meilisearch.md diff --git a/changelog.d/20241017_233457_regis_meilisearch.md b/changelog.d/20241017_233457_regis_meilisearch.md new file mode 100644 index 0000000..e21cac3 --- /dev/null +++ b/changelog.d/20241017_233457_regis_meilisearch.md @@ -0,0 +1 @@ +- [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb) diff --git a/tutornotes/patches/local-docker-compose-jobs-services b/tutornotes/patches/local-docker-compose-jobs-services index 0dc5f79..efbd8db 100644 --- a/tutornotes/patches/local-docker-compose-jobs-services +++ b/tutornotes/patches/local-docker-compose-jobs-services @@ -4,4 +4,7 @@ notes-job: DJANGO_SETTINGS_MODULE: notesserver.settings.tutor volumes: - ../plugins/notes/apps/settings/tutor.py:/app/edx-notes-api/notesserver/settings/tutor.py:ro + {%- for mount in iter_mounts(MOUNTS, "notes") %} + - {{ mount }} + {%- endfor %} depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} diff --git a/tutornotes/patches/local-docker-compose-services b/tutornotes/patches/local-docker-compose-services index e55c40e..ec6b37a 100644 --- a/tutornotes/patches/local-docker-compose-services +++ b/tutornotes/patches/local-docker-compose-services @@ -6,5 +6,8 @@ notes: volumes: - ../plugins/notes/apps/settings/tutor.py:/app/edx-notes-api/notesserver/settings/tutor.py:ro - ../../data/notes:/app/data + {%- for mount in iter_mounts(MOUNTS, "notes") %} + - {{ mount }} + {%- endfor %} restart: unless-stopped depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} diff --git a/tutornotes/templates/notes/apps/settings/tutor.py b/tutornotes/templates/notes/apps/settings/tutor.py index 18e0623..35b0b34 100644 --- a/tutornotes/templates/notes/apps/settings/tutor.py +++ b/tutornotes/templates/notes/apps/settings/tutor.py @@ -10,7 +10,7 @@ "default": { "ENGINE": "django.db.backends.mysql", "HOST": "{{ MYSQL_HOST }}", - "PORT": {{MYSQL_PORT}}, + "PORT": {{ MYSQL_PORT }}, "NAME": "{{ NOTES_MYSQL_DATABASE }}", "USER": "{{ NOTES_MYSQL_USERNAME }}", "PASSWORD": "{{ NOTES_MYSQL_PASSWORD }}", From 6e8bc34475b6eb96978655af20cbdfbd96062c20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Thu, 17 Oct 2024 23:54:15 +0200 Subject: [PATCH 5/6] feat: migrate to Meilisearch We make use of a new search engine to search annotations. The index will automatically be created and filled during init. This is considered a breaking change if you have customised your notes index. --- changelog.d/20241017_233457_regis_meilisearch.md | 1 + tutornotes/templates/notes/apps/settings/tutor.py | 11 ++++++----- tutornotes/templates/notes/tasks/notes/init | 4 +++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/changelog.d/20241017_233457_regis_meilisearch.md b/changelog.d/20241017_233457_regis_meilisearch.md index e21cac3..33808d4 100644 --- a/changelog.d/20241017_233457_regis_meilisearch.md +++ b/changelog.d/20241017_233457_regis_meilisearch.md @@ -1 +1,2 @@ - [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb) +- 💥[Feature] Replace Elasticsearch by Meilisearch. The implementation is much more compact and readable. All content will be automatically re-indexed during init. (by @regisb) diff --git a/tutornotes/templates/notes/apps/settings/tutor.py b/tutornotes/templates/notes/apps/settings/tutor.py index 35b0b34..be75dd4 100644 --- a/tutornotes/templates/notes/apps/settings/tutor.py +++ b/tutornotes/templates/notes/apps/settings/tutor.py @@ -23,11 +23,12 @@ CLIENT_ID = "notes" CLIENT_SECRET = "{{ NOTES_OAUTH2_SECRET }}" -ELASTICSEARCH_DSL = { - 'default': { - 'hosts': '{{ ELASTICSEARCH_SCHEME }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}' - } -} +# Meilisearch credentials +ES_DISABLED = True +MEILISEARCH_ENABLED = True +MEILISEARCH_URL = "{{ MEILISEARCH_URL }}" +MEILISEARCH_API_KEY = "{{ MEILISEARCH_API_KEY }}" +MEILISEARCH_INDEX = "{{ MEILISEARCH_INDEX_PREFIX }}student_notes" LOGGING = { "version": 1, diff --git a/tutornotes/templates/notes/tasks/notes/init b/tutornotes/templates/notes/tasks/notes/init index b0f3606..4d12a18 100644 --- a/tutornotes/templates/notes/tasks/notes/init +++ b/tutornotes/templates/notes/tasks/notes/init @@ -1,2 +1,4 @@ ./manage.py migrate -./manage.py search_index --rebuild -f + +# Re-index with meilisearch +./manage.py shell -c "from notesapi.v1.views.meilisearch import reindex; reindex()" From 0267ffde12aac2d9b058a23d4cfb1ae84a369302 Mon Sep 17 00:00:00 2001 From: Syed Muhammad Dawoud Sheraz Ali Date: Mon, 9 Dec 2024 18:52:20 +0500 Subject: [PATCH 6/6] chore: update changelog --- CHANGELOG.md | 9 +++++++++ changelog.d/20241017_233457_regis_meilisearch.md | 2 -- ...241111_165908_dawoud.sheraz_remove_py38_references.md | 1 - .../20241119_164506_dawoud.sheraz_branch_rename.md | 3 --- 4 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 changelog.d/20241017_233457_regis_meilisearch.md delete mode 100644 changelog.d/20241111_165908_dawoud.sheraz_remove_py38_references.md delete mode 100644 changelog.d/20241119_164506_dawoud.sheraz_branch_rename.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 0dfe56b..cc37e2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,15 @@ instructions, because git commits are used to generate release notes: - 💥[Feature] Update Notes Image to use Ubuntu 24.04 as base OS. (by @jfavellar90) +- [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb) +- 💥[Feature] Replace Elasticsearch by Meilisearch. The implementation is much more compact and readable. All content will be automatically re-indexed during init. (by @regisb) + +- 💥 [Deprecation] Drop support for python 3.8 and set Python 3.9 as the minimum supported python version. (by @DawoudSheraz) + +- 💥[Improvement] Rename Tutor's two branches (by @DawoudSheraz): + * Rename **master** to **release**, as this branch runs the latest official Open edX release tag. + * Rename **nightly** to **main**, as this branch runs the Open edX master branches, which are the basis for the next Open edX release. + - 💥[Feature] Upgrade to Sumac. (by @jfavellar90) diff --git a/changelog.d/20241017_233457_regis_meilisearch.md b/changelog.d/20241017_233457_regis_meilisearch.md deleted file mode 100644 index 33808d4..0000000 --- a/changelog.d/20241017_233457_regis_meilisearch.md +++ /dev/null @@ -1,2 +0,0 @@ -- [Bugfix] Actually mount edx-notes-api repositories from host on `tutor mounts add /path/to/edx-notes-api`. (by @regisb) -- 💥[Feature] Replace Elasticsearch by Meilisearch. The implementation is much more compact and readable. All content will be automatically re-indexed during init. (by @regisb) diff --git a/changelog.d/20241111_165908_dawoud.sheraz_remove_py38_references.md b/changelog.d/20241111_165908_dawoud.sheraz_remove_py38_references.md deleted file mode 100644 index aeead7e..0000000 --- a/changelog.d/20241111_165908_dawoud.sheraz_remove_py38_references.md +++ /dev/null @@ -1 +0,0 @@ -- 💥 [Deprecation] Drop support for python 3.8 and set Python 3.9 as the minimum supported python version. (by @DawoudSheraz) diff --git a/changelog.d/20241119_164506_dawoud.sheraz_branch_rename.md b/changelog.d/20241119_164506_dawoud.sheraz_branch_rename.md deleted file mode 100644 index fb6e264..0000000 --- a/changelog.d/20241119_164506_dawoud.sheraz_branch_rename.md +++ /dev/null @@ -1,3 +0,0 @@ -- 💥[Improvement] Rename Tutor's two branches (by @DawoudSheraz): - * Rename **master** to **release**, as this branch runs the latest official Open edX release tag. - * Rename **nightly** to **main**, as this branch runs the Open edX master branches, which are the basis for the next Open edX release. \ No newline at end of file