billowy-receptionist-31718
10/26/2023, 7:10 AM"METAFLOW_ARGO_EVENTS_EVENT": "xyzxyz",
"METAFLOW_ARGO_EVENTS_EVENT_BUS": "default",
"METAFLOW_ARGO_EVENTS_EVENT_SOURCE": "argo-events-webhook",
"METAFLOW_ARGO_EVENTS_INTERNAL_WEBHOOK_URL": "webhook-eventsource-test-svc.argo-events.svc.cluster.local",
"METAFLOW_ARGO_EVENTS_SERVICE_ACCOUNT": "operate-workflow-sa",
"METAFLOW_ARGO_EVENTS_WEBHOOK_URL": "<https://argo-events.prod>.*******.tech/example"
My flow looks like this:
from metaflow import FlowSpec, step, trigger, pypi
import datetime
@trigger(event='jri-test')
class TestEventFlow(FlowSpec):
@pypi(python='3.11.3')
@step
def start(self):
print(f"I just got triggered from the jri-test event {datetime.datetime.now()}")
self.next(self.end)
@step
def end(self):
print("finished...")
pass
if __name__ == '__main__':
TestEventFlow()
After deploying the flow with this: python test-flows/event-triggered-flow.py --environment=conda argo-workflows create I see a sensor+trigger in the UI, so i guess it works as supposed, however i do think that I have something in my configuration which does not work. argo workflow are under the namespace argo and argo-events are under argo-events if that has something to do with it.
And publish the event using this on my local machine:
python -c "from metaflow.integrations import ArgoEvent; ArgoEvent(name='jri-test').publish();"
# and i also tried this
python -c "from metaflow.integrations import ArgoEvent; ArgoEvent(name='xyzxyz', payload={'name': 'jri-test'}).publish();
I attached screendumps of the webhook pods. And I never see my flow run.
I hope someone might be able to help 🙏user
10/26/2023, 7:09 PM@trigger decorator, it will create a sensor object in K8s
• For each sensor object, there is a sensor-deployment . You can see the sensor-deployment pod. Check it's logs to see if anything is wrong
• This sensor-deployment pod subscribes to events that are published on the eventbus. This could be NATS, Jetstream, Kafka, etc. I believe the default is jetstream. And you might see a statefulset with pods eventbus-0, eventbus-1, etc.
• When you publish an event, the http request is sent to the webhook pod which writes it to the eventbus. The sensor-deployment reads the event from the eventbus and actually creates the argo-workflow.
In your case, most likely the sensor-deployment pod will show the reason why the argo-workflow could not be created. Maybe an RBAC issue in creating the workflow object.quiet-afternoon-68940
10/26/2023, 8:58 PMMETAFLOW_ARGO_EVENTS_EVENT_SOURCE and METAFLOW_ARGO_EVENTS_EVENT. I am sure there is a good reason why these exist as separate parameters but IMO they could use a bit more documentation.billowy-receptionist-31718
10/27/2023, 11:17 AMargo-events namespace and we have workflows in a namespace called argo .
I have this set in my metaflow configuration: "METAFLOW_KUBERNETES_NAMESPACE": "argo" and now i tried to modify it to argo-events and then i got a deployment for my sensor, but I want the workflow that triggers to run in the argo namespace.
How do I get that behaviour?
I found this PR which seems to address this: https://github.com/Netflix/metaflow/pull/1463
@quiet-afternoon-68940 do you run argo-events in a seperate namespace than where you run your workflows?