...
No Format |
---|
http://127.0.0.1:8889/?token=61f8a2aa8ad5e469d14d6a1f59baac05a8d9577916bd7eb0 Another example: http://127.0.0.1:8890/?token=8df8a9a79c00f0813055d48dfc79785c8ff6597cc0b1c456 Choose "New" then "Python 3" to launch a new notebook. Note that Jupyter may use a port that is different than the one you specified. This is why it is important to copy and paste the URL. When you are done, terminate the ssh tunnel on your local machine (desktop/laptop) by running lsof -i tcp:8889 to get the PID and then kill -9 <PID> (e.g., kill -9 6010). |
Choose "New" then "Python 3" to launch a new notebook. Note that Jupyter may use a port that is different than the one you specified. This is why it is important to copy and paste the URL.
When you are done, terminate the ssh tunnel on your local machine (desktop/laptop) by running lsof -i tcp:8889 to get the PID and then kill -9 <PID> (e.g., kill -9 6010).
Running it as a PBS jobRunning it as a PBS job
The second way of running Jupyter on the cluster is by submitting a job via pbs that launches Jupyter on the compute node
In order to do this we need a submission script like the following called jupyter.pbs
No Format |
---|
#!/bin/bash
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4G
#SBATCH --time=00:05:00
#SBATCH --job-name=jupyter-notebook
# get tunneling info
XDG_RUNTIME_DIR=""
node=$(hostname -s)
user=$(whoami)
cluster="tigercpu"
port=8889
# print tunneling instructions jupyter-log
echo -e "
Command to create ssh tunnel:
ssh -N -f -L ${port}:${node}:${port} ${user}@${cluster}.princeton.edu
Use a Browser on your local machine to go to:
localhost:${port} (prefix w/ https:// if using password)
"
# load modules or conda environments here
module load anaconda3/2020.11
# Run Jupyter
jupyter-notebook --no-browser --port=${port} --ip=${node} |
Aside on ssh
Looking at the man page for ssh, the relevant flags are:
...