Lab 3: HAProxy + 2 replicas, idempotency, graceful shutdown, track 1

This commit is contained in:
2026-11-16 21:48:11 +03:00
parent 0ab3a341aa
commit a3ac20d017
107 changed files with 24088 additions and 15 deletions
+37
View File
@@ -0,0 +1,37 @@
name: Application stack
# Отдельный job решения: сборка образа API, Compose-стенд (LB + 2 реплики + migrate + PostgreSQL + Redis),
# публичные smoke/persistence/failover и собственные проверки. Секреты синтетические, генерируются на лету.
on: [push, pull_request]
permissions:
contents: read
jobs:
stack:
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Secrets and env (synthetic)
run: ./scripts/init-secrets.sh
- name: Compose config
run: docker compose --env-file .env config --quiet
- name: Build and start
run: docker compose --env-file .env --profile ttl up -d --build --wait
- name: Public smoke via LB
run: make test BASE_URL=http://127.0.0.1:8080
- name: Failover (stop one replica), then restore
run: |
make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://127.0.0.1:8080
./scripts/start-replicas.sh
cat evidence/failover-hook.txt
- name: Persistence (restart LB, replicas, PostgreSQL, Redis; volumes kept)
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://127.0.0.1:8080
- name: Student tests
run: make test-student
- name: Rolling update under load
run: python3 research/lb_experiments.py rolling-update
- name: Logs on failure
if: failure()
run: docker compose --env-file .env --profile ttl logs --no-color --tail=200
- name: Stop
if: always()
run: docker compose --env-file .env --profile ttl down -v