Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions changelog.d/ITL-1210.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
### Changed

- The `ray` extra now requires `ray[default]>=2.60.0,<3`, no longer exactly `ray[default]==2.48.0`;
the dev group follows, and `uv.lock` holds ray 2.60.0 (ITL-1210). Since Ray 2.59, a local
`ray.init()` (no cluster address, which is what `RayExecutor` calls when you give it no
`ray_address`) turns on Ray's token authentication and writes a token to
`~/.ray/auth_token` if none exists. Set `RAY_AUTH_MODE=disabled` to opt out. Connecting to
a remote or multi-node cluster is unchanged.

### Known limitations

- With Ray 2.54 or later, a driver started with `uv run` from a project whose version comes
from version control (hatch-vcs or setuptools-scm, such as an Orcapod source checkout) hangs
on its first `RayExecutor` call: Ray rebuilds the project on its workers without `.git`, and
the workers never start. Set `RAY_ENABLE_UV_RUN_RUNTIME_ENV=0`, or start the driver with
`python`. See the troubleshooting page. A driver started with `python`, and a project with a
fixed version, are not affected (ITL-1210, ITL-1213).
24 changes: 24 additions & 0 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,30 @@ old results are returned.
default is `"v0.0"`, and a minor bump (`"v0.1"`) is not enough. Renaming the function also
works. See the tutorial, [Part 6](tutorial/06-reruns-and-caching.md).

### A job with `RayExecutor` hangs and its tasks never start

**Symptom.** With Ray 2.54 or later, a script started with `uv run` hangs on its first function
call through `RayExecutor`. No task ever runs and no error is raised. The Ray log (the raylet
output in the terminal) shows a failed build, ending with
`setuptools-scm was unable to detect version for .../working_dir_files/...`.

**Cause.** When the driver is started with `uv run`, Ray starts its workers through `uv run`
too: it uploads the working directory and installs the project there. Since Ray 2.54 the upload
leaves `.git` out. A project whose version comes from version control (hatch-vcs or
setuptools-scm, as an Orcapod source checkout's does) then cannot be installed on the workers,
so the workers never start. A driver started with `python`, or a project with a fixed version,
is not affected.

**Fix.** Turn off Ray's `uv run` propagation for the run:

```
RAY_ENABLE_UV_RUN_RUNTIME_ENV=0 uv run python my_pipeline.py
```

or start the driver with the environment's Python (`.venv/bin/python my_pipeline.py`). The
workers then use the driver's environment, which is what they do on a local cluster anyway.
`RayExecutor` raising instead of hanging is ITL-1213.

### A node's table is empty

**Cause.** A job node shows the results of its current run, and it has none yet:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Issues = "https://github.com/metamorphic-labs/orcapod-python/issues"

[project.optional-dependencies]
redis = ["redis>=6.2.0"]
ray = ["ray[default]==2.48.0", "ipywidgets>=8.1.7"]
ray = ["ray[default]>=2.60.0,<3", "ipywidgets>=8.1.7"]
postgresql = ["psycopg[binary]>=3.0"]
spiraldb = [
"pyspiral>=0.16.33",
Expand Down Expand Up @@ -101,7 +101,7 @@ dev = [
"pytest-cov>=6.1.1",
"pytest-xdist>=3.6",
"psycopg[binary]>=3.0",
"ray[default]==2.48.0",
"ray[default]>=2.60.0,<3",
"redis>=6.2.0",
"ruff>=0.14.4",
"testcontainers[postgres]>=4.0.0",
Expand Down
8 changes: 8 additions & 0 deletions src/orcapod/core/executors/ray.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class RayExecutor(PythonFunctionExecutorBase):
Note:
``ray`` is an optional dependency. Import errors surface at
construction time so callers get a clear message.

With Ray 2.54 or later, a driver started with ``uv run`` from a
project whose version comes from version control (such as an
Orcapod source checkout) hangs: Ray rebuilds the project on its
workers without ``.git``, and the workers never start. Set
``RAY_ENABLE_UV_RUN_RUNTIME_ENV=0`` or start the driver with
``python``. See "A job with ``RayExecutor`` hangs and its tasks
never start" in the troubleshooting page.
"""

SUPPORTED_TYPES: frozenset[str] = frozenset({"python.function.v0"})
Expand Down
Loading
Loading