fix(ops): expose release version and limit worker concurrency
Deploy / Build Production Runtime Images (push) Successful in 8m50s
Deploy / Deploy Production (push) Successful in 47s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been cancelled
Deploy / Deploy Staging (push) Has been cancelled

This commit is contained in:
Xiaoxia AI
2026-06-23 07:52:19 +08:00
parent d00d63f14d
commit 5fa4e2573e
6 changed files with 513 additions and 1 deletions
+11
View File
@@ -33,6 +33,9 @@ def test_deploy_production_uses_production_infra_and_project():
assert "RELEASE_VERSION" in script
assert "RUNTIME_IMAGE_TAR" in script
assert "docker load -i \"$RUNTIME_IMAGE_TAR\"" in script
assert 'export APP_VERSION="$RELEASE_VERSION"' in script
assert 'export WORKER_CONCURRENCY="${WORKER_CONCURRENCY:-1}"' in script
assert 'export WORKER_MAX_TASKS_PER_CHILD="${WORKER_MAX_TASKS_PER_CHILD:-100}"' in script
assert "docker image inspect \"${API_IMAGE:-xiaoxia-saas-api:dev}\"" in script
assert "docker image inspect \"${WORKER_IMAGE:-xiaoxia-saas-worker:dev}\"" in script
assert "ALLOW_PRODUCTION_BUILDS=true" in script
@@ -111,8 +114,16 @@ def test_deploy_scripts_build_web_image_explicitly():
assert "docker compose --env-file \"$ENV_FILE\" build --pull=false web" in production_script
assert "dockerfile: ${WEB_DOCKERFILE:-infra/docker/web.Dockerfile}" in compose
assert "NGINX_CONF: ${WEB_NGINX_CONF:-infra/docker/nginx.conf}" in compose
assert "APP_VERSION: ${APP_VERSION:-0.1.0}" in compose
assert "WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-1}" in compose
def test_worker_runtime_is_constrained_by_environment():
dockerfile = Path("infra/docker/worker.Dockerfile").read_text(encoding="utf-8")
assert "--concurrency=${WORKER_CONCURRENCY:-1}" in dockerfile
assert "--max-tasks-per-child=${WORKER_MAX_TASKS_PER_CHILD:-100}" in dockerfile
def test_production_nginx_proxies_to_production_api_container():
config = Path("infra/docker/nginx-production.conf").read_text(encoding="utf-8")