This version (2023/06/22 05:33) was approved by katrin.The Previously approved version (2023/06/22 05:37) is available.Diff

Jupyter notebook

Information

There is also a jupyterhub available, see Jupyterhub

To use jupyter notebook on VSC-3 nodes log in from a login node to your node, e.g. by doing:

salloc -N 1 [-L <licence> -J <jobname> ..]
srun hostname
ssh nXX-XXX
module load intelpython/35/2017

First time setup (to allow access from other hosts):

jupyter notebook --generate-config
sed -i "s/#c.NotebookApp.allow_origin/c.NotebookApp.allow_origin/;s/#c.NotebookApp.ip.*/c.NotebookApp.ip = '0.0.0.0'/" .jupyter/jupyter_notebook_config.py
Without this change in the configuration the jupyter notebook won't be reachable via the ssh-tunnel

To start the jupyter notebook:

nXX-XXX> jupyter notebook --port=12345 --no-browser
[..]
    Copy/paste this URL into your browser when you connect for the first time,
  to login with a token:
      http://0.0.0.0:12345/?token=aecbb236af1c04281ce5f7765bf0cc6003b2e4a9710cd7d2

Note down the token the notebook server produced (e.g. 'aecbb236af1c04281ce5f7765bf0cc6003b2e4a9710cd7d2')

To connect to the given port (in this example 12345), it has to be forwarded to your local browser (on the local command line):

my_local_machine> ssh -L 12345:<vsc3 node nXX-XXX>:12345 <user>@vsc3.vsc.ac.at

Please make sure that you use the right node when starting the tunnel (the machine the jupyter notebook server was started)

Do not close the terminal window with the ssh tunnel session!

Now connect with your local browser to the URL given by jupyter (including the first-time-token you noted down earlier):

http://localhost:12345/?token=<token>

When your work is finished on the allocated node, release the node allocation with

scancel $JOBID

or (if you do not remember the job id and had only one job running), alternatively with

scancel -u $USER
  • doku/jupyter/manual_jupyter_server.txt
  • Last modified: 2023/06/22 05:37
  • by katrin