Skip to content

Commit afb8d6c

Browse files
committed
improve ray stat
1 parent 38ba481 commit afb8d6c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

trinity/utils/dlc_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ def get_dlc_env_vars() -> dict:
3939

4040
def is_running() -> bool:
4141
"""Check if ray cluster is running."""
42-
ret = subprocess.run("ray status", shell=True, capture_output=True)
42+
python_dir = os.path.dirname(sys.executable)
43+
ray_path = os.path.join(python_dir, "ray")
44+
if os.path.exists(ray_path) is False:
45+
ray_path = "ray"
46+
ret = subprocess.run(f"{ray_path} status", shell=True, capture_output=True)
4347
return ret.returncode == 0
4448

4549

0 commit comments

Comments
 (0)