Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

On a seperate terminal (terminal for Mac/linux and Windows Command Prompt (for windows desktop users) type this to enable tunneling:

ssh -N -f -L port:n061gn061:port s123456@gc-prd-hpclogin1s123456@clogin1.rcs.griffith.edu.au

e.g:  ssh -N -f -L 8555:n061gn061:8555 s123456@gc-prd-hpclogin1s123456@clogin1.rcs.griffith.edu.au

It should return nothing if successful.

...

No Format
#!/bin/bash
#PBS -N jupyterN
#PBS -m abe
#PBS -M myemail@griffithuni.edu.au
##PBS -q workq
#PBS -q gpuq2
#PBS -l select=1:ncpus=1:ngpus=1:mem=12gb,walltime=0:13:00

# get tunneling info
XDG_RUNTIME_DIR=""
node=$(hostname -s)
user=$(whoami)
cluster="gc-prd-hpclogin1clogin1"
##Please change below port as it may be in use
##choose your own unique port between 8000 and 9999
port=8895

cd  $PBS_O_WORKDIR
# print tunneling instructions tunnel.$PBS_JOBID.txt
JJID=`echo $PBS_JOBID|sed 's/\.gc-prd-hpcadmcadmin//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)" >tunnel.$JJID.txt
# load modules or conda environments here
module load anaconda3/2021.11
source activate myenv
# Run Jupyter
jupyter-notebook --no-browser --port=${port} --ip=${node} 2>&1 | tee jupnote.$JJID.log

...

you will see something like this: 

ssh -N -f -L 8889:n061gn061:8889 s123456@gc-prd-hpclogin1s123456@clogin1.rcs.griffith.edu.au

cat jupnote.JOBID.log

...

Note: If needed only: you may run the following command on your local machine to start port forwarding. 

For n060 gn060 gpu node

ssh -CNL 8889:localhost:8889 s123456@n060s123456@gn060.rcs.griffith.edu.au

For gpu node n061gn061:

ssh  -N -f -L 8889:n061gn061:8889 -J s123456@gc-prd-hpclogin1s123456@clogin1.rcs.griffith.edu.au s123456@n061 s123456@gn061

Note that we selected the Linux port 8889 in the above command to connect to the notebook. If you don't specify the port, it will default to port 8888 but sometimes this port can be already in use either on the remote machine or the local one 
(i.e., your laptop). If the port you selected is unavailable, you will get an error message, in which case you should just pick another one. It is best to keep it greater than 1024.
Consider starting with 8888 and increment by 1 if it fails, e.g., try 8888, 8889, 8890 and so on. If you are running on a different port then substitute your port number for 8889.

...