[router] upgrade grpc dependency and py 3.13 3.14 support (#12284)
This commit is contained in:
@@ -57,7 +57,7 @@ jobs:
|
|||||||
- name: Build package
|
- name: Build package
|
||||||
uses: pypa/cibuildwheel@v2.21.3
|
uses: pypa/cibuildwheel@v2.21.3
|
||||||
env:
|
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: |
|
CIBW_BEFORE_ALL: |
|
||||||
yum update -y && yum install -y openssl-devel wget unzip && \
|
yum update -y && yum install -y openssl-devel wget unzip && \
|
||||||
# Install latest protoc (v32.0) that supports proto3
|
# Install latest protoc (v32.0) that supports proto3
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ jobs:
|
|||||||
- name: Build package
|
- name: Build package
|
||||||
uses: pypa/cibuildwheel@v2.21.3
|
uses: pypa/cibuildwheel@v2.21.3
|
||||||
env:
|
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: |
|
CIBW_BEFORE_ALL: |
|
||||||
yum update -y && yum install -y openssl-devel wget unzip && \
|
yum update -y && yum install -y openssl-devel wget unzip && \
|
||||||
# Install latest protoc (v32.0) that supports proto3
|
# 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 }
|
reqwest = { version = "0.12.8", features = ["stream", "blocking", "json", "rustls-tls"], default-features = false }
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
futures = "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"
|
dashmap = "6.1.0"
|
||||||
blake3 = "1.5"
|
blake3 = "1.5"
|
||||||
http = "1.1.0"
|
http = "1.1.0"
|
||||||
@@ -58,7 +58,7 @@ rayon = "1.10"
|
|||||||
thiserror = "2.0.12"
|
thiserror = "2.0.12"
|
||||||
regex = "1.10"
|
regex = "1.10"
|
||||||
url = "2.5.4"
|
url = "2.5.4"
|
||||||
validator = { version = "0.18", features = ["derive"] }
|
validator = { version = "0.20.0", features = ["derive"] }
|
||||||
tokio-stream = { version = "0.1", features = ["sync"] }
|
tokio-stream = { version = "0.1", features = ["sync"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
tokenizers = { version = "0.22.0" }
|
tokenizers = { version = "0.22.0" }
|
||||||
@@ -82,17 +82,18 @@ rustpython-parser = "0.4.0"
|
|||||||
num-traits = "0.2"
|
num-traits = "0.2"
|
||||||
|
|
||||||
# gRPC and Protobuf dependencies
|
# gRPC and Protobuf dependencies
|
||||||
tonic = { version = "0.12", features = ["tls", "gzip", "transport"] }
|
tonic = { version = "0.14.2", features = ["gzip", "transport"] }
|
||||||
prost = "0.13"
|
prost = "0.14.1"
|
||||||
prost-types = "0.13"
|
prost-types = "0.14.1"
|
||||||
|
tonic-prost = "0.14.2"
|
||||||
deadpool = { version = "0.12", features = ["managed", "rt_tokio_1"] }
|
deadpool = { version = "0.12", features = ["managed", "rt_tokio_1"] }
|
||||||
backoff = { version = "0.4", features = ["tokio"] }
|
backoff = { version = "0.4", features = ["tokio"] }
|
||||||
strum = { version = "0.26", features = ["derive"] }
|
strum = { version = "0.26", features = ["derive"] }
|
||||||
once_cell = "1.21.3"
|
once_cell = "1.21.3"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tonic-build = "0.12"
|
tonic-prost-build = "0.14.2"
|
||||||
prost-build = "0.13"
|
prost-build = "0.14.1"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
criterion = { version = "0.5", features = ["html_reports"] }
|
||||||
|
|||||||
+5
-24
@@ -2,34 +2,15 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
// Only regenerate if the proto file changes
|
// Only regenerate if the proto file changes
|
||||||
println!("cargo:rerun-if-changed=src/proto/sglang_scheduler.proto");
|
println!("cargo:rerun-if-changed=src/proto/sglang_scheduler.proto");
|
||||||
|
|
||||||
// Configure protobuf compilation with custom settings
|
// Configure tonic-prost-build for gRPC code generation
|
||||||
let config = prost_build::Config::new();
|
tonic_prost_build::configure()
|
||||||
|
|
||||||
// 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()
|
|
||||||
// Generate both client and server code
|
// Generate both client and server code
|
||||||
.build_server(true)
|
.build_server(true)
|
||||||
.build_client(true)
|
.build_client(true)
|
||||||
// Add protoc arguments for proto3 optional support
|
// Allow proto3 optional fields
|
||||||
.protoc_arg("--experimental_allow_proto3_optional")
|
.protoc_arg("--experimental_allow_proto3_optional")
|
||||||
// Add a module-level attribute for documentation and clippy warnings
|
// Compile the proto file
|
||||||
.server_mod_attribute(
|
.compile_protos(&["src/proto/sglang_scheduler.proto"], &["src/proto"])?;
|
||||||
"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"],
|
|
||||||
)?;
|
|
||||||
|
|
||||||
println!("cargo:warning=Protobuf compilation completed successfully");
|
println!("cargo:warning=Protobuf compilation completed successfully");
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,13 @@ classifiers = [
|
|||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Programming Language :: Rust",
|
"Programming Language :: Rust",
|
||||||
"Programming Language :: Python :: 3",
|
"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 = [
|
dependencies = [
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ use crate::protocols::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Include the generated protobuf code
|
// Include the generated protobuf code
|
||||||
|
#[allow(clippy::all)]
|
||||||
pub mod proto {
|
pub mod proto {
|
||||||
|
#![allow(clippy::all, unused_qualifications)]
|
||||||
tonic::include_proto!("sglang.grpc.scheduler");
|
tonic::include_proto!("sglang.grpc.scheduler");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user