Unverified Commit 25e73640 authored by Simo Lin's avatar Simo Lin Committed by GitHub
Browse files

[router] upgrade grpc dependency and py 3.13 3.14 support (#12284)

parent 0da9845e
......@@ -57,7 +57,7 @@ jobs:
- name: Build package
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: "cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64"
CIBW_BUILD: "cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64"
CIBW_BEFORE_ALL: |
yum update -y && yum install -y openssl-devel wget unzip && \
# Install latest protoc (v32.0) that supports proto3
......
......@@ -45,7 +45,7 @@ jobs:
- name: Build package
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BUILD: "cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64"
CIBW_BUILD: "cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64 cp314-manylinux_x86_64"
CIBW_BEFORE_ALL: |
yum update -y && yum install -y openssl-devel wget unzip && \
# Install latest protoc (v32.0) that supports proto3
......
......@@ -36,7 +36,7 @@ rand = "0.9.2"
reqwest = { version = "0.12.8", features = ["stream", "blocking", "json", "rustls-tls"], default-features = false }
futures-util = "0.3"
futures = "0.3"
pyo3 = { version = "0.25.1", features = ["extension-module"] }
pyo3 = { version = "0.27.1", features = ["extension-module"] }
dashmap = "6.1.0"
blake3 = "1.5"
http = "1.1.0"
......@@ -58,7 +58,7 @@ rayon = "1.10"
thiserror = "2.0.12"
regex = "1.10"
url = "2.5.4"
validator = { version = "0.18", features = ["derive"] }
validator = { version = "0.20.0", features = ["derive"] }
tokio-stream = { version = "0.1", features = ["sync"] }
anyhow = "1.0"
tokenizers = { version = "0.22.0" }
......@@ -82,17 +82,18 @@ rustpython-parser = "0.4.0"
num-traits = "0.2"
# gRPC and Protobuf dependencies
tonic = { version = "0.12", features = ["tls", "gzip", "transport"] }
prost = "0.13"
prost-types = "0.13"
tonic = { version = "0.14.2", features = ["gzip", "transport"] }
prost = "0.14.1"
prost-types = "0.14.1"
tonic-prost = "0.14.2"
deadpool = { version = "0.12", features = ["managed", "rt_tokio_1"] }
backoff = { version = "0.4", features = ["tokio"] }
strum = { version = "0.26", features = ["derive"] }
once_cell = "1.21.3"
[build-dependencies]
tonic-build = "0.12"
prost-build = "0.13"
tonic-prost-build = "0.14.2"
prost-build = "0.14.1"
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
......
......@@ -2,34 +2,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Only regenerate if the proto file changes
println!("cargo:rerun-if-changed=src/proto/sglang_scheduler.proto");
// Configure protobuf compilation with custom settings
let config = prost_build::Config::new();
// Skip serde for types that use prost_types::Struct
// These cause conflicts and we don't need serde for all generated types
// Configure tonic-build for gRPC code generation
tonic_build::configure()
// Configure tonic-prost-build for gRPC code generation
tonic_prost_build::configure()
// Generate both client and server code
.build_server(true)
.build_client(true)
// Add protoc arguments for proto3 optional support
// Allow proto3 optional fields
.protoc_arg("--experimental_allow_proto3_optional")
// Add a module-level attribute for documentation and clippy warnings
.server_mod_attribute(
"sglang.grpc.scheduler",
"#[allow(unused, unused_qualifications, clippy::mixed_attributes_style)]",
)
.client_mod_attribute(
"sglang.grpc.scheduler",
"#[allow(unused, unused_qualifications, clippy::mixed_attributes_style)]",
)
// Compile the proto file with the custom config
.compile_protos_with_config(
config,
&["src/proto/sglang_scheduler.proto"],
&["src/proto"],
)?;
// Compile the proto file
.compile_protos(&["src/proto/sglang_scheduler.proto"], &["src/proto"])?;
println!("cargo:warning=Protobuf compilation completed successfully");
......
......@@ -18,6 +18,13 @@ classifiers = [
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Rust",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
......
......@@ -20,7 +20,9 @@ use crate::protocols::{
};
// Include the generated protobuf code
#[allow(clippy::all)]
pub mod proto {
#![allow(clippy::all, unused_qualifications)]
tonic::include_proto!("sglang.grpc.scheduler");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment