Jupyter Notebook

Linux Desktop

To run a jupyter notebook on your linux is simple just run:

jupyter notebook

Euler Cluster

This service is made for developing and debugging your code, not to run your code on the cluster. If you wish to run it, please use the SLURM queue system. Please only request multiple cores if you are planning to run some code that can make use of multiple cores.

For more information go to the following website:

~/.config/euler/jupyterhub

I want to load a cluster module / I want to activate a virtualenv / Jupyterlab is missing some features

This script will be sourced (. ~/.config/euler/jupyterhub/jupyterlabrc) before starting any service.

cat << EOF > ~/.config/euler/jupyterhub/jupyterlabrc
module load stack
module load python_cuda
#module load sage
#jupyter kernelspec install --user $SAGE_EULER_ROOT/share/jupyter/kernels
EOF

Compute Clients (ada-X)

But if you like to run it on our “central clients” (ada-X) you need to do a port forwarding, to have access to the notebook.

There are some requirements:

The following command will start a new jupyter notebook and open a ssh tunnel.

You need to modify the following in the command:

  • HOST="ada-10" with the host you like
  • USERNAME="username" with your username to connect.

The list of hosts you can use is on the following page:

HOST="ada-10"; USERNAME="username"; PORT=$(($RANDOM % 1000 + 8000)); ssh -t $USERNAME@$HOST -L $PORT:localhost:$PORT "screen jupyter notebook --port $PORT --no-browser"

You need to keep the terminal window running otherwise the port forwarding will stop. The notebook however will still be running on the “central client”, you will just loose the connection in to the webinterface.


To be able to connect to it again, it get’s a bit tricky, you need to know on which port you have started the notebook and reopen a port forwarding to it.

This can be done with the following command (you need to modify HOST=, USERNAME= and PORT=):

HOST="ada-10"; USERNAME="username"; PORT=8943; ssh $USERNAME@$HOST -L $PORT:localhost:$PORT

Posted on
in Computing

PROTECT YOUR BRAINWORK.

An IT Security Initiative
https://itsecurity.ethz.ch

Trending

Categories

Recent Posts