Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 13 additions & 19 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ jobs:
runs-on: [self-hosted, linux, x64, codex]
timeout-minutes: 5
steps:
- name: Connect to Tailscale
# VM201 runner 不在 tailnet,直连 100.68.21.80 走公网 CGNAT 路由会撞上 ISP 内其他设备
# (run 38834509231 Host key verification failed);与 ship 内 ci-templates 同款临时入网,job 结束自动下线。
uses: tailscale/github-action@4e4c49acaa9818630ce0bd7a564372c17e33fb4d # v2
with:
authkey: ${{ secrets.TS_AUTHKEY }}

- name: Set up SSH
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
Expand All @@ -75,8 +68,9 @@ jobs:
fi
[[ "$DEPLOY_HOST" =~ ^[A-Za-z0-9._-]+$ ]] || { echo "::error::invalid host"; exit 1; }
[[ "$SSH_USER" =~ ^[a-z_][a-z0-9_-]{0,31}$ ]] || { echo "::error::invalid ssh_user"; exit 1; }
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20"
ssh $SSH_OPTS "${SSH_USER}@${DEPLOY_HOST}" "DEPLOY_DIR='$DEPLOY_DIR' CONTAINER_NAME='$CONTAINER_NAME' bash -s" <<'REMOTE'
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20 -v"
# TEMP DIAGNOSTIC (run 38834509231 Host key verification failed): ssh -v + known_hosts dump before failing; remove after root cause confirmed
if ! ssh $SSH_OPTS "${SSH_USER}@${DEPLOY_HOST}" "DEPLOY_DIR='$DEPLOY_DIR' CONTAINER_NAME='$CONTAINER_NAME' bash -s" <<'REMOTE'
set -euo pipefail
host_lock="${DEPLOY_DIR}/.deploy-state/busy.lock"
container_lock="/app/.deploy-state/busy.lock"
Expand Down Expand Up @@ -112,6 +106,13 @@ jobs:
fi
echo "pre-flight busy.lock inode ok ${host_inode}"
REMOTE
then
echo "known_hosts entries: $(wc -l < ~/.ssh/known_hosts)"
ssh-keygen -lf ~/.ssh/known_hosts || true
ssh-keyscan -T 10 100.68.21.80 2>/dev/null | ssh-keygen -lf - || true
ls -la ~/.ssh/
exit 1
fi

ship:
needs: pre-flight
Expand Down Expand Up @@ -148,13 +149,6 @@ jobs:
runs-on: [self-hosted, linux, x64, codex]
timeout-minutes: 5
steps:
- name: Connect to Tailscale
# 与 pre-flight 同款:本 job 的 identity 对账 / inode 对账 / 回滚三个 SSH step 都
# 需要先入 tailnet 才能到 100.68.21.80(run 38834509231 同因)。
uses: tailscale/github-action@4e4c49acaa9818630ce0bd7a564372c17e33fb4d # v2
with:
authkey: ${{ secrets.TS_AUTHKEY }}

