浏览代码

feat: auto-set VLLM_LOGGING_COLOR=1 on head node (override via recipe [env])

vLLM's default 'auto' mode disables ANSI colors when stdout is not
a terminal (e.g. piped through Docker).  Setting VLLM_LOGGING_COLOR=1
forces colored output for 'cargo run logs --recipe ... --follow'.

Head node only — workers don't serve the API so their logs are less
frequently tailed.  Recipe env vars come after, so a recipe can
override with e.g. VLLM_LOGGING_COLOR = "0" to opt out.
Alexander Korolev 4 月之前
父节点
当前提交
227eb18915
共有 3 个文件被更改,包括 4 次插入 和 10 次删除
  1. 0 3
      recipes/deepseek-v4-flash/recipe.toml
  2. 0 3
      recipes/minimax-m3-mxfp8/recipe.toml
  3. 4 4
      src/docker/mod.rs

+ 0 - 3
recipes/deepseek-v4-flash/recipe.toml

@@ -48,9 +48,6 @@ RAY_memory_monitor_refresh_ms = "0"
 RAY_num_prestart_python_workers = "0"
 RAY_object_store_memory = "1073741824"
 
-# Force colored logs through Docker pipeline
-VLLM_LOGGING_COLOR = "1"
-
 # vLLM features for DeepSeek V4 on Blackwell (GB10 / sm_120)
 VLLM_ALLOW_LONG_MAX_MODEL_LEN = "1"
 VLLM_USE_B12X_MOE = "1"

+ 0 - 3
recipes/minimax-m3-mxfp8/recipe.toml

@@ -30,9 +30,6 @@ args = [
 ]
 
 [env]
-# Force colored logs through Docker pipeline
-VLLM_LOGGING_COLOR = "1"
-
 # M3 supports thinking via chat_template_kwargs.thinking_mode
 # enabled / adaptive / disabled — pass per-request in extra_body
 SAFETENSORS_FAST_GPU = "1"

+ 4 - 4
src/docker/mod.rs

@@ -5,7 +5,6 @@ use tracing::info;
 use crate::config::*;
 use crate::doctor::try_repaired_image;
 use crate::ssh::*;
-
 /// Launches containers across the cluster for a recipe.
 pub async fn serve(
     config: &Config,
@@ -390,7 +389,6 @@ fn build_docker_command(
     } else {
         cmd.push(format!("-e VLLM_HOST_IP={}", node.ib_ip));
     }
-
     // Network interface env vars from cluster NCCL config
     cmd.push(format!("-e MN_IF_NAME={}", nccl.socket_ifname));
     cmd.push(format!("-e UCX_NET_DEVICES={}", nccl.socket_ifname));
@@ -405,6 +403,10 @@ fn build_docker_command(
     cmd.push("-e NCCL_NET=IB".to_string());
     cmd.push("-e NCCL_DEBUG=WARN".to_string());
 
+    // Force colored logs on head; recipe env can override
+    if is_head {
+        cmd.push("-e VLLM_LOGGING_COLOR=1".to_string());
+    }
     for (k, v) in &recipe.env {
         cmd.push(format!("-e {}={}", k, v));
     }
@@ -492,9 +494,7 @@ fn build_docker_command(
     cmd.push("0.0.0.0".to_string());
     cmd.push("--port".to_string());
     cmd.push(recipe.port.to_string());
-
     cmd
 }
-
 #[cfg(test)]
 mod tests;