Web Application R Shiny
Revision as of 19:19, 23 August 2024 by Moskalenko (talk | contribs)
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 mamba with miniforge https://github.com/conda-forge/miniforge for Linux. Log out and back in to initialize mamba.
- Create an application environment 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.