From 7a05d2dc65065da3d6fd54c67a670ab08ffaf600 Mon Sep 17 00:00:00 2001 From: TJian Date: Fri, 9 Jan 2026 12:54:20 +0800 Subject: [PATCH] [CI] [ROCm] Fix `tests/entrypoints/test_grpc_server.py` on ROCm (#31970) Signed-off-by: tjtanaa --- requirements/common.txt | 2 +- requirements/rocm-test.txt | 2 +- requirements/rocm.txt | 1 + setup.py | 15 ++++++++++++++- tests/entrypoints/test_grpc_server.py | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/requirements/common.txt b/requirements/common.txt index 29d59c8db8d..a569df8823f 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -53,4 +53,4 @@ anthropic == 0.71.0 model-hosting-container-standards >= 0.1.10, < 1.0.0 mcp grpcio>=1.76.0 -grpcio-reflection>=1.76.0 +grpcio-reflection>=1.76.0 \ No newline at end of file diff --git a/requirements/rocm-test.txt b/requirements/rocm-test.txt index 84ea7467f0d..feaf21f3de2 100644 --- a/requirements/rocm-test.txt +++ b/requirements/rocm-test.txt @@ -89,4 +89,4 @@ perceptron==0.1.4 # Required for the multi-modal models test timm==1.0.17 # Required for plugins test -albumentations==1.4.6 +albumentations==1.4.6 \ No newline at end of file diff --git a/requirements/rocm.txt b/requirements/rocm.txt index 05b9a21791c..673f237757f 100644 --- a/requirements/rocm.txt +++ b/requirements/rocm.txt @@ -16,3 +16,4 @@ runai-model-streamer[s3,gcs]==0.15.3 conch-triton-kernels==1.2.1 timm>=1.0.17 fastsafetensors @ git+https://github.com/foundation-model-stack/fastsafetensors.git@d6f998a03432b2452f8de2bb5cefb5af9795d459 +grpcio-tools>=1.76.0 \ No newline at end of file diff --git a/setup.py b/setup.py index 34bce769359..ea0dabfb0c8 100644 --- a/setup.py +++ b/setup.py @@ -19,6 +19,7 @@ from packaging.version import Version, parse from setuptools import Extension, setup from setuptools.command.build_ext import build_ext from setuptools.command.build_py import build_py +from setuptools.command.develop import develop from setuptools_scm import get_version from torch.utils.cpp_extension import CUDA_HOME, ROCM_HOME @@ -147,6 +148,14 @@ class BuildPyAndGenerateGrpc(build_py): super().run() +class DevelopAndGenerateGrpc(develop): + """Develop mode that also generates gRPC stubs from proto files.""" + + def run(self): + compile_grpc_protos() + super().run() + + class CMakeExtension(Extension): def __init__(self, name: str, cmake_lists_dir: str = ".", **kwa) -> None: super().__init__(name, sources=[], py_limited_api=not is_freethreaded(), **kwa) @@ -950,13 +959,17 @@ if _no_device(): ext_modules = [] if not ext_modules: - cmdclass = {"build_py": BuildPyAndGenerateGrpc} + cmdclass = { + "build_py": BuildPyAndGenerateGrpc, + "develop": DevelopAndGenerateGrpc, + } else: cmdclass = { "build_ext": precompiled_build_ext if envs.VLLM_USE_PRECOMPILED else cmake_build_ext, "build_py": BuildPyAndGenerateGrpc, + "develop": DevelopAndGenerateGrpc, } setup( diff --git a/tests/entrypoints/test_grpc_server.py b/tests/entrypoints/test_grpc_server.py index 5fb55843f75..a4e3a38602e 100644 --- a/tests/entrypoints/test_grpc_server.py +++ b/tests/entrypoints/test_grpc_server.py @@ -29,7 +29,7 @@ def find_free_port() -> int: return port -async def wait_for_server(port: int, timeout: float = 30.0) -> bool: +async def wait_for_server(port: int, timeout: float = 60.0) -> bool: """Wait for the gRPC server to be ready by trying health checks.""" start_time = time.time() print("waiting for server to start...")