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

[Core feature] improve flyte remote registration DX #4936

Open
2 tasks done
samhita-alla opened this issue Feb 23, 2024 · 2 comments
Open
2 tasks done

[Core feature] improve flyte remote registration DX #4936

samhita-alla opened this issue Feb 23, 2024 · 2 comments
Labels
enhancement New feature or request flytekit FlyteKit Python related issue flyteremote

Comments

@samhita-alla
Copy link
Contributor

samhita-alla commented Feb 23, 2024

Motivation: Why do you think this is important?

Observed quite a couple of times where flyteremote's register_task and register_workflow lead to some sort of no module found errors: https://discuss.flyte.org/t/13551857/hi-i-am-testing-remote-access-and-get-some-basic-questions-w#06ee2389-8d32-4118-8b20-83809484e62d and https://discuss.flyte.org/t/16600910/i-built-a-custom-image-and-pushed-it-to-the-demo-docker-regi. While register_script works fine, it requires specifying the source_root and module_name, which can be confusing.

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

Registration with Flyte remote should be seamless. It shouldn't lead to any sort of 'no module found' errors.

Describe alternatives you've considered

Use register_script instead of register_task and register_workflow.

Propose: Link/Inline OR Additional context

Kevin's suggestion: we could add a flag (fast) to register_task. thus, it can upload the workflow code by flytekit itself.

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

  • Yes

Have you read the Code of Conduct?

  • Yes
@samhita-alla samhita-alla added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Feb 23, 2024
Copy link

dosubot bot commented Feb 23, 2024

🤖

Based on the context provided, it seems like the 'no module found' error you're experiencing with Flyte remote's register_task and register_workflow functions could be due to missing dependencies or incorrect file paths. Here are some steps you can take to resolve this issue:

  1. Check your Python dependencies: Ensure that all the necessary Python dependencies are installed and updated in your requirements.txt file. This file should be in the same directory as your project template. If you have custom Python dependencies, update the requirements.txt file and those changes will be incorporated into the Docker image.

  2. Check your file paths: Make sure that the file paths you're using in your register_task and register_workflow functions are correct. The paths should point to the correct directory or file where your tasks and workflows are located.

  3. Use Fast Registration: Fast registration is a feature in Flyte that packages your code and dependencies into a tarball and uploads it to a blob store (like s3 or gcs). At workflow execution time, Flyte automatically injects the zipped up task/workflow code into the running container, thereby overriding the user-defined tasks/workflows that were originally baked into the image. This could help resolve the 'no module found' error if it's being caused by missing code or dependencies.

Here's how you can use fast registration:

pyflyte --pkgs workflows package --image ghcr.io/flyteorg/flytekit:py3.9-latest

This command packages your project and creates a portable package flyte-package.tgz containing all the Flyte entities compiled as protobuf files. You can then register this package with the flytectl register files command:

flytectl register files \
    --project flytesnacks \
    --domain development \
    --archive flyte-package.tgz \
    --version "$(git rev-parse HEAD)"

As for adding a flag (fast) to register_task to allow flytekit to upload the workflow code, it's not currently a feature in Flyte. However, you can achieve a similar result with fast registration as described above.

For more information, you can refer to the Flyte documentation on registering workflows.

If you're still experiencing issues, it would be helpful to know more about your setup. Could you provide more details about your environment, such as the Python version you're using, the exact error message you're seeing, and the steps you're taking when the error occurs? This will help me better understand the issue and provide a more accurate solution.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

@pingsutw pingsutw added flytekit FlyteKit Python related issue flyteremote and removed untriaged This issues has not yet been looked at by the Maintainers labels Feb 23, 2024
@novahow
Copy link
Contributor

novahow commented Mar 26, 2024

@samhita-alla Hi, I'm currently looking into this issue. And I have some questions.

  1. Is it possible to run the task if the user code isn't uploaded by specifying the FastSerializationSettings in SerializationSettings parameter of register_workflow?
  2. If not, should we develop another function call similar to register_workflow that automatically handles the source_path and module_name for users?

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flytekit FlyteKit Python related issue flyteremote
Projects
None yet
Development

No branches or pull requests

3 participants