Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Warning

While this interactive app has been tested, there is a possibility that users may have use cases or desires that are incompatible with the current version of the interactive app. If this happens to you please reach out to the HPC admins and let us know via email: hpcadmin@uams.edu


...

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

Code Block
titlerstudio_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}

first login to the HPC portal at: portal.hpc.uams.edu

...

Then navigate to the Interactive Apps tab in the top and select RStudio Server

Image Added



...

This will bring up a submission form where you will specify time, memory, CPUs, node type, and conda environment path needed for your job. 

You can also specify which type of nodes you want to queue on using the Queue drop down menu. 

Warning

By default the RStudio server will use the base conda environment for the R library and R version. If you need other packages or a different R version you should create a conda environment containing all the packages and appropriate R version on the login node. You then would give the full conda environment path (i.e. /home/username/.conda/envs/my_env) in the "conda env fullpath" box to specify the location of the conda environment to get your desired R packages and version. For more information about creating conda packages on the HPC please refer to the appropriate documentation: https://hpc.uams.edu/display/HPC/Conda+and+Jupyter+App+Documentation

Click Launch to submit the RStudio Server as a job.

Image Added


...

Once the job is submitted your RStudio Server session will be Queued

Image Added


...

Once the RStudio Server session has found an available node the status will switch to Starting. The RStudio Server session will not be available yet as it is still starting up.

Image Added

...

Once your RStudio Server session is ready the status will change to Running and you must click on the "(R) Connect to RStudio Server" button to access RStudio

Image Added

...

Once you click the Connect button you should see RStudio displayed in your browser. 

Warning

Note: As the RStudio session is running on a compute node (which doesn't have internet access), you will be unable to install packages from within the RStudio Session. You must leave the session and update your conda environment and resubmit the RStudio job to add packages that you have forgotten. 


Image Added

...

Warning

NOTE: If you switch R versions by changing conda environments you will see a message like this in the new session. 


Image Added

Warning

While the version of R has changed you may feel more comfortable restarting R as shown below

Image AddedWhen 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.