FLARE-forecast / FLARE-containers

Docker containers to run FLARE forecast
0 stars 2 forks source link

Implement GitHub Monitor with GitHub Actions #39

Open vahid-dan opened 3 years ago

vahid-dan commented 3 years ago

The idea is similar to https://github.com/FLARE-forecast/FLARE-containers/issues/38: 1- Check for the last update of the current branch. 2- Return an error if it has not been updated in the expected period. (We can use 12 hours as the default period.) 3- Send a notification to a Slack channel when an error happens.

We can do all these steps in GitHub Actions and bypass the need for building a Docker image, creating a Healtchchecks.io check (which has the limitation of 20 free checks per account), and using IBM Cloud Functions to run the container on a schedule. So, it is simpler and has fewer dependencies, which makes it more reliable.

In brief, for each GitHub branch we want to monitor, we need to create a separate Action and set it up to run on schedule.

The only caveat it has is that the cron scheduler is not exactly on time and based on my observations if you schedule the Action to take place every hour, it may have even a 20-minute delay, which is not important in our case.

Here are some pointers for the kick-start:

Learn GitHub Actions https://docs.github.com/en/actions/learn-github-actions

Quick-start for GitHub Actions https://docs.github.com/en/actions/quickstart

Running GitHub Actions on Schedule https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule

vahid-dan commented 2 years ago

It is implemented for just FCRE, but not BVRE, CCRE, and SUNP. Also, it is a good experience to reuse GitHub Actions instead of copying them and using them multiple times: https://github.com/FLARE-forecast/FLARE-containers/issues/45