- name: Set up SSH
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
Expand All @@ -181,7 +175,7 @@ jobs:
fi
[[ "$DEPLOY_HOST" =~ ^[A-Za-z0-9._-]+$ ]] || { echo "::error::invalid host"; exit 1; }
[[ "$SSH_USER" =~ ^[a-z_][a-z0-9_-]{0,31}$ ]] || { echo "::error::invalid ssh_user"; exit 1; }
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20"
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20 -v" # diag: run 38834509231 host key verification
ssh $SSH_OPTS "${SSH_USER}@${DEPLOY_HOST}" "CONTAINER_NAME='$CONTAINER_NAME' IMAGE_NAME='$IMAGE_NAME' GIT_SHA='$GIT_SHA' bash -s" <<'REMOTE'
set -euo pipefail
running_image="$(docker inspect --format='{{.Image}}' "$CONTAINER_NAME" 2>/dev/null || true)"
Expand Down Expand Up @@ -221,7 +215,7 @@ jobs:
fi
[[ "$DEPLOY_HOST" =~ ^[A-Za-z0-9._-]+$ ]] || { echo "::error::invalid host"; exit 1; }
[[ "$SSH_USER" =~ ^[a-z_][a-z0-9_-]{0,31}$ ]] || { echo "::error::invalid ssh_user"; exit 1; }
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20"
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20 -v" # diag: run 38834509231 host key verification
ssh $SSH_OPTS "${SSH_USER}@${DEPLOY_HOST}" "DEPLOY_DIR='$DEPLOY_DIR' CONTAINER_NAME='$CONTAINER_NAME' bash -s" <<'REMOTE'
set -euo pipefail
host_lock="${DEPLOY_DIR}/.deploy-state/busy.lock"
Expand Down Expand Up @@ -283,7 +277,7 @@ jobs:
fi
[[ "$DEPLOY_HOST" =~ ^[A-Za-z0-9._-]+$ ]] || { echo "::error::invalid host"; exit 1; }
[[ "$SSH_USER" =~ ^[a-z_][a-z0-9_-]{0,31}$ ]] || { echo "::error::invalid ssh_user"; exit 1; }
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20"
SSH_OPTS="-i $HOME/.ssh/id_deploy -o IdentitiesOnly=yes -o BatchMode=yes -o ServerAliveInterval=15 -o ServerAliveCountMax=4 -o ConnectTimeout=20 -v" # diag: run 38834509231 host key verification
ssh $SSH_OPTS "${SSH_USER}@${DEPLOY_HOST}" "DEPLOY_DIR='$DEPLOY_DIR' CONTAINER_NAME='$CONTAINER_NAME' IMAGE_NAME='$IMAGE_NAME' bash -s" <<'REMOTE'
set -euo pipefail
# 回滚前置对账(gate 第 10 轮):inode 分裂场景宿主锁与容器锁不互斥,不能安全
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# VideoTranscriptAPI-20261015-10 progress(card/VideoTranscriptAPI-261015-diag)

## 段 1:Tailscale 误判回退 + SSH host key 诊断注入

- **当前阶段**:implementing-done(Accept-Check 三项全过,待 CI)
- **本段结论**:
- 回退 7e264917 引入的两处「Connect to Tailscale」step(pre-flight 与 verify-busy-lock-inode 各 7 行,共 14 行全部移除,含注释)。根因误判:fleet runner 宿主自带 tailscaled、经宿主路由直达 n305,github-action 在 runner 内找不到本地 tailscaled 必败(run 38840253574 实测 `failed to connect to local tailscaled`);live-recorder 历次 ship 的同名步骤带 `if: inputs.runner == 'hosted'` 在 self 下被跳过,从未实跑。ship 的 `TS_AUTHKEY` secret 传递保留(ci-templates 的 hosted 分支仍消费)。
- pre-flight「Pre-flight busy.lock host/container inode」step 注入诊断:SSH_OPTS 追加 `-v`;ssh 调用包进 `if !` 结构,失败路径先输出诊断块(known_hosts 条目数、`ssh-keygen -lf` 本地指纹、`ssh-keyscan -T 10 100.68.21.80 | ssh-keygen -lf -` 远端实际指纹、`ls -la ~/.ssh/`)再 `exit 1`;注释 `# TEMP DIAGNOSTIC (run 38834509231 Host key verification failed)` 标记为临时手段,根因确认后由后续轮次移除。
- verify job 三个 SSH step(identity 对账 / inode 对账 / rollback)SSH_OPTS 同步追加 `-v`(行尾 diag 注释,不含 TEMP DIAGNOSTIC 关键词以满足 grep 计数=1);诊断块只放 pre-flight 一处,避免重复噪音。
- **验证**:`grep -c "tailscale" .github/workflows/deploy.yml` = 0;`grep -c "TEMP DIAGNOSTIC"` = 1;`yaml.safe_load` ok;workflow 全部 6 个 run 块 `bash -n` 语法通过。diff 13 insertions / 19 deletions(32 行 < target 40)。零测试耦合(卡面相关测试:无),Accept-Check 为静态判据无需红验。
- **关键决策与已否决方案**:按卡面锁定决策 1-4 执行,无新增自定决策。已否决(卡面给定):保留 Tailscale 步骤并修 github-action——fleet runner 靠宿主级 tailscale 路由,runner 内无本地 tailscaled 是环境常态。
- **下一步唯一动作**:commit + push + 开 PR,等 CI 与主脑验收。
Loading