Skip to content

How to run a huge Jupyter Notebook (bigger than the ones provided through Jupyterhub)

Start an interactive job with the ressource requests you have in mind e.g. this will provide ssh login on a workernode with 60GB memory, 8cores for 8h runtime:

[chbeyer@pal94]~% condor_submit -i -append request_cpus=8 -append request_memory=60GB -append request_runtime=28800 Submitting job(s). 1 job(s) submitted to cluster 2816959. Waiting for job to start...

Once logged into the slot:

start the notebook

[chbeyer@bird759]~chbeyer% jupyter notebook --no-browser --port=40000 --ip=131.169.77.205 [I 2024-11-28 15:39:57.908 ServerApp] jupyter_lsp | extension was successfully linked. < snip > [I 2024-11-28 15:39:58.317 ServerApp] Serving notebooks from local directory: /afs/desy.de/user/c/chbeyer/htcondor/testjobs [I 2024-11-28 15:39:58.318 ServerApp] Jupyter Server 2.14.1 is running at: [I 2024-11-28 15:39:58.318 ServerApp] http://131.169.77.205:40000/tree?token=abafc875c710f195bc236c7d7cbd35df34bdbd89d080646d [I 2024-11-28 15:39:58.318 ServerApp] http://127.0.0.1:40000/tree?token=abafc875c710f195bc236c7d7cbd35df34bdbd89d080646d [I 2024-11-28 15:39:58.318 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 2024-11-28 15:39:58.331 ServerApp] To access the server, open this file in a browser: file:///var/lib/condor/execute/dir_1308296/.local/share/jupyter/runtime/jpserver-1318198-open.html Or copy and paste one of these URLs: http://131.169.77.205:40000/tree?token=abafc875c710f195bc236c7d7cbd35df34bdbd89d080646d http://127.0.0.1:40000/tree?token=abafc875c710f195bc236c7d7cbd35df34bdbd89d080646d

use sshuttle to access the notebook

as you normally have no access to the worker node subnet you need to use a trick and run sshuttle through the naf-jhub server:

determin IP of the worker your notebook runs on

[chbeyer@bird759]~chbeyer% nslookup bird759 Server: 131.169.40.200 Address: 131.169.77.205

A small sshuttle hack redirects the traffic to the node running the notebook through the jhub

chbeyer@framo:~$ cat sshuttle_naf-jhub03.sh \#!/bin/bash exec sshuttle -r chbeyer@131.169.4.98 -x 131.169.4.98 131.169.77.205

On the CMD line exec the sshuttle script and connect your browser to the given address above