Note
This project is a proof of concept.
This repository contains operational workflows for the hubDashboard App. The workflow will generate predtimechart data and build a static site for each repository that installed the app.
The workflow then looks like this for each repository (note the build processes are in parallel):
sequenceDiagram
participant GitHub
participant App
GitHub-->>App: Request installation name
App->>GitHub: Installed: "dashboard-repo"
create participant dashboard-repo
GitHub-->>dashboard-repo: fetch "dashboard-repo"
Note over GitHub: Builds static site to site/
GitHub-->>dashboard-repo: Read hub repository name from config
dashboard-repo->>GitHub: Hub Repository: "hub-repo"
create participant hub as hub-repository
GitHub-->>hub: fetch "hub-repo"
Note over GitHub: Builds Predtimechart data to data/
GitHub-->>App: Generate Access Token
App->>dashboard-repo: Push site/ to gh-pages
App->>dashboard-repo: Push data/ to ptc/data
In the two sections below, I detail the general implementations.
The general steps to generate the data for predtimechart are:
- install
hub-dashboard-predtimechart
via
pip install --upgrade pip pip install git+https://github.com/hubverse-org/hub-dashboard-predtimechart
- clone the dashboard repository and enter it (you only need the
predtimechart-config.yml
) - clone the hub repository into
repo/
- Generate the Predtimechart data
mkdir -p out/targets/ mkdir -p out/forecasts/ ptc_generate_flusight_targets \ repo \ out/targets ptc_generate_json_files \ repo \ predtimechart-config.yml \ out/predtimechart-options.json \ out/forecasts
- enter
repo/
and checkout theptc/data
branch - copy the contents of
../data
to your current folder - add, commit, and push
The static site is generated via the hubverse-org/hub-dash-site-builder
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 the dashboard repository.
- clone the dashboard repository
- Run the container:
$ docker run \ --platform=linux/amd64 \ --rm \ -ti \ -v "/path/to/dashboard/repo":"/site" \ ghcr.io/hubverse-org/hub-dash-site-builder:main \ bash render.sh \ ${dashboard repo org} \ ${dashboard repo name} \ "ptc/data"
- clone the gh-pages branch of the dashboard repository into
pages/
- copy the files from the
dashboard repo/site/pages/_site/
folder intopages/
- push the
pages/
folder up.