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

feat(engine): Use uv in ray runtime env #789

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

daryllimyt
Copy link
Contributor

@daryllimyt daryllimyt commented Jan 23, 2025

UV cache is out in ray 2.41.0.
Our dockerfile uses /home/apiuser/.local/bin
But the below error indicates its looking in /root/.local/bin:

worker-1              | Traceback (most recent call last):
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/agent/runtime_env_agent.py", line 387, in _create_runtime_env_with_retry
worker-1              |     runtime_env_context = await asyncio.wait_for(
worker-1              |                           ^^^^^^^^^^^^^^^^^^^^^^^
worker-1              |   File "/usr/local/lib/python3.12/asyncio/tasks.py", line 520, in wait_for
worker-1              |     return await fut
worker-1              |            ^^^^^^^^^
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/agent/runtime_env_agent.py", line 351, in _setup_runtime_env
worker-1              |     await create_for_plugin_if_needed(
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/plugin.py", line 254, in create_for_plugin_if_needed
worker-1              |     size_bytes = await plugin.create(uri, runtime_env, context, logger=logger)
worker-1              |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/uv.py", line 312, in create
worker-1              |     uv_dir_bytes = await task
worker-1              |                    ^^^^^^^^^^
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/uv.py", line 292, in _create_for_hash
worker-1              |     await UvProcessor(
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/uv.py", line 202, in _run
worker-1              |     await self._install_uv_packages(
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/uv.py", line 181, in _install_uv_packages
worker-1              |     await check_output_cmd(pip_install_cmd, logger=logger, cwd=cwd, env=pip_env)
worker-1              |   File "/usr/local/lib/python3.12/site-packages/ray/_private/runtime_env/utils.py", line 105, in check_output_cmd
worker-1              |     raise SubprocessCalledProcessError(
worker-1              | ray._private.runtime_env.utils.SubprocessCalledProcessError: Run cmd[15] failed with the following details.
worker-1              | Command '['/tmp/ray/session_2025-01-23_18-48-52_275580_7/runtime_resources/uv/060bd28d0aa7053cb41735921f7965cf50b2d538/virtualenv/bin/python', '-m', 'uv', 'pip', 'install', '--no-cache', '-r', '/tmp/ray/session_2025-01-23_18-48-52_275580_7/runtime_resources/uv/060bd28d0aa7053cb41735921f7965cf50b2d538/ray_runtime_env_internal_pip_requirements.txt']' returned non-zero exit status 1.
worker-1              | Last 50 lines of stdout:
worker-1              |     Traceback (most recent call last):
worker-1              |       File "<frozen runpy>", line 198, in _run_module_as_main
worker-1              |       File "<frozen runpy>", line 88, in _run_code
worker-1              |       File "/usr/local/lib/python3.12/site-packages/uv/__main__.py", line 47, in <module>
worker-1              |         _run()
worker-1              |       File "/usr/local/lib/python3.12/site-packages/uv/__main__.py", line 27, in _run
worker-1              |         uv = os.fsdecode(find_uv_bin())
worker-1              |                          ^^^^^^^^^^^^^
worker-1              |       File "/usr/local/lib/python3.12/site-packages/uv/__init__.py", line 36, in find_uv_bin
worker-1              |         raise FileNotFoundError(path)
worker-1              |     FileNotFoundError: /root/.local/bin/uv
worker-1              |
worker-1              |
worker-1              | ------------------------------
worker-1              | File: /usr/local/lib/python3.12/site-packages/ray/_private/worker.py
worker-1              | Function: get_objects
worker-1              | Line: 908

We need a way to tell ray and uv where the uv binary is

@daryllimyt daryllimyt changed the title Use uv in ray runtime env feat(engine): Use uv in ray runtime env Jan 23, 2025
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