Using Jupyter Notebooks on MN5
This document describes a simple process for setting up a Jupyter Notebook on Mare Nostrum 5, allowing the user to access it on the web browser on their local machine.
Setup Environment
Since Mare Nostrum 5 does not allow users to connect to the internet for installing packages (e.g. using pip), we are going to create a Singularity container with all the necessary libraries locally and transfer it to MN5.
-
Clone this repository to your local machine
-
Navigate to the
jupyterfolder that contains the Singularity definition file and therequirements.txt -
Build the Singularity container
-
Transfer the container file to MN5
Allocate a node and run Jupyter
-
Connect to MN5
-
Allocate an interactive session on a GPU node
Info
You can find your
<project_name>by running the commandbsc_project liston MN5. -
Take note of the hostname of the allocated node (e.g.
as05r3b32) -
Load the Singularity module
-
Open a shell in the Singularity container
-
Run Jupyter Lab
-
Copy the Jupyter Lab URL with the access token (e.g.
http://127.0.0.1:8888/lab?token=8cc8d81...)
Create a Tunnel
-
Open another terminal on your local PC, while keeping the first one running
-
In this new terminal, type the following command, replacing
<allocated_node>with the node name you took note previously:GPP vs ACC nodes
If you allocated a GPP node instead of an ACC node, replace
alogin1withglogin1
Connect to Jupyter
On your local PC, go to your web browser and paste the Jupyter Lab URL you copied.
You should see the Jupyter Lab interface.
End Jupyter Lab Session
If you want to finish your session, go to the first terminal (the one that is running Jupyter Lab) and press ctrl c.
Then, type exit to leave the Singularity container. Type exit again to close your interactive session on the compute node.