HPC High Performance Computing: 8.2. Jupyter Notebook

Jupyter Notebook

Run an interactive job reserving 16 GB of memory in order to install the packages in the environment:

nsurname@ohpc:~$ salloc -w node002 -p high --mem 16GB 

Load Anaconda3 or Miniconda3 module:

nsurname@node001:~$ module load Miniconda3/4.9.2

Create the virtual environment installing Jupyterlab and Jupyter:

nsurname@node001:~$ conda create -n jupyter python=3.9 jupyterlab jupyter

Load the bash shell:

nsurname@node001:~$ eval "$(conda shell.bash hook)"

Activate the virtual environment:

nsurname@node001:~$ conda activate jupyter

Run Jupyter Notebook. The application default port is 8888:

(jupyter) [nsurname@node001 ~]$ jupyter notebook --no-browser --ip='0.0.0.0' --port=8888

Find in which node is running the job and the port that Jupyter Notebook is using, in this case, it is the node001 and the port number 8888. 

Now you have to open a tunnel SSH to establish a direct connection from your Computer to the Compute Node [node 001] through hpc.s.upf.edu, choose 1 or 2 depending of your Operating System.

1) In case you use Linux in your computer, open a new terminal session and create a SSH tunneling:

 ssh -p 22 -L 16008:node001:8888 <username>@hpc.s.upf.edu

2) In case you use Windows in your computer, open and create a new Putty session and fileld [Tunnels] and [Session] sections as follows:

Open a browser in your computer and connect to the following URL:

 http://localhost:16008/

In this case, you will have to add the token of the URL in the "Password or token" field. You can also access directly if you paste the URL:

http://127.0.0.1:8888/tree?token=427245a6807f383929b2837521d9dd8ad56165cefbbe7be0

And replace 8888 for 16008.