Files
mtusi2026lab6/.github/workflows/app.yml

48 lines
2.7 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Application stack
# Отдельный job решения: сборка образа (API и worker), Compose-стенд (LB + 2 API + 2 worker + migrate +
# s3-init + broker-init + PostgreSQL + Redis + SeaweedFS S3 + NATS JetStream + OTel Collector + Prometheus +
# Loki + Tempo + Grafana), публичные smoke/persistence/failover при включённой telemetry, проверки
# наблюдаемости (provisioning, корреляция, секреты), инциденты с алертами firing→resolved, регрессия lab2–5.
# Секреты синтетические, генерируются на лету.
on: [push, pull_request]
permissions:
contents: read
jobs:
stack:
runs-on: ubuntu-24.04
timeout-minutes: 90
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: Observability (provisioning, signals, request→log→trace, upload→worker, retry, no secrets)
run: make test-observability
- name: Telemetry history survives restart of all stores
run: make test-telemetry-persistence
- name: Incidents (worker stop, slow DB vs slow handler, DB down, telemetry backend/collector down)
run: make incidents
- 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, all stores incl. telemetry; 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 1 (cost of observability), short run
run: python3 research/telemetry_cost.py --reps 1 --window 30 --out evidence/track1-ci
- 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