[core] [3/N] Use uv as package manager#48611
Merged
pcmoritz merged 10 commits intoray-project:masterfrom Nov 8, 2024
Merged
Conversation
Contributor
|
Great progress! Here are two test cases I'm using to try this out: In [1]: import ray
In [2]: ray.init(runtime_env={"uv": ["emoji"]})
2024-11-06 13:41:00,419 INFO worker.py:1812 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
Out[2]: RayContext(dashboard_url='127.0.0.1:8265', python_version='3.11.4', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}')
In [3]: @ray.remote
...: def f():
...: import emoji
...: return emoji.emojize('Ray and UV is :thumbs_up:')
...:
In [4]: ray.get(f.remote())In [1]: import ray
In [2]: ray.init(runtime_env={"uv": ["openai-whisper"]})
2024-11-06 13:45:16,284 INFO worker.py:1812 -- Started a local Ray instance. View the dashboard at http://127.0.0.1:8265
Out[2]: RayContext(dashboard_url='127.0.0.1:8265', python_version='3.11.4', ray_version='3.0.0.dev0', ray_commit='{{RAY_COMMIT_SHA}}')
In [3]:
In [3]: @ray.remote
...: def f():
...: import whisper
...: return str(whisper.load_model("turbo"))
...:
In [4]: ray.get(f.remote())Currently failing with (which is probably expected since you marked it as "draft"). Once it is working I'm also happy to test it on workspaces :) |
e0a7f80 to
af8e53b
Compare
af8e53b to
d485d30
Compare
Signed-off-by: dentiny <dentinyhao@gmail.com>
d485d30 to
ab6b4e9
Compare
jjyao
reviewed
Nov 7, 2024
| # 1. Install specialized version of `uv`. | ||
| # 2. Options for `uv install`. | ||
| # 3. Use requirement files for packages. | ||
|
|
Contributor
There was a problem hiding this comment.
Most pip integration test can have a uv counterpart. Consider reusing the tests by using @pytest.mark.parametrize. This also shows people can just change pip to uv and things will just work.
Contributor
Author
There was a problem hiding this comment.
Yeah I considered that, but choose to rewrite in these reasons:
- (major) uv and pip are not 100% compatible, which means we will have a number of if-else branches
- For example, we need to add uv-specific tests at the end
- I've seen a few community discussions on leveraging uv features, I'm afraid the split will become larger and larger
- (major/minor) pip and uv installation process is different: we consider pip installed by default, while have to install uv ourselves, which means, we need to do extra checking for
uv - (minor) Not all the features are implemented for
uvfor now, so quite a lot of existing pip-based tests will be skipped;
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
Signed-off-by: dentiny <dentinyhao@gmail.com>
jjyao
approved these changes
Nov 7, 2024
Signed-off-by: dentiny <dentinyhao@gmail.com>
pcmoritz
reviewed
Nov 7, 2024
…hjiang/uv-installation
JP-sDEV
pushed a commit
to JP-sDEV/ray
that referenced
this pull request
Nov 14, 2024
This PR integrates `uv` into existing runtime env system, which uses `uv` to setup environment for better performance. TODO list: - [ ] Add `uv` to public documentation --------- Signed-off-by: dentiny <dentinyhao@gmail.com> Co-authored-by: Jiajun Yao <jeromeyjj@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR integrates
uvinto existing runtime env system, which usesuvto setup environment for better performance.TODO list:
uvto public documentation