Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flytekit/small feature] Allow pyflyte run to execute reference entities #6097

Open
2 tasks done
wild-endeavor opened this issue Dec 9, 2024 · 1 comment
Open
2 tasks done
Assignees
Labels
enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers

Comments

@wild-endeavor
Copy link
Contributor

wild-endeavor commented Dec 9, 2024

Issue

If you have a file like so

from flytekit import task, workflow

@task
def base_list_adder(x: list[int], y: list[int]) -> list[int]:
    return [a + b for a, b in zip(x, y)]

@workflow
def base_lists_wf(x: list[int], y: list[int]):
    base_list_adder(x=x, y=y)

and another file that invokes it as a reference workflow

from flytekit import reference_workflow

@reference_workflow(project="flytesnacks", domain="development", name="yt_dbg.scratchpad.ref_base.base_lists_wf", version="8jE3QH2_lkxcA6YIsRgQrg")
def base_lists_wf(x: list[int], y: list[int]):
    ...

and the first file is registered with the ID fields in the second, running on cli currently fails

pyflyte -vv -c ~/.flyte/config-sandbox.yaml run --remote using_references.py base_lists_wf --x "[1,2,3]" --y "[1,2,3]"

To fix:

First step is to just get the script to return the flyte entity
https://github.com/flyteorg/flytekit/compare/run-ref-entities?expand=1

(need to handle tasks/launch plans as well ofc).

Need to think about the usage of default inputs. This example shows a reference workflow, not a reference launch plan.
When FlyteRemote tries to execute a workflow, it will first fetch the default launch plan, and then run that. What if the default launch plan was registered with inputs different than the ones specified in the signature of the reference workflow? I think the reference workflow one should win (does it? need to check). Is it worth it to print a log line?

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@wild-endeavor wild-endeavor added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Dec 9, 2024
@wild-endeavor wild-endeavor changed the title [Core feature] fff [flytekit/small feature] Allow pyflyte run to execute reference entities Dec 9, 2024
@machichima
Copy link
Contributor

#take

@machichima machichima moved this to In progress in OSS Contributions Dec 14, 2024
@machichima machichima moved this from In progress to Backlog in OSS Contributions Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers
Projects
Status: Backlog
Status: Backlog
Development

No branches or pull requests

2 participants