[router][grpc] Add serve_grpc to launch_server and log id for HealthCheck (#11564)

This commit is contained in:
Chang Su
2025-10-13 16:07:19 -07:00
committed by GitHub
parent 065ce81574
commit 887c2b4575
9 changed files with 68 additions and 93 deletions

View File

@@ -1,9 +1,9 @@
"""Launch the inference server."""
import asyncio
import os
import sys
from sglang.srt.entrypoints.http_server import launch_server
from sglang.srt.server_args import prepare_server_args
from sglang.srt.utils import kill_process_tree
@@ -11,6 +11,13 @@ if __name__ == "__main__":
server_args = prepare_server_args(sys.argv[1:])
try:
launch_server(server_args)
if server_args.grpc_mode:
from sglang.srt.entrypoints.grpc_server import serve_grpc
asyncio.run(serve_grpc(server_args))
else:
from sglang.srt.entrypoints.http_server import launch_server
launch_server(server_args)
finally:
kill_process_tree(os.getpid(), include_parent=False)