|
|
This guide was written for the old cluster (2015). In case it does not work with the new cluster (2024), please reach out to me via Mattermost or document an issue [here](https://gitlab.pik-potsdam.de/sdmc/cluster-wiki/-/issues) and assign me to it (@davidgo).
|
|
|
In case it does not work, please reach out to me via Mattermost or document an issue [here](https://gitlab.pik-potsdam.de/sdmc/cluster-wiki/-/issues) and assign me to it (@davidgo).
|
|
|
|
|
|
# Important note
|
|
|
If you use the VSCode Remote SSH extension, do not use "hpc.pik-potsdam.de" but "login03-24.pik-potsdam.de" as the hostname (Old cluster: login01.pik-potsdam.de or login02.pik-potsdam.de). When ending a session, press CTRL + SHIFT + P and select “Kill VS Code Server on Host…” and select the same host.
|
|
|
# TL;DR:
|
|
|
0. You need to have set up your SSH keys previously, added direct access to a specific login node, and established the connection at least once via the terminal, otherwise you will run into errors.
|
|
|
1. Install the "Remote - SSH" extension
|
|
|
2. *DO NOT CONNECT TO hpc.pik-potsdam.de!* Instead connect *directly* to one of the four login nodes (login01-24.pik-potsdam.de - login04-24.pik-potsdam.de)!
|
|
|
3. After each session you need to “Kill VS Code Server on Host…” and select the same host.
|
|
|
( To do so, press COMMAND + SHIFT + P in VSCode on Mac and select “Kill VS Code Server on Host…” )
|
|
|
|
|
|
# Important note:
|
|
|
If you use the VSCode Remote SSH extension, do not use "hpc.pik-potsdam.de" but "login03-24.pik-potsdam.de" as the hostname! When ending a session, press CTRL + SHIFT + P and select “Kill VS Code Server on Host…” and select the same host.
|
|
|
|
|
|
This is because “clushpcter” is an alias for one or other of the login nodes, selected based on which node has the lowest current load. Repeated connections to “hpc” via the Remote SSH extension fail to reuse existing vscode-server processes, which then accumulate over time. (Exerpt from [Connection failures when using VSCode Remote SSH Extension](Troubleshooting/Problems with solutions/Connection failures when using VSCode Remote SSH Extension))
|
|
|
|
|
|
# How to connect
|
|
|
## Preliminaries:
|
|
|
Set up your ~/.ssh/config file for direct access to one of the four login nodes: (login01-24.pik-potsdam.de - login04-24.pik-potsdam.de):
|
|
|
|
|
|
1. Open VSCode
|
|
|
2. Install the "Remote - SSH" extension
|
|
|

|
|
|
3. If you are not at PIK, start a VPN connection or use a proxyjump
|
|
|
4. On the left via "Remote Explorer", you should already be able to connect to the cluster if you have have previously established a SSH connection. **If you use the VSCode Remote SSH extension, do not use hpc.pik-potsdam.de as the hostname. Instead, pick login03-24.pik-potsdam.de.**
|
|
|
- in VSCode open the ssh remote commands via the shortcut `F1`,
|
|
|
- `Remote-SSH: Add New SSH Host...`,
|
|
|
- enter specific host via `ssh username@login03-24.pik-potsdam.de`
|
|
|
- select where to store your private key (.ssh/config on your local computer)
|
|
|
- now you should be able to connect to a specific host
|
|
|
(On your local machine, run `cd` and then open the file via `nano ~/.ssh/config`. Edit the changes, and exit via CTRL + C)
|
|
|
```
|
|
|
Host login01-24.pik-potsdam.de
|
|
|
Hostname login01-24.pik-potsdam.de
|
|
|
ForwardX11 yes
|
|
|
Compression yes
|
|
|
User USERNAME
|
|
|
ProxyJump vpn
|
|
|
|
|
|
Host login02-24.pik-potsdam.de
|
|
|
Hostname login02-24.pik-potsdam.de
|
|
|
ForwardX11 yes
|
|
|
Compression yes
|
|
|
User USERNAME
|
|
|
ProxyJump vpn
|
|
|
|
|
|
Host login03-24.pik-potsdam.de
|
|
|
Hostname login03-24.pik-potsdam.de
|
|
|
ForwardX11 yes
|
|
|
Compression yes
|
|
|
User USERNAME
|
|
|
ProxyJump vpn
|
|
|
|
|
|

|
|
|
Host login04-24.pik-potsdam.de
|
|
|
Hostname login04-24.pik-potsdam.de
|
|
|
ForwardX11 yes
|
|
|
Compression yes
|
|
|
User USERNAME
|
|
|
ProxyJump vpn
|
|
|
```
|
|
|
**IMPORTANT: Make sure that you connected to the login nodes at least once via the terminal, otherwise it results in an error when trying to establish a connection for the first time via VSCode!**
|
|
|
|
|
|

|
|
|
When you first log in to a new host address you have accept the connection with `yes`:
|
|
|
{width=809 height=228}
|
|
|
|
|
|

|
|
|
# How to connect if you have set up all the above:
|
|
|
|
|
|
1. Open VSCode
|
|
|
2. Install the "Remote - SSH" extension
|
|
|

|
|
|
3. On the left via "Remote Explorer", you should already be able to connect to the login nodes if you have have previously established a SSH connection via the terminal at least once. **If you use the VSCode Remote SSH extension, do not use hpc.pik-potsdam.de as the hostname. Instead, pick login01-24.pik-potsdam.de - login02-24.pik-potsdam.de.**
|
|
|
4. Connect by clicking on the arrow and enter your passwords
|
|
|
5. If successful, you should see on the bottom left, that you are connected to the cluster:
|
|
|
|
|
|
{width=525 height=389}
|
|
|
|
|
|
4. Once connected, you should be able to connect via the Remote Explorer to the left and see the connection on the bottom left
|
|
|
{width=463 height=86}
|
|
|
|
|
|

|
|
|
6. IMPORTANT: When ending your sessions, you need to “Kill VS Code Server on Host…” to not cause errors. On Mac: press COMMAND + SHIFT + P in VSCode and select “Kill VS Code Server on Host…” and select the same host you are currently connected to.
|
|
|
|
|
|

|
|
|
{width=1101 height=382}
|
|
|
|
|
|
# First example run on the cluster using VS Code
|
|
|

|
|
|
|
|
|
# First example run on the cluster using VS Code
|
|
|
- open a terminal in VS Code (on Mac: Click on the "Terminal" menu in the top menu bar or use the shortcut " control + shift + ` ")
|
|
|
- create a new .py file in VSCode
|
|
|
- run the file on the cluster using commands in the terminal
|
|
|
|
|
|

|
|
|
|
|
|
(Info: These lines were written in June 2024, still for the old cluster from 2015.) |
|
|
\ No newline at end of file |