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

fix: ensure wftmplLifecycleHook wait for each dag task #12192

Merged
merged 1 commit into from
Dec 9, 2023

Conversation

toyamagu-2021
Copy link
Member

@toyamagu-2021 toyamagu-2021 commented Nov 13, 2023

Signed-off-by: toyamagu-2021 toyamagu2021@gmail.com

Fixes #12120

Motivation

Modifications

  • Add CheckAllHooksFullfilled to check child hooked nodes.

Verification

This PR resolve #12120

yaml
spec:
  templates:
    - name: main
      inputs: {}
      outputs: {}
      metadata: {}
      dag:
        tasks:
          - name: some-task
            template: some-task
            arguments: {}
            hooks:
              failure:
                template: exit-handler
                arguments: {}
                expression: tasks["some-task"].status == "Failed"
          - name: finish
            template: finish
            arguments: {}
            dependencies:
              - some-task
    - name: some-task
      inputs: {}
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:latest
        command:
          - sh
          - '-c'
        args:
          - |
            echo "Doing great things";
            echo "Failing...";
            exit 1;
        resources: {}
    - name: exit-handler
      inputs: {}
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:latest
        command:
          - sh
          - '-c'
        args:
          - |
            echo "Sending updates to github";
            sleep 5;
            echo "Done!";
        resources: {}
      retryStrategy:
        limit: 1
        retryPolicy: Always
    - name: finish
      inputs: {}
      outputs: {}
      metadata: {}
      container:
        name: ''
        image: alpine:latest
        command:
          - sh
          - '-c'
        args:
          - |
            echo "Finished!";
        resources: {}
  entrypoint: main
  • Success hook case

image

  • Failed hook case

image

Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
Copy link
Member

@terrytangyuan terrytangyuan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@terrytangyuan terrytangyuan merged commit b8e98e0 into argoproj:main Dec 9, 2023
27 checks passed
@toyamagu-2021 toyamagu-2021 deleted the fix-wftmpl-level-hook branch December 30, 2023 12:42
sarabala1979 pushed a commit that referenced this pull request Jan 9, 2024
Signed-off-by: toyamagu-2021 <toyamagu2021@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use retryStrategy and hooks in unison on intermediate steps/tasks
2 participants