Skip to content

Commit

Permalink
feat: Upgrade to Sumac
Browse files Browse the repository at this point in the history
  • Loading branch information
regisb authored Dec 16, 2024
2 parents 75e64f5 + 0267ffd commit e61f3ce
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 28 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ instructions, because git commits are used to generate release notes:

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

<a id='changelog-19.0.0'></a>
## 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)

- [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)

<a id='changelog-18.0.0'></a>
## v18.0.0 (2024-05-09)

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Students notes plugin for `Tutor <https://docs.tutor.edly.io>`_
===================================================================

This is a plugin for `Tutor <https://docs.tutor.edly.io>`_ to easily add the `Open edX note-taking app <https://github.com/openedx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-redwood.master/exercises_tools/notes.html>`_).
This is a plugin for `Tutor <https://docs.tutor.edly.io>`_ to easily add the `Open edX note-taking app <https://github.com/openedx/edx-notes-api>`_ to an Open edX platform. This app allows students to annotate portions of the courseware (see `the official documentation <https://docs.openedx.org/en/latest/educators/how-tos/course_development/exercise_tools/enable_notes.html>`_).

.. 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
Expand All @@ -23,7 +23,7 @@ Then, to make migrations & tasks::

You should beware that the ``notes.<LMS_HOST>`` 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".

Expand Down
1 change: 0 additions & 1 deletion changelog.d/20240621_170044_regis.md

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions changelog.d/20241119_164506_dawoud.sheraz_branch_rename.md

This file was deleted.

4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion tutornotes/__about__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "18.0.0"
__version__ = "19.0.0"
3 changes: 3 additions & 0 deletions tutornotes/patches/local-docker-compose-jobs-services
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
3 changes: 3 additions & 0 deletions tutornotes/patches/local-docker-compose-services
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
13 changes: 7 additions & 6 deletions tutornotes/templates/notes/apps/settings/tutor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}",
Expand All @@ -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,
Expand Down
23 changes: 13 additions & 10 deletions tutornotes/templates/notes/build/notes/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tutornotes/templates/notes/tasks/notes/init
Original file line number Diff line number Diff line change
@@ -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()"

0 comments on commit e61f3ce

Please sign in to comment.