feat: Саватеев А трек 4

This commit is contained in:
Enterxx2
2026-11-02 23:13:38 +03:00
parent 445cfe4789
commit 081d0fd2c8
76 changed files with 6387 additions and 77 deletions
+28 -3
View File
@@ -6,14 +6,17 @@ TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
export BUILDX_NO_DEFAULT_ATTESTATIONS := 1
.PHONY: help check validate test load test-persistence test-failover install up down restart restore instances rolling-update ps logs wait-ready destroy-data student-test concurrency-test test-expiry test-failures test-migrations explain sigterm-check experiment-failover experiment-rolling
.PHONY: help check validate test load test-persistence test-failover install init up down restart restore instances rolling-update ps logs wait-ready destroy-data student-test concurrency-test test-expiry test-failures test-migrations explain sigterm-check experiment-failover experiment-rolling test-storage test-s3-failure janitor-dry-run janitor-once experiment-uploads s3-ui
help:
@echo "check: offline structure; validate: full OpenAPI (requirements-dev.txt); test: running API; load: synthetic writes"
@echo "up/down/restart/ps/logs: compose stack; destroy-data: DELETE volumes intentionally"
@echo "instances: API containers <-> X-Instance-Id; restore: start replicas stopped by stop-one.sh; rolling-update: replace replicas one by one"
@echo "experiment-failover / experiment-rolling: load + stop each replica / rolling update, metrics to evidence/"
@echo "student-test: own tests; test-migrations: from empty volume; test-expiry: short SESSION_TTL; test-failures: stop Valkey/PostgreSQL; explain: EXPLAIN history"
@echo "student-test: own tests; test-migrations: from empty volume; test-expiry: short SESSION_TTL; test-failures: stop Valkey/PostgreSQL/S3; explain: EXPLAIN history"
@echo "init: .env + local S3 secrets; test-storage: private bucket/credentials/consistency; janitor-dry-run / janitor-once: S3/DB reconcile"
@echo "experiment-uploads: >=10 concurrent uploads, peak API memory to evidence/"
@echo "s3-ui: temporary read-only SeaweedFS Filer UI on 127.0.0.1:8888 (Ctrl+C to close)"
check:
$(PYTHON) scripts/check_contract.py
@@ -38,6 +41,9 @@ test-failover:
install:
poetry install --no-root
init:
./scripts/init-secrets.sh
up:
docker compose up -d --build --wait
@@ -78,12 +84,31 @@ student-test:
concurrency-test:
BASE_URL="$(BASE_URL)" poetry run pytest student-tests/test_concurrency.py -s
test-expiry:
docker compose --profile expiry up -d --build --wait api-short-ttl
EXPIRY_BASE_URL=http://localhost:8081 poetry run pytest student-tests/test_expiry.py -s; \
status=$$?; docker compose --profile expiry stop api-short-ttl; exit $$status
test-failures:
BASE_URL="$(BASE_URL)" RUN_FAILURE_TESTS=1 poetry run pytest student-tests/test_dependency_failures.py -s
BASE_URL="$(BASE_URL)" RUN_FAILURE_TESTS=1 poetry run pytest student-tests/test_dependency_failures.py student-tests/test_storage_failures.py student-tests/test_attachment_failover.py -s
test-s3-failure:
BASE_URL="$(BASE_URL)" RUN_FAILURE_TESTS=1 poetry run pytest student-tests/test_storage_failures.py -s
test-storage:
BASE_URL="$(BASE_URL)" RUN_STORAGE_TESTS=1 poetry run pytest student-tests/test_storage_security.py student-tests/test_storage_consistency.py -s
janitor-dry-run:
docker compose exec -T janitor python src/janitor.py --once --dry-run
janitor-once:
docker compose exec -T janitor python src/janitor.py --once
s3-ui:
$(PYTHON) scripts/s3_ui.py
experiment-uploads:
poetry run python scripts/upload_experiment.py --base-url "$(BASE_URL)" --output evidence/experiment-uploads.json
test-migrations:
./scripts/check_migrations.sh