sskj/scripts/common/deploy_cli.sh
Zhiyi Hong 9acf9fdfdb feat(pro6000): 部署/测试解耦 - deploy 层支持多节点与 vLLM,新增 6 个 profile
- sskj.deploy runtime 支持 NODE_HOSTS 多节点编排(ssh 分发/本地 rank/LOCAL_NODE_RANK)
  与 ENGINE=vllm 启动(SERVER_CMD),容器名按 rank 自动唯一
- scripts/common/deploy_cli.sh 新增 deploy_stop/status/multinode helper 与 node-rank 透传
- src/sskj/common/env.py 修复嵌套 ${VAR:-${OTHER}/path} 展开(平衡花括号扫描)
- deploy/profiles/pro6000/ 新增 6 个 profile: tp16/tp16_eagle/glm52(多节点)、
  sglang/vllm tp_dp_matrix、qwen3(单节点)
- 6 个实验 start/stop 脚本改为 deploy 薄包装,run_bench/adaptive 的 server 启停走
  deploy_render_args/deploy_start/deploy_stop,tp16 新增 matrix.json
- 首次入库 glm52_pro6000_sglang_multinode_tp16 实验目录;ops/README.md 补 pro6000 章节
- 实测通过: 单节点 dsv4 sglang/vllm 链路 + tp16 双节点启动/bench/清理
2026-08-03 15:17:41 +08:00

111 lines
2.9 KiB
Bash

#!/usr/bin/env bash
# Helpers to delegate server lifecycle and argument rendering to
# `python -m sskj.deploy`. The deployment profile is the single source of
# engine launch args; experiment scripts should call these helpers instead of
# maintaining their own copies.
DEPLOY_PYTHON="${PYTHON:-python3}"
deploy_profile_abs() {
local profile="$1"
printf '%s' "${ROOT_DIR}/deploy/profiles/${profile}.env"
}
deploy_start() {
local profile="$1"
local tp="$2"
local dp="$3"
local log_dir="$4"
local port="$5"
local model_path="$6"
local container="$7"
local node_rank="${8:-}"
local -a extra=()
if [[ -n "$node_rank" ]]; then
extra+=(--node-rank "$node_rank")
fi
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy start \
--profile "$(deploy_profile_abs "$profile")" \
--tp "$tp" \
--dp "$dp" \
--log-dir "$log_dir" \
--port "$port" \
--model-path "$model_path" \
--container-name "$container" \
"${extra[@]}"
}
deploy_render_args() {
local profile="$1"
local tp="$2"
local dp="$3"
local port="$4"
local model_path="$5"
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy render-args \
--profile "$(deploy_profile_abs "$profile")" \
--tp "$tp" \
--dp "$dp" \
--port "$port" \
--model-path "$model_path"
}
# Multi-node convenience helpers: orchestrate all NODE_HOSTS from one host.
deploy_start_multinode() {
local profile="$1"
local tp="$2"
local dp="$3"
local log_dir="$4"
local port="$5"
local model_path="$6"
local container="$7"
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy start \
--profile "$(deploy_profile_abs "$profile")" \
--tp "$tp" \
--dp "$dp" \
--log-dir "$log_dir" \
--port "$port" \
--model-path "$model_path" \
--container-name "$container"
}
deploy_stop() {
local profile="$1"
local tp="$2"
local dp="$3"
local port="$4"
local model_path="$5"
local container="$6"
local node_rank="${7:-}"
local -a extra=()
if [[ -n "$node_rank" ]]; then
extra+=(--node-rank "$node_rank")
fi
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy stop \
--profile "$(deploy_profile_abs "$profile")" \
--tp "$tp" \
--dp "$dp" \
--port "$port" \
--model-path "$model_path" \
--container-name "$container" \
"${extra[@]}"
}
deploy_status() {
local profile="$1"
local tp="${2:-}"
local dp="${3:-}"
local port="${4:-}"
local model_path="${5:-}"
local container="${6:-}"
local -a cmd=(
--profile "$(deploy_profile_abs "$profile")"
)
[[ -n "$tp" ]] && cmd+=(--tp "$tp")
[[ -n "$dp" ]] && cmd+=(--dp "$dp")
[[ -n "$port" ]] && cmd+=(--port "$port")
[[ -n "$model_path" ]] && cmd+=(--model-path "$model_path")
[[ -n "$container" ]] && cmd+=(--container-name "$container")
PYTHONPATH="${ROOT_DIR}/src" "${DEPLOY_PYTHON}" -m sskj.deploy status "${cmd[@]}"
}