Orquesta - is there a -succeed / -fail symbol in yaml so my jobs return with a green/not red symbol


(Peter Michael Gits) #1

Orquesta - is there a -succeed / -fail symbol in yaml so my jobs return with a green/not red symbol in case one of the tasks failed?

Thanks in advance…

example in in mistral:

            sub_cleanup:
            action: core.remote cmd=<% $.combinedCmdCleanupSuccess %> timeout=<% $.timeout %> cwd=<% $.cwd %>  hosts=<% $.leastBusyHost %> username=<% $.username %> private_key=<% $.private_key %>

            publish:
                exit_status_string: <% st2kv($.combinedKey) %>
            on-complete:
                - succeed

versus orquesta

iterate_vebs:
        with:
          items: <% ctx(vebs) %>
          concurrency: 1
        #action: examples.echo message=<% item() %>
        action: examples.orquesta-bios-avoton18-series veb_next="<% item() %>"

        next:
          - when: <% succeeded() %>
            publish:
              - stdout: <% result().stdout %>
              - iterate_vebs_result: <% result() %>
            do: finish
          - when: <% failed() %>
            publish:
              - iterate_vebs_result: <% result() %>
            do: finish

      finish:
        action: examples.echo message="Completed"

doesn’t necessarily end up with success, i.e. not the last task to succeed.

Thanks,

Peter M. Gits


#2

You should be able to do this:

next:
  - do: finish
  - when: <% succeeded() %>
    publish:
      - stdout: <% result().stdout %>
      - iterate_vebs_result: <% result() %>
  - when: <% failed() %>
    publish:
      - iterate_vebs_result: <% result() %>

or even this:

next:
  - when: <% succeeded() %>
    publish:
      - stdout: <% result().stdout %>
      - iterate_vebs_result: <% result() %>
    do: noop
  - when: <% failed() %>
    publish:
      - iterate_vebs_result: <% result() %>
    do: noop

and if your action will always have a stdout, you should be able to simplify it even further:

next:
  - publish:
      - stdout: <% result().stdout %>
      - iterate_vebs_result: <% result() %>
    do: noop

There are two “built-in” tasks in Orquesta: noop and fail, and I think if you transition “to” the noop task the workflow will not fail.


(Peter Michael Gits) #3

Thanks so much for your time and energy to answer questions.

Cheers,

Peter M. Gits


#4

You’re welcome!

Did you get things working the way you wanted to?