按外部分析报告(reports/analysis)挑出来做的几条: - CI 在编完前端之后跑 `bunx vp run verify`,有一项不过就不部署(必须排在编前端之后: 前端类型检查要的 auto-imports.d.ts / components.d.ts 是 vite build 时才生成的) - 连不上判题机(连接被拒、解析不到、被重置)时,正式判题等 2/5/10 秒重试,不再当场记成 系统错误;超时、判题机回错、页面上的运行和自测不重试 - worker 每 10 秒刷一次「还活着」,compose 加 `oj2-api healthcheck --worker`,deploy.sh 起栈后 也等 worker 健康(docker 不会因 unhealthy 自动重启,只是看得见、部署时拦得住) - 三套 compose 的容器日志限 10MB × 3 - `/public/%` 这类畸形编码回 404 而不是 500;找不到的接口回统一的 JSON 错误 - 删掉没人用的「停用判题机」接口,契约不再给 task_number / is_disabled(列留在库里) - 删掉腐化的 apps/web/tests/submitButtonState.test.ts;契约包 zod 范围对齐到 ^4.6.6 - 修几处和实际对不上的注释与文档(表数、编译并发、AST 语言数、deploy.sh 流程、校验处数) ⚠️ 改了 compose 的日志配置,这次部署会把 postgres / redis / 判题机也重建一遍,各停几秒 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b344bd1dd6
commit
b046af4ba0
20 files changed
+187
-104
No files matched your search
+12
-1
@@ -4,7 +4,7 @@
|
||||
# 全部由 docker/compose.debian.yml 管。
|
||||
#
|
||||
# cd /root/OJDeploy/OJ2
|
||||
# docker/deploy.sh # 自检 → 构建 → 起栈 → 冒烟
|
||||
# docker/deploy.sh # 自检 → 构建 → 迁移 → 起栈 → 冒烟
|
||||
# docker/deploy.sh --check # 只自检,不动任何容器
|
||||
# docker/deploy.sh --no-build # 跳过构建(只改了 env / compose 时用)
|
||||
# docker/deploy.sh --prebuilt # 用现成产物,不在这台机器上编(CI 走这条)
|
||||
@@ -171,6 +171,17 @@ done
|
||||
[ "$status" = healthy ] || die "oj-api 没起来(状态 $status)
|
||||
看日志:docker logs oj-api --tail 50"
|
||||
|
||||
# worker 的健康检查每 30 秒一次,第一次也要等满 30 秒,所以这里多给一些时间。
|
||||
# 它不起来的话站点照样能开,但交上去的题没人判 —— 学生那边一直「等待评分」
|
||||
wstatus=starting
|
||||
for _ in $(seq 45); do
|
||||
wstatus=$(docker inspect -f '{{.State.Health.Status}}' oj-worker 2>/dev/null || echo starting)
|
||||
[ "$wstatus" = healthy ] && break
|
||||
sleep 2
|
||||
done
|
||||
[ "$wstatus" = healthy ] || die "oj-worker 没起来(状态 $wstatus)—— 站点能开,但提交没人判
|
||||
看日志:docker logs oj-worker --tail 50"
|
||||
|
||||
# ---------------------------------------------------------------- 冒烟
|
||||
say "冒烟(端口 $port)"
|
||||
code() { curl -s -o /dev/null -w '%{http_code}' "http://localhost:$port$1"; }
|
||||
|
||||
Reference in new issue
Block a user