ray/doc/source/serve
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
..
deployment-graph [Deployment Graph] Add visualization cookbook (#25112) 2022-06-06 11:05:58 -07:00
doc_code [Serve] [Docs] Create end-to-end documentation example for Serve REST API and CLI (#25936) 2022-06-24 14:44:39 -07:00
tutorials [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
architecture.md [Serve][Doc] Convert Serve doc sources from rst to myst (#24657) 2022-05-10 14:04:17 -07:00
architecture.svg Revert "[docs] Clean up doc structure (first part) (#21667)" (#21763) 2022-01-20 15:30:56 -08:00
autoscaling.md [Serve][Doc] Autoscaling (#25646) 2022-06-22 15:32:18 -05:00
deploying-serve.md [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
deployment-graph.md [Deployment Graph] Add visualization cookbook (#25112) 2022-06-06 11:05:58 -07:00
faq.md [Serve][Doc] Split core-apis to key concepts and user guide (#24713) 2022-05-20 10:56:34 -07:00
getting_started.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
handle-guide.md [Serve][Doc] Split core-apis to key concepts and user guide (#24713) 2022-05-20 10:56:34 -07:00
handling-dependencies.md [Serve][Doc] Split core-apis to key concepts and user guide (#24713) 2022-05-20 10:56:34 -07:00
http-adapters.md Revert "Revert "[AIR][Serve] Rename ModelWrapperDeployment -> PredictorDeployment"" (#26231) 2022-07-05 13:26:49 -07:00
http-guide.md [Serve][Doc] Split core-apis to key concepts and user guide (#24713) 2022-05-20 10:56:34 -07:00
index.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
key-concepts.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
logo.svg Revert "[docs] Clean up doc structure (first part) (#21667)" (#21763) 2022-01-20 15:30:56 -08:00
managing-deployments.md [Serve] Promote autoscaling feature (#26393) 2022-07-13 14:38:38 -05:00
ml-models.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
monitoring.md [Serve][Doc] Convert Serve doc sources from rst to myst (#24657) 2022-05-10 14:04:17 -07:00
package-ref.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00
performance.md [serve][docs] Replaced term 'actor_init_options' with 'ray_actor_options' in documentation (#25808) 2022-06-15 15:21:24 -05:00
production.md Revert "Revert "[Dashboard][Serve] Move Serve related endpoints to dashboard agent"" (#26336) 2022-07-06 19:37:30 -07:00
user-guide.md [Docs] [Serve] Has a consistent landing page style (#26029) 2022-07-08 11:58:21 -07:00