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

[Feedback] Feedback for ray + uv #50961

Open
cszhu opened this issue Feb 27, 2025 · 6 comments
Open

[Feedback] Feedback for ray + uv #50961

cszhu opened this issue Feb 27, 2025 · 6 comments
Assignees

Comments

@cszhu
Copy link

cszhu commented Feb 27, 2025

Hello everyone! As of Ray 2.43.0, we have launched a new integration with uv run that we are super excited to share with you all. This will serve as the main Github issue to track any issues or feedback that ya'll might have while using this.

Please share any success stories, configs, or just cool discoveries that you might have while running uv + Ray! We are excited to hear from you.

To read more about uv + Ray, check out our new blog post here.

@pcmoritz pcmoritz pinned this issue Feb 27, 2025
@cabreraalex
Copy link

Hey ya'll! Would be great to have some more formal docs or guide to get this working besides the blog post. I don't know how to use our current JobConfig + anyscale.job.submit workflow with this new method

@pcmoritz
Copy link
Contributor

pcmoritz commented Mar 5, 2025

@cabreraalex Thanks for your feedback, I'm currently working on the anyscale.job.submit workflow and will update here after that's deployed. And yes you are right, we also need to work on more formal docs 👍

@krzysztof-gre
Copy link

Hi. The ray docker image does not include the uv binary, what blocks using the new feature in containerized setup.

docker run --rm -it rayproject/ray:2.43.0 sh
$ uv
sh: 1: uv: not found

@pcmoritz
Copy link
Contributor

pcmoritz commented Mar 7, 2025

@cabreraalex In the latest release 0.26.4 of the anyscale CLI (https://pypi.org/project/anyscale/), the py_executable support is now implemented for JobConfig and the job submit workflow. You need a cluster image that has UV installed and also unsets RAY_RUNTIME_ENV_HOOK (that's a wrinkle we'd like to remove going forward), for example like this

FROM anyscale/ray:2.43.0-slim-py312-cu125

RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN echo "unset RAY_RUNTIME_ENV_HOOK" >> /home/ray/.bashrc

and then you can e.g. use it like the following -- create a working_dir with the following files:

main.py

import ray

@ray.remote
def f():
    import emoji
    return emoji.emojize("Python rocks :thumbs_up:")

print(ray.get(f.remote()))

pyproject.toml

[project]
name = "test"
version = "0.1"
dependencies = ["emoji", "ray"]

job.yaml

name: test-uv
image_uri: <your image here>
working_dir: .
py_executable: "uv run"
entrypoint: uv run main.py
# If there is an error, do not retry.
max_retries: 0

And submit your job with anyscale job submit -f job.yaml. Instead of using a yaml you can also submit it via the SDK like

import anyscale
from anyscale.job.models import JobConfig

config = JobConfig(
    name="my-job",
    entrypoint="uv run main.py",
    working_dir=".",
    max_retries=0,
    image_uri="<your image here>",
    py_executable="uv run",
)

anyscale.job.submit(config)

@cabreraalex
Copy link

Fantastic, will test it out, thanks!

@hongbo-miao
Copy link

Just found out this ticket. I opened two tickets which related with uv

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

No branches or pull requests

5 participants