mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-12-04 19:03:39 +00:00
Move plugins to dedicated repositories
minio, notes and xqueue plugins are moved to tutor-* github repos.
This commit is contained in:
parent
7790028cf7
commit
a94cbc2914
@ -4,7 +4,7 @@ Note: Breaking changes between versions are indicated by "💥".
|
||||
|
||||
## Latest
|
||||
|
||||
- [Improvement] Move minio plugin outside of the tutor repo
|
||||
- [Improvement] Move all plugins outside of the tutor repo
|
||||
- [Bugfix/Improvement] Add all plugins (with data) into binary bundle (#242)
|
||||
|
||||
## 3.6.2 (2019-08-07)
|
||||
|
21
Makefile
21
Makefile
@ -1,5 +1,5 @@
|
||||
.DEFAULT_GOAL := help
|
||||
SRC_DIRS = ./tutor ./tests ./plugins ./bin
|
||||
SRC_DIRS = ./tutor ./tests ./bin
|
||||
BLACK_OPTS = --exclude templates ${SRC_DIRS}
|
||||
|
||||
###### Development
|
||||
@ -12,10 +12,6 @@ compile-requirements: ## Compile requirements files
|
||||
package: ## Build a package ready to upload to pypi
|
||||
python3 setup.py sdist
|
||||
|
||||
package-plugins: ## Build packages for each plugin
|
||||
cd plugins/notes && python3 setup.py sdist --dist-dir=../../dist/
|
||||
cd plugins/xqueue && python3 setup.py sdist --dist-dir=../../dist/
|
||||
|
||||
test: test-lint test-unit test-format test-packages ## Run all tests by decreasing order or priority
|
||||
|
||||
test-format: ## Run code formatting tests
|
||||
@ -24,15 +20,10 @@ test-format: ## Run code formatting tests
|
||||
test-lint: ## Run code linting tests
|
||||
pylint --errors-only --ignore=templates ${SRC_DIRS}
|
||||
|
||||
test-unit: test-unit-core test-unit-plugins ## Run unit tests
|
||||
|
||||
test-unit-core: ## Run unit tests on core
|
||||
test-unit: ## Run unit tests
|
||||
python3 -m unittest discover tests
|
||||
|
||||
test-unit-plugins: ## Run unit tests on plugins
|
||||
python3 -m unittest discover plugins/xqueue/tests
|
||||
|
||||
test-packages: package package-plugins ## Test that packages can be uploaded to pypi
|
||||
test-packages: package ## Test that package can be uploaded to pypi
|
||||
twine check dist/tutor-*.tar.gz
|
||||
|
||||
format: ## Format code automatically
|
||||
@ -87,9 +78,7 @@ ci-bundle: ## Create bundle and run basic tests
|
||||
./dist/tutor config printroot
|
||||
yes "" | ./dist/tutor config save --interactive
|
||||
./dist/tutor config save
|
||||
./dist/tutor plugins enable notes
|
||||
./dist/tutor plugins enable xqueue
|
||||
|
||||
./dist/tutor plugins enable discovery ecommerce minio notes xqueue
|
||||
|
||||
./releases/github-release: ## Download github-release binary
|
||||
cd releases/ \
|
||||
@ -117,8 +106,6 @@ ci-github: ./releases/github-release ## Upload assets to github
|
||||
|
||||
ci-bootstrap-images:
|
||||
pip install -r requirements/plugins.txt
|
||||
tutor plugins enable notes
|
||||
tutor plugins enable xqueue
|
||||
tutor config save
|
||||
|
||||
ci-build-images: ci-bootstrap-images ## Build docker images
|
||||
|
@ -1,2 +0,0 @@
|
||||
recursive-include tutornotes/patches *
|
||||
recursive-include tutornotes/templates *
|
@ -1,37 +0,0 @@
|
||||
Students notes plugin for `Tutor <https://docs.tutor.overhang.io>`_
|
||||
===================================================================
|
||||
|
||||
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ to easily add the `Open edX note-taking app <https://github.com/edx/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-ironwood.master/exercises_tools/notes.html?highlight=notes>`_).
|
||||
|
||||
.. image:: https://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/open-release-ironwood.master/_images/SFD_SN_bodyexample.png
|
||||
:alt: Notes in action
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The plugin is currently bundled with the `binary releases of Tutor <https://github.com/overhangio/tutor/releases>`_. If you have installed Tutor from source, you will have to install this plugin from source, too::
|
||||
|
||||
pip install tutor-notes
|
||||
|
||||
Then, to enable this plugin, run::
|
||||
|
||||
tutor plugins enable notes
|
||||
|
||||
|
||||
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). In particular, in development you should set this configuration variable to ``notes.localhost`` in order to be able to access the notes service from the LMS. Otherwise you will get a "Sorry, we could not search the store for annotations" error.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
- ``NOTES_MYSQL_PASSWORD`` (default: ``"{{ 8|random_string }}"``)
|
||||
- ``NOTES_SECRET_KEY`` (default: ``"{{ 24|random_string }}"``)
|
||||
- ``NOTES_OAUTH2_SECRET`` (default: ``"{{ 24|random_string }}"``)
|
||||
- ``NOTES_DOCKER_IMAGE`` (default: ``"overhangio/openedx-notes:{{ TUTOR_VERSION }}"``)
|
||||
- ``NOTES_HOST`` (default: ``"notes.{{ LMS_HOST }}"``)
|
||||
- ``NOTES_MYSQL_DATABASE`` (default: ``"notes"``)
|
||||
- ``NOTES_MYSQL_USERNAME`` (default: ``"notes"``)
|
||||
|
||||
These values can be modified with ``tutor config save --set PARAM_NAME=VALUE`` commands.
|
@ -1,40 +0,0 @@
|
||||
import io
|
||||
import os
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
with io.open(os.path.join(here, "README.rst"), "rt", encoding="utf8") as f:
|
||||
readme = f.read()
|
||||
|
||||
|
||||
setup(
|
||||
name="tutor-notes",
|
||||
version="0.1.1",
|
||||
url="https://docs.tutor.overhang.io/",
|
||||
project_urls={
|
||||
"Documentation": "https://docs.tutor.overhang.io/",
|
||||
"Code": "https://github.com/overhangio/tutor/tree/master/plugins/notes",
|
||||
"Issue tracker": "https://github.com/overhangio/tutor/issues",
|
||||
"Community": "https://discuss.overhang.io",
|
||||
},
|
||||
license="AGPLv3",
|
||||
author="Overhang.io",
|
||||
author_email="contact@overhang.io",
|
||||
description="A Tutor plugin for student notes",
|
||||
long_description=readme,
|
||||
packages=find_packages(exclude=["tests*"]),
|
||||
include_package_data=True,
|
||||
python_requires=">=3.5",
|
||||
entry_points={"tutor.plugin.v0": ["notes = tutornotes.plugin"]},
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
],
|
||||
)
|
@ -1 +0,0 @@
|
||||
"ENABLE_EDXNOTES": true
|
@ -1 +0,0 @@
|
||||
certbot certonly --standalone -n --agree-tos -m admin@{{ LMS_HOST }} -d {{ NOTES_HOST }}
|
@ -1,32 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: notes
|
||||
labels:
|
||||
app.kubernetes.io/name: notes
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: notes
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: notes
|
||||
spec:
|
||||
containers:
|
||||
- name: notes
|
||||
image: {{ DOCKER_REGISTRY }}{{ NOTES_DOCKER_IMAGE }}
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
env:
|
||||
- name: DJANGO_SETTINGS_MODULE
|
||||
value: notesserver.settings.tutor
|
||||
volumeMounts:
|
||||
- mountPath: /openedx/edx-notes-api/notesserver/settings/tutor.py
|
||||
name: settings
|
||||
subPath: tutor.py
|
||||
volumes:
|
||||
- name: settings
|
||||
configMap:
|
||||
name: notes-settings
|
@ -1,18 +0,0 @@
|
||||
---
|
||||
apiVersion: certmanager.k8s.io/v1alpha1
|
||||
kind: Certificate
|
||||
metadata:
|
||||
name: {{ NOTES_HOST|replace(".", "-") }}
|
||||
spec:
|
||||
secretName: {{ NOTES_HOST }}-tls
|
||||
issuerRef:
|
||||
name: letsencrypt
|
||||
commonName: {{ NOTES_HOST }}
|
||||
dnsNames:
|
||||
- {{ NOTES_HOST }}
|
||||
acme:
|
||||
config:
|
||||
- http01:
|
||||
ingress: web
|
||||
domains:
|
||||
- {{ NOTES_HOST }}
|
@ -1,6 +0,0 @@
|
||||
- host: {{ NOTES_HOST }}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: nginx
|
||||
servicePort: {% if ACTIVATE_HTTPS %}443{% else %}80{% endif %}
|
@ -1 +0,0 @@
|
||||
- {{ NOTES_HOST }}
|
@ -1,12 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: notes
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 8000
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: notes
|
@ -1,3 +0,0 @@
|
||||
- name: notes-settings
|
||||
files:
|
||||
- plugins/notes/apps/settings/tutor.py
|
@ -1,2 +0,0 @@
|
||||
"EDXNOTES_PUBLIC_API": "{{ "https" if ACTIVATE_HTTPS else "http" }}://{{ NOTES_HOST }}/api/v1",
|
||||
"EDXNOTES_INTERNAL_API": "http://notes:8000/api/v1"
|
@ -1,11 +0,0 @@
|
||||
############# Notes: backend store for edX Student Notes
|
||||
notes:
|
||||
image: {{ DOCKER_REGISTRY }}{{ NOTES_DOCKER_IMAGE }}
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: notesserver.settings.tutor
|
||||
volumes:
|
||||
- ../plugins/notes/apps/settings/tutor.py:/openedx/edx-notes-api/notesserver/settings/tutor.py
|
||||
- ../../data/notes:/openedx/data
|
||||
restart: unless-stopped
|
||||
{% if ACTIVATE_MYSQL %}depends_on:
|
||||
- mysql{% endif %}
|
@ -1,37 +0,0 @@
|
||||
### Student notes service
|
||||
upstream notes-backend {
|
||||
server notes:8000 fail_timeout=0;
|
||||
}
|
||||
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
server {
|
||||
server_name {{ NOTES_HOST }};
|
||||
listen 80;
|
||||
return 301 https://$server_name$request_uri;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
server {
|
||||
{% if ACTIVATE_HTTPS %}listen 443 {{ "" if WEB_PROXY else "ssl" }};{% else %}listen 80;{% endif %}
|
||||
server_name notes.localhost {{ NOTES_HOST }};
|
||||
|
||||
{% if ACTIVATE_HTTPS and not WEB_PROXY %}
|
||||
ssl_certificate /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem;
|
||||
{% endif %}
|
||||
|
||||
# Disables server version feedback on pages and in headers
|
||||
server_tokens off;
|
||||
|
||||
location / {
|
||||
{% if not WEB_PROXY %}
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
{% endif %}
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
|
||||
proxy_pass http://notes-backend;
|
||||
}
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
<VirtualHost *:80>
|
||||
ServerName {{ NOTES_HOST }}
|
||||
Redirect / https://notes.{{ LMS_HOST }}/
|
||||
</VirtualHost>
|
||||
|
||||
<VirtualHost *:443>
|
||||
ServerName {{ NOTES_HOST }}
|
||||
SSLEngine on
|
||||
SSLCertificateFile /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyRequests On
|
||||
ProxyPass / http://localhost:{{ NGINX_HTTP_PORT }}/
|
||||
ProxyPassReverse / http://localhost:{{ NGINX_HTTP_PORT }}/
|
||||
</VirtualHost>
|
||||
{% else %}
|
||||
<VirtualHost *:80>
|
||||
ServerName {{ NOTES_HOST }}
|
||||
|
||||
ProxyPreserveHost On
|
||||
ProxyRequests On
|
||||
ProxyPass / http://localhost:{{ NGINX_HTTP_PORT }}/
|
||||
ProxyPassReverse / http://localhost:{{ NGINX_HTTP_PORT }}/
|
||||
</VirtualHost>
|
||||
{% endif %}
|
@ -1,33 +0,0 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name {{ NOTES_HOST }};
|
||||
|
||||
server_tokens off;
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_pass http://localhost:{{ NGINX_HTTP_PORT }};
|
||||
}
|
||||
}
|
||||
{% if ACTIVATE_HTTPS %}
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name {{ NOTES_HOST }};
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/{{ NOTES_HOST }}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{{ NOTES_HOST }}/privkey.pem;
|
||||
|
||||
server_tokens off;
|
||||
location / {
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_redirect off;
|
||||
proxy_pass http://localhost:{{ NGINX_HTTPS_PORT }};
|
||||
}
|
||||
}
|
||||
{% endif %}
|
@ -1,35 +0,0 @@
|
||||
from glob import glob
|
||||
import os
|
||||
|
||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
config = {
|
||||
"add": {
|
||||
"MYSQL_PASSWORD": "{{ 8|random_string }}",
|
||||
"SECRET_KEY": "{{ 24|random_string }}",
|
||||
"OAUTH2_SECRET": "{{ 24|random_string }}",
|
||||
},
|
||||
"defaults": {
|
||||
"DOCKER_IMAGE": "overhangio/openedx-notes:{{ TUTOR_VERSION }}",
|
||||
"HOST": "notes.{{ LMS_HOST }}",
|
||||
"MYSQL_DATABASE": "notes",
|
||||
"MYSQL_USERNAME": "notes",
|
||||
},
|
||||
}
|
||||
|
||||
templates = os.path.join(HERE, "templates")
|
||||
hooks = {
|
||||
"init": ["mysql-client", "lms", "notes"],
|
||||
"build-image": {"notes": "{{ NOTES_DOCKER_IMAGE }}"},
|
||||
"remote-image": {"notes": "{{ NOTES_DOCKER_IMAGE }}"},
|
||||
}
|
||||
|
||||
|
||||
def patches():
|
||||
all_patches = {}
|
||||
for path in glob(os.path.join(HERE, "patches", "*")):
|
||||
with open(path) as patch_file:
|
||||
name = os.path.basename(path)
|
||||
content = patch_file.read()
|
||||
all_patches[name] = content
|
||||
return all_patches
|
@ -1,33 +0,0 @@
|
||||
from .common import *
|
||||
|
||||
SECRET_KEY = "{{ NOTES_SECRET_KEY }}"
|
||||
ALLOWED_HOSTS = [
|
||||
"localhost",
|
||||
"notes",
|
||||
"notes.localhost",
|
||||
"{{ NOTES_HOST }}",
|
||||
]
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.mysql",
|
||||
"HOST": "{{ MYSQL_HOST }}",
|
||||
"PORT": {{MYSQL_PORT}},
|
||||
"NAME": "{{ NOTES_MYSQL_DATABASE }}",
|
||||
"USER": "{{ NOTES_MYSQL_USERNAME }}",
|
||||
"PASSWORD": "{{ NOTES_MYSQL_PASSWORD }}",
|
||||
}
|
||||
}
|
||||
|
||||
CLIENT_ID = "notes"
|
||||
CLIENT_SECRET = "{{ NOTES_OAUTH2_SECRET }}"
|
||||
|
||||
HAYSTACK_CONNECTIONS = {
|
||||
"default": {
|
||||
"ENGINE": "notesserver.highlight.ElasticsearchSearchEngine",
|
||||
"URL": "http://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}/",
|
||||
"INDEX_NAME": "notes",
|
||||
}
|
||||
}
|
||||
|
||||
LOGGING["handlers"]["local"] = LOGGING["handlers"]["console"].copy()
|
@ -1,15 +0,0 @@
|
||||
FROM ubuntu:18.04
|
||||
MAINTAINER Overhang.io <contact@overhang.io>
|
||||
|
||||
RUN apt update && \
|
||||
apt upgrade -y && \
|
||||
apt install -y language-pack-en git python-pip libmysqlclient-dev
|
||||
|
||||
RUN mkdir /openedx
|
||||
RUN git clone https://github.com/edx/edx-notes-api --branch open-release/ironwood.2 --depth 1 /openedx/edx-notes-api
|
||||
WORKDIR /openedx/edx-notes-api
|
||||
|
||||
RUN pip install -r requirements/base.txt
|
||||
|
||||
EXPOSE 8000
|
||||
CMD gunicorn --workers=2 --name notes --bind=0.0.0.0:8000 --max-requests=1000 notesserver.wsgi:application
|
@ -1,18 +0,0 @@
|
||||
export DJANGO_SETTINGS_MODULE=lms.envs.tutor.production
|
||||
|
||||
# Modify users created an incorrect email and that might clash with the newly created users
|
||||
./manage.py lms shell -c \
|
||||
"from django.contrib.auth import get_user_model;\
|
||||
get_user_model().objects.filter(username='notes').exclude(email='notes@openedx').update(email='notes@openedx')"
|
||||
|
||||
./manage.py lms manage_user notes notes@openedx --staff --superuser
|
||||
./manage.py lms create_oauth2_client \
|
||||
"http://notes:8000" \
|
||||
"http://notes:8000/complete/edx-oidc/" \
|
||||
confidential \
|
||||
--client_name edx-notes \
|
||||
--client_id notes \
|
||||
--client_secret {{ NOTES_OAUTH2_SECRET }} \
|
||||
--trusted \
|
||||
--logout_uri "http://notes:8000/logout/" \
|
||||
--username notes
|
@ -1,2 +0,0 @@
|
||||
mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'CREATE DATABASE IF NOT EXISTS {{ NOTES_MYSQL_DATABASE }};'
|
||||
mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'GRANT ALL ON {{ NOTES_MYSQL_DATABASE }}.* TO "{{ NOTES_MYSQL_USERNAME }}"@"%" IDENTIFIED BY "{{ NOTES_MYSQL_PASSWORD }}";'
|
@ -1 +0,0 @@
|
||||
./manage.py migrate --settings=notesserver.settings.tutor
|
@ -1,2 +0,0 @@
|
||||
recursive-include tutorxqueue/patches *
|
||||
recursive-include tutorxqueue/templates *
|
@ -1,28 +0,0 @@
|
||||
Xqueue external grading system plugin for `Tutor <https://docs.tutor.overhang.io>`_
|
||||
===================================================================================
|
||||
|
||||
This is a plugin for `Tutor <https://docs.tutor.overhang.io>`_ that provides the Xqueue external grading system for Open edX platforms. If you don't know what it is, you probably don't need it.
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
The plugin is currently bundled with the `binary releases of Tutor <https://github.com/overhangio/tutor/releases>`_. If you have installed Tutor from source, you will have to install this plugin from source, too::
|
||||
|
||||
pip install tutor-xqueue
|
||||
|
||||
Then, to enable this plugin, run::
|
||||
|
||||
tutor plugins enable xqueue
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
- ``XQUEUE_AUTH_PASSWORD`` (default: ``"{{ 8|random_string }}"``)
|
||||
- ``XQUEUE_MYSQL_PASSWORD`` (default: ``"{{ 8|random_string }}"``)
|
||||
- ``XQUEUE_SECRET_KEY`` (default: ``"{{ 24|random_string }}"``)
|
||||
- ``XQUEUE_DOCKER_IMAGE`` (default: ``"overhangio/openedx-xqueue:{{ TUTOR_VERSION }}"``)
|
||||
- ``XQUEUE_AUTH_USERNAME`` (default: ``"lms"``)
|
||||
- ``XQUEUE_MYSQL_DATABASE`` (default: ``"xqueue"``
|
||||
- ``XQUEUE_MYSQL_USERNAME`` (default: ``"xqueue"``)
|
||||
|
||||
These values can be modified with ``tutor config save --set PARAM_NAME=VALUE`` commands.
|
@ -1,40 +0,0 @@
|
||||
import io
|
||||
import os
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
here = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
with io.open(os.path.join(here, "README.rst"), "rt", encoding="utf8") as f:
|
||||
readme = f.read()
|
||||
|
||||
|
||||
setup(
|
||||
name="tutor-xqueue",
|
||||
version="0.1.1",
|
||||
url="https://docs.tutor.overhang.io/",
|
||||
project_urls={
|
||||
"Documentation": "https://docs.tutor.overhang.io/",
|
||||
"Code": "https://github.com/overhangio/tutor/tree/master/plugins/xqueue",
|
||||
"Issue tracker": "https://github.com/overhangio/tutor/issues",
|
||||
"Community": "https://discuss.overhang.io",
|
||||
},
|
||||
license="AGPLv3",
|
||||
author="Overhang.io",
|
||||
author_email="contact@overhang.io",
|
||||
description="A Tutor plugin for Xqueue (external grading system)",
|
||||
long_description=readme,
|
||||
packages=find_packages(exclude=["tests*"]),
|
||||
include_package_data=True,
|
||||
python_requires=">=3.5",
|
||||
entry_points={"tutor.plugin.v0": ["xqueue = tutorxqueue.plugin"]},
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: GNU Affero General Public License v3",
|
||||
"Operating System :: OS Independent",
|
||||
"Programming Language :: Python",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
"Programming Language :: Python :: 3.6",
|
||||
"Programming Language :: Python :: 3.7",
|
||||
],
|
||||
)
|
@ -1,43 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: xqueue
|
||||
labels:
|
||||
app.kubernetes.io/name: xqueue
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: xqueue
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: xqueue
|
||||
spec:
|
||||
containers:
|
||||
- name: xqueue
|
||||
image: {{ DOCKER_REGISTRY }}{{ XQUEUE_DOCKER_IMAGE }}
|
||||
ports:
|
||||
- containerPort: 8040
|
||||
env:
|
||||
- name: DJANGO_SETTINGS_MODULE
|
||||
value: xqueue.tutor
|
||||
volumeMounts:
|
||||
- mountPath: /openedx/xqueue/xqueue/tutor.py
|
||||
name: settings
|
||||
subPath: tutor.py
|
||||
- name: xqueue-consumer
|
||||
image: {{ DOCKER_REGISTRY }}{{ XQUEUE_DOCKER_IMAGE }}
|
||||
command: ["sh", "-e", "-c"]
|
||||
args: ["while true; do echo 'running consumers'; ./manage.py run_consumer; sleep 10; done"]
|
||||
env:
|
||||
- name: DJANGO_SETTINGS_MODULE
|
||||
value: xqueue.tutor
|
||||
volumeMounts:
|
||||
- mountPath: /openedx/xqueue/xqueue/tutor.py
|
||||
name: settings
|
||||
subPath: tutor.py
|
||||
volumes:
|
||||
- name: settings
|
||||
configMap:
|
||||
name: xqueue-settings
|
@ -1,12 +0,0 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: xqueue
|
||||
spec:
|
||||
type: NodePort
|
||||
ports:
|
||||
- port: 8040
|
||||
protocol: TCP
|
||||
selector:
|
||||
app.kubernetes.io/name: xqueue
|
@ -1,3 +0,0 @@
|
||||
- name: xqueue-settings
|
||||
files:
|
||||
- plugins/xqueue/apps/xqueue/settings/tutor.py
|
@ -1,24 +0,0 @@
|
||||
############# Xqueue: external grading of Open edX problems
|
||||
xqueue:
|
||||
image: {{ DOCKER_REGISTRY }}{{ XQUEUE_DOCKER_IMAGE }}
|
||||
volumes:
|
||||
- ../plugins/xqueue/apps/settings/tutor.py:/openedx/xqueue/xqueue/tutor.py
|
||||
- ../../data/xqueue:/openedx/data
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: xqueue.tutor
|
||||
restart: unless-stopped
|
||||
{% if ACTIVATE_MYSQL %}depends_on:
|
||||
- mysql{% endif %}
|
||||
|
||||
xqueue_consumer:
|
||||
image: {{ DOCKER_REGISTRY }}{{ XQUEUE_DOCKER_IMAGE }}
|
||||
volumes:
|
||||
- ../plugins/xqueue/apps/settings/tutor.py:/openedx/xqueue/xqueue/tutor.py
|
||||
- ../../data/xqueue:/openedx/data
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: xqueue.tutor
|
||||
restart: unless-stopped
|
||||
entrypoint: ["sh", "-e", "-c"]
|
||||
command: ["while true; do echo 'running consumers'; ./manage.py run_consumer; sleep 10; done"]
|
||||
{% if ACTIVATE_MYSQL %}depends_on:
|
||||
- mysql{% endif %}
|
@ -1,7 +0,0 @@
|
||||
XQUEUE_INTERFACE = {
|
||||
"django_auth": {
|
||||
"username": "{{ XQUEUE_AUTH_USERNAME }}",
|
||||
"password": "{{ XQUEUE_AUTH_PASSWORD }}"
|
||||
},
|
||||
"url": "http://xqueue:8040"
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
from glob import glob
|
||||
import os
|
||||
|
||||
HERE = os.path.abspath(os.path.dirname(__file__))
|
||||
|
||||
config = {
|
||||
"add": {
|
||||
"AUTH_PASSWORD": "{{ 8|random_string }}",
|
||||
"MYSQL_PASSWORD": "{{ 8|random_string }}",
|
||||
"SECRET_KEY": "{{ 24|random_string }}",
|
||||
},
|
||||
"defaults": {
|
||||
"DOCKER_IMAGE": "overhangio/openedx-xqueue:{{ TUTOR_VERSION }}",
|
||||
"AUTH_USERNAME": "lms",
|
||||
"MYSQL_DATABASE": "xqueue",
|
||||
"MYSQL_USERNAME": "xqueue",
|
||||
},
|
||||
}
|
||||
|
||||
templates = os.path.join(HERE, "templates")
|
||||
hooks = {
|
||||
"init": ["mysql-client", "xqueue"],
|
||||
"build-image": {"xqueue": "{{ XQUEUE_DOCKER_IMAGE }}"},
|
||||
"remote-image": {"xqueue": "{{ XQUEUE_DOCKER_IMAGE }}"},
|
||||
}
|
||||
|
||||
|
||||
def patches():
|
||||
all_patches = {}
|
||||
for path in glob(os.path.join(HERE, "patches", "*")):
|
||||
with open(path) as patch_file:
|
||||
name = os.path.basename(path)
|
||||
content = patch_file.read()
|
||||
all_patches[name] = content
|
||||
return all_patches
|
@ -1,18 +0,0 @@
|
||||
from .settings import *
|
||||
|
||||
DATABASES = {
|
||||
"default": {
|
||||
"ENGINE": "django.db.backends.mysql",
|
||||
"HOST": "{{ MYSQL_HOST }}",
|
||||
"PORT": {{MYSQL_PORT}},
|
||||
"NAME": "{{ XQUEUE_MYSQL_DATABASE }}",
|
||||
"USER": "{{ XQUEUE_MYSQL_USERNAME }}",
|
||||
"PASSWORD": "{{ XQUEUE_MYSQL_PASSWORD }}",
|
||||
}
|
||||
}
|
||||
|
||||
LOGGING = get_logger_config(log_dir="/openedx/data/", logging_env="tutor", dev_env=True)
|
||||
|
||||
SECRET_KEY = "{{ XQUEUE_SECRET_KEY }}"
|
||||
|
||||
XQUEUE_USERS = {"{{ XQUEUE_AUTH_USERNAME }}": "{{ XQUEUE_AUTH_PASSWORD}}"}
|
@ -1,15 +0,0 @@
|
||||
FROM ubuntu:18.04
|
||||
MAINTAINER Overhang.io <contact@overhang.io>
|
||||
|
||||
RUN apt update && \
|
||||
apt upgrade -y && \
|
||||
apt install -y language-pack-en git python-pip libmysqlclient-dev
|
||||
|
||||
RUN mkdir /openedx /openedx/data
|
||||
RUN git clone https://github.com/edx/xqueue --branch open-release/ironwood.2 --depth 1 /openedx/xqueue
|
||||
WORKDIR /openedx/xqueue
|
||||
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
EXPOSE 8040
|
||||
CMD gunicorn --workers=2 --name xqueue --bind=0.0.0.0:8040 --max-requests=1000 xqueue.wsgi:application
|
@ -1,2 +0,0 @@
|
||||
mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'CREATE DATABASE IF NOT EXISTS {{ XQUEUE_MYSQL_DATABASE }};'
|
||||
mysql -u root --password="{{ MYSQL_ROOT_PASSWORD }}" --host "{{ MYSQL_HOST }}" --port {{ MYSQL_PORT }} -e 'GRANT ALL ON {{ XQUEUE_MYSQL_DATABASE }}.* TO "{{ XQUEUE_MYSQL_USERNAME }}"@"%" IDENTIFIED BY "{{ XQUEUE_MYSQL_PASSWORD }}";'
|
@ -1 +0,0 @@
|
||||
./manage.py migrate
|
@ -1,6 +1,6 @@
|
||||
-e ./plugins/notes
|
||||
-e ./plugins/xqueue
|
||||
tutor-discovery
|
||||
tutor-ecommerce
|
||||
tutor-figures
|
||||
tutor-minio
|
||||
tutor-minio
|
||||
tutor-notes
|
||||
tutor-xqueue
|
Loading…
Reference in New Issue
Block a user