Skip to content

Commit a2340e9

Browse files
committed
Add content to advanced customization and nbgrader and minor changes to other
1 parent fb4265b commit a2340e9

File tree

6 files changed

+159
-18
lines changed

6 files changed

+159
-18
lines changed

learning-pathways/jupyter-based-teaching.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,11 @@ pathway:
3333
- topic: teaching
3434
name: jbt-featured
3535

36-
- section: "For teachers: Use custom Jupyter Images with JHaaS"
37-
description: "Learn how to teach a course or workshop with your Jupyter customizations on JHaaS"
36+
- section: "Use your customized JupyterLab for Courses"
37+
description: "Learn how to teach a course or workshop with your custom JupyterLab"
3838
tutorials:
3939
- topic: teaching
4040
name: jbt-jhaas
41-
42-
- section: "For admins: Provide your Jupyter Images with Galaxy"
43-
description: "Learn how to provide your custom Jupyter customizations on your Galaxy instance"
44-
tutorials:
4541
- topic: teaching
4642
name: jbt-galaxy
4743

topics/teaching/tutorials/jbt-customization-1/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ contributors:
3030
* WIP
3131

3232
```bash
33-
sudo docker run --rm -p 127.0.0.1:8888:8888 quay.io/jupyter/minimal-notebook:2025-06-23
33+
sudo docker run --rm -it -p 127.0.0.1:8888:8888 quay.io/jupyter/minimal-notebook:2025-06-23
3434
```
3535

3636
* Will print out a link to `http://localhost:8888/lab?token=<token>`

topics/teaching/tutorials/jbt-customization-2/tutorial.md

Lines changed: 96 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: tutorial_hands_on
44
title: Advanced Jupyter customization
55
subtopic: practises
66
draft: true
7-
time_estimation: 1h
7+
time_estimation: 90m
88
questions:
99
- How can I tailor Jupyter to my specific teaching needs?
1010
objectives:
@@ -170,12 +170,105 @@ RUN pip install jupyter_server_proxy
170170

171171
You may install any other arbitrary server applications this way too, e.g. RStudio.
172172

173-
# Exercise
173+
# Exercise 1: Persistent Data
174174

175175
Why is the rust installation in step 1 of this tutorial problematic in case this notebook is served via JupyterHub?
176176

177177
--> it installs rust in homedir
178178

179179
Build a Customized JupyterLab with an available rust kernel even in JupyterHub szenario.
180180

181-
--> Dockerfile here
181+
```dockerfile
182+
FROM quay.io/jupyter/minimal-notebook:2025-06-23
183+
184+
USER root
185+
RUN apt update \
186+
&& apt install -y build-essential \
187+
&& apt clean
188+
189+
ARG RUSTUP_URL=https://sh.rustup.rs
190+
ARG RUSTUP_INIT=/tmp/rustup.sh
191+
192+
ENV RUSTUP_HOME=/opt/rustup
193+
ENV CARGO_HOME=/opt/cargo
194+
ENV JUPYTER_PATH=/usr/local/share/jupyter
195+
ENV PATH="${PATH}:${CARGO_HOME}/bin"
196+
197+
ADD --chmod=755 "${RUSTUP_URL}" "${RUSTUP_INIT}"
198+
RUN "${RUSTUP_INIT}" -v -y
199+
RUN cargo install --locked evcxr_jupyter
200+
RUN evcxr_jupyter --install
201+
202+
RUN rm "${RUSTUP_INIT}"
203+
204+
USER ${NB_UID}
205+
```
206+
207+
# Exercise 2: Proxy Application
208+
209+
Create a simple html page like this:
210+
211+
```html
212+
<!DOCTYPE html>
213+
<html>
214+
<head>
215+
<title>Hello World</title>
216+
<meta charset="UTF-8" />
217+
</head>
218+
<body>
219+
<h1>Hello World!</h1>
220+
<p>I am served by your python server application!</p>
221+
</body>
222+
</html>
223+
```
224+
225+
Include it as `index.html` in a separate folder in your container image.
226+
227+
Create a proxy application serving this index.html file with the simple python builtin `http.server` package.
228+
229+
Tip:
230+
231+
```bash
232+
python3 -m http.server -d {path_to_dir_containing_the_html_file} {PORT}
233+
```
234+
235+
236+
237+
Serve it via simple python
238+
239+
Solution:
240+
241+
Create the index.html as explained above.
242+
243+
Create a JupyterLab config `jupyter_lab_config.py` like this:
244+
245+
```python
246+
c.ServerProxy.servers = {
247+
"hello-world-server": {
248+
"command": [
249+
"python3",
250+
"-m", "http.server",
251+
"-d", "/srv/html",
252+
"{port}"
253+
],
254+
"launcher_entry": {
255+
"enabled": True,
256+
"title": "Hello World Server"
257+
}
258+
}
259+
}
260+
```
261+
262+
Create a Dockerfile like this:
263+
264+
```dockerfile
265+
FROM quay.io/jupyter/minimal-notebook:2025-06-23
266+
267+
USER root
268+
269+
COPY --chown=root:root jupyter_lab_config.py /etc/jupyter/jupyter_lab_config.py
270+
COPY --chown=root:root index.html /srv/html/index.html
271+
272+
USER ${NB_UID}
273+
RUN pip install jupyter_server_proxy
274+
```

