# RStudio as a web application

**URL:** <https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223>\
**Category:** Get Help\
**Created:** [January 25, 2024, 3:28pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223 "2024-01-25T15:28:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![maestro7879](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/maestro7879/32/1865_2.png) [@maestro7879](https://discourse.openondemand.org/u/maestro7879)\
**Post date:** [January 25, 2024, 3:28pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/1 "2024-01-25T15:28:18Z")

</div>

What is the preferred method of serving up RStudio as an application? I think this is now possible without Singularity. We would continue to use Singularity but we have been unable to figure out how to change the RStudio version.

If there is an example somewhere that would be much appreciated.

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [January 25, 2024, 4:07pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/2 "2024-01-25T16:07:35Z")

</div>

The app as OSC uses it can be seen here:

> **[GitHub - OSC/bc\_osc\_rstudio\_server: Batch Connect - OSC RStudio Server](https://github.com/OSC/bc_osc_rstudio_server)**
>
> Batch Connect - OSC RStudio Server. Contribute to OSC/bc\_osc\_rstudio\_server development by creating an account on GitHub.

As for updating the version, if that version is available on the compute cluster, you would need to just add the version to the `form.yml` for selection.

> <https://github.com/OSC/bc_osc_rstudio_server/blob/b677aad582edc875932fbacca05144e1e0206264/form.yml.erb#L222>

Then you can handle that `version` in the `script` like we do here:

> <https://github.com/OSC/bc_osc_rstudio_server/blob/3764080d08aa332abc03ad6125fd94bdd96bcbe1/template/script.sh.erb#L15>

To then use that variable to ensure you load all modules (we use `lmod` at OSC).

The `README.md` states 2 ways to set this up with Singularity being one way to set things up.

We have a link in the docs to many of the interactive apps under the OSC org on GitHub here:  
[https://osc.github.io/ood-documentation/latest/install-ihpc-apps.html](https://osc.github.io/ood-documentation/latest/install-ihpc-apps.html)

---

<div class="post-metadata">

**Author:** ![maestro7879](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/maestro7879/32/1865_2.png) [@maestro7879](https://discourse.openondemand.org/u/maestro7879)\
**Post date:** [January 25, 2024, 4:43pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/3 "2024-01-25T16:43:37Z")

</div>

Thank you.  
RStudio only needs to exist on the compute node and not the Singularity container, correct ?

---

<div class="post-metadata">

**Author:** ![travert](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/travert/32/3074_2.png) [@travert](https://discourse.openondemand.org/u/travert)\
**Post date:** [January 25, 2024, 4:59pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/4 "2024-01-25T16:59:20Z")

</div>

Correct, `lmod` should load the module on the compute node, the `script.sh` will do the work to then get the context in the container and launch it.

---

<div class="post-metadata">

**Author:** ![mjbludwig](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mjbludwig/32/684_2.png) [@mjbludwig](https://discourse.openondemand.org/u/mjbludwig)\
**Post date:** [January 25, 2024, 5:30pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/5 "2024-01-25T17:30:20Z")

</div>

FWIW, I actually build rstudio as an lmod module. I just take the rstudio rpm and `rpm2cpio [rstudio rpm] | cpio -idmv`. Rstudio is just a prebuilt binary in there so you just have to make a basic module that points to the bin in that unpacked rpm, i.e. `prepend-path PATH /home/software/rstudio/2022.12.0-353//bin`. This then allows you to build various versions of R as modules as well. Then you can make form widgets with drop downs so users can choose the R version to use and rstudio version should you want that.

---

<div class="post-metadata">

**Author:** ![mcuma](https://sea1.discourse-cdn.com/flex015/user_avatar/discourse.openondemand.org/mcuma/32/171_2.png) [@mcuma](https://discourse.openondemand.org/u/mcuma)\
**Post date:** [January 26, 2024, 4:11pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/6 "2024-01-26T16:11:08Z")

</div>

Our app uses either R installed on the system with RStudio that was hand extracted from an RPM to our apps location, or Rocker based Singularity container, where both R and RStudio are in the container. It is chosen through the R module pull down in the form.yml. It’s at [OOD-apps-v3/rstudio\_server\_app at master · CHPC-UofU/OOD-apps-v3 · GitHub](https://github.com/CHPC-UofU/OOD-apps-v3/tree/master/rstudio_server_app) though the form.yml is somewhat convoluted since we share many of the form items with other apps.The template/script.sh shows the logic of choice between the local and containerized setup, though.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/osc/original/2X/b/bae70bd0ed39a3ae769c2108155f4cb3e9da8385.png) [@system](https://discourse.openondemand.org/u/system)\
**Post date:** [July 24, 2024, 4:11pm UTC](https://discourse.openondemand.org/t/rstudio-as-a-web-application/3223/7 "2024-07-24T16:11:46Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
