[model-gateway] change sgl-router to sgl-model-gateway (#14312)
This commit is contained in:
+2
-2
@@ -1,10 +1,10 @@
|
|||||||
# Configuration for the GitHub Labeler action
|
# Configuration for the GitHub Labeler action
|
||||||
# Automatically adds labels to PRs based on the files changed
|
# Automatically adds labels to PRs based on the files changed
|
||||||
|
|
||||||
# Router specific (Rust code in sgl-router)
|
# Router specific (Rust code in sgl-model-gateway)
|
||||||
model-gateway:
|
model-gateway:
|
||||||
- changed-files:
|
- changed-files:
|
||||||
- any-glob-to-any-file: 'sgl-router/**/*'
|
- any-glob-to-any-file: 'sgl-model-gateway/**/*'
|
||||||
|
|
||||||
# Kernel specific
|
# Kernel specific
|
||||||
sgl-kernel:
|
sgl-kernel:
|
||||||
|
|||||||
@@ -35,16 +35,16 @@ jobs:
|
|||||||
|
|
||||||
- name: Check proto files are in sync
|
- name: Check proto files are in sync
|
||||||
run: |
|
run: |
|
||||||
if ! diff -q python/sglang/srt/grpc/sglang_scheduler.proto sgl-router/src/proto/sglang_scheduler.proto; then
|
if ! diff -q python/sglang/srt/grpc/sglang_scheduler.proto sgl-model-gateway/src/proto/sglang_scheduler.proto; then
|
||||||
echo "❌ ERROR: Proto files are out of sync!"
|
echo "❌ ERROR: Proto files are out of sync!"
|
||||||
echo ""
|
echo ""
|
||||||
echo "The following files must be kept identical:"
|
echo "The following files must be kept identical:"
|
||||||
echo " - python/sglang/srt/grpc/sglang_scheduler.proto"
|
echo " - python/sglang/srt/grpc/sglang_scheduler.proto"
|
||||||
echo " - sgl-router/src/proto/sglang_scheduler.proto"
|
echo " - sgl-model-gateway/src/proto/sglang_scheduler.proto"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Please ensure both files have the same content."
|
echo "Please ensure both files have the same content."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Differences:"
|
echo "Differences:"
|
||||||
diff python/sglang/srt/grpc/sglang_scheduler.proto sgl-router/src/proto/sglang_scheduler.proto || true
|
diff python/sglang/srt/grpc/sglang_scheduler.proto sgl-model-gateway/src/proto/sglang_scheduler.proto || true
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -50,9 +50,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: sglang-repo
|
path: sglang-repo
|
||||||
|
|
||||||
- name: Move sgl-router folder to root and delete sglang-repo
|
- name: Move sgl-model-gateway folder to root and delete sglang-repo
|
||||||
run: |
|
run: |
|
||||||
mv sglang-repo/sgl-router/* .
|
mv sglang-repo/sgl-model-gateway/* .
|
||||||
rm -rf sglang-repo
|
rm -rf sglang-repo
|
||||||
ls -alt
|
ls -alt
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -138,9 +138,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: sglang-repo
|
path: sglang-repo
|
||||||
|
|
||||||
- name: Move sgl-router folder to root and delete sglang-repo
|
- name: Move sgl-model-gateway folder to root and delete sglang-repo
|
||||||
run: |
|
run: |
|
||||||
mv sglang-repo/sgl-router/* .
|
mv sglang-repo/sgl-model-gateway/* .
|
||||||
rm -rf sglang-repo
|
rm -rf sglang-repo
|
||||||
ls -alt
|
ls -alt
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
paths:
|
||||||
- "sgl-router/**"
|
- "sgl-model-gateway/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
paths:
|
||||||
- "sgl-router/**"
|
- "sgl-model-gateway/**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
# Share cache across all benchmark jobs
|
# Share cache across all benchmark jobs
|
||||||
shared-key: "rust-cache"
|
shared-key: "rust-cache"
|
||||||
# Save cache even on failure
|
# Save cache even on failure
|
||||||
@@ -56,7 +56,7 @@ jobs:
|
|||||||
- name: Check benchmarks compile
|
- name: Check benchmarks compile
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
cargo check --benches
|
cargo check --benches
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
# Share cache across all benchmark jobs
|
# Share cache across all benchmark jobs
|
||||||
shared-key: "rust-cache"
|
shared-key: "rust-cache"
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
@@ -104,7 +104,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
# Try to use sccache, but disable if it fails
|
# Try to use sccache, but disable if it fails
|
||||||
if command -v sccache &> /dev/null; then
|
if command -v sccache &> /dev/null; then
|
||||||
echo "Testing sccache availability..."
|
echo "Testing sccache availability..."
|
||||||
@@ -130,7 +130,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: request-processing-results-${{ github.sha }}
|
name: request-processing-results-${{ github.sha }}
|
||||||
path: |
|
path: |
|
||||||
sgl-router/target/criterion/benchmark_summary/
|
sgl-model-gateway/target/criterion/benchmark_summary/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
@@ -164,7 +164,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
# Share cache across all benchmark jobs
|
# Share cache across all benchmark jobs
|
||||||
shared-key: "rust-cache"
|
shared-key: "rust-cache"
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
@@ -176,7 +176,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
# Try to use sccache, but disable if it fails
|
# Try to use sccache, but disable if it fails
|
||||||
if command -v sccache &> /dev/null; then
|
if command -v sccache &> /dev/null; then
|
||||||
echo "Testing sccache availability..."
|
echo "Testing sccache availability..."
|
||||||
@@ -201,7 +201,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: tokenizer-results-${{ github.sha }}
|
name: tokenizer-results-${{ github.sha }}
|
||||||
path: |
|
path: |
|
||||||
sgl-router/target/criterion/tokenizer*/
|
sgl-model-gateway/target/criterion/tokenizer*/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
benchmark-tool-parser:
|
benchmark-tool-parser:
|
||||||
@@ -231,7 +231,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
# Share cache across all benchmark jobs
|
# Share cache across all benchmark jobs
|
||||||
shared-key: "rust-cache"
|
shared-key: "rust-cache"
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
@@ -243,7 +243,7 @@ jobs:
|
|||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
# Try to use sccache, but disable if it fails
|
# Try to use sccache, but disable if it fails
|
||||||
if command -v sccache &> /dev/null; then
|
if command -v sccache &> /dev/null; then
|
||||||
echo "Testing sccache availability..."
|
echo "Testing sccache availability..."
|
||||||
@@ -268,7 +268,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: tool-parser-results-${{ github.sha }}
|
name: tool-parser-results-${{ github.sha }}
|
||||||
path: |
|
path: |
|
||||||
sgl-router/target/criterion/tool_parser*/
|
sgl-model-gateway/target/criterion/tool_parser*/
|
||||||
retention-days: 30
|
retention-days: 30
|
||||||
|
|
||||||
- name: Show sccache stats
|
- name: Show sccache stats
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- 'python/sglang/srt/disaggregation/**'
|
- 'python/sglang/srt/disaggregation/**'
|
||||||
- 'scripts/ci/ci_start_disaggregation_servers.sh'
|
- 'scripts/ci/ci_start_disaggregation_servers.sh'
|
||||||
- 'sgl-router/**'
|
- 'sgl-model-gateway/**'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
paths:
|
paths:
|
||||||
- 'python/sglang/srt/disaggregation/**'
|
- 'python/sglang/srt/disaggregation/**'
|
||||||
- 'scripts/ci/ci_start_disaggregation_servers.sh'
|
- 'scripts/ci/ci_start_disaggregation_servers.sh'
|
||||||
- 'sgl-router/**'
|
- 'sgl-model-gateway/**'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -58,8 +58,8 @@ jobs:
|
|||||||
~/.cargo/registry/index/
|
~/.cargo/registry/index/
|
||||||
~/.cargo/registry/cache/
|
~/.cargo/registry/cache/
|
||||||
~/.cargo/git/db/
|
~/.cargo/git/db/
|
||||||
sgl-router/target/
|
sgl-model-gateway/target/
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('sgl-router/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('sgl-model-gateway/Cargo.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-
|
${{ runner.os }}-cargo-
|
||||||
|
|
||||||
@@ -147,11 +147,11 @@ jobs:
|
|||||||
python3 -m pip --no-cache-dir install mooncake-transfer-engine==0.3.7.post2
|
python3 -m pip --no-cache-dir install mooncake-transfer-engine==0.3.7.post2
|
||||||
python3 -m pip --no-cache-dir install --user --force-reinstall genai-bench==0.0.2
|
python3 -m pip --no-cache-dir install --user --force-reinstall genai-bench==0.0.2
|
||||||
|
|
||||||
- name: Build and install sgl-router
|
- name: Build and install sgl-model-gateway
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
echo "Building sgl-router..."
|
echo "Building sgl-model-gateway..."
|
||||||
cd sgl-router/bindings/python
|
cd sgl-model-gateway/bindings/python
|
||||||
pip install maturin
|
pip install maturin
|
||||||
maturin build --release --out dist --features vendored-openssl
|
maturin build --release --out dist --features vendored-openssl
|
||||||
pip install --force-reinstall dist/*.whl
|
pip install --force-reinstall dist/*.whl
|
||||||
|
|||||||
@@ -4,12 +4,12 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
paths:
|
paths:
|
||||||
- "sgl-router/**"
|
- "sgl-model-gateway/**"
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
types: [opened, synchronize, reopened, labeled]
|
types: [opened, synchronize, reopened, labeled]
|
||||||
paths:
|
paths:
|
||||||
- "sgl-router/**"
|
- "sgl-model-gateway/**"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
@@ -32,9 +32,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: sglang-repo
|
path: sglang-repo
|
||||||
|
|
||||||
- name: Move sgl-router folder to root
|
- name: Move sgl-model-gateway folder to root
|
||||||
run: |
|
run: |
|
||||||
mv sglang-repo/sgl-router/* .
|
mv sglang-repo/sgl-model-gateway/* .
|
||||||
rm -rf sglang-repo
|
rm -rf sglang-repo
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
@@ -96,21 +96,21 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
cache-on-failure: true
|
cache-on-failure: true
|
||||||
|
|
||||||
- name: Run lint
|
- name: Run lint
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
rustup component add clippy
|
rustup component add clippy
|
||||||
cargo clippy --all-targets --all-features -- -D warnings
|
cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
- name: Run fmt
|
- name: Run fmt
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
|
rustup component add --toolchain nightly-x86_64-unknown-linux-gnu rustfmt
|
||||||
rustup toolchain install nightly --profile minimal
|
rustup toolchain install nightly --profile minimal
|
||||||
cargo +nightly fmt -- --check
|
cargo +nightly fmt -- --check
|
||||||
@@ -118,28 +118,30 @@ jobs:
|
|||||||
- name: Generate vision golden fixtures
|
- name: Generate vision golden fixtures
|
||||||
run: |
|
run: |
|
||||||
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
||||||
|
|
||||||
pip install transformers pillow numpy scipy
|
pip install transformers pillow numpy scipy
|
||||||
cd sgl-router/
|
pip install transformers pillow numpy
|
||||||
|
cd sgl-model-gateway/
|
||||||
python scripts/generate_vision_golden.py
|
python scripts/generate_vision_golden.py
|
||||||
|
|
||||||
- name: Run Rust tests
|
- name: Run Rust tests
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
- name: Check benchmark compilation
|
- name: Check benchmark compilation
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
cargo check --benches
|
cargo check --benches
|
||||||
|
|
||||||
- name: Quick benchmark sanity check
|
- name: Quick benchmark sanity check
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
cd sgl-router/
|
cd sgl-model-gateway/
|
||||||
# Run quick benchmarks to ensure they work using Python script
|
# Run quick benchmarks to ensure they work using Python script
|
||||||
python3 scripts/run_benchmarks.py --quick
|
python3 scripts/run_benchmarks.py --quick
|
||||||
|
|
||||||
@@ -170,7 +172,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
cache-on-failure: true
|
cache-on-failure: true
|
||||||
|
|
||||||
@@ -182,7 +184,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
export RUSTC_WRAPPER=sccache
|
export RUSTC_WRAPPER=sccache
|
||||||
cd sgl-router/bindings/python
|
cd sgl-model-gateway/bindings/python
|
||||||
python3 -m pip install --upgrade pip maturin
|
python3 -m pip install --upgrade pip maturin
|
||||||
pip uninstall -y sglang-router
|
pip uninstall -y sglang-router
|
||||||
maturin build --profile ci --features vendored-openssl --out dist
|
maturin build --profile ci --features vendored-openssl --out dist
|
||||||
@@ -190,14 +192,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Python unit tests
|
- name: Run Python unit tests
|
||||||
run: |
|
run: |
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
python3 -m pip install pytest pytest-cov pytest-xdist
|
python3 -m pip install pytest pytest-cov pytest-xdist
|
||||||
pytest -q py_test/unit --cov=sglang_router --cov-config=bindings/python/.coveragerc --cov-report=term-missing --cov-fail-under=80
|
pytest -q py_test/unit --cov=sglang_router --cov-config=bindings/python/.coveragerc --cov-report=term-missing --cov-fail-under=80
|
||||||
|
|
||||||
- name: Run Python integration tests
|
- name: Run Python integration tests
|
||||||
run: |
|
run: |
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
# Integration tests use FastAPI/uvicorn for mock workers
|
# Integration tests use FastAPI/uvicorn for mock workers
|
||||||
python3 -m pip install fastapi uvicorn orjson
|
python3 -m pip install fastapi uvicorn orjson
|
||||||
@@ -206,7 +208,7 @@ jobs:
|
|||||||
- name: Run Python E2E tests
|
- name: Run Python E2E tests
|
||||||
run: |
|
run: |
|
||||||
bash scripts/killall_sglang.sh "nuk_gpus"
|
bash scripts/killall_sglang.sh "nuk_gpus"
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
python3 -m pip --no-cache-dir install --upgrade --ignore-installed blinker
|
python3 -m pip --no-cache-dir install --upgrade --ignore-installed blinker
|
||||||
python3 -m pip --no-cache-dir install --upgrade genai-bench==0.0.2
|
python3 -m pip --no-cache-dir install --upgrade genai-bench==0.0.2
|
||||||
@@ -217,7 +219,7 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: genai-bench-results-all-policies
|
name: genai-bench-results-all-policies
|
||||||
path: sgl-router/benchmark_**/
|
path: sgl-model-gateway/benchmark_**/
|
||||||
|
|
||||||
router-grpc-response-api-tests:
|
router-grpc-response-api-tests:
|
||||||
if: |
|
if: |
|
||||||
@@ -242,7 +244,7 @@ jobs:
|
|||||||
- name: Rust cache
|
- name: Rust cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
workspaces: sgl-router
|
workspaces: sgl-model-gateway
|
||||||
cache-all-crates: true
|
cache-all-crates: true
|
||||||
cache-on-failure: true
|
cache-on-failure: true
|
||||||
|
|
||||||
@@ -294,7 +296,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
export RUSTC_WRAPPER=sccache
|
export RUSTC_WRAPPER=sccache
|
||||||
cd sgl-router/bindings/python
|
cd sgl-model-gateway/bindings/python
|
||||||
python3 -m pip install --upgrade pip maturin
|
python3 -m pip install --upgrade pip maturin
|
||||||
pip uninstall -y sglang-router
|
pip uninstall -y sglang-router
|
||||||
maturin build --profile ci --features vendored-openssl --out dist
|
maturin build --profile ci --features vendored-openssl --out dist
|
||||||
@@ -304,14 +306,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
python3 -m pip install pytest-rerunfailures
|
python3 -m pip install pytest-rerunfailures
|
||||||
bash scripts/killall_sglang.sh "nuk_gpus"
|
bash scripts/killall_sglang.sh "nuk_gpus"
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
SHOW_ROUTER_LOGS=1 pytest --reruns 3 --reruns-delay 2 py_test/e2e_response_api -s -vv -o log_cli=true --log-cli-level=INFO
|
SHOW_ROUTER_LOGS=1 pytest --reruns 3 --reruns-delay 2 py_test/e2e_response_api -s -vv -o log_cli=true --log-cli-level=INFO
|
||||||
|
|
||||||
- name: Run Python E2E gRPC tests
|
- name: Run Python E2E gRPC tests
|
||||||
run: |
|
run: |
|
||||||
bash scripts/killall_sglang.sh "nuk_gpus"
|
bash scripts/killall_sglang.sh "nuk_gpus"
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
source "$HOME/.cargo/env"
|
source "$HOME/.cargo/env"
|
||||||
SHOW_ROUTER_LOGS=1 ROUTER_LOCAL_MODEL_PATH="/home/ubuntu/models" pytest py_test/e2e_grpc -s -vv -o log_cli=true --log-cli-level=INFO
|
SHOW_ROUTER_LOGS=1 ROUTER_LOCAL_MODEL_PATH="/home/ubuntu/models" pytest py_test/e2e_grpc -s -vv -o log_cli=true --log-cli-level=INFO
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- "sgl-router/bindings/python/sglang_router/version.py"
|
- "sgl-model-gateway/bindings/python/sglang_router/version.py"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
run: |
|
run: |
|
||||||
version=$(cat sgl-router/bindings/python/sglang_router/version.py | cut -d'"' -f2)
|
version=$(cat sgl-model-gateway/bindings/python/sglang_router/version.py | cut -d'"' -f2)
|
||||||
tag=v${version}
|
tag=v${version}
|
||||||
|
|
||||||
docker build . -f docker/gateway.Dockerfile -t lmsysorg/sglang-router:${tag} --no-cache
|
docker build . -f docker/gateway.Dockerfile -t lmsysorg/sglang-router:${tag} --no-cache
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- sgl-router/bindings/python/pyproject.toml
|
- sgl-model-gateway/bindings/python/pyproject.toml
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@@ -50,9 +50,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: sglang-repo
|
path: sglang-repo
|
||||||
|
|
||||||
- name: Move sgl-router folder to root and delete sglang-repo
|
- name: Move sgl-model-gateway folder to root and delete sglang-repo
|
||||||
run: |
|
run: |
|
||||||
mv sglang-repo/sgl-router/* .
|
mv sglang-repo/sgl-model-gateway/* .
|
||||||
rm -rf sglang-repo
|
rm -rf sglang-repo
|
||||||
ls -alt
|
ls -alt
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -123,9 +123,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: sglang-repo
|
path: sglang-repo
|
||||||
|
|
||||||
- name: Move sgl-router folder to root and delete sglang-repo
|
- name: Move sgl-model-gateway folder to root and delete sglang-repo
|
||||||
run: |
|
run: |
|
||||||
mv sglang-repo/sgl-router/* .
|
mv sglang-repo/sgl-model-gateway/* .
|
||||||
rm -rf sglang-repo
|
rm -rf sglang-repo
|
||||||
ls -alt
|
ls -alt
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ repos:
|
|||||||
args:
|
args:
|
||||||
- --select=F401,F821
|
- --select=F401,F821
|
||||||
- --fix
|
- --fix
|
||||||
files: ^(benchmark/|docs/|examples/|python/sglang/|sgl-router/py_*|test/)
|
files: ^(benchmark/|docs/|examples/|python/sglang/|sgl-model-gateway/py_*|test/)
|
||||||
exclude: |
|
exclude: |
|
||||||
(?x)^(
|
(?x)^(
|
||||||
.*/__init__\.py$|
|
.*/__init__\.py$|
|
||||||
@@ -60,7 +60,7 @@ repos:
|
|||||||
python/sglang/srt/grpc/.*_pb2_grpc\.py|
|
python/sglang/srt/grpc/.*_pb2_grpc\.py|
|
||||||
python/sglang/srt/grpc/.*_pb2\.pyi|
|
python/sglang/srt/grpc/.*_pb2\.pyi|
|
||||||
python/sglang/srt/grpc/.*_pb2_grpc\.pyi|
|
python/sglang/srt/grpc/.*_pb2_grpc\.pyi|
|
||||||
sgl-router/src/tokenizer/chat_template\.rs
|
sgl-model-gateway/src/tokenizer/chat_template\.rs
|
||||||
)$
|
)$
|
||||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
rev: v18.1.8
|
rev: v18.1.8
|
||||||
|
|||||||
+3
-3
@@ -281,16 +281,16 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|||||||
nixl \
|
nixl \
|
||||||
py-spy
|
py-spy
|
||||||
|
|
||||||
# Build and install sgl-router (install Rust, build, then remove to save space)
|
# Build and install sgl-model-gateway (install Rust, build, then remove to save space)
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
curl --proto '=https' --tlsv1.2 --retry 3 --retry-delay 2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
curl --proto '=https' --tlsv1.2 --retry 3 --retry-delay 2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
||||||
&& export PATH="/root/.cargo/bin:${PATH}" \
|
&& export PATH="/root/.cargo/bin:${PATH}" \
|
||||||
&& rustc --version && cargo --version \
|
&& rustc --version && cargo --version \
|
||||||
&& python3 -m pip install maturin \
|
&& python3 -m pip install maturin \
|
||||||
&& cd /sgl-workspace/sglang/sgl-router/bindings/python \
|
&& cd /sgl-workspace/sglang/sgl-model-gateway/bindings/python \
|
||||||
&& ulimit -n 65536 && maturin build --release --features vendored-openssl --out dist \
|
&& ulimit -n 65536 && maturin build --release --features vendored-openssl --out dist \
|
||||||
&& python3 -m pip install --force-reinstall dist/*.whl \
|
&& python3 -m pip install --force-reinstall dist/*.whl \
|
||||||
&& cd /sgl-workspace/sglang/sgl-router \
|
&& cd /sgl-workspace/sglang/sgl-model-gateway \
|
||||||
&& cargo build --release --bin sglang-router --features vendored-openssl \
|
&& cargo build --release --bin sglang-router --features vendored-openssl \
|
||||||
&& cp target/release/sglang-router /usr/local/bin/sglang-router \
|
&& cp target/release/sglang-router /usr/local/bin/sglang-router \
|
||||||
&& rm -rf /root/.cargo /root/.rustup target dist ~/.cargo \
|
&& rm -rf /root/.cargo /root/.rustup target dist ~/.cargo \
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
|||||||
COPY --from=local_src /src /opt/sglang
|
COPY --from=local_src /src /opt/sglang
|
||||||
|
|
||||||
# working directory
|
# working directory
|
||||||
WORKDIR /opt/sglang/sgl-router
|
WORKDIR /opt/sglang/sgl-model-gateway
|
||||||
|
|
||||||
# install maturin and build the wheel with vendored OpenSSL
|
# install maturin and build the wheel with vendored OpenSSL
|
||||||
RUN uv pip install maturin \
|
RUN uv pip install maturin \
|
||||||
@@ -66,7 +66,7 @@ RUN uv pip install maturin \
|
|||||||
FROM base AS router-image
|
FROM base AS router-image
|
||||||
|
|
||||||
# Copy the built package from the build image
|
# Copy the built package from the build image
|
||||||
COPY --from=build-image /opt/sglang/sgl-router/bindings/python/dist/*.whl dist/
|
COPY --from=build-image /opt/sglang/sgl-model-gateway/bindings/python/dist/*.whl dist/
|
||||||
|
|
||||||
# Build the package and install
|
# Build the package and install
|
||||||
RUN uv pip install --force-reinstall dist/*.whl
|
RUN uv pip install --force-reinstall dist/*.whl
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ Error response format:
|
|||||||
|
|
||||||
The classification API is implemented using:
|
The classification API is implemented using:
|
||||||
|
|
||||||
1. **Rust Router**: Handles routing and request/response models in `sgl-router/src/protocols/spec.rs`
|
1. **Rust Model Gateway**: Handles routing and request/response models in `sgl-model-gateway/src/protocols/spec.rs`
|
||||||
2. **Python HTTP Server**: Implements the actual endpoint in `python/sglang/srt/entrypoints/http_server.py`
|
2. **Python HTTP Server**: Implements the actual endpoint in `python/sglang/srt/entrypoints/http_server.py`
|
||||||
3. **Classification Service**: Handles the classification logic in `python/sglang/srt/entrypoints/openai/serving_classify.py`
|
3. **Classification Service**: Handles the classification logic in `python/sglang/srt/entrypoints/openai/serving_classify.py`
|
||||||
|
|
||||||
|
|||||||
@@ -611,7 +611,7 @@ cargo test
|
|||||||
cd bindings/python && maturin develop
|
cd bindings/python && maturin develop
|
||||||
|
|
||||||
# Run Python tests
|
# Run Python tests
|
||||||
cd ../.. # Back to sgl-router root
|
cd ../.. # Back to sgl-model-gateway root
|
||||||
pytest py_test/
|
pytest py_test/
|
||||||
```
|
```
|
||||||
For production builds, use `maturin build --release --out dist` from the `bindings/python/` directory to create optimized wheels. During development, `maturin develop` rebuilds and installs instantly without creating wheel files. Use `python -m sglang_router.launch_server` to co-launch router and SGLang workers in small clusters for local validation.
|
For production builds, use `maturin build --release --out dist` from the `bindings/python/` directory to create optimized wheels. During development, `maturin develop` rebuilds and installs instantly without creating wheel files. Use `python -m sglang_router.launch_server` to co-launch router and SGLang workers in small clusters for local validation.
|
||||||
@@ -665,7 +665,7 @@ make release-notes PREV=gateway-v0.2.2 CURR=gateway-v1.0.0 CREATE_RELEASE=1 DRAF
|
|||||||
### Filtered Paths
|
### Filtered Paths
|
||||||
|
|
||||||
Release notes only include commits touching:
|
Release notes only include commits touching:
|
||||||
- `sgl-router/` - Router codebase
|
- `sgl-model-gateway/` - Router codebase
|
||||||
- `python/sglang/srt/grpc/` - gRPC protocol
|
- `python/sglang/srt/grpc/` - gRPC protocol
|
||||||
- `python/sglang/srt/entrypoints/grpc_server.py` - gRPC server
|
- `python/sglang/srt/entrypoints/grpc_server.py` - gRPC server
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
A high-level Go SDK for interacting with SGLang gRPC API, designed with an OpenAI-style API for familiarity and ease of use.
|
A high-level Go SDK for interacting with SGLang gRPC API, designed with an OpenAI-style API for familiarity and ease of use.
|
||||||
|
|
||||||
**Location**: `sgl-router/bindings/golang/`
|
**Location**: `sgl-model-gateway/bindings/golang/`
|
||||||
|
|
||||||
## Table of Contents
|
## Table of Contents
|
||||||
|
|
||||||
@@ -501,8 +501,8 @@ bindings/golang/
|
|||||||
**Error**: `library 'sglang_router_rs' not found`
|
**Error**: `library 'sglang_router_rs' not found`
|
||||||
|
|
||||||
**Solution**:
|
**Solution**:
|
||||||
1. Rebuild Rust library: `cd sgl-router/bindings/golang && make build`
|
1. Rebuild Rust library: `cd sgl-model-gateway/bindings/golang && make build`
|
||||||
2. Or manually with cargo: `cd sgl-router/bindings/golang && cargo build --release`
|
2. Or manually with cargo: `cd sgl-model-gateway/bindings/golang && cargo build --release`
|
||||||
3. Set `CARGO_BUILD_DIR` if using non-standard build location
|
3. Set `CARGO_BUILD_DIR` if using non-standard build location
|
||||||
4. Ensure Rust toolchain is installed: `rustup toolchain list`
|
4. Ensure Rust toolchain is installed: `rustup toolchain list`
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
//! FFI module for exposing sgl-router preprocessing and postprocessing functions
|
//! FFI module for exposing sgl-model-gateway preprocessing and postprocessing functions
|
||||||
//! to C-compatible languages (e.g., Golang via cgo)
|
//! to C-compatible languages (e.g., Golang via cgo)
|
||||||
//!
|
//!
|
||||||
//! This module provides C-compatible function signatures for:
|
//! This module provides C-compatible function signatures for:
|
||||||
@@ -33,7 +33,7 @@ bindings/python/
|
|||||||
pip install maturin
|
pip install maturin
|
||||||
|
|
||||||
# Build and install in development mode
|
# Build and install in development mode
|
||||||
cd sgl-router/bindings/python
|
cd sgl-model-gateway/bindings/python
|
||||||
maturin develop --features vendored-openssl
|
maturin develop --features vendored-openssl
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ maturin develop --features vendored-openssl
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build wheel
|
# Build wheel
|
||||||
cd sgl-router/bindings/python
|
cd sgl-model-gateway/bindings/python
|
||||||
maturin build --release --out dist --features vendored-openssl
|
maturin build --release --out dist --features vendored-openssl
|
||||||
|
|
||||||
# Install the built wheel
|
# Install the built wheel
|
||||||
@@ -52,7 +52,7 @@ pip install dist/sglang_router-*.whl
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Run Python tests
|
# Run Python tests
|
||||||
cd sgl-router
|
cd sgl-model-gateway
|
||||||
pytest py_test/
|
pytest py_test/
|
||||||
```
|
```
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user