File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515def ray_only ():
1616 serve .shutdown ()
17-
17+
18+ if "RAY_DOCKER" in os .environ :
19+ ray .init (
20+ dashboard_host = os .environ .get ("RAY_DASHBOARD_HOST" , "0.0.0.0" ),
21+ dashboard_port = int (os .environ .get ("RAY_DASHBOARD_PORT" , 8265 ))
22+ )
23+ elif "RAY_HEAD_ADDRESS" in os .environ :
24+ ray .init (address = os .environ .get ("RAY_HEAD_ADDRESS" , "" ))
25+ elif "RAY_SERVE_ONLY" in os .environ :
26+ pass
27+ else :
28+ ray .init ()
29+
30+
1831 print ("starting ray" )
1932 serve .start (
2033
@@ -29,18 +42,3 @@ def ray_only():
2942 print ("Done setting up replicas! Now accepting requests..." )
3043 while True :
3144 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 (address = 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