Skip to content

Batch Connect - Example Shiny App that runs on OSC OnDemand

License

Notifications You must be signed in to change notification settings

chpc-uofu/bc_osc_example_shiny

 
 

Repository files navigation

[WIP] Batch Connect - OSC Example Shiny App

GitHub Release GitHub License

A Batch Connect app designed for OSC OnDemand that launches a Shiny App within an Owens batch job.

Prerequisites

This Batch Connect app requires the following software be installed on the compute nodes that the batch job is intended to run on (NOT the OnDemand node):

  • Shiny x.y.z+
  • Lmod 6.0.1+ or any other module purge and module load <modules> based CLI used to load appropriate environments within the batch job

Install

Use git to clone this app and checkout the desired branch/version you want to use:

scl enable git19 -- git clone <repo>
cd <dir>
scl enable git19 -- git checkout <tag/branch>

You will not need to do anything beyond this as all necessary assets are installed. You will also not need to restart this app as it isn't a Passenger app.

To update the app you would:

cd <dir>
scl enable git19 -- git fetch
scl enable git19 -- git checkout <tag/branch>

Again, you do not need to restart the app as it isn't a Passenger app.

Contributing

  1. Fork it ( https://github.com/OSC/bc_osc_example_shiny/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

CHPC's notes

Functional overview

  • Uses CHPC's R (3.6.1) which has shiny installed
  • To run a webserver, use an openresty container running nginx
  • The script.sh that launches the OOD app creates a nginx config file and Shiny app launcher, then runs R with the launcher, followed by looking for the Unix socket created by the R's Shiny, thich then gets used by the nginx startup
  • The user shiny app path is specified in the job specs' input box

Note that Shiny app can be also launched from the OOD's RStudio app by typing library('shiny') runApp("newdir") - where "newdir" is the directory where app.R resides

Application's dependencies

R libraries that are needed by the application need to either be installed centrally to CHPC's R libraries location, or to other shared directory location. The former approach risks potential version conflicts with other library dependencies (this is more of an issue in Python but is possible in R as well).

Best practice may be for the creator of the app to install all the dependencies to his/her home directory, and in the app modify the R library path (using the .libPaths function) to add this directory to it.

About

Batch Connect - Example Shiny App that runs on OSC OnDemand

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 57.1%
  • R 23.3%
  • HTML 19.6%