COVID-19 Forecast Hub uses GitHub actions as its primary CD/CI tool. This page documents the actions and scripts involved with our CD/CI process.
(Note: As the repository is getting larger in size, the GitHub Actions runner is unable to provide enough disk space for our CD/CI scripts. We are in progress of moving some actions to a Githooks based triggering system on a cloud VM.)
Some actions may contain identical initial steps. This is because each time a GitHub action is run, it is run on a clean VM with no software/packages/libraries installed.
- Check disk space and delete temporary files
- Checkout latest commit on
master
(uses this external action) - Install Node.js (uses this external action)
- Install Python (uses this external action)
- Install Node.js requirements
- Install Python requirements
- Deploy the contents in
visualization/vis-master/dist
onto thegh-pages
branch
This action is quite simple. The Hub uses GitHub Pages to host our external-facing website; GitHub Pages hosts files on the gh-pages
branch. The file visualization/vis-master/dist/CNAME
determines under which domain should the host be configured.
Please consult the GitHub Pages documentation for how to set up GitHub Pages.
- Checkout latest commit on
master
- Install Python
- Install Python requirements
- Run this validation script
- The script implements these validation rules
On every push to master
and every newly-created pull request, this action is run to make sure that all CSV data files meets Zoltar's formatting requirements for CSV files. Teams will resubmit updated versions of their data files if the validation did not pass.
For an overview of all validation rules we have, please see this page on the repository's wiki.
- Check disk space and delete temporary files
- Checkout latest commit on
master
- Install Node.js
- Install Python
- Install Node.js requirements
- Install Python requirements
- Run this build script
- Validate that all metadata files exist and are in the correct location
- Parse raw CSV data into visualization's CSV format
- Get the latest truth data from JHU
- Parse data from sub step 2 to visualization's JSON format
- Build the visualization
The most important steps are the substeps of step 7; that is where the bulk of the work is done. The build script runs three separate scripts: 0-init-vis.sh
, 1-patch-vis.sh
, and 2-build-vis.sh
; please see the source code for details.
- Checkout latest commit on
master
- Install Node.js
- Install Python
- Install Node.js requirements
- Install Python requirements
- Update truth data from JHU, NYTimes, USAFacts
- JHU data is both updated in the hub repository and on Zoltar
- NYTimes and USAFacts truth data is only updated in the repository
Mostly, the details are in the code for parsing JHU, NYTimes, and USAFacts data by their respective formats. All the relevant source code is in the data-truth/
folder.
- Checkout latest commit on
master
- Install Node.js
- Install Python
- Install Node.js requirements
- Install Python requirements
- Upload all CSVs to Zoltar, including both forecast and truth CSVs
By design, we require the teams submit their forecast CSVs in Zoltar format to facilitate this pipeline. This action is run every 6 hours to upload the latest forecast and truth CSVs to Zoltar. To reduce the amount of data to upload, we use a JSON file containing hashes of all validated and uploaded forecast CSVs so that they are not uploaded twice. During the validation and upload process, if we find new files that we don't have hashes for, or old files that have a different hash, we will upload the relevant files (again).