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

Adds experimental support for uv.lock in ImageSpec #2929

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

thomasjpfan
Copy link
Member

@thomasjpfan thomasjpfan commented Nov 14, 2024

Why are the changes needed?

uv and uv.lock is becoming a commonly used tool for managing python environments. This PR adds experimental support for uv.lock into ImageSpec.

What changes were proposed in this pull request?

This PR enables requirements="uv.lock" support in ImageSpec. Using uv.lock shows a warning stating that uv.lock support is experimental since uv sync is experimental, so our integration may change.

How was this patch tested?

mkdir uv-check
cd uv-check
uv init
uv add flytekit numpy

# activate python environment with this PR
pyflyte run --remote main.py my_task

where main.py is:

from flytekit import task, ImageSpec

image_spec = ImageSpec(
    name="uv-wow",
    requirements="uv.lock",
    registry="localhost:30000",
    env={"abc": "xyz125"},
)


@task(container_image=image_spec)
def my_task() -> int:
    import numpy as np

    return np.asarray([1, 2, 3]).sum().item()

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
@thomasjpfan thomasjpfan changed the title Adds experimental support for uv.lock Adds experimental support for uv.lock in ImageSpec Nov 14, 2024
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
…rt_uv_lock

Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Signed-off-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant