Repository navigation
[runtime env] redefine runtime env to protobuf - #19511
Conversation
|
The protobuf looks good to me. I guess now any custom plugin needs to have a config that's serializable to |
| message PipRuntimeEnv { | ||
| /// A list of pip packages, such as ["redis >= 3.5.0", "numpy"]. | ||
| repeated string config = 1; | ||
| /// The path to a pip requirements.txt file. | ||
| string config_file_path = 2; | ||
| /// The name of a local virtual env. | ||
| string virtual_env_name = 3; |
There was a problem hiding this comment.
Should this also be oneof? Or are we leaving these all in to allow for the future possibility of combining these options (for example, specifying a virtual env together with a list of additional packages to install)? I'm not sure what the best practice is here
There was a problem hiding this comment.
Yep, I think we can make it to be oneof. And the CondaRuntimeEnv should be oneof as well.
There was a problem hiding this comment.
The pb has been updated.
|
@SongGuyang sorry for the delay, will review tmrw. |
|
@SongGuyang I don't think we can assume that plugins will use We will also need some way to pass URIs for those options as well. I'm also generally a little worried that this is adding complexity without clear value, given that language frontends can just serialize things to JSON already. |
|
@edoakes make sense. We can use a single string to represent a common plugin, instead of map. About "We will also need some way to pass URIs for those options as well.", do you mean that the plugin could append some uris to the |
|
@SongGuyang that's right, plugins should be able to use the caching/GC setup too, so they'll need to be able to pass URIs (see https://docs.google.com/document/d/1x1JAHg7c0ewcOYwhhclbuW0B0UC7l92WFkF4Su0T-dk/edit#heading=h.rcrah72c195t) |
|
@SongGuyang kind of a crazy idea: what if instead of moving this to protobuf we just had the core worker call back into Python to do validation on the JSON string? |
|
@edoakes I found a issue in my implementation. I ran the test case It seems protobuf can not be pickled. Do you know how to fix this? The actor class depends on protobuf indirectly after my refector. |
|
@fyrestone has helped solve the pickle issue f01d09d. |
|
@edoakes @architkulkarni Do you have any other comments? We plan to merge current PR this week. cc @raulchen |
architkulkarni
left a comment
There was a problem hiding this comment.
This looks good to me. I think we would prefer to have the overriding logic in Python rather than C++, but like you said in the PR description, in order for it to work for all languages it needs to be in the CoreWorker, so it has to be in C++.
Does it make sense to add unit tests for the new code in core_worker.cc?
Also, now OverrideTaskOrActorRuntimeEnv is duplicated, appearing both in C++ and in Python (override_task_or_actor_runtime_env in validation.py). Is it feasible to unify them somehow so there's a single code path?
|
The linter is failing with |
| import ray.dashboard.optional_deps # noqa: F401 | ||
| except ImportError: | ||
| if require_dashboard: | ||
| logger.exception("dashboard dependency error") |
There was a problem hiding this comment.
What's the context for adding this? Does the ImportError on the line below not show up in some cases?
There was a problem hiding this comment.
If I don't log this, I can't see which package import error.
|
@architkulkarni Yep, I can remove this function in python and add some test cases in C++. For long term, I'm thinking that can we do this override logic in runtime env agent?But we need to do a refacter. In this way, the runtime env and hash will be generated by agent with installng. I'm not sure about that. |
| for plugin_class_path in runtime_env.get("plugins", {}).keys(): | ||
| for plugin_class_path, config in runtime_env.plugins(): | ||
| logger.debug( | ||
| f"Run setup function of plugin {plugin_class_path}") |
There was a problem hiding this comment.
Setting up RuntimeEnv plugin {...}
| else: | ||
| return runtime_env_agent_pb2.DeleteURIsReply( | ||
| status=agent_manager_pb2.AGENT_RPC_STATUS_OK) | ||
| if failed_uris: |
There was a problem hiding this comment.
Is this change intended? Why move this if statement out of the for loop?
There was a problem hiding this comment.
Yep, I think here is a bug before. We need to reply the rpc after getting all the failed uris.
| // never see a new one. | ||
| serialized_runtime_env_ = task_spec.SerializedRuntimeEnv(); | ||
| if (!serialized_runtime_env_.serialized_runtime_env().empty()) { | ||
| RAY_LOG(INFO) << "serialized_runtime_env_.serialized_runtime_env() " |
There was a problem hiding this comment.
Let me remove this.
This reverts commit ad56b9b.
Reverts #19511 Breaks windows compilation
… outage (#65880) ## Why this change is needed `data.pyg.org`, the PyG wheel index that every ML/data/rllib depset declares via `--find-links`, has been a dangling CNAME since 2026-09-02: it points at `d28mro9bmx3ky3.cloudfront.net`, and that CloudFront distribution returns `NOERROR` with zero answers from 8.8.8.8, 1.1.1.1 and 9.9.9.9. Upstream is tracking it at pyg-team/pyg-lib#719 and has said they are working on it with urgency; as of their last update there is no ETA. uv fails eagerly on an unreadable `--find-links` URL before deciding whether it needs anything from it, so `raydepsets build --all-configs --check` is red on every run regardless of the PR's contents: | Pipeline | Build | Time (UTC) | Result | |---|---|---|---| | postmerge | #19487 | Sep 2 05:05 | passed (last good) | | postmerge | #19498 | Sep 2 15:28 | pyg DNS | | postmerge | #19501 | Sep 2 16:09 | pyg DNS | | postmerge | #19507 | Sep 2 20:06 | pyg DNS | | postmerge | #19511 | Sep 3 00:05 | pyg DNS | | premerge | #72711, #72712 | Sep 2 | pyg DNS | Every run since ~15:30Z Sep 2 has failed. It blocks every `python_dependencies`-tagged PR and paints master red. The `pip-compile dependencies` step is **not** affected and is left alone: pip treats an unreachable find-links as a warning, PyPI's sdist satisfies `torch-scatter==2.1.2`, and since `requirements_compiled.txt` pins without the `+pt29cpu` local version the output is byte-identical. It passed in all six of the builds above where raydepsets failed, so it keeps guarding `requirements_compiled.txt`. ## What changes `soft_fail: true` on the `raydepsets: compile all dependencies` step, with a comment recording why and when to remove it. `soft_fail` rather than removing the step: the job still runs and reports, so it turns green on its own when upstream restores the record, and reviewers can still see lock drift in its output in the meantime. There's precedent for this pattern in `lint.rayci.yml` (`api-param-coverage`). ## What this does not fix - **Image builds.** 32 deplocks carry the find-links line, so any wanda image build that misses cache fails at `pip install` inside the Dockerfile (#72719 lost `docgpubuild-py3.10` and `mlgpubuild-py3.10` this way). Most PRs are unaffected because unchanged inputs reuse the cached image. Nothing CI-side fixes this without hosting the wheels somewhere else, which is a separate change. - **Lock regeneration.** A PR that needs a new deplock still can't produce one until the index is back, since the recompile itself reads the find-links. ## Cost While this is in, a PR that edits a requirements file without regenerating its lock can merge. The pip-compile guard still covers `requirements_compiled.txt`, and the window should be short. ## Revert when `raydepsets: compile all dependencies` is green on a master postmerge build. Track pyg-team/pyg-lib#719. Signed-off-by: elliot-barn <[email protected]>
… outage (ray-project#65880) ## Why this change is needed `data.pyg.org`, the PyG wheel index that every ML/data/rllib depset declares via `--find-links`, has been a dangling CNAME since 2026-09-02: it points at `d28mro9bmx3ky3.cloudfront.net`, and that CloudFront distribution returns `NOERROR` with zero answers from 8.8.8.8, 1.1.1.1 and 9.9.9.9. Upstream is tracking it at pyg-team/pyg-lib#719 and has said they are working on it with urgency; as of their last update there is no ETA. uv fails eagerly on an unreadable `--find-links` URL before deciding whether it needs anything from it, so `raydepsets build --all-configs --check` is red on every run regardless of the PR's contents: | Pipeline | Build | Time (UTC) | Result | |---|---|---|---| | postmerge | ray-project#19487 | Sep 2 05:05 | passed (last good) | | postmerge | ray-project#19498 | Sep 2 15:28 | pyg DNS | | postmerge | ray-project#19501 | Sep 2 16:09 | pyg DNS | | postmerge | ray-project#19507 | Sep 2 20:06 | pyg DNS | | postmerge | ray-project#19511 | Sep 3 00:05 | pyg DNS | | premerge | #72711, #72712 | Sep 2 | pyg DNS | Every run since ~15:30Z Sep 2 has failed. It blocks every `python_dependencies`-tagged PR and paints master red. The `pip-compile dependencies` step is **not** affected and is left alone: pip treats an unreachable find-links as a warning, PyPI's sdist satisfies `torch-scatter==2.1.2`, and since `requirements_compiled.txt` pins without the `+pt29cpu` local version the output is byte-identical. It passed in all six of the builds above where raydepsets failed, so it keeps guarding `requirements_compiled.txt`. ## What changes `soft_fail: true` on the `raydepsets: compile all dependencies` step, with a comment recording why and when to remove it. `soft_fail` rather than removing the step: the job still runs and reports, so it turns green on its own when upstream restores the record, and reviewers can still see lock drift in its output in the meantime. There's precedent for this pattern in `lint.rayci.yml` (`api-param-coverage`). ## What this does not fix - **Image builds.** 32 deplocks carry the find-links line, so any wanda image build that misses cache fails at `pip install` inside the Dockerfile (#72719 lost `docgpubuild-py3.10` and `mlgpubuild-py3.10` this way). Most PRs are unaffected because unchanged inputs reuse the cached image. Nothing CI-side fixes this without hosting the wheels somewhere else, which is a separate change. - **Lock regeneration.** A PR that needs a new deplock still can't produce one until the index is back, since the recompile itself reads the find-links. ## Cost While this is in, a PR that edits a requirements file without regenerating its lock can merge. The pip-compile guard still covers `requirements_compiled.txt`, and the window should be short. ## Revert when `raydepsets: compile all dependencies` is green on a master postmerge build. Track pyg-team/pyg-lib#719. Signed-off-by: elliot-barn <[email protected]>

Why are these changes needed?
In current PR:
PluginRuntimeEnvtype to support the pluggability.After this refector, we can get some benefits:
oneoftype in protobuf.Future work:
Related issue number
#19447