02 - RStudio server
Launching RStudio server
We will use RStudio server to run MitoPilot. RStudio server on Hydra functions just like the normal RStudio on your local computer, except that you are accessing it remotely.
There are two methods to access RStudio server on Hydra.
Method 1: RStudio Galaxy server (recommended)
The Hydra Team recently launched an interactive R Studio environment that is accessible directly via a browser, at https://galaxy.si.edu/R4.
Hydra users can leverage this server to test, debug, and develop R based workflows using the interactive RStudio GUI (currently running R 4.4.3).
By logging in with your Hydra account credentials, users will have access to the storage under /pool, /scratch, and /store. This server offers resources totaling 192 CPUs and 1.5 T of RAM.
Notes:
- This is a shared resource and should be used accordingly. Long running jobs or jobs requiring the entire resources of the server would be more appropriate as a job submission.
- This server is only accessible from trusted computers, not on the public internet. For technical reasons, to access this resource via telework.si.edu, go to https://galaxy.si.edu and then choose the “R4 v443” option.
- This is a new resource - please be patient as we test this offering with our user community. We will evaluate this test once Hydra is moved to the new datacenter and decide whether it should be kept or altered in any way.
Method 2: tunneling to a RStudio server session
To launch RStudio server on Hydra, run the following.
# avoid package conflicts (may not be necessary for all users)
conda deactivate
# load the RStudio server module
module load tools/R/RStudio/server
# launch RStudio server
start-rstudio-server
If this is your first time launching RStudio server, you may be asked to run a different command.
You will see something like this printed to your screen.
start-rstudio-server: starting RStudio server on host=login02 and port=8787
you need to create a ssh tunnel on your local machine with
ssh -N -L 8787:login02:8787 macguigand@hydra-login01.si.edu
Point your browser to http://localhost:8787 on your local machine.
Use Control+C in this window to kill the server when done.
TTY detected. Printing informational message about logging configuration. Logging configuration loaded from '/etc/rstudio/logging.conf'. Logging to '/home/macguigand/.local/share/rstudio/log/rserver.log'.
If you get a message saying “ERROR system error 98 (Address already in use)”, someone else has a tunnel established with the default port (8787). To fix this, try using a different port, e.g. start-rstudio-server -port 8890
. Any port number between 1025-65535 is allowed.
Leave this cluster terminal window open, open a new terminal window on your local computer, and run the ssh
command printed by start-rstudio-server
.
ssh -N -L 8787:login02:8787 macguigand@hydra-login01.si.edu
Enter your Hydra password when prompted. If nothing happens, this means that you have successfully established a SSH tunnel and can connect to RStudio server.
Leaving both terminal windows open, enter http://localhost:YOUR_PORT_NUMBER in a web browser. We recommend using Chrome or Firefox. There are some known issues running MitoPilot with Safari.
Enter your cluster login credentials to access the RStudio server. This should open a full RStudio session in your browser. Any R commands run in this new window will execute on the cluster.