@@ -82,17 +82,12 @@ def __init__(self, conf_dir: Path = Path("/etc/nginx/sites-enabled")) -> None:
8282 async def register (self , conf : SiteConfig , acme : ACMESettings ) -> None :
8383 logger .debug ("Registering %s domain %s" , conf .type , conf .domain )
8484 conf_name = self .get_config_name (conf .domain )
85- logger .debug (f"[SglangRouterTesting] Register Conf object dict: { conf .dict ()} " )
8685 async with self ._lock :
8786 if conf .https :
8887 await run_async (self .run_certbot , conf .domain , acme )
8988 await run_async (self .write_conf , conf .render (), conf_name )
90- # Start sglang-router if router is sglang
9189 if hasattr (conf , "router" ) and conf .router == "sglang" :
9290 replicas = len (conf .replicas ) if hasattr (conf , "replicas" ) and conf .replicas else 1
93- logger .debug (
94- f"[SglangRouterTesting] Starting sglang-router with { replicas } replicas"
95- )
9691 await run_async (self .write_sglang_workers_conf , conf )
9792 await run_async (self .start_sglang_router , replicas )
9893
@@ -106,7 +101,6 @@ async def unregister(self, domain: str) -> None:
106101 async with self ._lock :
107102 await run_async (sudo_rm , conf_path )
108103 workers_conf_path = self ._conf_dir / f"sglang-workers.{ domain } .conf"
109- logger .debug (f"[SglangRouterTesting] Workers conf path: { workers_conf_path } " )
110104 if workers_conf_path .exists ():
111105 await run_async (sudo_rm , workers_conf_path )
112106 await run_async (self .stop_sglang_router )
@@ -122,26 +116,20 @@ def reload() -> None:
122116
123117 @staticmethod
124118 def start_sglang_router (replicas : int ) -> None :
125- """Start sglang-router service, killing existing one if running."""
126119 try :
127- # Kill existing sglang-router if running
128120 result = subprocess .run (
129121 ["pgrep" , "-f" , "sglang::router" ], capture_output = True , timeout = 5
130122 )
131123 if result .returncode == 0 :
132- logger .info ("Killing existing sglang-router..." )
124+ logger .info ("Stopping existing sglang-router..." )
133125 subprocess .run (["pkill" , "-f" , "sglang::router" ], timeout = 5 )
134- # Wait a moment for the process to terminate
135126 import time
136127
137128 time .sleep (1 )
138-
139- # Generate worker URLs based on replica count
140129 worker_urls = []
141130 for i in range (1 , replicas + 1 ):
142131 worker_urls .append (f"http://127.0.0.1:{ 10000 + i } " )
143132
144- # Start sglang-router with system-wide installation
145133 logger .info (f"Starting sglang-router with { replicas } replicas..." )
146134 cmd = (
147135 [
0 commit comments