Kien Nguyen
08/08/2021, 3:27 AMKevin Kho
StartFlowRun
callKevin Kho
Kevin Kho
Kien Nguyen
08/09/2021, 1:45 PMsub_flow
concept will solve this problemKien Nguyen
08/10/2021, 3:21 AMsub_flow
's run in parallel? Let's say I have 2 sub_flow's: sub_flow1 and sub_flow2, each sub_flows consists of extract, transform and load task. sub_flow1 finishes extract task, and starts the transform task, at the same time sub_flow2 starts the extract task, once the sub_flow1 starts the load task, and sub_flow2 finishes extract task, sub_flow2 can start the transform task and so on...?Kevin Kho
wait=True
from the StartFlowRun
call. You just need to be aware of how much aware these subflows are using because you may overload your compute. The default LocalExecutor
is sequential but you can use the LocalDaskExecutor
for parallel execution.Kien Nguyen
08/10/2021, 4:10 AMKevin Kho
@task()
def abc(a):
return a
with Flow("ecs_testing") as flow:
x = abc(1)
y = abc(1, upstream_tasks=[x])
with Flow("ecs_tes") as flow2:
x = abc(1)
y = abc(1)
y.set_upstream(x)
Kien Nguyen
08/10/2021, 4:48 AMKevin Kho
wait_for_flow_run
task we have. It might be tricky though.
I am thinking you can create this wait_for_flow_run
task and point it to the first task of the first sub_flow. Then the first task of the second sub_flow could wait for it. But maybe this task has to be created during build time so it defeats the point.
But I think something might be off. Are your subflows dependent on each other? That becomes really tricky when combining with task looping.Kien Nguyen
08/10/2021, 5:52 AMKevin Kho
load
steps sequentially in a different Flow.Kien Nguyen
08/10/2021, 9:19 AM