Jupyter Notebook plugin for Tutor
Project description
This is a plugin for Tutor that makes it easy to integrate Jupyter notebooks in Open edX. It achieves the following:
Install the official jupyter-xblock in the Open edX LMS and Studio.
Run a Docker-based JupyterHub instance with a Docker spawner.
In pratice, it means that students will be allocated Docker containers with limited CPU and memory to run their custom notebooks.
⚠️ This plugin is not compatible with Kubernetes. If you wish to run JupyterHub on Kubernetes, you are encouraged to check the documentation of the Zero to JupyterHub with Kubernetes project.
Installation
pip install tutor-jupyter
Usage
Launch a local platform
tutor plugins enable jupyter mfe tutor config save tutor images build openedx tutor local launch
TODO Create LTI passport in Open edX:
echo "$(tutor config printvalue JUPYTER_DEFAULT_PASSPORT_ID):$(tutor config printvalue JUPYTER_LTI_CLIENT_KEY):$(tutor config printvalue JUPYTER_LTI_CLIENT_SECRET)"
Configuration
Settings
TODO
JUPYTER_DOCKER_IMAGE_HUB (default: "{{ DOCKER_REGISTRY }}overhangio/jupyterhub:{{ JUPYTER_VERSION }}")
JUPYTER_DOCKER_IMAGE_LAB (default: "{{ DOCKER_REGISTRY }}overhangio/jupyterlab:{{ JUPYTER_VERSION }}")
JUPYTER_HOST (default: "jupyter.{{ LMS_HOST }}")
JUPYTER_DEFAULT_PASSPORT_ID (default: "jupyterhub")
JUPYTER_LTI_CLIENT_KEY (default: "openedx")
JUPYTER_HUB_MYSQL_DATABASE (default: "jupyterhub")
JUPYTER_HUB_MYSQL_USERNAME (default: "jupyterhub")
JUPYTER_LAB_CPU_LIMIT”, None
JUPYTER_LAB_MEMORY_LIMIT (default: "200M")
JUPYTER_HUB_COOKIE_SECRET (default: "{{ 32|jupyterhub_crypt_key }}")
JUPYTER_HUB_CRYPT_KEY (default: "{{ 32|jupyterhub_crypt_key }}")
JUPYTER_HUB_MYSQL_PASSWORD (default: "{{ 24|random_string }}")
JUPYTER_LTI_CLIENT_SECRET (default: "{{ 24|random_string }}")
Modifying the default lab environment
TODO implement “jupyter-lab-dockerfile” patch:
from tutor import hooks hooks.Filters.ENV_PATCHES.add_item( ( "jupyter-lab-dockerfile", """ # Install extra Python packages RUN pip install matplotlib scipy seaborn """ ) )
Then build the lab image again:
tutor config save tutor images build jupyterlab
License
This software is licensed under the terms of the AGPLv3.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.