Jupyter Over Tunneling
For HPC
Note: The procedure below will run the jupyter notebook on an interactive node in an HPC.
- Ssh to hpc.
- Claim an interactive node with qrsh (or something similar).
- Note the node name.
- Run jupyter on the claimed node by
jupyter notebook --no-browser --ip='0.0.0.0'
or create an alias in your bashrc for a shortcutalias jup='jupyter notebook --no-browser --ip='0.0.0.0''
. - On your own computer start another ssh session with tunnelling using the node name as noted above
ssh user@host -L8888:nodeName:8888 -N
. You will not see any message this time, but if it's not throwing any error then it's probably running just fine. - To avoid writing the code in line 5 everytime you tunnel you can use the shell script below.
I name it as jupssh
.
#!/bin/sh
# Check if the arugment is passed.
if [[ $# -eq 0 ]];
then
echo 'Usage: jupssh <node name>'
exit 1
fi
ssh user@host -L8888:$1:8888 -N
http://(nodeName or 127.0.0.1):8888/?token=3f7c3a8949b3fa1961c63653873fea075a93a29bffe373b5