argo-workflows icon indicating copy to clipboard operation
argo-workflows copied to clipboard

workflowStopped event enhancement

Open uday-mandava opened this issue 3 years ago • 5 comments

Both successful workflows and stopped workflows are generating similar kind of events with 'reason' as 'WorkflowSucceeded'. There is no way to differentiate successful vs stopped events to trigger different down streams based on the status.

What change needs making? Would like to see reason as 'workflowStopped' for stopped workflows.

Use Cases

We are using Argo events architecture. We are using K8s Resource eventsource, relying on these k8 events to trigger downstreams. Since we are relying on 'WorkflowSucceeded' , it is matching events for both successful and stopped workflows.


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

uday-mandava avatar Jan 23 '22 20:01 uday-mandava

Can you please clarify what you mean by "workflow stopped"? Do you mean you ran "argo stop my-wf"?

alexec avatar Jan 24 '22 16:01 alexec

Yes, but through the API call /api/v1/workflows/{namespace}/{my-wf}/stop

uday-mandava avatar Jan 24 '22 19:01 uday-mandava

Note that I am viewing this information on the UI's 'message' field

I was not able to replicate this issue. I get "workflow shutdown with strategy: Stop". This corresponds to https://github.com/argoproj/argo-workflows/blob/95cd467c7e75c38548bf42a5f3c940ac61568e4b/workflow/controller/workflowpod.go#L145

~~Are workflows currently being executed, capable of being "stopped"? if so this may be why I was unable to replicate this issue.~~

Update: Error (exit code 137) is the error message when you "stop" a running workflow.

This is the workflow I ran if that is of importance

metadata:
  name: omniscient-bear
  namespace: argo
  labels:
    example: 'true'
spec:
  entrypoint: argosay
  templates:
    - name: argosay
      container:
        name: main
        image: ubuntu:20.04
        command:
          - yes
  ttlStrategy:
    secondsAfterCompletion: 300
  podGC:
    strategy: OnPodCompletion

This information is based on the master as of 25/1/2022, commit 95cd467c7e75c38548bf42a5f3c940ac61568e4b

isubasinghe avatar Jan 25 '22 10:01 isubasinghe

@isubasinghe @uday-mandava please make sure you do NOT use Kubernetes events for any automation, they are not reliable:

https://blog.argoproj.io/maybe-dont-use-kubernetes-events-for-automation-53951bdfd602

alexec avatar Jan 28 '22 17:01 alexec

Hello can I work on this issue? I can't however see WorkflowSucceeded succeeded phase when I stop a workflow through the API call /api/v1/workflows/{namespace}/{my-wf}/stop. Instead I'm getting to see WorkflowFailed phase.

AnuragThePathak avatar Mar 16 '22 12:03 AnuragThePathak