-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This acts as the notepad for the current implementation of the automated update workflow. See issues #42 #66
Update monitor
A monitor service is setup via cron job on Paphlagon to ping ViralAI's dnastack API every hour to see if any updates had been found by comparing the ViralAI's last update date with Duotang's last udpate date. If an update is found, we then query VirusSeq DP's API for the latest release. If the hash of the release from VirusSeq DP and ViralAI matches, the monitor service starts the update.sh script and sends a message to slack via Duoli.
Update process
The update script pulls in all required metadata (See CONTRIBUTING.md), extracts recombinants from sequence data, perform subsampling and alignment, build phylogenetic trees, knit the duotang and duotang-sandbox documents, and push all changes to dev.
Upon success, a slack notification will be sent where the body of the text is the whatsnew.md content and a preview link generated using Cloudflare Pages. A pull request will also be created that merges dev into main. Otherwise, if the update failed, the update log will be posted to slack for troubleshooting.
Approval and Merging
Once the update successfully finishes, share the preview link from Duoli's success post to the relevant people for review and comment. If changes are required, make the relevant changes, and push to dev branch. Then, reply in thread to the previous success post made by duoli using "@duoli /update".
OR alternatively, if only a current situation text update is required, reply to the success post with the new current situation text prepended by "@duoli /currentsituation" and a new line. This ensures the formatting to be the same as the formatting posted on Slack.
Then, once every hour at XX:00, the UpdateMonitor.service script will check for these commands and rebuild Duotang as needed. Another Cloudflare Pages link will be generated and posted as a thread reply. This link can then be shared for approval. An additional message asking the user to merge the PR is also sent.
Finally, to approve and publish the update, approve the PR linked by Duoli and let Github Actions do the rest.
Future work:
At some point, it would be beneficial to put this workflow into a docker image so it can be deployed to everywhere rather than just set up on Paphlagon
Notes:
Duoli is not setup as an async/websocket slack integration as I don't think it's necessary since we have a cron job setup to run once every hour anyways to check for VirusSeq/ViralAI updates. This means that the user may have to wait for up to an hour before seeing the new duotang preview and the associated messages.