Skip to content

Commit 0dcae12

Browse files
committed
make ray available on toolkit
1 parent 04358c3 commit 0dcae12

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/agentlab/experiments/launch_exp.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import logging
2+
import os
23
from importlib import import_module
34
from pathlib import Path
45

@@ -7,6 +8,8 @@
78
from agentlab.experiments.exp_utils import run_exp
89
from agentlab.experiments.loop import ExpArgs, yield_all_exp_results
910

11+
RAY_PUBLIC_DASHBOARD = os.environ.get("RAY_PUBLIC_DASHBOARD", "false") == "true"
12+
1013

1114
def run_experiments(
1215
n_jobs,
@@ -82,7 +85,9 @@ def run_experiments(
8285
elif parallel_backend == "ray":
8386
from agentlab.experiments.graph_execution_ray import execute_task_graph, ray
8487

85-
ray.init(num_cpus=n_jobs)
88+
ray.init(
89+
num_cpus=n_jobs, dashboard_host="0.0.0.0" if RAY_PUBLIC_DASHBOARD else "127.0.0.1"
90+
)
8691
try:
8792
execute_task_graph(exp_args_list, avg_step_timeout=avg_step_timeout)
8893
finally:

0 commit comments

Comments
 (0)