Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automate rebuilds #100

Merged
merged 10 commits into from
Aug 3, 2022
Merged

Automate rebuilds #100

merged 10 commits into from
Aug 3, 2022

Conversation

joverlee521
Copy link
Contributor

Description of proposed changes

Automates rebuilds for mpxv and hpmxv1 to run when there's new data from ingest. Includes threaded Slack replies for builds since we don't want to mix up Slack messages from the separate builds. (Note this is separate from #36, which is specifically for ingest).

Testing

Unfortunately cannot fully test the ingest trigger since repository dispatch events only trigger the workflow on the main branch.

Uses `nextstrain remote upload` command to deploy builds to a specified
`deploy_url` provided in the config. Purposely uses the build name from
the config instead of the wildcard build name to allow the rule to be
a target rule without providing explicit output files.

The default `deploy_url` is added to an optional config file
`config/nextstrain_automation.yaml` that is intended for internal use
by the Nextstrain team.
The `--output` option allows us to save the curl output in a file.
This will allow us to parse the response for the Slack thread timestamp
required to post threaded messages.

The `--thread-ts` option allows us to provide a timestamp for the
Slack message to be sent as a threaded message.

The `--broadcast` option allows us to send a threaded Slack message that
are also broadcasted to the channel for high priority messages such
as error messages.

This will make the Slack notifications for automated builds much cleaner
where each build will have their own start message with threaded
replies for further updates.
Sends a Slack notification that indicates the start of the build
pipeline. Includes the AWS Batch and GitHub Action links if their ids
are provided via environment variables `AWS_BATCH_JOB_ID` and
`GITHUB_RUN_ID`.

Saves the onstart Slack message timestamp to a file so that it can be
accessed by later notification jobs to thread their responses.
Sends a Slack notification that indicates the build has successfully
finished as a threaded reply to the onstart message.
Sends a Slack notification taht indicates an error has occurred in
the build. The message is sent as a threaded reply that is broadcasted
to the channel to get more visibility on the error.
Sends a Slack message that indicates the build has build deployed as a
threaded reply to the onstart message.
Added the `hmpxv1` and `mpxv` builds as separate GitHub Action workflows
so that they can be run separately as needed. They share a repository
dispatch type (`rebuild`) so that they can both be triggered at the same
time by the ingest workflow for automated builds.
Will be using this script to trigger the monkeypox builds after the
latest data has been uploaded to S3.
Triggers the rebuild GitHub Action workflows via a repository dispatch
type `rebuild`, which will trigger both the hmpxv1 and the mpxv builds.
The ingest pipeline will only trigger the builds if the config sets
`trigger_rebuild` to true as included in the optional config file.

This currently will trigger rebuild regardless of whether there's new
data included. The following commit will add changes to a check whether
new data has been uploaded to S3.
We do not want to waste time and resources to run rebuilds when there's
no new data from ingest. This commit checks the output from the
uploads of the metadata TSV and sequences FASTA files to verify they
have been uploaded to S3. If the output includes the message
"files are identical" then we know they have not been updated and skip
the trigger for rebuilds.
@joverlee521 joverlee521 requested a review from a team August 2, 2022 22:58
@corneliusroemer
Copy link
Member

@joverlee521 is it intended that the output of the auto-builds only contains around 20 sequences? I downloaded the output tree and put it in Auspice.

Looks good so I'll merge so we can see how it goes - not much can go wrong here I think - in worst case we'll revert ;)

@corneliusroemer corneliusroemer merged commit 929ed97 into master Aug 3, 2022
@corneliusroemer corneliusroemer deleted the auto-builds branch August 3, 2022 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants