flyte icon indicating copy to clipboard operation
flyte copied to clipboard

[Core feature] UX improvement: `pyflyte run` includes imported local modules in the target workflow file

Open cosmicBboy opened this issue 2 weeks ago • 2 comments

Motivation: Why do you think this is important?

Say I have the following flytekit project folder structure:

/my_project
    /src
        __init__.py
        module_a.py
        ... # etc
    tasks.py  # imports modules from src
    workflows.py  # imports modules from task
    setup.py

Currently, for this workflow to run correctly with pyflyte run --remote, I have to pass in the --copy-all flag to make sure that all the source files are present in the container running the workflow.

This isn't a great beginner UX: I would expect a local pyflyte run and remote pyflyte run --remote to "just work".

Goal: What should the final outcome look like, ideally?

Today, pyflyte run --remote workflow.py will fast-register the workflow, meaning that the workflow.py file itself will be shipped as a tar file and injected into the container running in the remote pod.

Ideally, pyflyte run should also automatically detect all of the locally defined modules that are being used in workflow.py and include it in the tar file being fast registered.

Describe alternatives you've considered

Keep the status quo, which is to require users to provide the --copy-all flag. There's also another issue proposing a --copy flag (see here) which proposes a more targeted version of the --copy-all flag.

Propose: Link/Inline OR Additional context

No response

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

  • [X] Yes

Have you read the Code of Conduct?

  • [X] Yes

cosmicBboy avatar Jun 20 '24 19:06 cosmicBboy