Skip to content

Commit e192cd9

Browse files
committed
cleaning up ray init script
1 parent 6340fba commit e192cd9

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎modules/api/ray.py‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,29 @@
99

1010
#ray.init(os.environ.get("RAY_HEAD_ADDRESS", ""))
1111
#ray.init("ray://localhost:10001")
12-
if "RAY_HEAD_ADDRESS" in os.environ:
13-
ray.init(address=os.environ.get("RAY_HEAD_ADDRESS"))
12+
13+
14+
ray_head_address = os.environ.get("RAY_HEAD_ADDRESS")
15+
print("RAY_HEAD_ADDRESS:", ray_head_address)
16+
17+
if ray_head_address:
18+
ray.init(address=ray_head_address)
1419
else:
1520
ray.init()
1621

22+
1723
def ray_only():
1824
serve.shutdown()
1925
if "RAY_DOCKER" in os.environ:
2026
print("starting ray in docker")
2127
serve.start(
22-
detached=True,
28+
detached=True,
2329
http_options={
2430
"host": os.environ.get("RAY_IP", "0.0.0.0"),
2531
"port": int(os.environ.get("RAY_PORT", 8000))
2632
}
2733
)
28-
else:
34+
else:
2935
serve.start(
3036
http_options={
3137
"host": os.environ.get("RAY_IP", "0.0.0.0"),

0 commit comments

Comments
 (0)