ray/doc/source
Stephanie Wang 55a0f7bb2d
[core] ray.init defaults to an existing Ray instance if there is one (#26678)
ray.init() will currently start a new Ray instance even if one is already existing, which is very confusing if you are a new user trying to go from local development to a cluster. This PR changes it so that, when no address is specified, we first try to find an existing Ray cluster that was created through `ray start`. If none is found, we will start a new one.

This makes two changes to the ray.init() resolution order:
1. When `ray start` is called, the started cluster address was already written to a file called `/tmp/ray/ray_current_cluster`. For ray.init() and ray.init(address="auto"), we will first check this local file for an existing cluster address. The file is deleted on `ray stop`. If the file is empty, autodetect any running cluster (legacy behavior) if address="auto", or we will start a new local Ray instance if address=None.
2. When ray.init(address="local") is called, we will create a new local Ray instance, even if one is already existing. This behavior seems to be necessary mainly for `ray.client` use cases.

This also surfaces the logs about which Ray instance we are connecting to. Previously these were hidden because we didn't set up the log until after connecting to Ray. So now Ray will log one of the following messages during ray.init:
```
(Connecting to existing Ray cluster at address: <IP>...)
...connection...
(Started a local Ray cluster.| Connected to Ray Cluster.)( View the dashboard at <URL>)
```

Note that this changes the dashboard URL to be printed with `ray.init()` instead of when the dashboard is first started.

Co-authored-by: Eric Liang <ekhliang@gmail.com>
2022-07-23 11:27:22 -07:00
..
_includes Remove RL Summit announcement (#25354) 2022-06-18 16:01:23 -07:00
_static [Doc] Fix docs feedback button (#26402) 2022-07-09 09:35:06 -07:00
_templates [docs] templates and contribution guide (fixes #21753) (#23003) 2022-03-10 15:28:07 +00:00
cluster [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
data [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
images [Examples] OCR Ray Datasets example (#25930) 2022-07-06 13:11:26 -07:00
ray-air [air/tune] Add top-level imports for Tuner, TuneConfig, move CheckpointConfig (#26882) 2022-07-22 20:17:06 -07:00
ray-contribute [docs] Fix pytest and add stacklevel (#26340) 2022-07-11 19:43:37 -07:00
ray-core [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
ray-more-libs [docs] Add initial AIR documentation (#24483) 2022-05-13 01:29:59 -07:00
ray-observability [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
ray-overview Enable usage stats collection for ray.init iff nightly wheels (#26461) 2022-07-14 12:14:01 -07:00
ray-references [docs] Add initial AIR documentation (#24483) 2022-05-13 01:29:59 -07:00
rllib [Lint Check] Remove broken link (#26505) 2022-07-13 10:30:20 +01:00
serve [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
train [air] update remaining dict scaling_configs (#26856) 2022-07-21 18:55:21 -07:00
tune [tune] Docs for custom command based syncer (awscli / gsutil) (#26879) 2022-07-22 15:28:53 -07:00
workflows [Workflow] Rename the argument of "workflow.get_output" (#26876) 2022-07-22 12:06:19 -07:00
_toc.yml [docs] Improve AIR table of contents titles (#26858) 2022-07-22 17:17:49 -07:00
conf.py [Docs] Add "rate the docs" plugin for feedback on docs (#26330) 2022-07-07 22:30:32 -07:00
custom_directives.py [Docs] Update Train user guide to use the new APIs (#26091) 2022-07-11 15:10:10 -07:00
index.md [docs] Move the workflows (alpha) library to the more libraries section for now (#25704) 2022-06-11 19:47:45 -07:00
preprocess_github_markdown.py exclude doc_code from import sorting (#25772) 2022-06-15 11:34:45 -07:00
robots.txt [docs] add robots txt (#24726) 2022-05-18 10:52:22 +01:00