Prechádzať zdrojové kódy

fix: HF_HOME -> /root/.cache/huggingface (fixes stale cache)

Switching HF_HOME from /cache/huggingface to /root/.cache/huggingface
aligns with the reference spark-vllm-docker project and avoids stale
cache issues that caused compilation-time crashes on restart.

Quote pattern for JSON args: TOML triple-quoted strings with embedded
single quotes ("""'{...}'""") are needed because:
1. Shell (bash) processes the inner double-quotes in JSON values,
   stripping them unless protected by shell single-quotes.
2. TOML literal strings ('{...}') cannot contain single-quote chars
   to wrap the value for shell protection.
3. Triple-quoted basic strings ("""...""") allow literal single
   quotes at the start and end, producing the shell-safe form:
   --flag '{...}'  → bash strips '...'  → vLLM receives {...}
Alexander Korolev 4 mesiacov pred
rodič
commit
7b01e19ec2

+ 1 - 1
README.md

@@ -245,7 +245,7 @@ The launcher passes the following env vars to every container.  Recipe-level
 | `NCCL_CROSS_NIC` | `1` | Allow traffic across multiple RDMA NICs (multi-rail) |
 | `NCCL_DEBUG` | `WARN` | NCCL log level (override with `[env]` for `INFO`/`TRACE` while debugging) |
 | `OMP_NUM_THREADS` | `4` | OpenMP thread limit per process |
-| `HF_HOME` | `/cache/huggingface` | HuggingFace cache root (volume-mounted from `ssh_user`'s host cache) |
+| `HF_HOME` | `/root/.cache/huggingface` | HuggingFace cache root (volume-mounted from `ssh_user`'s host cache) |
 
 ### Engine-specific host IP
 

+ 8 - 4
recipes/deepseek-v4-flash/recipe.toml

@@ -21,16 +21,20 @@ args = [
     "--max-num-batched-tokens", "8192",
     "--enable-chunked-prefill",
     "--gpu-memory-utilization", "0.85",
-    "--compilation-config", '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}',
+    "--compilation-config", """
+'{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}'""",
     "--enable-prefix-caching",
     "--load-format", "safetensors",
-    "--speculative-config", '{"method":"mtp","num_speculative_tokens":2}',
+    "--speculative-config", """
+'{"method":"mtp","num_speculative_tokens":2}'""",
     "--tokenizer-mode", "deepseek_v4",
     "--tool-call-parser", "deepseek_v4",
     "--enable-auto-tool-choice",
     "--reasoning-parser", "deepseek_v4",
-    "--reasoning-config", '{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}',
-    "--default-chat-template-kwargs", '{"thinking":true,"preserve_thinking":true}',
+    "--reasoning-config", """
+'{"reasoning_parser":"deepseek_v4","reasoning_start_str":"","reasoning_end_str":""}'""",
+    "--default-chat-template-kwargs", """
+'{"thinking":true,"preserve_thinking":true}'""",
     "--default-chat-template-kwargs.reasoning_effort", "high",
     "--enable-flashinfer-autotune",
     "--trust-remote-code",

+ 2 - 2
src/docker/mod.rs

@@ -380,8 +380,8 @@ fn build_docker_command(
         format!("-e GLOO_SOCKET_IFNAME={}", nccl.socket_ifname),
         format!("-e TP_SOCKET_IFNAME={}", nccl.socket_ifname),
         format!("-e NCCL_IB_GID_INDEX={}", nccl.ib_gid_index),
-        format!("-e HF_HOME=/cache/huggingface"),
-        format!("-v {}:/cache/huggingface", cache_dir),
+        format!("-e HF_HOME=/root/.cache/huggingface"),
+        format!("-v {}:/root/.cache/huggingface", cache_dir),
     ];
 
     // Engine-specific host IP env var

+ 4 - 4
src/docker/tests.rs

@@ -273,8 +273,8 @@ fn sglang_head() {
     assert!(cmd.contains("-p 8000:8000"));
     assert!(cmd.contains("-e TORCH_NCCL_ASYNC_ERROR_HANDLING=1"));
     assert!(cmd.contains("--port 8000"));
-    assert!(cmd.contains("-e HF_HOME=/cache/huggingface"));
-    assert!(cmd.contains("-v /home/user/.cache/huggingface:/cache/huggingface"));
+    assert!(cmd.contains("-e HF_HOME=/root/.cache/huggingface"));
+    assert!(cmd.contains("-v /home/user/.cache/huggingface:/root/.cache/huggingface"));
     assert!(
         cmd.contains("--rm"),
         "SGLang default --rm should be present"
@@ -311,8 +311,8 @@ fn keep_disables_rm() {
     assert!(!cmd.contains("--rm"), "--keep should suppress --rm");
     assert!(cmd.contains("docker run -d"));
     assert!(cmd.contains("--gpus all"));
-    assert!(cmd.contains("-e HF_HOME=/cache/huggingface"));
-    assert!(cmd.contains("-v /home/user/.cache/huggingface:/cache/huggingface"));
+    assert!(cmd.contains("-e HF_HOME=/root/.cache/huggingface"));
+    assert!(cmd.contains("-v /home/user/.cache/huggingface:/root/.cache/huggingface"));
 }
 
 #[test]