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

RFE: Workflow convergence based on status of all the previous jobs #3054

Closed
cesarfn4 opened this issue Jan 23, 2019 · 12 comments
Closed

RFE: Workflow convergence based on status of all the previous jobs #3054

cesarfn4 opened this issue Jan 23, 2019 · 12 comments

Comments

@cesarfn4
Copy link

ISSUE TYPE
  • Feature Idea
COMPONENT NAME
  • API
SUMMARY

Currently, if you have two jobs in a Workflow converging in one with RUN condition "On success", Tower runs the job if one of the previous one finishes successfully and not if both finish successfully. It would be great if you could set a RUN condition like "Run this convergent job just if these previous jobs finish successfully".

ADDITIONAL INFORMATION

Workflow example:
wfjt

In the example provided, "Job Template 1" and "Job Template 2" are set with RUN condition "On success", but Tower runs "Job Tempate 3" if one of the previous jobs finishes successfully and not if both finish successfully.

@matburt
Copy link
Member

matburt commented Jan 23, 2019

The way to expand on this would be to add a conditional on the convergence point to decide on whether a condition should be applied based on the state of previous jobs leading to the converged node.

@kdelee
Copy link
Member

kdelee commented May 23, 2019

  • Want way to support OR as we as AND logic
    • Current behavior is OR (e.g. any parent that WOULD trigger causes convergence node to trigger)
      • migrate any current WFJT that are convergence nodes (have multiple parents), to be set to have "OR" behavior
        • may have some challenge finding these nodes
    • New default should be “AND” instead of “OR”
  • How to present this to users in UI?
    • Just an API property “converged_behavior: ANY/ALL”
    • Need to decide “OR”/”AND” vs. “ANY”/”ALL”
  • Want to ensure performance concerns are maintained
    • How heavy are checks for AND/OR logic on front/backend for large workflows?
    • Check for effects on "Do Not Run" logic
    • Ensure still wait for all parents to finish

DEPENDENCY/ORDER OF OPERATION:
Need to happen AFTER “pause”/”Approval” node #1206
^ Also referred to sometimes as "logic node"

NO WE WILL NOT DO:

  • Percentage logic
  • ⅔ of parents successful logic, etc

API SCHEMA:

  • Parameter on the WFJT node / WFJ node "convergence_behavior" with two choices XOR boolean with different name. Need to discuss more with @tvo318 and @trahman73 for name

UI:

  • undecided when node "becomes" convergence node. Perhaps all nodes will have "converged_behavior" attribute, but when will we expose option to users? After node has multiple parents?

@chrismeyersfsu
Copy link
Member

@Dagon- @piroux I've written a blog post on how to, effectively, get AND behavior out of a workflow as a stop gap https://www.ansible.com/blog/tower-workflow-convergence Let me know if that meets your needs.

@manderson-it
Copy link

It would be great to have this as a standard product feature. To only have logical OR convergence is insufficient.

@yeago
Copy link

yeago commented Jan 4, 2020

i think currently in conjunction with the "on success" run option the OR is a pretty unexpected result, as when the user arrived at the convergence step they would have chosen that option already differently to handle the failed states. only giving my 2c because i think surfacing an API to the user to handle partial failure behavior any/all takes on less importance.

@kdelee
Copy link
Member

kdelee commented Jan 15, 2020

@rebeccahhh have you synced up w/ @appuk lately on this?

@rebeccahhh
Copy link
Member

@kdelee yep, we've been chatting

@adpavlov
Copy link

I would actually call it a bug instead of feature idea:)
if 2 blocks lead to one, that usually means that last one depends on both previous steps.

@appuk
Copy link
Member

appuk commented Feb 12, 2020

Tests PR merged, hence closing the issue

@appuk appuk closed this as completed Feb 12, 2020
@adpavlov
Copy link

Please add link to commit/merge

@ryanpetrello
Copy link
Contributor

@adpavlov this feature is available in awx 9.2.0, which was just published.

Here's the PR:
#5621

@adpavlov
Copy link

@adpavlov this feature is available in awx 9.2.0, which was just published.

Here's the PR:
#5621

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests