mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
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>
This commit is contained in:
parent
454424c36c
commit
a3c52e69d3
3 changed files with 15 additions and 1 deletions
11
.github/workflows/test-integration.yml
vendored
11
.github/workflows/test-integration.yml
vendored
|
|
@ -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: |
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue