This repository creates a docker container used by hubverse-org/hub-dashboard-control-room to generate a static site that contains a forecast dashboard and other customizations.
This container works on a repository created from the dashboard template that assumes one of the following is true if the predevals and predtimechart configuration files are present:
- (default) your public GitHub dashboard repository has two orphan branches
called
ptc/data
andpredevals/data
containing data sources for the visualizations OR - you have copies of these data sources in individual folders locally in your repository.
If you do not have either of the predtimechart or predevals configuration files present, then these data are not necessary.
The static site is generated via render.sh
inside the
container and writes a folder called _site/
under the pages/
folder of the
dashboard repository. You need to then copy the contents of _site/
into the
gh-pages
branch of a dashboard repository.
To get help, you can run the container with no arguments.
The general workflow can be run like so:
- clone the dashboard repository
- pull the latest container:
docker pull ghcr.io/hubverse-org/hub-dash-site-builder:latest
- Run the container (replace
/path/to/dashboard/repo
with the absolute path to your dashboard. This can be replaced with$(pwd)
to use the current working directory):docker run \ --platform=linux/amd64 \ --rm \ -ti \ -v "/path/to/dashboard/repo":"/site" \ ghcr.io/hubverse-org/hub-dash-site-builder:latest \ render.sh -u <owner> -r <repo> -o out
- clone the gh-pages branch from the dashboard repository into a folder called
site/
- copy the files from the
/path/to/dashboard/out/
folder intosite/
- enter the
site/
folder and rungit push
to push the changes.
If you have local versions of the predtimechart and predevals data, then you can build the site and store the copies in the site itself by using the -p and -e flags:
docker run \
--platform=linux/amd64 \
--rm \
-ti \
-v "/path/to/dashboard/repo":"/site" \
ghcr.io/hubverse-org/hub-dash-site-builder:latest \
render.sh
-p <relative-path-to-predtimechart-data>
-e <relative-path-to-predevals-data>
-o out
This docker container can be tested with the tests/run.sh
script and
the flusight hub. These tests will clone a hub dashboard to a temporary file and
run tests on it.
# Step 1 build the container
docker build --platform=linux/amd64 -t hdsb .
# Step 2 run the tests against an _active_ hub dashboard
bash tests/run.sh hdsb reichlab/flusight-dashboard