...
The trick is to start RStudio server via a job submitted to a computing node and creating a SSH tunnel to access it on a local PC.
...
Create a the following file:
Code Block | ||||
---|---|---|---|---|
| ||||
#!/bin/bash
#SBATCH --partition plgrid
#SBATCH --nodes 1
#SBATCH --ntasks-per-node 6
#SBATCH --time 0:30:00
#SBATCH --job-name rstudio-server-tunnel
#SBATCH --output rstudio-log-%J.txt
## get tunneling info
XDG_RUNTIME_DIR=""
ipnport=$(shuf -i8000-9999 -n1)
ipnip=$(hostname -i)
user=$USER
## print tunneling instructions to rstudio-log-{jobid}.txt
echo -e "
Copy/Paste this in your local terminal to ssh tunnel with remote
-----------------------------------------------------------------
ssh -o ServerAliveInterval=300 -N -L $ipnport:$ipnip:$ipnport ${user}@ares.cyfronet.pl
-----------------------------------------------------------------
Then open a browser on your local machine to the following address
------------------------------------------------------------------
localhost:$ipnport (prefix w/ https:// if using password)
------------------------------------------------------------------
"
module load rstudio-server/2022.12.0+353-foss-2021b-java-11-r-4.2.0
## start an rserver instance
rserver-start --www-port $ipnport |
...
Code Block | ||
---|---|---|
| ||
ssh -o ServerAliveInterval=300 -N -L 8511:172.20.68.193:8511 plgusername@ares.cyfronet.pl |
...
Open in browser: `localhost:8511
`
...