ЛР 5 — БВТ2302 — Лебедев — на 5

This commit is contained in:
2026-11-22 23:05:53 +03:00
parent 276dbdad8a
commit fbd04ce238
112 changed files with 9536 additions and 16 deletions
+39
View File
@@ -0,0 +1,39 @@
name: Application stack
# Отдельный job решения: сборка образа (API и worker), Compose-стенд (LB + 2 API + 2 worker + migrate +
# s3-init + broker-init + PostgreSQL + Redis + SeaweedFS S3 + NATS JetStream), публичные smoke/persistence/
# failover, сценарий защиты, отказы pipeline и трек 2. Секреты синтетические, генерируются на лету.
on: [push, pull_request]
permissions:
contents: read
jobs:
stack:
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Secrets and env (synthetic; FAULT_HOOKS=lab for the failure tests)
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 (202 → ready, original + JPEG thumbnail 256×160)
run: make test BASE_URL=http://127.0.0.1:8080
- name: Defense scenario (worker down → 202 → 409 → restart API+broker → worker → ready)
run: python3 student-tests/defense_demo.py
- name: Failover (stop one API 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
- name: Persistence (restart LB, API, worker, PostgreSQL, Redis, S3, NATS; volumes kept)
run: make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://127.0.0.1:8080
- name: Student tests (pipeline, variants, crash windows, outbox, retry/DLQ/replay, lab2–4 regression)
run: make test-student
- name: Track 2 chaos (3 seeds) + invariants
run: make chaos
- name: Logs on failure
if: failure()
run: docker compose --env-file .env --profile ttl --profile fault logs --no-color --tail=200
- name: Stop
if: always()
run: docker compose --env-file .env --profile ttl --profile fault down -v