Jupyter Notebook
Running a jupyter notebook in the WI-HPC cluster requires Apptainer and SSH Tunneling.
This process is best done through an interactive srun
session as you will be required to input your password (same one you use to login to the HPC cluster with).
- Login to
wi-hpc
and start an interactive session, where the--options
will be your requested resources. See Key Slurm Flags for a list of all available options.
ssh wi-hpc
srun --pty --options /bin/bash
- Load the Apptainer module and pull down the image you would like to use from Docker Hub. See the Jupyter Project for a full list of all the available types of Jupyter notebooks.
module load apptainer
apptainer pull docker://jupyter/scipy-notebook:latest
- Set up a port to use, for this example we will use 8888. However, only ONE notebook can run on a single port at a time. The better way to to do this is to choose a port at random.
PORT=8888
# or select at random with =$(shuf -i 8888-9999 -n 1)
- Execute the command to setup the SSH tunnel from the container back to the HPC cluster
apptainer exec scipy-notebook_latest.sif /usr/bin/ssh -N -f -R $PORT:localhost:$PORT wi-hpc
- Start up the notebook in the container over the specified port.
Note
COPY OF THE URL STARTING WITH http://127.0.0.1 (also known as localhost)
apptainer exec scipy-notebook_latest.sif jupyter-notebook --no-browser --port=$PORT
- Finally, setup the SSH tunnel from your laptop/desktop to the HPC cluster. Make sure to set the port number same as before.
$PORT=8888
ssh -N -L $PORT:localhost:$PORT wi-hpc
- Open your preferred browser (Chrome, Firefox, or Edge) and paste in the URL you copied earlier. You are now logged into the Jupyter Notebook!