[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
@@ -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