Skip to content

Commit 9d90c65

Browse files
authored
Merge pull request #4400 from StackStorm/orquesta-with-items
Implement with items for Orquesta workflows
2 parents a2bf25e + e062c29 commit 9d90c65

28 files changed

+1316
-231
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: orquesta-test-with-items
3+
description: A workflow for testing with items and concurrency.
4+
runner_type: orquesta
5+
entry_point: workflows/tests/orquesta-test-with-items.yaml
6+
enabled: true
7+
parameters:
8+
tempfiles:
9+
required: true
10+
type: array
11+
concurrency:
12+
type: integer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: orquesta-with-items-concurrency
3+
description: A workflow demonstrating with items and concurrent processing.
4+
runner_type: orquesta
5+
entry_point: workflows/orquesta-with-items-concurrency.yaml
6+
enabled: true
7+
parameters:
8+
members:
9+
required: true
10+
type: array
11+
default:
12+
- Lakshmi
13+
- Lindsay
14+
- Tomaz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: orquesta-with-items
3+
description: A workflow demonstrating with items.
4+
runner_type: orquesta
5+
entry_point: workflows/orquesta-with-items.yaml
6+
enabled: true
7+
parameters:
8+
members:
9+
required: true
10+
type: array
11+
default:
12+
- Lakshmi
13+
- Lindsay
14+
- Tomaz
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 1.0
2+
3+
description: A workflow demonstrating with items and concurrent processing.
4+
5+
input:
6+
- members
7+
8+
tasks:
9+
task1:
10+
with:
11+
items: <% ctx(members) %>
12+
concurrency: 2
13+
action: core.echo message="<% item() %>, resistance is futile!"
14+
15+
output:
16+
- items: <% task(task1).result.items.select($.result.stdout) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 1.0
2+
3+
description: A workflow demonstrating with items.
4+
5+
input:
6+
- members
7+
8+
tasks:
9+
task1:
10+
with: <% ctx(members) %>
11+
action: core.echo message="<% item() %>, resistance is futile!"
12+
13+
output:
14+
- items: <% task(task1).result.items.select($.result.stdout) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 1.0
2+
3+
description: A workflow for testing with items and concurrency.
4+
5+
input:
6+
- tempfiles
7+
- concurrency: <% len(ctx(tempfiles)) %>
8+
9+
tasks:
10+
task1:
11+
with:
12+
items: tempfile in <% ctx(tempfiles) %>
13+
concurrency: <% ctx(concurrency) %>
14+
action: core.local
15+
input:
16+
cmd: "while [ -e '<% item(tempfile) %>' ]; do sleep 0.1; done"
17+
timeout: 300
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
git+https://github.com/StackStorm/orquesta.git#egg=orquesta
1+
git+https://github.com/StackStorm/orquesta.git@142a19ddabbeea6a8d9d10341ba70585114dc3b7#egg=orquesta

contrib/runners/orquesta_runner/orquesta_runner/orquesta_runner.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def pause(self):
134134

135135
def resume(self):
136136
# Resume the target workflow.
137-
wf_svc.request_resume(self.execution)
137+
wf_ex_db = wf_svc.request_resume(self.execution)
138138

139139
# Request resume of tasks that are workflows and still running.
140140
for child_ex_id in self.execution.children:
@@ -147,7 +147,7 @@ def resume(self):
147147
)
148148

149149
return (
150-
ac_const.LIVEACTION_STATUS_RUNNING,
150+
wf_ex_db.status if wf_ex_db else ac_const.LIVEACTION_STATUS_RUNNING,
151151
self.liveaction.result,
152152
self.liveaction.context
153153
)
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Don't edit this file. It's generated automatically!
2-
git+https://github.com/StackStorm/orquesta.git#egg=orquesta
2+
git+https://github.com/StackStorm/orquesta.git@142a19ddabbeea6a8d9d10341ba70585114dc3b7#egg=orquesta

contrib/runners/orquesta_runner/tests/unit/test_error_handling.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,11 @@ def test_fail_inspection(self):
138138
},
139139
{
140140
'type': 'syntax',
141-
'message': '[{\'cmd\': \'echo <% ctx().macro %>\'}] is not of type \'object\'',
142-
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.type',
141+
'message': (
142+
'[{\'cmd\': \'echo <% ctx().macro %>\'}] is '
143+
'not valid under any of the given schemas'
144+
),
145+
'schema_path': 'properties.tasks.patternProperties.^\w+$.properties.input.oneOf',
143146
'spec_path': 'tasks.task2.input'
144147
}
145148
]

0 commit comments

Comments
 (0)