sneaky bug logging

This commit is contained in:
Jai Suphavadeeprasit 2026-03-10 11:18:05 -04:00
parent 64794e7c72
commit 09ad401995
3 changed files with 40 additions and 0 deletions

View file

@ -1,5 +1,6 @@
import asyncio
import inspect
import logging
import os
import warnings
from contextlib import asynccontextmanager
@ -25,6 +26,8 @@ from atroposlib.envs.server_handling.sglang_server import SGLangServer
from atroposlib.envs.server_handling.trl_vllm_server import TrlVllmServer
from atroposlib.envs.server_handling.vllm_server import VLLMServer
logger = logging.getLogger(__name__)
class ServerManagerConfig(BaseModel):
slurm: bool = Field(
@ -103,6 +106,13 @@ class ServerManager:
self.servers = [ServerHarness()]
return
if not isinstance(configs, list):
logger.warning(
"ServerManager: configs is NOT a list (type=%s). "
"Using auto-generated URLs (template mode). "
"Passed base_url=%s will be IGNORED.",
type(configs).__name__,
getattr(configs, "base_url", "N/A"),
)
urls = []
if os.environ.get("SLURM_JOB_NODELIST", None) is not None:
nodelist = (
@ -145,11 +155,21 @@ class ServerManager:
server_class(config, reasoning_config=reasoning_config)
for config in openai_configs
]
logger.warning(
"ServerManager: auto-generated %s server(s) at URLs: %s",
len(self.servers),
[c.base_url for c in openai_configs],
)
elif not slurm:
self.servers = [
server_class(config, reasoning_config=reasoning_config)
for config in configs
]
logger.warning(
"ServerManager: using %s explicit config(s) at URLs: %s",
len(self.servers),
[c.base_url for c in configs],
)
else:
nodelist = (
os.popen(f'scontrol show hostnames {os.environ["SLURM_JOB_NODELIST"]}')