Unverified Commit 56379dd5 authored by jh-nv's avatar jh-nv Committed by GitHub
Browse files

chore: standardizes Rust-side Dynamo environment variable names (#6358)

parent 5a67b246
......@@ -635,7 +635,7 @@ impl PyKvConnectorLeader {
// Initialize logging for the vLLM connector
dynamo_runtime::logging::init();
let enable_kvbm_record = std::env::var(env_kvbm::ENABLE_KVBM_RECORD)
let enable_kvbm_record = std::env::var(env_kvbm::DYN_KVBM_ENABLE_RECORD)
.map(|v| v == "1" || v.eq_ignore_ascii_case("true"))
.unwrap_or(false);
......
......@@ -5,7 +5,7 @@ use std::env;
use std::path::PathBuf;
// Environment variable names (build.rs can't import from runtime crate)
const DYNAMO_FATBIN_PATH: &str = "DYNAMO_FATBIN_PATH";
const DYN_FATBIN_PATH: &str = "DYN_FATBIN_PATH";
const OUT_DIR: &str = "OUT_DIR";
fn main() -> Result<(), Box<dyn std::error::Error>> {
......@@ -38,11 +38,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!(
"cargo:warning=CUDA FATBIN not found - run 'make fatbin' in cuda_kernels directory"
);
println!("cargo:warning=Set DYNAMO_FATBIN_PATH env var to specify custom location");
println!("cargo:warning=Set DYN_FATBIN_PATH env var to specify custom location");
}
// Rerun build if environment variable changes
println!("cargo:rerun-if-env-changed=DYNAMO_FATBIN_PATH");
println!("cargo:rerun-if-env-changed=DYN_FATBIN_PATH");
Ok(())
}
......@@ -56,7 +56,7 @@ fn build_protos() -> Result<(), Box<dyn std::error::Error>> {
fn find_fatbin_file() -> Option<PathBuf> {
// 1. Check if user specified custom path via environment variable
if let Ok(custom_path) = env::var(DYNAMO_FATBIN_PATH) {
if let Ok(custom_path) = env::var(DYN_FATBIN_PATH) {
let fatbin_file = PathBuf::from(custom_path);
if fatbin_file.exists() {
println!(
......
......@@ -587,7 +587,7 @@ fn load_embedded_fatbin() -> Result<cudarc::driver::sys::CUmodule, cudarc::drive
// Try to load FATBIN from filesystem (runtime)
fn load_runtime_fatbin() -> Result<cudarc::driver::sys::CUmodule, cudarc::driver::DriverError> {
// 1. Check runtime environment variable first
if let Ok(runtime_path) = std::env::var(env_cuda::DYNAMO_FATBIN_PATH)
if let Ok(runtime_path) = std::env::var(env_cuda::DYN_FATBIN_PATH)
&& let Ok(fatbin_data) = std::fs::read(&runtime_path)
{
tracing::debug!("Loading FATBIN from runtime env var: {}", runtime_path);
......
......@@ -67,7 +67,7 @@ const VALIDATION_PREFIX: &str = "Validation: ";
// Default axum max body limit without configuring is 2MB: https://docs.rs/axum/latest/axum/extract/struct.DefaultBodyLimit.html
/// Default body limit in bytes (45MB) to support 500k+ token payloads.
/// Can be configured at compile time using the DYN_FRONTEND_BODY_LIMIT_MB environment variable
/// Can be configured at runtime using the DYN_HTTP_BODY_LIMIT_MB environment variable.
pub(super) fn get_body_limit() -> usize {
std::env::var(env_llm::DYN_HTTP_BODY_LIMIT_MB)
.ok()
......
......@@ -174,8 +174,8 @@ pub mod kvbm {
/// KVBM metrics endpoint port
pub const DYN_KVBM_METRICS_PORT: &str = "DYN_KVBM_METRICS_PORT";
/// Enable KVBM recording for debugging
pub const ENABLE_KVBM_RECORD: &str = "ENABLE_KVBM_RECORD";
/// Enable KVBM recording for debugging.
pub const DYN_KVBM_ENABLE_RECORD: &str = "DYN_KVBM_ENABLE_RECORD";
/// Disable disk offload filter
pub const DYN_KVBM_DISABLE_DISK_OFFLOAD_FILTER: &str = "DYN_KVBM_DISABLE_DISK_OFFLOAD_FILTER";
......@@ -343,11 +343,11 @@ pub mod zmq_broker {
/// CUDA and GPU environment variables
pub mod cuda {
/// Path to custom CUDA fatbin file
/// Path to custom CUDA fatbin file.
///
/// Note: build.rs files cannot import this constant at build time,
/// so they must define local constants with the same value.
pub const DYNAMO_FATBIN_PATH: &str = "DYNAMO_FATBIN_PATH";
pub const DYN_FATBIN_PATH: &str = "DYN_FATBIN_PATH";
}
/// Build-time environment variables
......@@ -435,7 +435,7 @@ mod tests {
// KVBM
kvbm::DYN_KVBM_METRICS,
kvbm::DYN_KVBM_METRICS_PORT,
kvbm::ENABLE_KVBM_RECORD,
kvbm::DYN_KVBM_ENABLE_RECORD,
kvbm::DYN_KVBM_DISABLE_DISK_OFFLOAD_FILTER,
kvbm::cpu_cache::DYN_KVBM_CPU_CACHE_GB,
kvbm::cpu_cache::DYN_KVBM_CPU_CACHE_OVERRIDE_NUM_BLOCKS,
......@@ -468,7 +468,7 @@ mod tests {
zmq_broker::ZMQ_BROKER_XPUB_BIND,
zmq_broker::ZMQ_BROKER_NAMESPACE,
// CUDA
cuda::DYNAMO_FATBIN_PATH,
cuda::DYN_FATBIN_PATH,
// Build
build::OUT_DIR,
// Mocker
......
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