ray/dashboard
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
..
client added summary why and when to use bulk vs streaming data ingest (#26637) 2022-07-17 18:46:58 -07:00
modules [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
tests [Dashboard] Fix test dashboard flaky by catch an expected exception (#26555) 2022-07-14 20:57:46 -07:00
__init__.py [Dashboard] New dashboard skeleton (#9099) 2020-07-27 11:34:47 +08:00
agent.py redo agent_pid -> agent_id (#25806) 2022-07-19 20:26:49 -07:00
BUILD Revert "Revert "Bump pytest from 5.4.3 to 7.0.1"" (#26525) 2022-07-18 21:21:19 -07:00
consts.py [Core | State Observability] Implement API Server (Dashboard) HTTP Requests Throttling (#26257) 2022-07-13 09:05:26 -07:00
dashboard.py [Core][cli][usability] ray stop prints errors during graceful shutdown (#25686) 2022-06-27 08:14:59 -07:00
datacenter.py [Dashboard] fix iterating over GPU processes (#23562) 2022-03-31 17:16:53 -07:00
head.py Auto reconnect for gcs aio client (#26673) 2022-07-19 13:11:09 -07:00
http_server_agent.py Revert "Revert "[Dashboard][Serve] Move Serve related endpoints to dashboard agent"" (#26336) 2022-07-06 19:37:30 -07:00
http_server_head.py [Core][cli][usability] ray stop prints errors during graceful shutdown (#25686) 2022-06-27 08:14:59 -07:00
k8s_utils.py [dashboard][kubernetes] Dashboard CPU and memory adjustments. (#21688) 2022-03-01 17:15:59 -08:00
memory_utils.py [State Observability] Summary APIs (#25672) 2022-06-22 06:21:50 -07:00
optional_deps.py [Dashboard] Agent in minimal ray installation (#21817) 2022-01-26 04:03:54 -08:00
optional_utils.py [Serve] Default to EveryNode when starting Serve from REST API (#26588) 2022-07-15 15:47:54 -07:00
state_aggregator.py [Core][State Observability] Fix is_alive column with wrong column type that breaks filtering (#26739) 2022-07-20 16:38:15 -07:00
utils.py Revert "Revert "[Dashboard][Serve] Move Serve related endpoints to dashboard agent"" (#26336) 2022-07-06 19:37:30 -07:00