https://flyte.org logo
k

Keshav Sharma

10/10/2022, 4:43 AM
hi team, I am an engineer at Gojek and we use flyte for orchestrating ML pipelines. I have a requirement to create multiple
launch plans
with different set of
fixed inputs
for an existing
workflow
. I am following flytekit documentation to fetch a workflow and create a launchplan for it. The following in the code snippet from above docs:
Copy code
from flytekit import LaunchPlan

flyte_workflow = remote.fetch_workflow(
    name="my_workflow", version="v1", project="flytesnacks", domain="development"
)
launch_plan = LaunchPlan.get_or_create(name="my_launch_plan", workflow=flyte_workflow)
Creating a launchplan fails with the following error:
Copy code
File "/Users/.../lib/python3.7/site-packages/flytekit/core/launch_plan.py", line 143, in create
    native_types=workflow.python_interface.inputs,
AttributeError: 'NoneType' object has no attribute 'inputs'
python_interface
attribute of workflow object returned by
fetch_workflow
is None, although the workflow is a valid one and when i register a launchplan using "register files" in cli, it works. flytekit version: 1.1.0 flyte helm chart version: 1.1.0 Any help appreciated.
k

Ketan (kumare3)

10/10/2022, 5:58 AM
Cc @Samhita Alla this is completely doable- so must be some usage issue can you check?
s

Samhita Alla

10/10/2022, 6:13 AM
Hi, @Keshav Sharma! Is your workflow accepting inputs?
Also, would you mind sharing the command with me, the one that’s resulting in the error?
k

Keshav Sharma

10/10/2022, 7:13 AM
yes the workflow accepts two string type inputs, which I am trying to pass a fixed_inputs in the launch plan.
Copy code
generated_lp = LaunchPlan.get_or_create(
    name="somename",
    workflow=fetched_workflow,
    # specify the input value for the workflow when it's being triggered by the scheduler
    fixed_inputs={
        "input1": "value1",
        "input2": "value2"
    }
)
calling
LaunchPlan.get_or_create
ends up in error
s

Samhita Alla

10/10/2022, 7:20 AM
When are you seeing this error if registration is working fine?
k

Keshav Sharma

10/10/2022, 7:38 AM
I am not able to reach the registration part when I pass workflow received from
fetch_workflow
method to
LaunchPlan.get_or_create
method registration works fine if i use cli and pass the workflow annotated imported from file
s

Samhita Alla

10/10/2022, 12:12 PM
I’m sorry I don’t understand. Can you send me the commands you’re trying to run after you create a launch plan in your Python code?
@Keshav Sharma, I’m able to reproduce this issue. Seems like a bug. cc: @Kevin Su @Eduardo Apolinario (eapolinario)
k

Kevin Su

10/10/2022, 3:31 PM
I got the same error, trying to fix it now.
k

Keshav Sharma

10/11/2022, 7:45 AM
Is there a github issue logged for this bug ?
2 Views