fix(infra): 修复 worker healthcheck YAML 语法 & APP_VERSION 添加默认值
Tests / lint (pull_request) Failing after 145h39m28s
Tests / test (pull_request) Failing after 145h39m28s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 145h39m53s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 145h39m59s
Deploy / Deploy Staging (push) Failing after 145h40m35s
CI/CD Pipeline / Frontend Lint (push) Failing after 145h41m1s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 145h41m9s
Deploy / Production Browser E2E (push) Failing after 1804h16m12s
Deploy / Build Production Runtime Images (push) Failing after 1804h16m16s
Deploy / Deploy Production (push) Failing after 1804h47m39s
Tests / lint (pull_request) Failing after 145h39m28s
Tests / test (pull_request) Failing after 145h39m28s
CI/CD Pipeline / Frontend Lint (pull_request) Failing after 145h39m53s
CI/CD Pipeline / Validate Code Quality And Tests (pull_request) Failing after 145h39m59s
Deploy / Deploy Staging (push) Failing after 145h40m35s
CI/CD Pipeline / Frontend Lint (push) Failing after 145h41m1s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 145h41m9s
Deploy / Production Browser E2E (push) Failing after 1804h16m12s
Deploy / Build Production Runtime Images (push) Failing after 1804h16m16s
Deploy / Deploy Production (push) Failing after 1804h47m39s
- Worker healthcheck: 原 python3 单引号嵌套导致 YAML 解析错误,改用 grep -q celery /proc/1/cmdline - APP_VERSION: 添加 :-unknown 默认值,防止变量缺失时健康检查端点崩溃
This commit is contained in:
@@ -52,7 +52,7 @@ services:
|
||||
|
||||
environment:
|
||||
APP_ENV: ${APP_ENV:-staging}
|
||||
APP_VERSION: ${APP_VERSION}
|
||||
APP_VERSION: ${APP_VERSION:-unknown}
|
||||
GENERATED_FILES_DIR: /app/generated
|
||||
GENERATED_FILES_URL_PREFIX: /generated-files
|
||||
PUBLIC_API_BASE_URL: ${PUBLIC_API_BASE_URL:-https://api.xiaoxiajianji.com}
|
||||
@@ -106,7 +106,7 @@ services:
|
||||
|
||||
environment:
|
||||
APP_ENV: ${APP_ENV:-staging}
|
||||
APP_VERSION: ${APP_VERSION}
|
||||
APP_VERSION: ${APP_VERSION:-unknown}
|
||||
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-1}
|
||||
WORKER_MAX_TASKS_PER_CHILD: ${WORKER_MAX_TASKS_PER_CHILD:-100}
|
||||
GENERATED_FILES_DIR: /app/generated
|
||||
@@ -122,7 +122,7 @@ services:
|
||||
# 健康检查配置
|
||||
# 注:celery inspect ping 依赖 broker 连接,在容器内不可靠,改用进程检查
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "python3 -c "import os,sys;sys.exit(0 if any(b'celery' in open(f'/proc/{p}/cmdline','rb').read() for p in os.listdir('/proc') if p.isdigit()) else 1)""]
|
||||
test: ["CMD-SHELL", "grep -q celery /proc/1/cmdline || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
Reference in New Issue
Block a user