Versions Compared

Key

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

...

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 your own unique port between 8000 and 9999

cd  $PBS_O_WORKDIR
# print tunneling instructions jupyter-log
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)" cd  $PBS_O_WORKDIR>jupyter-log.txt

# load modules or conda environments here
module load anaconda3/20202021.11
source activate myenv
# Run Jupyter
jupyter-notebook --no-browser --port=${port} --ip=${node} > notebook.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.

...