Skip to content

Commit 231175c

Browse files
Add Environment Variable for Ray port (#315)
* add env variable for ray port * document env variables
1 parent 04eddfe commit 231175c

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,15 @@ dynamic benchmarks.
278278

279279
## Variables
280280
Here's a list of relevant env. variables that are used by AgentLab:
281-
- `OPEAI_API_KEY` which is used by default for OpenAI LLMs.
281+
- `OPENAI_API_KEY` which is used by default for OpenAI LLMs.
282282
- `AZURE_OPENAI_API_KEY`, used by default for AzureOpenAI LLMs.
283283
- `AZURE_OPENAI_ENDPOINT` to specify your Azure endpoint.
284284
- `OPENAI_API_VERSION` for the Azure API.
285285
- `OPENROUTER_API_KEY` for the Openrouter API
286286
- `AGENTLAB_EXP_ROOT`, desired path for your experiments to be stored, defaults to `~/agentlab-results`.
287287
- `AGENTXRAY_SHARE_GRADIO`, which prompts AgentXRay to open a public tunnel on launch.
288+
- `RAY_PUBLIC_DASHBOARD` (true / false), used to specify whether the ray dashboard should be made publicly accessible (`0.0.0.0`) or not (`127.0.0.1`).
289+
- `RAY_DASHBOARD_PORT` (int), used to specify the port on which the ray dashboard should be accessible.
288290

289291
## Misc
290292

src/agentlab/experiments/launch_exp.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from agentlab.experiments.loop import ExpArgs, yield_all_exp_results
1010

1111
RAY_PUBLIC_DASHBOARD = os.environ.get("RAY_PUBLIC_DASHBOARD", "false") == "true"
12+
RAY_DASHBOARD_PORT = os.environ.get("RAY_DASHBOARD_PORT")
1213

1314

1415
def run_experiments(
@@ -86,7 +87,9 @@ def run_experiments(
8687
from agentlab.experiments.graph_execution_ray import execute_task_graph, ray
8788

8889
ray.init(
89-
num_cpus=n_jobs, dashboard_host="0.0.0.0" if RAY_PUBLIC_DASHBOARD else "127.0.0.1"
90+
num_cpus=n_jobs,
91+
dashboard_host="0.0.0.0" if RAY_PUBLIC_DASHBOARD else "127.0.0.1",
92+
dashboard_port=None if RAY_DASHBOARD_PORT is None else int(RAY_DASHBOARD_PORT),
9093
)
9194
try:
9295
execute_task_graph(exp_args_list, avg_step_timeout=avg_step_timeout)

0 commit comments

Comments
 (0)