diff --git a/README.rst b/README.rst index bb5498f..5acc8ea 100644 --- a/README.rst +++ b/README.rst @@ -98,16 +98,35 @@ The configuration template for the JupyterHub instance is stored in `jupyterhub_ ) ) +To modify the "jupyterhub" Docker image and add extra Python packages (for example), you should create a Tutor plugin that implements the "jupyterhub-dockerfile" patch:: + + from tutor import hooks + + hooks.Filters.ENV_PATCHES.add_item( + ( + "jupyterhub-dockerfile", + """ + # Install extra Python packages + RUN pip install jupyterhub-idle-culler + """ + ) + ) + +Then build the JupyterHub image again:: + + tutor config save + tutor images build jupyterhub + Lab environment ~~~~~~~~~~~~~~~ -By default, Jupyter lab notebooks will be spawned that do not include extra Python packages or dependencies. To modify the "jupyterlab" Docker image and add extra Python packages (for example), you should create a Tutor plugin that implements the "jupyter-lab-dockerfile" patch:: +By default, Jupyter lab notebooks will be spawned that do not include extra Python packages or dependencies. To modify the "jupyterlab" Docker image and add extra Python packages (for example), you should create a Tutor plugin that implements the "jupyterlab-dockerfile" patch:: from tutor import hooks hooks.Filters.ENV_PATCHES.add_item( ( - "jupyter-lab-dockerfile", + "jupyterlab-dockerfile", """ # Install extra Python packages RUN pip install matplotlib scipy seaborn diff --git a/changelog.d/20241230_185457_abdul.muqadim_jupyterhub_patch.md b/changelog.d/20241230_185457_abdul.muqadim_jupyterhub_patch.md new file mode 100644 index 0000000..ae3f902 --- /dev/null +++ b/changelog.d/20241230_185457_abdul.muqadim_jupyterhub_patch.md @@ -0,0 +1 @@ +- 💥[Feature] Renamed the `jupyter-lab-dockerfile` to `jupyterlab-dockerfile` for consistency across the Tutor ecosystem and added the `jupyterhub-dockerfile` patch to the JupyterHub Dockerfile for customization. If you were previously using the patch with the old name, update your configuration to reflect the new name to ensure compatibility. (by @Abdul-Muqadim-Arbisoft) diff --git a/tutorjupyter/templates/jupyter/build/hub/Dockerfile b/tutorjupyter/templates/jupyter/build/hub/Dockerfile index 20c4380..cc24004 100644 --- a/tutorjupyter/templates/jupyter/build/hub/Dockerfile +++ b/tutorjupyter/templates/jupyter/build/hub/Dockerfile @@ -12,4 +12,6 @@ RUN pip install \ jupyterhub-ltiauthenticator==1.6.1 \ pymysql==1.1.0 +{{ patch("jupyterhub-dockerfile") }} + CMD ["jupyterhub"] diff --git a/tutorjupyter/templates/jupyter/build/lab/Dockerfile b/tutorjupyter/templates/jupyter/build/lab/Dockerfile index b2e771b..4ade123 100644 --- a/tutorjupyter/templates/jupyter/build/lab/Dockerfile +++ b/tutorjupyter/templates/jupyter/build/lab/Dockerfile @@ -16,7 +16,7 @@ RUN pip install nbgitpuller==1.2.0 # https://pypi.org/project/jupyterlab/ RUN pip install jupyterlab==4.0.9 -{{ patch("jupyter-lab-dockerfile") }} +{{ patch("jupyterlab-dockerfile") }} # Disable obnoxious jupyterlab announcements # https://jupyterlab.readthedocs.io/en/stable/user/announcements.html