Difference between revisions of "RStudio Server"

From UFRC
Jump to navigation Jump to search
(Created page with "Category:SoftwareCategory:Statistics To run RStudio Server in a job on HiPerGator and connect to the session from a web browser on your local computer do the following...")
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
[[Category:Software]][[Category:Statistics]]
 
[[Category:Software]][[Category:Statistics]]
 +
 +
{{Note | We recommend using RStudio through [[Open OnDemand]] as the main GUI interface to R| warn}}
 +
 
To run RStudio Server in a job on HiPerGator and connect to the session from a web browser on your local computer do the following:
 
To run RStudio Server in a job on HiPerGator and connect to the session from a web browser on your local computer do the following:
  
Line 32: Line 35:
  
 
* Use the above information to create an ssh tunnel from your local computer to the rserver instance.
 
* Use the above information to create an ssh tunnel from your local computer to the rserver instance.
 +
** {{Note | Once you enter the ssh line and get connected, '''the terminal will appear to hang and just sit there.''' <br> This is normal, proceed to the next step, '''leaving the terminal running in the background'''.| warn}}
 
* Open [http://localhost:8080 http://localhost:8080] in the web browser on your local computer.
 
* Open [http://localhost:8080 http://localhost:8080] in the web browser on your local computer.
  
 
If you run into any issues [https://support.rc.ufl.edu open a support ticket].
 
If you run into any issues [https://support.rc.ufl.edu open a support ticket].
 +
 +
If you need to access environment variables outside of the small list RStudio Server allows through like SLURM_CPUS_ON_NODE to automate parallelization use the following patter in your job script
 +
 +
module purge; module load R
 +
env > ~/.Renviron
 +
rserver
 +
rm -f .Renviron

Latest revision as of 15:56, 22 February 2023


We recommend using RStudio through Open OnDemand as the main GUI interface to R

To run RStudio Server in a job on HiPerGator and connect to the session from a web browser on your local computer do the following:

  • Create a job script similar to the following job script, but with your own resource request. E.g. run.sh
#!/bin/bash
#SBATCH --job-name=rserver
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=4
#SBATCH --mem=8gb
#SBATCH --time=48:00:00
#SBATCH --output=rserver_%j.log
module purge; module load R
rserver
  • Submit the job
sbatch run.sh
  • Once the job starts see the connection information in the job log. E.g.
$ cat rserver_9999999.log

Starting rserver on port 37546 in the /blue/somegroup/someuser/rserver_test directory.
Create an SSH tunnel with:
ssh -N -L 8080:c12345a-s42.ufhpc:37546 albert.gator@hpg.rc.ufl.edu
Then, open in the local browser:
http://localhost:8080
  • Use the above information to create an ssh tunnel from your local computer to the rserver instance.
    • Once you enter the ssh line and get connected, the terminal will appear to hang and just sit there.
      This is normal, proceed to the next step, leaving the terminal running in the background.
  • Open http://localhost:8080 in the web browser on your local computer.

If you run into any issues open a support ticket.

If you need to access environment variables outside of the small list RStudio Server allows through like SLURM_CPUS_ON_NODE to automate parallelization use the following patter in your job script

module purge; module load R
env > ~/.Renviron
rserver
rm -f .Renviron