fix(ops): expose release version and limit worker concurrency
This commit is contained in:
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user