Skip to content

Commit 08179fb

Browse files
committed
modifying ray.py
1 parent e192cd9 commit 08179fb

2 files changed

Lines changed: 13 additions & 17 deletions

File tree

‎modules/api/ray.py‎

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,33 +11,27 @@
1111
#ray.init("ray://localhost:10001")
1212

1313

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)
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", 8000))
18+
)
1919
else:
2020
ray.init()
2121

2222

2323
def ray_only():
2424
serve.shutdown()
25-
if "RAY_DOCKER" in os.environ:
26-
print("starting ray in docker")
27-
serve.start(
28-
detached=True,
29-
http_options={
30-
"host": os.environ.get("RAY_IP", "0.0.0.0"),
31-
"port": int(os.environ.get("RAY_PORT", 8000))
32-
}
33-
)
34-
else:
35-
serve.start(
25+
26+
print("starting ray")
27+
serve.start(
28+
3629
http_options={
3730
"host": os.environ.get("RAY_IP", "0.0.0.0"),
3831
"port": int(os.environ.get("RAY_PORT", 8000))
3932
}
4033
)
34+
4135
print(f"Starting Raypi on port {os.environ.get('RAY_PORT', 8000)}")
4236
serve.run(Raypi.bind(), port=int(os.environ.get("RAY_PORT", 8000)), route_prefix="/sdapi/v1") #route_prefix="/sdapi/v1" # Call the launch_ray method to get the FastAPI app
4337
print("Done setting up replicas! Now accepting requests...")

‎webui-user.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,7 @@
5252
#export RAY_MAX_REPLICAS=2
5353
#export RAY_PORT=7575
5454
#export RAY_IP="0.0.0.0"
55-
#export RAY_HEAD_ADDRESS='ray://ray-head:10001'
55+
#export RAY_ADDRESS='ray://ray-head:10001'
5656
#export RAY_DOCKER="True"
57+
#export RAY_DASHBOARD_PORT=8265
58+
#export RAY_DASHBOARD_HOST="0.0.0.0"

0 commit comments

Comments
 (0)