diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1c4303d..1ec11db 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ variables: TUTOR_PLUGIN: xqueue TUTOR_IMAGES: xqueue TUTOR_PYPI_PACKAGE: tutor-xqueue - OPENEDX_RELEASE: lilac + OPENEDX_RELEASE: maple GITHUB_REPO: overhangio/tutor-xqueue include: diff --git a/setup.py b/setup.py index 8cfcb57..e7a8051 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ setup( packages=find_packages(exclude=["tests*"]), include_package_data=True, python_requires=">=3.5", - install_requires=["tutor>=12.0.0,<13.0.0", "requests"], + install_requires=["tutor>=13.0.0,<14.0.0", "requests"], entry_points={"tutor.plugin.v0": ["xqueue = tutorxqueue.plugin"]}, classifiers=[ "Development Status :: 3 - Alpha", diff --git a/tutorxqueue/__about__.py b/tutorxqueue/__about__.py index 13b4a72..1311252 100644 --- a/tutorxqueue/__about__.py +++ b/tutorxqueue/__about__.py @@ -1 +1 @@ -__version__ = "12.1.0" +__version__ = "13.0.0" diff --git a/tutorxqueue/patches/caddyfile b/tutorxqueue/patches/caddyfile index eb9ef4e..837761e 100644 --- a/tutorxqueue/patches/caddyfile +++ b/tutorxqueue/patches/caddyfile @@ -1,4 +1,4 @@ # Xqueue -{{ XQUEUE_HOST }}{% if not ENABLE_HTTPS %}:80{% endif %} { - reverse_proxy nginx:80 -} \ No newline at end of file +{{ XQUEUE_HOST }}{$default_site_port} { + import proxy "xqueue:8000" +} diff --git a/tutorxqueue/patches/local-docker-compose-services b/tutorxqueue/patches/local-docker-compose-services index 49ec223..3651e6b 100644 --- a/tutorxqueue/patches/local-docker-compose-services +++ b/tutorxqueue/patches/local-docker-compose-services @@ -9,6 +9,13 @@ xqueue: restart: unless-stopped depends_on: {{ [("mysql", RUN_MYSQL)]|list_if }} +xqueue-permissions: + image: {{ DOCKER_IMAGE_PERMISSIONS }} + command: ["1000", "/openedx/xqueue"] + restart: on-failure + volumes: + - ../../data/xqueue/media:/openedx/xqueue + xqueue-consumer: image: {{ XQUEUE_DOCKER_IMAGE }} volumes: diff --git a/tutorxqueue/patches/nginx-extra b/tutorxqueue/patches/nginx-extra deleted file mode 100644 index b1aa651..0000000 --- a/tutorxqueue/patches/nginx-extra +++ /dev/null @@ -1,18 +0,0 @@ -### Xqueue -upstream xqueue-backend { - server xqueue:8000 fail_timeout=0; -} - -server { - listen 80; - server_name {{ XQUEUE_HOST }}; - - # Disables server version feedback on pages and in headers - server_tokens off; - - location / { - proxy_set_header Host $http_host; - proxy_redirect off; - proxy_pass http://xqueue-backend; - } -} \ No newline at end of file diff --git a/tutorxqueue/plugin.py b/tutorxqueue/plugin.py index bf507f3..384376f 100644 --- a/tutorxqueue/plugin.py +++ b/tutorxqueue/plugin.py @@ -60,7 +60,11 @@ def command(): "-u", "--url", envvar="TUTOR_XQUEUE_URL", - help="Xqueue server base url. By default, this value will be defined from the plugin configuration. Alternatively, this value can be defined from the TUTOR_XQUEUE_URL environment variable.", + help=( + "Xqueue server base url. By default, this value will be defined from " + "the plugin configuration. Alternatively, this value can be defined " + "from the TUTOR_XQUEUE_URL environment variable." + ), ) def submissions(context, queue, url): context.queue = queue diff --git a/tutorxqueue/templates/xqueue/build/xqueue/Dockerfile b/tutorxqueue/templates/xqueue/build/xqueue/Dockerfile index 65dd7f7..abf511c 100644 --- a/tutorxqueue/templates/xqueue/build/xqueue/Dockerfile +++ b/tutorxqueue/templates/xqueue/build/xqueue/Dockerfile @@ -3,15 +3,23 @@ MAINTAINER Overhang.io RUN apt update && \ apt upgrade -y && \ - apt install -y language-pack-en git python3 python3-pip libmysqlclient-dev + apt install -y language-pack-en git python3 python3-pip python3-venv libmysqlclient-dev RUN ln -s /usr/bin/python3 /usr/bin/python -RUN mkdir /openedx /openedx/data /openedx/data/media +ARG APP_USER_ID=1000 +RUN useradd --home-dir /openedx --create-home --shell /bin/bash --uid ${APP_USER_ID} app +USER ${APP_USER_ID} + RUN git clone https://github.com/edx/xqueue --branch {{ OPENEDX_COMMON_VERSION }} --depth 1 /openedx/xqueue WORKDIR /openedx/xqueue +RUN python -m venv /openedx/venv +ENV PATH /openedx/venv/bin:${PATH} +RUN pip install --upgrade pip setuptools RUN pip install -r requirements.txt -RUN pip install uwsgi==2.0.19.1 +RUN pip install uwsgi==2.0.20 + +RUN mkdir /openedx/data /openedx/data/media EXPOSE 8000 CMD uwsgi \