-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add script to post alerts to CoMapeo Cloud API #60
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great "Notes" section. I would absolutely use a Windmill Flows.
Justification:
We have said that most users of Windmill will not be writing their own scripts, but instead just using scripts we've written in this Git repo: they would be pasting in inputs and maybe scheduling these canned scripts. The same goes for Flows. Windmill's UI exposes Flows as a first-class entity in almost the identical way it displays scripts: you click its name, paste your inputs, and click Run (or schedule). Most users will be able to use this repo's canned flows without ever reading the words "Directed Acyclic Graph".
Moreover, I think Flows may offer a pretty good solution (or workaround) to the code-reuse and package dependency questions discussed in #58.
If I were in your shoes, I'd:
- merge this PR as you have it (its own script) - once the upstream dependency is in.
- do a follow-up PR to define a flow that invokes both
alerts_gcs
and this script.
I will leave this PR open until digidem/comapeo-cloud#41 is merged. |
Goal
Closes #28.
Note
This code will not yet work in production, because it depends on digidem/comapeo-cloud#41 being merged and a new CoMapeo Docker image being published and deployed.
What I changed
comapeo_alerts
script that performs the following tasks:Notes
In implementing this, I sought fit to turn this into its own script apart from
alerts_gcs
to maintain clean code and ensure separation of concerns.However, this approach introduces a sequence issue: when scheduled in production, this script should run after
alerts_gcs
has successfully ingested a new batch of alerts. While we can make a reasonable estimate of when to schedule this based on existingalerts_gcs
run data across our Windmill instances, this approach is not deterministic and could encounter edge cases where analerts_gcs
run takes significantly longer than expected due to issues with GCP upstream.This is further complicated by the fact we have a third operation in the sequence: #59 aims to send a Twilio message to recipients about new alerts. #59 adds this operation to the
alerts_gcs
script, but arguably, a message to recipients about new alerts should not be sent until both scripts have run: a CoMapeo user in the field can then know to synchronize, to see the new alerts on CoMapeo right away.This leads me to think there are two options:
main
function, but are imported into one that does.alerts_twilio
script, and preparealerts_gcs
script for future usage in a Windmill Flow #59:Opinions welcome.