diff --git a/requirements/common.txt b/requirements/common.txt index 29d59c8db8..a569df8823 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 84ea7467f0..feaf21f3de 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 05b9a21791..673f237757 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 34bce76935..ea0dabfb0c 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 5fb55843f7..a4e3a38602 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...")