diff --git a/CHANGELOG.md b/CHANGELOG.md index 978cfb8..c3aea80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Unreleased + +* [BREAKING CHANGE] Add support for Tutor 18 and Open edX Redwood. + The Tubular repository has been deprecated and the relevant scripts + have been moved to the `edx-platform` repository (https://github.com/openedx/axim-engineering/issues/881); the plugin now installs the scripts from there. + ## Version 3.4.0 (2024-08-01) * [Bug fix] Complete the removal of (not-ever-working) support for the Ecommerce service, by also removing references to that service from the `openedx-lms-common-settings` patch. diff --git a/README.md b/README.md index 309a234..4547249 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,10 @@ appropriate one: | Lilac | `>=12.0, <13` | Not supported | Not supported | | Maple | `>=13.2, <14`[^1] | `maple` | 0.1.x | | Nutmeg | `>=14.0, <15` | `nutmeg` | 1.x.x | -| Olive | `>=15.0, <16` | `main` | 2.x.x | -| Palm | `>=16.0, <17` | `main` | 3.x.x | -| Quince | `>=17.0, <18` | `main` | 3.x.x | +| Olive | `>=15.0, <16` | `quince` | 2.x.x | +| Palm | `>=16.0, <17` | `quince` | 3.x.x | +| Quince | `>=17.0, <18` | `quince` | 3.x.x | +| Redwood | `>=18.0, <19` | `main` | 4.x.x | [^1]: For Open edX Maple and Tutor 13, you must run version 13.2.0 or  later. That is because this plugin uses the Tutor v1 plugin API, diff --git a/setup.py b/setup.py index 620693e..770dd2d 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def load_readme(): packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.8", - install_requires=["tutor <18, >=16.1.7"], + install_requires=["tutor <19, >=16.1.7"], setup_requires=["setuptools-scm"], entry_points={ "tutor.plugin.v1": [ diff --git a/tutorretirement/patches/k8s-jobs b/tutorretirement/patches/k8s-jobs index 82919d2..0674424 100644 --- a/tutorretirement/patches/k8s-jobs +++ b/tutorretirement/patches/k8s-jobs @@ -19,11 +19,11 @@ spec: command: - 'bash' - '-e' - - 'run_retirement_pipeline.sh' + - 'scripts/user_retirement/run_retirement_pipeline.sh' - '{{ RETIREMENT_COOL_OFF_DAYS }}' volumeMounts: - name: pipeline-config - mountPath: '/tubular/pipeline_config/config.yml' + mountPath: '/edx-platform/scripts/user_retirement/pipeline_config/config.yml' subPath: config.yml volumes: - name: pipeline-config diff --git a/tutorretirement/patches/local-docker-compose-jobs-services b/tutorretirement/patches/local-docker-compose-jobs-services index e8b97db..7ee498d 100644 --- a/tutorretirement/patches/local-docker-compose-jobs-services +++ b/tutorretirement/patches/local-docker-compose-jobs-services @@ -2,6 +2,6 @@ retirement-job: image: {{ RETIREMENT_DOCKER_IMAGE }} volumes: - - ../plugins/retirement/build/retirement/pipeline_config:/tubular/pipeline_config + - ../plugins/retirement/build/retirement/pipeline_config:/edx-platform/scripts/user_retirement/pipeline_config depends_on: - lms diff --git a/tutorretirement/plugin.py b/tutorretirement/plugin.py index 3ad7fd9..09183ca 100644 --- a/tutorretirement/plugin.py +++ b/tutorretirement/plugin.py @@ -20,7 +20,6 @@ "DOCKER_IMAGE": "{{ DOCKER_REGISTRY }}retirement:{{ RETIREMENT_VERSION }}", # noqa: E501 "EDX_OAUTH2_CLIENT_ID": "retirement_service_worker", "COOL_OFF_DAYS": 30, - "TUBULAR_VERSION": "{{ OPENEDX_COMMON_VERSION }}", "K8S_CRONJOB_HISTORYLIMIT_FAILURE": 1, "K8S_CRONJOB_HISTORYLIMIT_SUCCESS": 3, "K8S_CRONJOB_SCHEDULE": "0 0 * * *", @@ -51,7 +50,8 @@ def retire_users(context): cool_off_days = config["RETIREMENT_COOL_OFF_DAYS"] job_runner.run_task( service="retirement", - command=f"bash -e run_retirement_pipeline.sh {cool_off_days}" + command="bash -e scripts/user_retirement/run_retirement_pipeline.sh " + f"{cool_off_days}" ) diff --git a/tutorretirement/templates/retirement/build/retirement/Dockerfile b/tutorretirement/templates/retirement/build/retirement/Dockerfile index ea20f04..06e2571 100644 --- a/tutorretirement/templates/retirement/build/retirement/Dockerfile +++ b/tutorretirement/templates/retirement/build/retirement/Dockerfile @@ -3,9 +3,9 @@ ENV PYTHONUNBUFFERED 1 RUN python3 -m venv /retirement/venv/ ENV PATH "/retirement/venv/bin:$PATH" RUN apt-get update && \ - git clone --depth 1 --branch {{ RETIREMENT_TUBULAR_VERSION }} https://github.com/openedx/tubular.git ./tubular -WORKDIR ./tubular -COPY run_retirement_pipeline.sh . + git clone --depth 1 --branch {{ OPENEDX_COMMON_VERSION }} https://github.com/openedx/edx-platform.git +WORKDIR ./edx-platform +COPY run_retirement_pipeline.sh scripts/user_retirement/ RUN pip install --upgrade pip && \ - pip install -r requirements.txt --exists-action w && \ - mkdir learners_to_retire + pip install -r scripts/user_retirement/requirements/base.txt --exists-action w && \ + mkdir scripts/user_retirement/learners_to_retire diff --git a/tutorretirement/templates/retirement/build/retirement/run_retirement_pipeline.sh b/tutorretirement/templates/retirement/build/retirement/run_retirement_pipeline.sh index 8bcfbd5..96851f1 100644 --- a/tutorretirement/templates/retirement/build/retirement/run_retirement_pipeline.sh +++ b/tutorretirement/templates/retirement/build/retirement/run_retirement_pipeline.sh @@ -1,12 +1,12 @@ cool_off_days=$1 -python scripts/get_learners_to_retire.py --config_file=./pipeline_config/config.yml --output_dir=learners_to_retire --cool_off_days="$cool_off_days" -for filename in learners_to_retire/*;do +python scripts/user_retirement/get_learners_to_retire.py --config_file=scripts/user_retirement/pipeline_config/config.yml --output_dir=scripts/user_retirement/learners_to_retire --cool_off_days="$cool_off_days" +for filename in scripts/user_retirement/learners_to_retire/*;do if test ! -f "$filename";then echo "No users to retire" continue else IFS="=" read -r name username <"$filename" echo "Retiring $username" - python scripts/retire_one_learner.py --config_file=./pipeline_config/config.yml --username="$username" + python scripts/user_retirement/retire_one_learner.py --config_file=scripts/user_retirement/pipeline_config/config.yml --username="$username" fi done