topics/teaching/tutorials/jbt-featured/tutorial.md

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: tutorial_hands_on
44
title: Featured Jupyter customizations
55
subtopic: practises
66
draft: true
7-
time_estimation: 1h
7+
time_estimation: 30m
88
questions:
99
- Which customizations are battle-tested and recommended for teaching?
1010
objectives:
@@ -21,14 +21,68 @@ We present adaptions that the JLU Physics Department has been successfully using
2121

2222
# nbgitpuller
2323

24+
https://github.com/jupyterhub/nbgitpuller
25+
26+
Allows a teacher to host his teaching material in a git repository.
27+
28+
Teacher may update the repo while course is running in order to provide new exercises or to provide solutions for older exercises.
29+
30+
nbgitpuller will will sync if either
31+
32+
- the git puller url is opened
33+
- the notebook is started and git puller is configured as default url
34+
2435
## Install
2536

37+
```dockerfile
38+
FROM quay.io/jupyter/minimal-notebook:2025-06-23
39+
40+
RUN pip install nbgitpuller
41+
```
42+
2643
## Configuration
2744

28-
## Usage
45+
Link generator: https://nbgitpuller.readthedocs.io/en/latest/link.html
46+
47+
No special config needed, you just generate a link and call it
48+
49+
Hint: when using nbgitpuller with a standalone JupyterLab and not JupyterHub, you need to remove the `hub/user-redirect/` part from the resulting URL!
50+
51+
So, instead of `http://localhost:8888/hub/user-redirect/git-pull?repo=...` you should use `http://localhost:8888/git-pull?repo=...`
52+
53+
## Use it
54+
55+
## Exercise: create a git puller url for the igv-notebook repo
56+
57+
From the earlier tutorial, expand the JupyterLab with igv-notebook installed: install nbgitpuller inside this JupyterLab.
58+
59+
Then goto link generator and create a git puller link for https://github.com/igvteam/igv-notebook
60+
61+
Configure it so the `BamFiles_Lab.ipynb` example openes automatically in the JupyterLab.
62+
63+
solution: configure the link generator like this:
64+
65+
| --- | --- |
66+
| JupyterHub URL | http://localhost:8888 |
67+
| Git Repository URL | https://github.com/igvteam/igv-notebook.git |
68+
| branch | main |
69+
| File to open | examples/BamFiles_Lab.ipynb |
70+
| Application to Open | JupyterLab |
71+
| Named Server to open | (leave it blank) |
72+
73+
74+
Strip off the `hub/user-redirect/` part.
75+
76+
The link will be:
77+
78+
http://localhost:8888/git-pull?repo=https%3A%2F%2Fgithub.com%2Figvteam%2Figv-notebook.git&urlpath=tree%2Figv-notebook.git%2Fexamples%2FBamFiles_Lab.ipynb&branch=main
79+
80+
It should pull the repo and opens the example automatically. You should be able to run the example if you extended the igv-notebook tutorial.
2981

3082
# nbgrader
3183

84+
https://github.com/jupyter/nbgrader
85+
3286
## Install
3387

3488
## Configuration
@@ -42,5 +96,3 @@ We present adaptions that the JLU Physics Department has been successfully using
4296
# Setup Scripts
4397

4498
## Where to place them what to do with them
45-
46-
(WIP)

topics/teaching/tutorials/jbt-galaxy/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
layout: tutorial_hands_on
33

4-
title: Provide your custom Jupyter Image via Galaxy
4+
title: Provide your custom JupyterLab via Galaxy
55
subtopic: practises
66
draft: true
7-
time_estimation: 1h
7+
time_estimation: 15m
88
questions:
99
- As a Galaxy admin, how can I provide my users with a custom Notebook Server?
1010
objectives:

topics/teaching/tutorials/jbt-jhaas/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
layout: tutorial_hands_on
33

4-
title: Teaching a course with custom Jupyter via JHaaS
4+
title: Provide your custom JupyterLab via JHaaS
55
subtopic: practises
66
draft: true
7-
time_estimation: 1h
7+
time_estimation: 15m
88
questions:
99
- How can I use my Jupyter customizations in a course relevant matter?
1010
objectives:

0 commit comments

Comments
 (0)