You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

To launch RStudio on GRACE you need to create a submission script. You can use the following template below:

rstudio_server.sh
#!/bin/bash

#SBATCH --job-name=RStudio_Server
#SBATCH --nodes=1
#SBATCH --time=10:00:00
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --partition=any
#SBATCH --mem=10GB
#SBATCH --output=/home/%u/rstudio-server.job.%j


readonly PORT=$(python -c 'import socket; s=socket.socket(); s.bind(("", 0)); print(s.getsockname()[1]); s.close()')
cat 1>&2 <<END
1. SSH tunnel from your workstation using the following command:

   ssh -N -L 8787:${HOSTNAME}:${PORT} ${USER}@144.30.235.160

   and point your web browser to http://localhost:8787

2. log in to RStudio Server using the following credentials:

   user: ${USER}
   password: ${PASSWORD}

When done using RStudio Server, terminate the job by:

1. Exit the RStudio Session ("power" button in the top right corner of the RStudio window)
2. Issue the following command on the login node:

      scancel -f ${SLURM_JOB_ID}
END

module use --append /home/$USER/modulefiles
module load singularity/x.y.z
module load rstudio_singularity
rserver --www-port ${PORT}

When you submit the job you will need to find the output file that contains the instructions to create the ssh tunnel to connect to RStudio. A VPN connection is required to open SSH tunnels. To open the SSH tunnel simply open a terminal on your local machine and copy the ssh command in the output file and then type "http://localhost:8787" in your browser window once the tunnel connects.

  • No labels