docs(ops): 同步 103 生产 goosed 扩容为 9 实例

确认 goosed-prod-1..9 映射 18006-18014,更新 topology、发包必看、
发布 skill 与 release 脚本的动态 pool 校验。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-07 09:22:40 +08:00
parent 5485cc563b
commit cf04e73f51
9 changed files with 74 additions and 39 deletions
+33 -2
View File
@@ -214,7 +214,17 @@ fi
docker_bin="/opt/homebrew/bin/docker"
if [[ -x "${docker_bin}" ]] && "${docker_bin}" ps --format '{{.Names}}' 2>/dev/null | grep -q '^goosed-prod-1$'; then
for index in 1 2 3 4; do
goosed_indexes=()
while IFS= read -r name; do
if [[ "${name}" =~ ^goosed-prod-([0-9]+)$ ]]; then
goosed_indexes+=("${BASH_REMATCH[1]}")
fi
done < <("${docker_bin}" ps --format '{{.Names}}' | sort -V)
if ((${#goosed_indexes[@]} == 0)); then
echo "goosed dependency check failed: no goosed-prod-* containers running" >&2
missing=1
fi
for index in "${goosed_indexes[@]}"; do
container="goosed-prod-${index}"
host_port=$((18005 + index))
if ! "${docker_bin}" ps --format '{{.Names}} {{.Ports}} {{.Status}}' | grep -q "^${container} .*0.0.0.0:${host_port}->18006/tcp.*healthy"; then
@@ -233,7 +243,7 @@ if [[ -x "${docker_bin}" ]] && "${docker_bin}" ps --format '{{.Names}}' 2>/dev/n
echo "goosed dependency check failed: Portal .env must set GOOSED_MCP_NODE_PATH and GOOSED_MCP_SERVER_PATH for Docker goosed" >&2
missing=1
else
for index in 1 2 3 4; do
for index in "${goosed_indexes[@]}"; do
container="goosed-prod-${index}"
if ! "${docker_bin}" exec "${container}" sh -lc "test -x '${portal_mcp_node}' && test -f '${portal_mcp_server}'" >/dev/null 2>&1; then
echo "goosed dependency check failed: ${container} cannot resolve Portal .env MCP paths '${portal_mcp_node}' and '${portal_mcp_server}'" >&2
@@ -241,6 +251,27 @@ if [[ -x "${docker_bin}" ]] && "${docker_bin}" ps --format '{{.Names}}' 2>/dev/n
fi
done
fi
targets_line="$(grep -E '^TKMIND_API_TARGETS=' /Users/john/Project/Memind/.env | tail -1 | cut -d= -f2- || true)"
if [[ -z "${targets_line}" ]]; then
echo "goosed dependency check failed: Portal .env must set TKMIND_API_TARGETS for Docker goosed pool" >&2
missing=1
else
IFS=',' read -ra target_urls <<< "${targets_line}"
for target_url in "${target_urls[@]}"; do
trimmed="$(echo "${target_url}" | tr -d ' \"')"
if [[ -z "${trimmed}" ]]; then
continue
fi
status="$(curl -skS -m 5 "${trimmed}/status" 2>/dev/null || true)"
if [[ "${status}" != "ok" ]]; then
echo "goosed dependency check failed: ${trimmed}/status != ok (${status:-empty})" >&2
missing=1
fi
done
if ((${#target_urls[@]} != ${#goosed_indexes[@]})); then
echo "goosed dependency check warning: TKMIND_API_TARGETS count (${#target_urls[@]}) != running containers (${#goosed_indexes[@]})" >&2
fi
fi
fi
else
api_secret="$(grep -E '^TKMIND_SERVER__SECRET_KEY=' /Users/john/Project/Memind/.env 2>/dev/null | tail -1 | cut -d= -f2- || true)"
+1 -1
View File
@@ -14,7 +14,7 @@ fi
export NODE_ENV=production
export H5_PORT="${H5_PORT:-8081}"
export H5_PUBLIC_BASE_URL="${H5_PUBLIC_BASE_URL:-https://m.tkmind.cn}"
export TKMIND_API_TARGETS="${TKMIND_API_TARGETS:-https://127.0.0.1:18006,https://127.0.0.1:18007,https://127.0.0.1:18008,https://127.0.0.1:18009}"
export TKMIND_API_TARGETS="${TKMIND_API_TARGETS:-https://127.0.0.1:18006,https://127.0.0.1:18007,https://127.0.0.1:18008,https://127.0.0.1:18009,https://127.0.0.1:18010,https://127.0.0.1:18011,https://127.0.0.1:18012,https://127.0.0.1:18013,https://127.0.0.1:18014}"
export TKMIND_API_TARGET="${TKMIND_API_TARGET:-https://127.0.0.1:18006}"
export TKMIND_API_TARGET_1="${TKMIND_API_TARGET_1:-https://127.0.0.1:18007}"