Repository navigation
Fix bare 'uv run' py_executable causing unloadable logs - #65788
lorenzozanee wants to merge 1 commit into
Conversation
Since Ray 2.47 uv integration is automatic when the driver is launched with `uv run` (hook sets py_executable to `uv run --python X.Y.Z python` automatically). The legacy value `py_executable='uv run'` lacks a Python interpreter and causes worker startup failures with unloadable runtime_env/ worker logs and an ambiguous dashboard error. Validate `py_executable` early and reject bare `uv run` (including path-prefixed variants) with a clear ValueError directing users to remove `py_executable`; jobs succeed without it. Also documents that `py_executable` should not be set for uv. Signed-off-by: lorenzozanee <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request introduces validation for the 'py_executable' field in 'runtime_env' to deprecate and reject the bare 'uv run' command, which is now handled automatically since Ray 2.47. It also updates the documentation to guide users on this change. The review feedback points out that the path-matching logic for 'uv.exe' on Windows fails when absolute paths are used, and suggests a more robust, platform-agnostic approach to extract the executable name.
| first == "uv" | ||
| or first.endswith("/uv") | ||
| or first.endswith("\\uv") | ||
| or first == "uv.exe" | ||
| ) | ||
| if is_uv and second == "run": |
There was a problem hiding this comment.
The current check for uv.exe only matches when first == "uv.exe". If a Windows user specifies an absolute path to uv.exe (e.g., C:\Users\Username\AppData\Local\Programs\uv\uv.exe run), first will be C:\Users\Username\AppData\Local\Programs\uv\uv.exe, which does not match first == "uv.exe", nor does it end with \uv or /uv. This allows the deprecated bare uv run command to bypass validation on Windows, leading to worker startup failures.
Using a platform-agnostic check like first.replace("\\", "/").split("/")[-1] in ("uv", "uv.exe") is more robust and handles absolute/relative paths on all platforms.
is_uv = first.replace("\\", "/").split("/")[-1] in ("uv", "uv.exe")|
@pcmoritz Can you help with reviewing the PR? Thanks! |
Description
Since Ray 2.47 the
uvintegration is automatic when the driver is launched withuv run; the hook now setspy_executabletouv run --python X.Y.Z pythonautomatically. The legacy valuepy_executable='uv run'lacks a Python interpreter and causes workers to fail to start with unloadable runtime_env/worker logs. This PR rejects the bare value at validation time with a clear error directing users to removepy_executable.Related issues
Fixes #54275
Additional information
Docs updated to state that
py_executableshould not be set manually foruv.