[Build] Propagate vLLM version to Rust binaries (#52593)
Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Nick Hill <nickhill123@gmail.com> Co-authored-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
co-authored by
Nick Hill
Andreas Karatzas
parent
b0e9cff5e7
commit
c89d692cb5
Generated
+7
@@ -5505,9 +5505,14 @@ dependencies = [
|
||||
"tracing",
|
||||
"url",
|
||||
"uuid",
|
||||
"vllm-build-info",
|
||||
"vllm-tracing",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "vllm-build-info"
|
||||
version = "0.1.0"
|
||||
|
||||
[[package]]
|
||||
name = "vllm-chat"
|
||||
version = "0.1.0"
|
||||
@@ -5574,6 +5579,7 @@ dependencies = [
|
||||
"tracing",
|
||||
"uuid",
|
||||
"vllm-bench",
|
||||
"vllm-build-info",
|
||||
"vllm-chat",
|
||||
"vllm-engine-core-client",
|
||||
"vllm-managed-engine",
|
||||
@@ -5755,6 +5761,7 @@ dependencies = [
|
||||
"url",
|
||||
"uuid",
|
||||
"validator",
|
||||
"vllm-build-info",
|
||||
"vllm-chat",
|
||||
"vllm-engine-core-client",
|
||||
"vllm-llm",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[workspace]
|
||||
members = [
|
||||
"src/bench",
|
||||
"src/build-info",
|
||||
"src/chat",
|
||||
"src/cmd",
|
||||
"src/engine-core-client",
|
||||
@@ -135,6 +136,7 @@ url = "2.5.7"
|
||||
uuid = { version = "1.22.0", features = ["v4"] }
|
||||
validator = { version = "0.20.0", features = ["derive"] }
|
||||
vllm-bench = { path = "src/bench" }
|
||||
vllm-build-info = { path = "src/build-info" }
|
||||
vllm-chat = { path = "src/chat" }
|
||||
vllm-engine-core-client = { path = "src/engine-core-client" }
|
||||
vllm-llm = { path = "src/llm" }
|
||||
|
||||
@@ -34,6 +34,7 @@ tokio-stream.workspace = true
|
||||
tracing.workspace = true
|
||||
url.workspace = true
|
||||
uuid.workspace = true
|
||||
vllm-build-info.workspace = true
|
||||
vllm-tracing.workspace = true
|
||||
|
||||
[lints]
|
||||
|
||||
@@ -12,7 +12,7 @@ use clap::Parser;
|
||||
#[command(
|
||||
name = "vllm-bench",
|
||||
about = "Benchmark online serving throughput",
|
||||
version
|
||||
version = vllm_build_info::VERSION
|
||||
)]
|
||||
struct Cli {
|
||||
#[command(flatten)]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "vllm-build-info"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -0,0 +1,10 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
// SPDX-FileCopyrightText: Copyright contributors to the vLLM project
|
||||
|
||||
/// The vLLM package version supplied by the build system.
|
||||
///
|
||||
/// Direct Cargo builds fall back to the internal crate version.
|
||||
pub const VERSION: &str = match option_env!("VLLM_RS_BUILD_VERSION") {
|
||||
Some(version) => version,
|
||||
None => env!("CARGO_PKG_VERSION"),
|
||||
};
|
||||
@@ -28,6 +28,7 @@ tokio-util.workspace = true
|
||||
tracing.workspace = true
|
||||
uuid.workspace = true
|
||||
vllm-bench.workspace = true
|
||||
vllm-build-info.workspace = true
|
||||
vllm-chat.workspace = true
|
||||
vllm-engine-core-client.workspace = true
|
||||
vllm-managed-engine.workspace = true
|
||||
|
||||
@@ -39,7 +39,8 @@ use crate::cli::unsupported::UnsupportedArgs;
|
||||
#[derive(Debug, Parser)]
|
||||
#[command(
|
||||
name = "vllm-rs",
|
||||
about = "Rust frontend and managed-engine CLI for vLLM."
|
||||
about = "Rust frontend and managed-engine CLI for vLLM.",
|
||||
version = vllm_build_info::VERSION
|
||||
)]
|
||||
pub struct Cli {
|
||||
#[command(subcommand)]
|
||||
|
||||
@@ -45,6 +45,7 @@ tracing-subscriber.workspace = true
|
||||
url.workspace = true
|
||||
uuid.workspace = true
|
||||
validator.workspace = true
|
||||
vllm-build-info.workspace = true
|
||||
vllm-chat.workspace = true
|
||||
vllm-engine-core-client.workspace = true
|
||||
vllm-llm.workspace = true
|
||||
|
||||
@@ -1746,7 +1746,7 @@ async fn version_returns_engine_vllm_version() {
|
||||
json,
|
||||
json!({
|
||||
"version": "test-vllm-version",
|
||||
"rust_frontend_version": env!("CARGO_PKG_VERSION"),
|
||||
"rust_frontend_version": vllm_build_info::VERSION,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,6 @@ pub async fn version(State(state): State<Arc<AppState>>) -> Json<VersionResponse
|
||||
|
||||
Json(VersionResponse {
|
||||
version,
|
||||
rust_frontend_version: env!("CARGO_PKG_VERSION"),
|
||||
rust_frontend_version: vllm_build_info::VERSION,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user