Repository navigation
[Docs][Core] Warn against setting py_executable to a bare uv run - #67281
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request adds a caution note to the documentation warning users against setting py_executable to a bare uv run when using the uv integration, explaining that it can cause workers to crash. The review feedback suggests refining the wording of this warning for better clarity, precision, and a more professional tone, providing a concrete code suggestion.
| :::{caution} | ||
| Don't set `py_executable` to a bare `uv run` to enable the uv integration. When you launch the driver with `uv run`, Ray sets `py_executable` for you. A bare `uv run` starts workers in whatever environment uv resolves from the directory the worker starts in. If that environment doesn't include Ray, workers crash on startup. Jobs then stay pending without a clear error, and their logs might not load. | ||
| ::: |
There was a problem hiding this comment.
To improve the clarity, precision, and professional tone of the documentation, we can make a few minor adjustments:
- Use more formal phrasing (e.g., "Do not" instead of "Don't", "remain pending" instead of "stay pending").
- Clarify "the directory the worker starts in" to "the worker's working directory" for technical precision.
- Use backticks around
uvfor consistency when referring to the tool/command environment resolution.
| :::{caution} | |
| Don't set `py_executable` to a bare `uv run` to enable the uv integration. When you launch the driver with `uv run`, Ray sets `py_executable` for you. A bare `uv run` starts workers in whatever environment uv resolves from the directory the worker starts in. If that environment doesn't include Ray, workers crash on startup. Jobs then stay pending without a clear error, and their logs might not load. | |
| ::: | |
| :::{caution} | |
| Do not set `py_executable` to a bare `uv run` to enable the `uv` integration. When you launch the driver with `uv run`, Ray automatically sets `py_executable` for you. A bare `uv run` starts workers in whatever environment `uv` resolves from the worker's working directory. If that environment does not include Ray, workers will crash on startup. Jobs then remain pending without a clear error, and their logs might not load. | |
| ::: |
There was a problem hiding this comment.
Applied part of this in 2352a44: reworded the "starts workers in ... the worker starts in" clause, and widened "Jobs" to "Tasks and jobs," since a plain driver's tasks hang too. I kept the contractions, present tense, and "stay"/"hang" wording, per Ray's writing-style guide (doc/source/ray-contribute/writing-style.md: always use contractions, avoid "will"). I also kept "uv" without backticks to match the rest of the page, and avoided "working directory" so readers don't confuse it with the working_dir field.
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: Douglas Strodtman <[email protected]>
Description
Adds a caution to the
uv runsection of the runtime environments page: don't setpy_executableto a bareuv runto enable the uv integration. When the driver is launched withuv run, Ray setspy_executableitself. A bareuv runstarts workers in whatever environment uv resolves from the worker's starting directory, and if that environment lacks Ray, workers crash on startup and jobs hang without a clear error.@martinlhw, this is a docs-only alternative to #66191, which you're assigned to. Your question on that PR, whether bare
uv runalways fails, turned out to be the deciding one: it doesn't. Results on Ray 2.59.0 with uv 0.11.14, macOS, local cluster:pythondriver outside any uv project,py_executable="uv run"ModuleNotFoundError: No module named 'ray';ray.gettimes outpythondriver inside a uv project that depends on Rayuv runpy_executableJobSubmissionClient.submit_jobwithpy_executable="uv run", cluster started inside a uv projectSUCCEEDED, with and withoutworking_dirPENDING(reproduces #54275)Because the bare value works in some setups, rejecting it with a
ValueErroras #66191 does would break working configurations, including per-taskruntime_envusage that the uv hook never rewrites. The failure is also the same one anypy_executablepointing at a Python without Ray produces, so a string match onuv runcovers only one case of it. A docs caution addresses what the issue reporter asked for at minimum, "noting in the docs specifically thatpy_executableshouldn't be provided." If Core wants a runtime guard too, a warning rather than an error seems like the safer shape, and it can land separately.Related issues
Addresses #54275. Supersedes #66191, which conflicts with master: its
local://changes landed separately in #65245, and the page it edits moved to MyST in #66461.Additional information
py_executable=uv runcauses failures with unloadable logs #54275, and none of the openpy_executableor uv PRs touch this guidance.🤖 Generated with Claude Code