...
No Format |
---|
#!/bin/bash #PBS -N jupyterNotebook #PBS -m abe #PBS -M myEmail@griffithuni.edu.au #PBS -q workq #PBS -l select=1:ncpus=1:mem=12gb,walltime=5:00:00 # get tunneling info XDG_RUNTIME_DIR="" node=$(hostname -s) user=$(whoami) cluster="gc-prd-hpclogin1" port=8889 #### choose##choose your own unique port between 8000 and 9999 cd $PBS_O_WORKDIR # print tunneling instructions jupyter-log to tunnel.$PBS_JOBID.txt JJID=`echo $PBS_JOBID|sed 's/\.gc-prd-hpcadm//g'` echo -e " Command to create ssh tunnel: ssh -N -f -L ${port}:${node}:${port} ${user}@${cluster}.rcs.griffith.edu.au Use a Browser on your local machine to go to: localhost:${port} (prefix w/ https:// if using password)" >jupyter-log>tunnel.$JJID.txt # load modules or conda environments here module load anaconda3/2021.11 source activate myenvsource activate snumber-tf-cpu # Run Jupyter jupyter-notebook --no-browser --port=${port} --ip=${node} 2>&1 | tee notebookjupnote.$JJID.log |
This job launches Jupyter on the allocated compute node and we can access it through an ssh tunnel as we did in the previous section.
...
Once the job is running, a log file will be created that is called jupyter-notebook-jupnote.<jobid>.log. The log file contains information on how to connect to Jupyter, and the necessary token.
...
No Format |
---|
ssh -N -f -L 8889:gc-prd-hpcn002:8889 <YourNetID>@tigercpu.princeton.edu |
where gc-prd-hpcn002 is the name of the node that was allocated in this case.
...
s123456@gc-prd-hpclogin1.rcs.griffith.edu.au
Have a look at the file named tunnel.$PBS_JOBID.txt for exact syntax. Copy and paste that on a laptop (if running linux or mac). If running windows, use putty to enable tunneling. |
where gc-prd-hpcn002 is the name of the node that was allocated in this case.
In order to access Jupyter, have a look at the file named "jupnote.$JJID.log" and copy and paste one of these URLs. As an example:
http://127.0.0.1:8889/?token=2ac632f932d17059377fcfe25afc9d52fd29bf83ba6c0999
Only packages that are available to the user are those made available by loading the anaconda3 module. If you have created your own Conda environment then you will need to activate it (e.g source activate myenv)
...