Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add patch for jupyterhub and rename jupyterlab patch #20

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:::
Abdul-Muqadim-Arbisoft marked this conversation as resolved.
Show resolved Hide resolved

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") }}
Abdul-Muqadim-Arbisoft marked this conversation as resolved.
Show resolved Hide resolved

# Disable obnoxious jupyterlab announcements
# https://jupyterlab.readthedocs.io/en/stable/user/announcements.html
Expand Down
Loading