https://flyte.org logo
p

Prada Souvanlasy

07/13/2022, 11:32 AM
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

Ketan (kumare3)

07/13/2022, 2:01 PM
Same should work in dynamic
Is it not?
p

Prada Souvanlasy

07/13/2022, 2:07 PM
It fails with
Cannot use explicit run to call Flyte entities workflows.test.task1
r

Rémy Dubois

07/13/2022, 2:17 PM
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

Ketan (kumare3)

07/13/2022, 3:05 PM
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

Rémy Dubois

07/13/2022, 3:06 PM
we didn't try in remote...
e

Eduardo Apolinario (eapolinario)

07/13/2022, 3:07 PM
looking
It looks like we a bug in
create_node
in
@dynamic
in local executions. This works in a remote setting.
r

Rémy Dubois

07/13/2022, 3:51 PM
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

Eduardo Apolinario (eapolinario)

07/13/2022, 3:52 PM
I don't believe so, but give me a few minutes to confirm.
thx 1
k

Ketan (kumare3)

07/13/2022, 5:27 PM
@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

Eduardo Apolinario (eapolinario)

07/13/2022, 5:32 PM
Yeah, this has been bug for a long time. I opened https://github.com/flyteorg/flyte/issues/2692 to track it.
r

Rémy Dubois

07/13/2022, 5:42 PM
thanks a lot @Eduardo Apolinario (eapolinario) and @Ketan (kumare3)
k

Ketan (kumare3)

07/13/2022, 11:27 PM
we will fix this
2 Views