按外部分析报告(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
@@ -25,8 +25,17 @@
|
||||
# 是后端认的名字。忘了设 OJ2_JUDGE_TOKEN 的话 docker compose 会直接报错退出;忘了设
|
||||
# JUDGE_SERVER_TOKEN 的话后端会随机生成一个并在启动日志里告警,判题请求会被 401 挡掉。
|
||||
|
||||
# 每个容器的日志最多 3 个 10MB 的文件。docker 默认的 json-file 不设上限,判题、worker
|
||||
# 天天打日志,2 核小服务器的磁盘迟早被写满 —— 磁盘一满,postgres 写不进、判题跟着失败。
|
||||
x-logging: &logging
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: '3'
|
||||
|
||||
services:
|
||||
postgres:
|
||||
logging: *logging
|
||||
image: postgres:18-alpine
|
||||
container_name: oj2-postgres
|
||||
restart: unless-stopped
|
||||
@@ -48,6 +57,7 @@ services:
|
||||
retries: 10
|
||||
|
||||
redis:
|
||||
logging: *logging
|
||||
image: redis:8-alpine
|
||||
container_name: oj2-redis
|
||||
restart: unless-stopped
|
||||
@@ -60,6 +70,7 @@ services:
|
||||
retries: 10
|
||||
|
||||
judge:
|
||||
logging: *logging
|
||||
# 自己构建的判题沙箱(go-judge + gcc / python,见 docker/judge/)。
|
||||
# ⚠️ 这个 tag 不在任何 registry 上:本机 docker/judge/build.sh 构建,
|
||||
# 服务器/机房用 docker load 装。镜像不在本地时 compose 会去 pull 然后报找不到。
|
||||
|
||||
Reference in new issue
Block a user