ray/doc/source/ray-core
Guyang Song eb2692cb32
[runtime env] runtime env inheritance refactor (#24538)
* [runtime env] runtime env inheritance refactor (#22244)

Runtime Environments is already GA in Ray 1.6.0. The latest doc is [here](https://docs.ray.io/en/master/ray-core/handling-dependencies.html#runtime-environments). And now, we already supported a [inheritance](https://docs.ray.io/en/master/ray-core/handling-dependencies.html#inheritance) behavior as follows (copied from the doc):
- The runtime_env["env_vars"] field will be merged with the runtime_env["env_vars"] field of the parent. This allows for environment variables set in the parent’s runtime environment to be automatically propagated to the child, even if new environment variables are set in the child’s runtime environment.
- Every other field in the runtime_env will be overridden by the child, not merged. For example, if runtime_env["py_modules"] is specified, it will replace the runtime_env["py_modules"] field of the parent.

We think this runtime env merging logic is so complex and confusing to users because users can't know the final runtime env before the jobs are run.

Current PR tries to do a refactor and change the behavior of Runtime Environments inheritance. Here is the new behavior:
- **If there is no runtime env option when we create actor, inherit the parent runtime env.**
- **Otherwise, use the optional runtime env directly and don't do the merging.**

Add a new API named `ray.runtime_env.get_current_runtime_env()` to get the parent runtime env and modify this dict by yourself. Like:
```Actor.options(runtime_env=ray.runtime_env.get_current_runtime_env().update({"X": "Y"}))```
This new API also can be used in ray client.
2022-05-20 10:53:54 +08:00
..
_examples/datasets_train [test] add back deleted datasets train test file (#23051) 2022-03-10 21:46:07 -08:00
actors [Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544) 2022-05-18 09:41:51 -07:00
doc_code [Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544) 2022-05-18 09:41:51 -07:00
examples [docs] remove non-functional lbfgs example (#24727) 2022-05-18 10:53:14 +01:00
images [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
objects [docs] Add documentation on how to handle read-only arrays and actor reprs (#24410) 2022-05-02 23:52:54 -07:00
tasks [Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544) 2022-05-18 09:41:51 -07:00
actors.rst Add actor out-of-band communication doc (#24185) 2022-05-03 21:36:26 -07:00
advanced.rst [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
configure.rst [docs] Remove bad suggestions to use local_mode or num_cpus in init (#24827) 2022-05-17 12:55:04 -07:00
cross-language.rst [Java][API CHANGE] Move exception to api module. (#24540) 2022-05-19 10:18:20 +08:00
handling-dependencies.rst [runtime env] runtime env inheritance refactor (#24538) 2022-05-20 10:53:54 +08:00
key-concepts.rst [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
more-topics.rst [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
namespaces.rst [docs] integrate algolia docsearch, move to sphinx panels (#21814) 2022-01-24 17:00:41 -08:00
objects.rst [doc] Improve the object reference documentation (#24636) 2022-05-10 18:39:16 -07:00
package-ref.rst [Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544) 2022-05-18 09:41:51 -07:00
placement-group.rst [Placement group] Update the old placement group API usage to the new scheduling_strategy based API (#24544) 2022-05-18 09:41:51 -07:00
ray-dashboard.rst Fix broken links in documentation and put linkcheck linter in place on CI (#23340) 2022-03-18 21:02:52 -07:00
starting-ray.rst [docs] Remove bad suggestions to use local_mode or num_cpus in init (#24827) 2022-05-17 12:55:04 -07:00
tasks.rst [Doc] Add scheduling doc (#23343) 2022-03-20 16:05:06 -07:00
tips-for-first-time.rst [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
troubleshooting.rst Fix broken links in documentation and put linkcheck linter in place on CI (#23340) 2022-03-18 21:02:52 -07:00
user-guide.rst [docs] Core docs refactor (#23216) 2022-03-17 11:26:17 -07:00
using-ray-with-jupyter.rst [docs] re/move old core examples (#22802) 2022-03-10 12:17:00 -08:00
walkthrough.rst [C++ API][Doc] Add doc and error log to notice C++ API is not supported on Windows (#23272) 2022-03-18 10:52:57 +08:00