ray/doc/source/cluster
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
..
examples exclude doc_code from import sorting (#25772) 2022-06-15 11:34:45 -07:00
kuberay [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
api.rst Add landing & key concepts pages for clusters (#24379) 2022-05-25 10:23:50 -07:00
aws-tips.rst [doc] Add CloudWatch integration documentation (#22638) 2022-04-21 09:44:41 -07:00
cloud.rst [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
commands.rst [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
config.rst Bump Ray Version from 2.0.0.dev0 to 3.0.0.dev0 (#24894) 2022-05-17 19:31:05 -07:00
deploy.rst [KubeRay] Documentation structure and skeleton (#26589) 2022-07-19 13:28:04 -07:00
guide.rst [Docs] [Clusters] Fix issues in the overview part of Cluster Deployment Guide, and fix a typo (#25473) 2022-06-06 14:11:41 -07:00
index.rst [Docs] Note that certain features are community maintained (#25687) 2022-06-13 16:10:32 -07:00
job-submission.rst Add warning about entrpoint command in quotes (#25519) 2022-06-08 09:38:55 -07:00
jobs-package-ref.rst Add warning about entrpoint command in quotes (#25519) 2022-06-08 09:38:55 -07:00
key-concepts.rst [Docs] Note that certain features are community maintained (#25687) 2022-06-13 16:10:32 -07:00
kuberay.md [KubeRay] Documentation structure and skeleton (#26589) 2022-07-19 13:28:04 -07:00
kubernetes-advanced.rst [docs] new structure (#21776) 2022-01-21 15:42:05 -08:00
kubernetes-gpu.rst [docs] new structure (#21776) 2022-01-21 15:42:05 -08:00
kubernetes-manual.rst [docs] new structure (#21776) 2022-01-21 15:42:05 -08:00
kubernetes.rst [KubeRay] Documentation structure and skeleton (#26589) 2022-07-19 13:28:04 -07:00
lsf.rst [GCS-Ray] update doc and error message for GCS-Ray (#22528) 2022-02-22 17:56:30 -08:00
quickstart.rst [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
ray-client.rst Fix broken links in documentation and put linkcheck linter in place on CI (#23340) 2022-03-18 21:02:52 -07:00
ray-cluster.jpg Revert "[docs] Clean up doc structure (first part) (#21667)" (#21763) 2022-01-20 15:30:56 -08:00
reference.rst [docs] landing page (fixes #21750) (#21859) 2022-01-26 17:14:25 -08:00
sdk.rst Revert "[docs] Clean up doc structure (first part) (#21667)" (#21763) 2022-01-20 15:30:56 -08:00
slurm.rst [Docs] Note that certain features are community maintained (#25687) 2022-06-13 16:10:32 -07:00
usage-stats-data-ref.rst [Doc] Add doc for usage stats collection (#24522) 2022-05-10 17:18:49 -07:00
usage-stats.rst Enable usage stats collection for ray.init iff nightly wheels (#26461) 2022-07-14 12:14:01 -07:00
user-guide.rst Add landing & key concepts pages for clusters (#24379) 2022-05-25 10:23:50 -07:00
we_are_hiring.rst Comment our banner (#25369) 2022-06-01 16:36:33 -07:00
yarn.rst [docs] new structure (#21776) 2022-01-21 15:42:05 -08:00