Skip to content

explodecomputer/USSpensions-shiny

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
www
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Shiny app for USS pensions

Info

The modelling for this was developed by Neil Davies and ported to an R package here https://github.com/explodecomputer/USSpensions.

This is a shiny wrapper for the functions in that package.

Running the app locally

Clone the repository

git clone https://github.com/explodecomputer/USSpensions-shiny.git

Install the dependencies

devtools::install_github("explodecomputer/USSpensions")
install.packages("shiny")
install.packages("shinydashboard")

Then in R when the work directory is path/to/USSpensions-shiny, run:

library(shiny)
runApp()

Deploying to server

There are two parts to updating the website:

If any changes are made to the shiny app then increment the version number by running

./update_version.sh <1/2/3>

The shiny app is deployed as a Docker container on crashdown.epi.bris.ac.uk. To update either because of changes to the app or the data dictionary, ssh into the server, clone the repository

git clone git@github.com:explodecomputer/USSpensions-shiny.git

Then build and deploy

cd USSpensions-shiny
./release.sh

Kubernates deployment

We need to build a docker image of the site, push it to hub.docker.com and then deploy it to Kubernetes

Build:

docker build . -t explodecomputer/usspensions-shiny:<VERSION>

Push to docker hub. First login with docker hub credentials

docker login

Next push

docker push explodecomputer/usspensions-shiny:<VERSION>

Kubernetes deployment

  1. Setup kubectl on local machine
  2. kubectl apply -f uss-pensions-shiny_deployment.yml
  3. kubectl apply -f uss-pensions-shiny_service.yml
  4. Check with kubectl describe [deployment/service] uss-pensions-shiny

Updating when image updates:

  1. List existing pods kubectl get deployments
  2. Delete each of them kubectl delete deployment uss-pensions-shiny-deployment

They should be automatically replaced

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •