Web Application R Shiny

From UFRC
Revision as of 21:51, 12 December 2023 by Moskalenko (talk | contribs) (Created page with "Back to Web Application Hosting =How-To= To set up an environment for a PubApps R Shiny application. =Prerequisites= * You already have a trial or...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Back to Web Application Hosting

How-To

To set up an environment for a PubApps R Shiny application.

Prerequisites

  • You already have a trial or a purchased PubApps or PrivApps instance, so storage and resources are available.
  • You know where you are going to be running the app (shared server, private VM, container VM with GPUs).
  • You are able to ssh into the respective server from a HPG login node.
  • You have a support ticket, which has details like the project username for pubapps/privapps you will use, which port your application should be listening on, what DNS record (project.rc.ufl.edu and projectdev.rc.ufl.edu) it is going to use.

Install dependencies

  • ssh into your project account on the respective server (shared or VM)
  • Install conda with e.g. Miniconda for Linux. For better performance 'conda install mamba' into the base conda env. Log out and back in to initialize conda/mamba.
  • Create a conda application in the respective project tree e.g. ${HOME}/myproject/prod/conda or ${HOME}/myproject/prod/conda. E.g.
mamba create -yp ${HOME}/myproject/prod/conda
mamba activate ${HOME}/myproject/prod/conda
  • Install r-shiny package
mamba install r-shiny
  • Install any other R packages or conda packages you need for your application into the environment.

Run/Test Application

  • Clone your git repository with shiny app code into e.g. ${HOME}/myproject/prod/app
  • Configure your shiny app to run on a pre-selected port (and host if not running on the shared webserver).

Production Setup

  • Add a systemd startup script to run the app when the server is rebooted e.g. after security patches are applied or power is lost.