Skip to content

Commit 9416705

Browse files
binary-huskypan-x-cgemini-code-assist[bot]
authored
improve ray stat (#454)
Co-authored-by: Xuchen Pan <[email protected]> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 8d4ff3b commit 9416705

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 not os.path.exists(ray_path):
45+
ray_path = "ray"
46+
ret = subprocess.run([ray_path, "status"], capture_output=True)
4347
return ret.returncode == 0
4448

4549

0 commit comments

Comments
 (0)