ray/dashboard/modules
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
..
actor [api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695) 2022-06-21 15:13:29 -07:00
event [api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695) 2022-06-21 15:13:29 -07:00
healthz [dashboard][2/2] Add endpoints to dashboard and dashboard_agent for liveness check of raylet and gcs (#26408) 2022-07-09 13:09:48 -07:00
job [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
log Revert Revert "[Observability] Fix --follow lost connection when it is used for > 30 seconds" #26162 (#26163) 2022-06-28 16:07:32 -07:00
node [api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695) 2022-06-21 15:13:29 -07:00
reporter [Dashboard] Fix dashboard RAM and CPU with cgroups2 (#25710) 2022-06-26 14:01:26 -07:00
runtime_env [runtime env] plugin refactor [5/n]: support priority (#26659) 2022-07-20 10:07:06 +08:00
serve [Serve] Fix test_cli flakiness (#26471) 2022-07-12 17:57:08 -07:00
snapshot [dashboard] Add RAY_CLUSTER_ACTIVITY_HOOK to /api/component_activities (#26297) 2022-07-08 10:51:59 -07:00
state [Core][State Observability] Use address arg + print warning if API responds slowly (#26008) 2022-07-14 06:44:07 -07:00
test [api] Annotate as public / move ray-core APIs to _private and add enforcement rule (#25695) 2022-06-21 15:13:29 -07:00
tests [serve] Reject Ray client addresses when submitting via Dashboard (#23339) 2022-03-21 11:17:51 -05:00
tune [tune] fix set_tune_experiment (#26298) 2022-07-05 15:04:51 -07:00
usage_stats [Usage stats] Report total number of running jobs for usage stats purpose. (#26787) 2022-07-21 01:37:58 -07:00
__init__.py [Dashboard] New dashboard skeleton (#9099) 2020-07-27 11:34:47 +08:00
dashboard_sdk.py [core] ray.init defaults to an existing Ray instance if there is one (#26678) 2022-07-23 11:27:22 -07:00
version.py Revert "Revert "[Dashboard][Serve] Move Serve related endpoints to dashboard agent"" (#26336) 2022-07-06 19:37:30 -07:00