hello! assuming that we're in a `@dynamic` workflo...
# announcements
p
hello! assuming that we're in a
@dynamic
workflow, is there a way to define dependencies between tasks without relying on their respective outputs? i.e, we would like to run
task2()
after
task1()
even though the latter does not output anything. In a classic
@workflow
, we could rely on
create_node()
+
>>
but can't figure out the equivalent for
@dynamic
k
Same should work in dynamic
Is it not?
p
It fails with
Cannot use explicit run to call Flyte entities workflows.test.task1
r
This issue appears when we run a dynamic in local mode.
and the code is as simple as this
Copy code
@task
def task1():
    print("1")

@task
def task2():
    print("2")

@task
def task3():
    print("3") 

@dynamic
def dynamic_wf() -> str:
    node_1 = create_node(
        task1
    )       
    node_2 = create_node(
        task2
    )
    node_3 = create_node(
        task3
    )

    node_3 >> node_2
    node_1 >> node_2

    return "Done"

@workflow
def wf2() -> str:
    return dynamic_wf()
after a further investigation, it looks like the execution mode is set to "TASK_EXECUTION" when we run
pyflyte run file.py wf2
the execution mode is correctly set to "LOCAL_WORKFLOW_EXECUTION" when we target a workflow which doesn't return a dynamic.
k
Cc ohh and this runs in remote? The code looks right, will tal in a bit. Cc @Eduardo Apolinario (eapolinario) if you are around
r
we didn't try in remote...
e
looking
It looks like we a bug in
create_node
in
@dynamic
in local executions. This works in a remote setting.
r
thanks Eduardo. Do you know if this bug has been introduced recently ? Is there a way to downgrade to an earlier version of Flyte, in order to make this work ?
e
I don't believe so, but give me a few minutes to confirm.
thx 1
k
@Rémy Dubois the fix should be very simple as local execution is actually very simple
thank you for pointing it out, do you mind filing it?
e
Yeah, this has been bug for a long time. I opened https://github.com/flyteorg/flyte/issues/2692 to track it.
r
thanks a lot @Eduardo Apolinario (eapolinario) and @Ketan (kumare3)
k
we will fix this
160 Views