From a3c52e69d30c3b067a11cc892a9d4e84f0bcef0a Mon Sep 17 00:00:00 2001 From: Mateo Wang <277851410+mateo-berri@users.noreply.github.com> Date: Thu, 12 Nov 2026 04:07:07 +0000 Subject: [PATCH] ci(integration): install the Rust gateway and fail forwarded_proxy when Rust is not in front (#51307) * ci(integration): install the Rust gateway and fail forwarded_proxy when Rust is not in front Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci(integration): build the Rust gateway only for the management suites that run forwarded_proxy Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/test-integration.yml | 11 +++++++++++ litellm/proxy/rust_forward/supervisor/__init__.py | 3 ++- tests/integration/_support/rust_forward.py | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 8be7b89e076..5bcd5d6d7c4 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -116,6 +116,17 @@ jobs: timeout-minutes: 20 run: .github/scripts/uv_sync_with_retries.sh --frozen --all-groups --all-extras + - name: Install the Rust gateway + if: matrix.suite == 'management' || matrix.suite == 'management-replica' + timeout-minutes: 15 + working-directory: packaging/litellm-proxy + env: + CARGO_INCREMENTAL: "0" + run: | + uv run --no-project --with maturin==1.15.0 maturin build --profile dev --strip --out "$RUNNER_TEMP/gateway-dist" + uv pip install --no-deps --python ../../.venv/bin/python "$RUNNER_TEMP"/gateway-dist/*.whl + test -x ../../.venv/bin/litellm-gateway + - name: Install redis-server 7.2.16 timeout-minutes: 3 run: | diff --git a/litellm/proxy/rust_forward/supervisor/__init__.py b/litellm/proxy/rust_forward/supervisor/__init__.py index b6611e30ffa..768ce336af1 100644 --- a/litellm/proxy/rust_forward/supervisor/__init__.py +++ b/litellm/proxy/rust_forward/supervisor/__init__.py @@ -13,6 +13,7 @@ from litellm.proxy.rust_forward.supervisor.preflight import StartupError, gatewa from litellm.proxy.rust_forward.supervisor.runtime import SpawnFailed, exit_like, run OWN_COMMAND: Final = (sys.executable, *sys.orig_argv[1:]) +SERVING_WITHOUT_RUST: Final = "so Python serves the public port without Rust forwarding" def _nothing_to_prepare() -> None: @@ -34,7 +35,7 @@ def supervise( chosen: Final = current_platform() if platform is None else platform checked: Final = startup_check(chosen, server, gateway_binary(chosen, scripts_dir)) if isinstance(checked, StartupError): - sys.stderr.write(f"{checked.reason}, so Python serves the public port without Rust forwarding\n") + sys.stderr.write(f"{checked.reason}, {SERVING_WITHOUT_RUST}\n") return checked before_start() try: diff --git a/tests/integration/_support/rust_forward.py b/tests/integration/_support/rust_forward.py index 14b557897c5..86cc064a370 100644 --- a/tests/integration/_support/rust_forward.py +++ b/tests/integration/_support/rust_forward.py @@ -13,6 +13,7 @@ from typing import Final import httpx from pydantic import JsonValue +from litellm.proxy.rust_forward.supervisor import SERVING_WITHOUT_RUST from tests.integration._support.client import eventually from tests.integration._support.ports import allocate_port from tests.integration._support.process import stop_root_process @@ -111,6 +112,7 @@ def forwarded_proxy( ): try: assert eventually(lambda: _serving(proxy.url), bool, seconds=180), proxy.log.read_text() + assert SERVING_WITHOUT_RUST not in proxy.log.read_text(), proxy.log.read_text() yield proxy finally: assert stop_root_process(process), proxy.log.read_text()