Both sides previous revision Previous revision Next revision | Previous revision |
software:rstudio [2025-03-24 18:26] – [Using R Studio] anita | software:rstudio [2025-03-24 18:40] (current) – [Access RStudio Interface] anita |
---|
==== Start RStudio Server in Singularity Container ==== | ==== Start RStudio Server in Singularity Container ==== |
<note important> | <note important> |
Do not run RStudio on the login (head) nodes. Always start an interactive job on the compute node before launching RStudio. | Do not run RStudio on the login (head) nodes. Always start an interactive job on a compute node before launching RStudio. |
</note> | </note> |
First, make sure you are in your workgroup, then launch an interactive job on a compute node. For example using workgroup ''it_css'', account ''traine'' and specifying the ''standard'' partition, 2GB of memory and 1 hour of time, it would look something like this | First, make sure you are in your workgroup, then launch an interactive job on a compute node. For example using workgroup ''it_css'', account ''traine'' and specifying the ''standard'' partition, 2GB of memory and 1 hour of time, it would look something like this |
[(it_css:traine)@r1n17 ~] | [(it_css:traine)@r1n17 ~] |
</code> | </code> |
Once on the compute node the prompt changes accordingly, in this case the compute node name is ''r1n17''. Now use VALET to load the RStudio package and the necessary software dependencies. | Once on a compute node the prompt changes accordingly, in this case the compute node name is ''r1n17''. Now use VALET to load the RStudio package and the necessary software dependencies. |
<code bash> | <code bash> |
[(it_css:traine)@r1n17 ~]$ vpkg_require r-studio-server/4.2.1 | [(it_css:traine)@r1n17 ~]$ vpkg_require r-studio-server/4.2.1 |
</note> | </note> |
=== Linux/MacOS === | === Linux/MacOS === |
If you are using Linux or MacOS, open the terminal on your laptop and type | If you are using Linux or MacOS, open the terminal on your laptop or desktop computer, and type |
<code bash> | <code bash> |
ssh -L 8787:r1n17:8787 traine@darwin.hpc.udel.edu | ssh -L 8787:r1n17:8787 traine@darwin.hpc.udel.edu |
</code> | </code> |
be sure to replace ''traine'' with your actual username, and substitute ''r1n17'' with the compute node where your interactive job is running and you started the ''rserver'' in the previous step. You will need to log in using your DARWIN credentials in this terminal. If you are doing this on Caviness, then you would use the same command but replace ''darwin.hpc.udel.edu'' with ''caviness.hpc.udel.edu''. | be sure to replace ''traine'' with your actual username, and substitute ''r1n17'' with the compute node name where your interactive job is running and where you started ''rserver'' in the previous step. You will need to log in using your DARWIN credentials in this terminal. If you are doing this on Caviness, then you would use the same command but replace ''darwin.hpc.udel.edu'' with ''caviness.hpc.udel.edu''. |
| |
=== Windows === | === Windows === |
{{:software:rstudio-putty-1.png?400|}} | {{:software:rstudio-putty-1.png?400|}} |
| |
If you are doing this on Caviness, then you would use ''caviness.hpc.udel.edu'' instead of ''darwin.hpc.udel.edu''. In addition to your standard connection settings, you'll need to set up an SSH tunnel. To do this, navigate to **Connection → SSH → Tunnels** in PuTTY. Then, add the **Source Port** to ''8787'' and the **Destination** to ''r1n17:8787'' (remember to replace ''r1n17'' with the compute node where your interactive job is running and you started the ''rserver'' in the previous step). | If you are doing this on Caviness, then you would use ''caviness.hpc.udel.edu'' instead of ''darwin.hpc.udel.edu''. In addition to your standard connection settings, you'll need to set up an SSH tunnel. To do this, navigate to **Connection → SSH → Tunnels** in PuTTY. Then, add the **Source Port** to ''8787'' and the **Destination** to ''r1n17:8787'' (remember to replace ''r1n17'' with the compute node name where your interactive job is running and where you started ''rserver'' in the previous step). |
| |
{{:software:rstudio-putty-2.png?400|}} | {{:software:rstudio-putty-2.png?400|}} |
| |
Click **Add** to confirm the tunnel settings, then click **Open** to connect. You will be prompted to enter your username and password for your DARWIN (or Caviness) account. | Click **Add** to confirm the tunnel settings, then click **Open** to connect. You will be prompted to enter your username and password for your DARWIN (or Caviness) account depending on which hostname you used in the previous step. |
| |
{{:software:rstudio-putty-3.png?400|}} | {{:software:rstudio-putty-3.png?400|}} |
| |
==== Access RStudio Interface ==== | ==== Access RStudio Interface ==== |
Once SSH tunnel connection is open, then open a web browser and navigate to the following URL | Once SSH tunnel connection is established, then open a web browser on your laptop or desktop computer and navigate to the following URL |
<code> | <code> |
localhost:8787 | localhost:8787 |
</code> | </code> |
You should see the RStudio session start. Once you have completed your work, exit the RStudio session by closing the browser, close the SSH tunnel, and stop the ''rserver' on the compute node, and type ''exit'' to end the interactive job. | You should see the RStudio session start. Once you have completed your work, exit the RStudio session by closing the browser, close the SSH tunnel terminal, stop the ''rserver'' on the compute node with ''CTRL-C'', and then type ''exit'' to end the interactive job. |