CSCfi / rstudio-openshift

MIT License
7 stars 15 forks source link

RStudio Openshift

Run RStudio integrated development environment and Shiny application server on the Red Hat OpenShift platform. This package is based on the Kubernetes solution from https://github.com/Uninett/helm-charts

Template for notebooks.csc.fi can be found from template_imageready -branch

How to use this template

Install the template by downloading the rstudio-template.yaml file and import it to your OpenShift project via a web console. CLI instructions are below.

RStudio default working directory is located on persistent storage. Save all your work under the default working directory to avoid data loss. Files saved under other locations will be lost when the pod serving application restarts or changes after redeployment.

Variables

All variables are mandatory for the application to be created. When using CSC Rahti service, consult Rahti Documentation for the details of computing environment and project quotas.

The initial quota of 50G is shared by both STORAGE_SIZE and STORAGE_SIZE_TMP. So the sum of both values cannot be bigger than 50G.

If running through the Command line

Download the oc client for Openshift and rstudio-template.yaml from GitHub.

Process and apply template using default values from the template and passing your application specific parameters.

Deleting application and project

You might also want to delete the persistent volume created by the setup by

Using Allas object storage

How to use Allas from RStudio using AWS credentials and aws.s3 package

Publish an application to Shiny

Shiny is an application server for R. This template runs it by default, but if you develop an application and want to deploy it to Shiny, you will need to do a manual copy of the files. The procedure is:

  1. Login in the rstudio terminal. You need to find a running rstudio-... Pod. You can do this from the webinterface or from the command line. Follow How to open a terminal to a Pod?.

  2. Once in the terminal, you will find the application you developed in Rstudio located in /home/rstudio-server/. Shiny, on the other hand, will serve any application located in the folder /srv/shiny-server. Shiny will look for a file called app.R. You can copy the application by:

    cp -r /home/rstudio-server/* /srv/shiny-server/

    For every change in your application that you want to be published, you need to make this copy again.