Skip to content

Commit 9d390bf

Browse files
committed
added ray_docker env var
1 parent 1e52016 commit 9d390bf

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎modules/api/ray.py‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@
1616

1717
def ray_only():
1818
serve.shutdown()
19-
serve.start(detached=True, http_options={
20-
"host": os.environ.get("RAY_IP", "0.0.0.0"),
21-
"port": int(os.environ.get("RAY_PORT", 8000))
22-
}
23-
)
19+
if "RAY_DOCKER" in os.environ:
20+
print("starting ray in docker")
21+
serve.start(detached=True, http_options={
22+
"host": os.environ.get("RAY_IP", "0.0.0.0"),
23+
"port": int(os.environ.get("RAY_PORT", 8000))
24+
}
25+
)
26+
else:
27+
serve.start()
2428
print(f"Starting Raypi on port {os.environ.get('RAY_PORT', 8000)}")
2529
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
2630
print("Done setting up replicas! Now accepting requests...")

‎webui-user.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,4 @@ export RAY_MAX_REPLICAS=2
5353
export RAY_PORT=7575
5454
export RAY_IP="0.0.0.0"
5555
#export RAY_HEAD_ADDRESS='ray://ray-head:10001'
56+
#export RAY_DOCKER="True"

0 commit comments

Comments
 (0)