StackStorm / community

Async conversation about ideas, planning, roadmap, issues, RFCs, etc around StackStorm
https://stackstorm.com/
Apache License 2.0
8 stars 3 forks source link

Proposal: Retire Action-Chain workflow engine #49

Open nzlosh opened 3 years ago

nzlosh commented 3 years ago

With Mistral deprecation underway, I found myself questioning the value of keeping and maintaining the action-chain workflow engine when it only provides a subset of Orquesta functionality without any major advantages.

If we compare a simple workflow in Orquesta vs Action-Chain, we can see the complexity of writing in on or the other is near parity.

Action-Chain

Metadata

---
name: simple_actionchain
pack: test
description: Simple Action Chain workflow
runner_type: action-chain
entry_point: "workflows/simple_actionchain.yaml"
enabled: true
parameters:
  message:
    type: string
    default: "Hello World!"

Workflow

---
chain:
  - name: display_message
    ref: core.local
    parameters:
      cmd: "echo {{ message }}"
    on-success: celebrate
    on-failure: retire

  - name: celebrate
    ref: core.local
    parameters:
      cmd: "echo Time to celebrate."

  - name: retire
    ref: core.local
    parameters:
      cmd: "echo Time to retire."

Result

id: 5f51046d79d4aea9a17090a0
action.ref: test.simple_actionchain
parameters: None
status: succeeded (2s elapsed)
result_task: celebrate
result: 
  failed: false
  return_code: 0
  stderr: ''
  stdout: Time to celebrate.
  succeeded: true
start_timestamp: Thu, 03 Sep 2020 14:57:49 UTC
end_timestamp: Thu, 03 Sep 2020 14:57:51 UTC
+--------------------------+------------------------+-----------------+------------+-------------------------------+
| id                       | status                 | task            | action     | start_timestamp               |
+--------------------------+------------------------+-----------------+------------+-------------------------------+
| 5f51046db6b0404a4575781d | succeeded (0s elapsed) | display_message | core.local | Thu, 03 Sep 2020 14:57:49 UTC |
| 5f51046eb6b0404a4575781f | succeeded (0s elapsed) | celebrate       | core.local | Thu, 03 Sep 2020 14:57:50 UTC |
+--------------------------+------------------------+-----------------+------------+-------------------------------+

Orquesta

Metadata

---
name: simple_orquesta
pack: test
description: Simple Orquesta workflow
runner_type: orquesta
entry_point: "workflows/simple_orquesta.yaml"
enabled: true
parameters:
  message:
    type: string
    default: "Hello World!"

Workflow

version: 1.0

input:
  - message

tasks:
  display_message:
    action: core.local
    input:
      cmd: "echo <% ctx().message %>"
    next:
      - when: <% succeeded() %>
        do: celebrate
      - when: <% failed() %>
        do: retire

  celebrate:
    action: core.local
    input:
      cmd: "echo Time to celebrate."

  retire:
    action: core.local
    input:
      cmd: "echo Time to retire."

Result

id: 5f51047b79d4aea9a17090a3
action.ref: test.simple_orquesta
parameters: None
status: succeeded (2s elapsed)
start_timestamp: Thu, 03 Sep 2020 14:58:03 UTC
end_timestamp: Thu, 03 Sep 2020 14:58:05 UTC
result: 
  output: null
+--------------------------+------------------------+-----------------+------------+-------------------------------+
| id                       | status                 | task            | action     | start_timestamp               |
+--------------------------+------------------------+-----------------+------------+-------------------------------+
| 5f51047b4d06ed3c6511eee6 | succeeded (1s elapsed) | display_message | core.local | Thu, 03 Sep 2020 14:58:03 UTC |
| 5f51047c4d06ed3c6511eef6 | succeeded (0s elapsed) | celebrate       | core.local | Thu, 03 Sep 2020 14:58:04 UTC |
+--------------------------+------------------------+-----------------+------------+-------------------------------+

The output is slightly different, but the overall execution is the same. I haven't done any extensive benchmarking between action-chain verses orquesta performance but the example shows that they are on par for simple linear workflows.

I think converging workflows to orquesta would simplify the choice for end users and reduce the code base/maintenance for St2 developers, hence this proposal.

m4dcoder commented 3 years ago

The intent of Orquesta is to replace both Mistral and Action Chain. We decided to put Action Chain deprecation on hold because it's working for many users and very little known defects. We can revisit this for Action Chain if there's significant vote on the community as this may impact a larger number of packs and workflows in production than Mistral.

arm4b commented 3 years ago

Thanks for opening this issue!

There were some internal chats before about the Orquesta vs Action Chain. I remember the main arguments behind keeping the Action Chain were simplicity, painless work and near real-time performance/speed, especially for big workflows.

It's good to have this discussion in one place and revisit the decisions with time as we got new data and opinions.