14 Deployment Walkthrough
This is a guide for the remote deployment of the VizIT dashboard.
14.1 Step-by-step Guide
VizIT is a Shiny server application that allows instructors and course designers to see how their students are interacting with their courses. For best results, this application should be run from a server and installed there. This step-by-step guide will help you to set up such a server.
- Spin up a server instance. This process was tested on an Azure instance with 7 Gb of RAM and 7 Gb of space. The amount of RAM needed is a function of the number of concurrent users you expect and whether they are working on multiple courses. This setup was tested with six separate courses and there was no lag.
- SSH into your instance,
- Type
git clone git@github.com:ubc/vizit2.git
cd vizit
This will clone the git repo. All the necessary code is included.sudo docker run --rm -ti -p 3838:3838 -v $(pwd):/srv/shiny-server --name="populate" lstmemery/moocshiny bin/bash
This will download and deploy the docker image. The image is about 2 gigabytes and contains the scripts to populate the course and run the server.cd srv/shiny-server/
conda env create -f environment.yml
source activate mooc
This creates and activates a virtual Python. environment in which courses can be populated.gcloud auth application-default login
This grants access to Google BigQuery. Copy the URL into the browser and paste the result into the terminal.gcloud auth login
nano .config.json
.config.json
defines which courses should be populated. Each entry should have- A short_name (which defines its path on the site)
- A BigQuery table name
- A Google Cloud Storage table name (likely similar to the BigQuery name)
cd r-package/exec/
python populate_courses.py
This step can take a significant amount of time to complete, depending on the number of courses being populated.exit
sudo docker rm -f populate
sudo docker run -d -p 80:3838 -v ~/vizit/r-package/:/srv/shiny-server/ -v ~/vizit/docs/:/var/log/shiny-server/ lstmemery/moocshiny
This runs the shiny server.