diff --git a/scripts/deploy-remote.sh b/scripts/deploy-remote.sh index 303189d..a0afbb2 100755 --- a/scripts/deploy-remote.sh +++ b/scripts/deploy-remote.sh @@ -1223,11 +1223,11 @@ PY # A stale container with the same name makes `podman run --name` fail at # start; remove any leftover from a failed previous attempt. podman rm -f "$LLM_PRIMARY_CONTAINER" >/dev/null 2>&1 || true - # On a re-deploy the predecessor is THIS unit (the llama.cpp unit until - # the 2026-09-27 cutover, the vLLM unit after it): stop it before - # waiting on the port, or the wait deadlocks on the server it just - # stopped serving. + # A stopped unit can leave its container running: systemd's cgroup kill + # races conmon's --rm cleanup, and the orphan holds the port and GPUs. + # Stop the unit, then remove the container BEFORE waiting on the port. run_privileged systemctl stop frank-primary.service 2>/dev/null || true + podman rm -f "$LLM_PRIMARY_CONTAINER" >/dev/null 2>&1 || true # Nothing starts until the port is released: the lucebox cutover # (2026-09-26) and the frank-large cutover (2026-09-16) both failed # exactly here when the next engine bound 7770 a second too early. diff --git a/scripts/serve-frank-primary.sh b/scripts/serve-frank-primary.sh index 8513053..20e8720 100755 --- a/scripts/serve-frank-primary.sh +++ b/scripts/serve-frank-primary.sh @@ -78,7 +78,7 @@ fi mkdir -p /home/dank/.cache/frank-primary-vllm -SERVE_ARGS=(serve "$MODEL_DIR" +SERVE_ARGS=("$MODEL_DIR" --served-model-name "$SERVED_NAME" --host "$BIND_HOST" --port "$PORT" @@ -99,6 +99,10 @@ SERVE_ARGS=(serve "$MODEL_DIR" if [ -n "${SPEC_CONFIG:-}" ]; then SERVE_ARGS+=(--speculative-config "$SPEC_CONFIG") fi +# A crashed/killed unit leaves the container name registered (systemd can +# SIGKILL conmon before the --rm cleanup runs); podman run would then die +# on name-in-use forever. Clear any orphan of OUR name first — idempotent. +podman rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true exec podman run --rm \ --name "$CONTAINER_NAME" \ @@ -113,11 +117,13 @@ exec podman run --rm \ -e ROCR_VISIBLE_DEVICES="$ROCR_VISIBLE_DEVICES" \ -e HIP_VISIBLE_DEVICES="$HIP_VISIBLE_DEVICES" \ -e VLLM_ROCM_USE_AITER="$VLLM_ROCM_USE_AITER" \ + -e NCCL_P2P_DISABLE="$NCCL_P2P_DISABLE" \ -e TRITON_CACHE_DIR="$CACHE_ROOT/triton" \ -e TORCHINDUCTOR_CACHE_DIR="$CACHE_ROOT/inductor" \ - -e VLLM_CACHE_DIR="$CACHE_ROOT/vllm" \ + -e HOME="$CACHE_ROOT" \ -e TRITON_ALLOW_NON_CONST_GLOBALS=1 \ --volume /home/dank/models:/models \ --volume /home/dank/.cache/frank-primary-vllm:"$CACHE_ROOT" \ "$IMAGE" \ - vllm "${SERVE_ARGS[@]}" + "${SERVE_ARGS[@]}" +