[bug] fix router installation to include additional dependency (#12348)
This commit is contained in:
2
.github/workflows/nightly-release-router.yml
vendored
2
.github/workflows/nightly-release-router.yml
vendored
@@ -94,7 +94,7 @@ jobs:
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
manylinux: ${{ matrix.manylinux || 'auto' }}
|
||||
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14' }}
|
||||
args: --release --out dist --features vendored-openssl --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14' }}
|
||||
rust-toolchain: stable
|
||||
docker-options: -e CI -e CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc -e CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
|
||||
before-script-linux: |
|
||||
|
||||
2
.github/workflows/pr-test-pd-router.yml
vendored
2
.github/workflows/pr-test-pd-router.yml
vendored
@@ -149,7 +149,7 @@ jobs:
|
||||
echo "Building sgl-router..."
|
||||
cd sgl-router
|
||||
pip install maturin
|
||||
maturin build --release --out dist
|
||||
maturin build --release --out dist --features vendored-openssl
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
- name: Start disaggregation servers
|
||||
|
||||
6
.github/workflows/pr-test-rust.yml
vendored
6
.github/workflows/pr-test-rust.yml
vendored
@@ -57,7 +57,7 @@ jobs:
|
||||
- name: Test maturin build
|
||||
uses: PyO3/maturin-action@v1
|
||||
with:
|
||||
args: --release --out dist
|
||||
args: --release --out dist --features vendored-openssl
|
||||
rust-toolchain: stable
|
||||
sccache: true
|
||||
|
||||
@@ -166,7 +166,7 @@ jobs:
|
||||
export RUSTC_WRAPPER=sccache
|
||||
cd sgl-router
|
||||
pip install maturin
|
||||
maturin build --release --out dist
|
||||
maturin build --release --out dist --features vendored-openssl
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
|
||||
@@ -263,7 +263,7 @@ jobs:
|
||||
export RUSTC_WRAPPER=sccache
|
||||
cd sgl-router
|
||||
pip install maturin
|
||||
maturin build --release --out dist
|
||||
maturin build --release --out dist --features vendored-openssl
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
- name: Run Python E2E response API tests
|
||||
|
||||
2
.github/workflows/release-pypi-router.yml
vendored
2
.github/workflows/release-pypi-router.yml
vendored
@@ -79,7 +79,7 @@ jobs:
|
||||
with:
|
||||
target: ${{ matrix.target }}
|
||||
manylinux: ${{ matrix.manylinux || 'auto' }}
|
||||
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14' }}
|
||||
args: --release --out dist --features vendored-openssl --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14' }}
|
||||
rust-toolchain: stable
|
||||
docker-options: -e CI -e CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc -e CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
|
||||
before-script-linux: |
|
||||
|
||||
@@ -18,6 +18,9 @@ Options:
|
||||
### Install Dependencies
|
||||
pip install "grpcio==1.75.1" "grpcio-tools==1.75.1"
|
||||
|
||||
Please make sure to use the same version of grpcio and grpcio-tools specified in pyproject.toml
|
||||
otherwise update the versions specified in pyproject.toml
|
||||
|
||||
### Run Script
|
||||
cd python/sglang/srt/grpc
|
||||
python compile_proto.py
|
||||
|
||||
@@ -24,6 +24,29 @@ rm -rf /root/.cache/flashinfer
|
||||
# Install apt packages
|
||||
apt install -y git libnuma-dev
|
||||
|
||||
# Install protoc for router build (gRPC protobuf compilation)
|
||||
if ! command -v protoc &> /dev/null; then
|
||||
echo "Installing protoc..."
|
||||
if command -v apt-get &> /dev/null; then
|
||||
# Ubuntu/Debian
|
||||
apt-get update
|
||||
apt-get install -y wget unzip gcc g++ perl make
|
||||
elif command -v yum &> /dev/null; then
|
||||
# RHEL/CentOS
|
||||
yum update -y
|
||||
yum install -y wget unzip gcc gcc-c++ perl-core make
|
||||
fi
|
||||
|
||||
cd /tmp
|
||||
wget https://github.com/protocolbuffers/protobuf/releases/download/v32.0/protoc-32.0-linux-x86_64.zip
|
||||
unzip protoc-32.0-linux-x86_64.zip -d /usr/local
|
||||
rm protoc-32.0-linux-x86_64.zip
|
||||
protoc --version
|
||||
cd -
|
||||
else
|
||||
echo "protoc already installed: $(protoc --version)"
|
||||
fi
|
||||
|
||||
# Install uv
|
||||
if [ "$IS_BLACKWELL" = "1" ]; then
|
||||
# The blackwell CI runner has some issues with pip and uv,
|
||||
@@ -58,8 +81,11 @@ else
|
||||
$PIP_CMD install -e "python[dev]" --extra-index-url https://download.pytorch.org/whl/${CU_VERSION} $PIP_INSTALL_SUFFIX --upgrade
|
||||
fi
|
||||
|
||||
# Install OpenSSL development libraries for router build
|
||||
apt install -y libssl-dev pkg-config
|
||||
|
||||
# Install router for pd-disagg test
|
||||
SGLANG_ROUTER_BUILD_NO_RUST=1 $PIP_CMD install -e "sgl-router" $PIP_INSTALL_SUFFIX
|
||||
$PIP_CMD install -e "sgl-router" $PIP_INSTALL_SUFFIX
|
||||
|
||||
# Install sgl-kernel
|
||||
SGL_KERNEL_VERSION_FROM_KERNEL=$(grep -Po '(?<=^version = ")[^"]*' sgl-kernel/pyproject.toml)
|
||||
|
||||
@@ -7,6 +7,7 @@ edition = "2021"
|
||||
default = ["grpc-client"]
|
||||
grpc-client = []
|
||||
grpc-server = []
|
||||
vendored-openssl = ["openssl/vendored"]
|
||||
|
||||
[lints.rust]
|
||||
unused_qualifications = "warn"
|
||||
@@ -67,7 +68,7 @@ tiktoken-rs = { version = "0.7.0" }
|
||||
minijinja = { version = "2.0", features = ["unstable_machinery", "json", "builtins"] }
|
||||
minijinja-contrib = { version = "2.0", features = ["pycompat"] }
|
||||
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
|
||||
openssl = { version = "0.10.73", features = ["vendored"] }
|
||||
openssl = "0.10.73"
|
||||
hf-hub = { version = "0.4.3", features = ["tokio"] }
|
||||
rmcp = { version = "0.8.3", features = ["client", "server",
|
||||
"transport-child-process",
|
||||
|
||||
@@ -70,13 +70,21 @@ cargo build --release
|
||||
pip install maturin
|
||||
|
||||
# Fast development mode (debug build, no wheel, instant)
|
||||
# Uses system OpenSSL (requires libssl-dev/openssl-devel)
|
||||
maturin develop
|
||||
|
||||
# Production build (optimized, creates wheel)
|
||||
# Uses vendored OpenSSL (cross-platform compatibility)
|
||||
maturin build --release --features vendored-openssl
|
||||
pip install --force-reinstall dist/*.whl
|
||||
|
||||
# Development build with system OpenSSL (faster)
|
||||
# Requires: apt install libssl-dev pkg-config (Ubuntu/Debian)
|
||||
# or: yum install openssl-devel (RHEL/CentOS)
|
||||
maturin build --release
|
||||
pip install --force-reinstall dist/*.whl
|
||||
```
|
||||
> **Note:** Use `maturin develop` for fast iteration during development (builds in debug mode and installs directly). Use `maturin build --release` for production wheels with full optimizations (opt-level="z", lto="fat"). The package uses abi3 support for Python 3.8+ compatibility.
|
||||
> **Note:** Use `maturin develop` for fast iteration during development (builds in debug mode and installs directly). Use `maturin build --release --features vendored-openssl` for production wheels with full optimizations (opt-level="z", lto="fat") and cross-platform compatibility. The package uses abi3 support for Python 3.8+ compatibility.
|
||||
|
||||
## Quick Start
|
||||
|
||||
|
||||
Reference in New Issue
Block a user