Skip to content

Commit

Permalink
Add patch for jupyterhub and rename jupyterlab patch (#20)
Browse files Browse the repository at this point in the history
* Add patch for jupyterhub and rename jupyterlab patch
  • Loading branch information
Abdul-Muqadim-Arbisoft authored Jan 6, 2025
1 parent 8dc1660 commit f358502
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
23 changes: 21 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 2 additions & 0 deletions tutorjupyter/templates/jupyter/build/hub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ RUN pip install \
jupyterhub-ltiauthenticator==1.6.1 \
pymysql==1.1.0

{{ patch("jupyterhub-dockerfile") }}

CMD ["jupyterhub"]
2 changes: 1 addition & 1 deletion tutorjupyter/templates/jupyter/build/lab/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f358502

Please sign in to comment.