Update Cluster notes authored by Federico Izzo's avatar Federico Izzo
WIP
\ No newline at end of file
## Port forwarding
In order to be able to have ssh port forwarding follow this guidelines.
Disclaimer: this approach assume usage of [jump host](https://gitlab.fbk.eu/di-center/di-club/di-club-technical/-/wikis/A.-intro/1.-DICLUB-and-slurm-intro) technique. For VPN approach this was not tested.
#### Update ssh config
Update ssh config (usually inside ~/.ssh/config) adding this line:
```yaml
Host sshJumpFbk
Hostname jump.fbk.eu
User <your-username>
IdentityFile <path-to-the-key-used-for-jumphost>
Host diclub
Hostname diclubclsin.fbk.eu
User <your-username>
ProxyJump sshJumpFbk
IdentityFile <path-to-the-key-used-for-jumphost>
LocalForward 65432 localhost:65432
```
Port number 65432 is not mandatory, it is possible to specify any number with the shrewdness of use the same value in steps below
#### Get a node
It is possible to use this command to reserve a node inside the cluster:
```bash
srun --gres=gpu:1 -p gpu-K80 --pty bash -i # for a node with a gpu
```
#### Identify the node number
At this point with
```bash
squeue -u $USER
```
user need to take note of node number, for example *node9*, *node11*, etc.
#### Start process
Start process that needs port forwarding. An example may be jupyter notebook:
```bash
d your-project
./run run_misc --notebook --port 65432 --config path_to_config/config.ini
```
#### Connect local machine to the node
From a new terminal inside user's local machine:
```bash
ssh diclub ssh <node> -L <port>:localhost:<cluster-port>
```
Where:
* \<node\> is the node number (*node9*, *node11*, etc); * \<port\> is the port written inside ~/.ssh/config;
* \<cluster-port\> is the port of step "Start process".
An example may be:
```bash
ssh diclub ssh node9 -L 65432:localhost:65432
```
\ No newline at end of file