Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
habrok:examples:jupyter [2024/08/02 13:42] – Fix portal URL pedro | habrok:examples:jupyter [2024/08/02 15:34] (current) – Update for habrok pedro | ||
---|---|---|---|
Line 20: | Line 20: | ||
- Load the Python version you want to use and set up a virtual environment for your packages | - Load the Python version you want to use and set up a virtual environment for your packages | ||
- Create a batch job with the CPU, memory and time requirements you need, which will load the virtual environment and start the Jupyter notebook on the compute node | - Create a batch job with the CPU, memory and time requirements you need, which will load the virtual environment and start the Jupyter notebook on the compute node | ||
- | - Once the job is running you need to set up an SSH tunnel on your local system that will forward requests from your local web browser to the Jupyter notebook on a Peregrine | + | - Once the job is running you need to set up an SSH tunnel on your local system that will forward requests from your local web browser to the Jupyter notebook on a Hábrók |
- You connect your local browser to the address given in the job output | - You connect your local browser to the address given in the job output | ||
Line 30: | Line 30: | ||
First load a Python module, e.g. | First load a Python module, e.g. | ||
< | < | ||
- | module load Python/3.7.4-GCCcore-8.3.0 | + | module load Python/3.11.5-GCCcore-13.2.0 |
</ | </ | ||
If you don't need specific numerical Python package versions, consider loading the corresponding SciPy-bundle, | If you don't need specific numerical Python package versions, consider loading the corresponding SciPy-bundle, | ||
< | < | ||
- | module load SciPy-bundle/ | + | module load SciPy-bundle/ |
</ | </ | ||
If you need different versions of these packages you can ignore this step, or try a more recent Python/ | If you need different versions of these packages you can ignore this step, or try a more recent Python/ | ||
Line 73: | Line 73: | ||
# Load the Python version that has been used to construct the virtual environment | # Load the Python version that has been used to construct the virtual environment | ||
# we are using below | # we are using below | ||
- | module load Python/3.7.4-GCCcore-8.3.0 | + | module load Python/3.11.5-GCCcore-13.2.0 |
# Activate the virtual environment | # Activate the virtual environment | ||
Line 101: | Line 101: | ||
or http:// | or http:// | ||
</ | </ | ||
- | The thing to take a note of here is the address of the Jupyter web server, including the nodename, the port number and a *secret* token. The nodename is the machine name given in the http address. In this case '' | + | The thing to take a note of here is the address of the Jupyter web server, including the nodename, the port number and a *secret* token. The nodename is the machine name given in the http address. In this case '' |
We now need to setup an SSH tunnel from our local machine to the node where the job is running. For this we also need to define on which port we want the remote session to be available locally. We will refer to this port number as '' | We now need to setup an SSH tunnel from our local machine to the node where the job is running. For this we also need to define on which port we want the remote session to be available locally. We will refer to this port number as '' | ||
Line 108: | Line 108: | ||
On command line SSH this can be done using a command like: | On command line SSH this can be done using a command like: | ||
< | < | ||
- | ssh username@peregrine.hpc.rug.nl -L jupyter_local_port: | + | ssh username@login1.hb.hpc.rug.nl -L jupyter_local_port: |
</ | </ | ||
- | Note that this command will open a session on Peregrine, which you have to leave open for the tunnel to keep working. | + | Note that this command will open a session on Habrok, which you have to leave open for the tunnel to keep working. |
When using MobaXterm you can set up an SSH tunnel using the Tunnel icon in the top list. After clicking on this icon you can select "New SSH tunnel", | When using MobaXterm you can set up an SSH tunnel using the Tunnel icon in the top list. After clicking on this icon you can select "New SSH tunnel", | ||
Line 116: | Line 116: | ||
Within this menu you have to add the following settings: | Within this menu you have to add the following settings: | ||
- < | - < | ||
- | - <SSH server> : A Peregrine | + | - <SSH server> : A Hábrók |
- | - <SSH login>: Your Peregrine | + | - <SSH login>: Your Hábrók |
- <SSH port>: This can be left at the default of 22. | - <SSH port>: This can be left at the default of 22. | ||
- | - <Remote server> : The '' | + | - <Remote server> : The '' |
- <Remote port> : The '' | - <Remote port> : The '' | ||
After saving these settings, you can start the tunnel by clicking on the start button with the triangle icon. | After saving these settings, you can start the tunnel by clicking on the start button with the triangle icon. | ||
Line 128: | Line 128: | ||
Since we need to connect to Jupyter on the local machine using a certain port number as well, you may also get issues if that port is already occupied, for example by a local Jupyter session. If this happens you have to adjust the '' | Since we need to connect to Jupyter on the local machine using a certain port number as well, you may also get issues if that port is already occupied, for example by a local Jupyter session. If this happens you have to adjust the '' | ||
- | The way you will notice this problem is that the SSH tunnel will refuse to start, and that connecting to the notebook will show you a connection to your local machine, instead of the remote | + | The way you will notice this problem is that the SSH tunnel will refuse to start, and that connecting to the notebook will show you a connection to your local machine, instead of the remote |
==== Connect to the Jupyter notebook ==== | ==== Connect to the Jupyter notebook ==== |