File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111#ray.init("ray://localhost:10001")
1212
1313
14- if "RAY_DOCKER" in os .environ :
15- ray .init (
16- dashboard_host = os .environ .get ("RAY_DASHBOARD_HOST" , "0.0.0.0" ),
17- dashboard_port = int (os .environ .get ("RAY_DASHBOARD_PORT" , 8265 ))
18- )
19- else :
20- ray .init ()
21-
2214
2315def ray_only ():
2416 serve .shutdown ()
@@ -37,3 +29,18 @@ def ray_only():
3729 print ("Done setting up replicas! Now accepting requests..." )
3830 while True :
3931 time .sleep (1000 )
32+
33+
34+ if __name__ == "__main__" :
35+
36+ if "RAY_DOCKER" in os .environ :
37+ ray .init (
38+ dashboard_host = os .environ .get ("RAY_DASHBOARD_HOST" , "0.0.0.0" ),
39+ dashboard_port = int (os .environ .get ("RAY_DASHBOARD_PORT" , 8265 ))
40+ )
41+ elif "RAY_HEAD_ADDRESS" in os .environ :
42+ ray .init (os .environ .get ("RAY_HEAD_ADDRESS" , "" ))
43+ elif "RAY_SERVE_ONLY" in os .environ :
44+ ray_only ()
45+ else :
46+ ray .init ()
You can’t perform that action at this time.
0 commit comments