From e469930d0fa902e19eed5524550596477249d78f Mon Sep 17 00:00:00 2001 From: Zhifei Li Date: Tue, 2 Jun 2026 09:47:31 -0700 Subject: [PATCH] fix(cd): uv sync must include the serve extra (torch/faiss), not bare core The deploy script ran a bare `uv sync`, which installs only the light core and UNINSTALLS torch/transformers/faiss-cpu (they live in the serve/embed extras). That silently stripped them from the venv on the last lock change; the running serves survived on in-memory copies but crashed on restart with 'No module named torch'. Use `uv sync --extra all` so the box's Python stack (embed+serve+index) is preserved. --- deploy/deploy.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 3ace682..9e89470 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -32,10 +32,13 @@ say "changed: $(echo "$CHANGED" | tr '\n' ' ')" changed() { echo "$CHANGED" | grep -qE "$1"; } -# 1. Python deps +# 1. Python deps. MUST include the extras the box runs (the search API needs the +# `serve` extra: torch, transformers, faiss-cpu). A bare `uv sync` installs only +# the light core and would UNINSTALL torch/faiss, breaking the serves on their +# next restart. `all` = embed+serve+index (no gpu — there's no CUDA here). if changed '^uv\.lock$'; then - say "uv.lock changed -> uv sync" - uv sync >>"$LOG" 2>&1 || say "WARN: uv sync failed" + say "uv.lock changed -> uv sync --extra all" + uv sync --extra all >>"$LOG" 2>&1 || say "WARN: uv sync failed" fi # 2. Agent backend — cheap restart, safe to automate.