forked from mtusi2026/mtusi2026lab3
feat: конф нгинкс, тесты, ключ идмпт etc
This commit is contained in:
@@ -4,11 +4,15 @@ CA_FILE ?=
|
||||
ACTION_SCRIPT ?=
|
||||
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
|
||||
|
||||
.PHONY: help check validate test load test-persistence test-failover install up down restart ps logs wait-ready destroy-data student-test concurrency-test test-expiry test-failures test-migrations explain sigterm-check
|
||||
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
|
||||
|
||||
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"
|
||||
|
||||
check:
|
||||
@@ -44,11 +48,20 @@ restart:
|
||||
./scripts/restart.sh
|
||||
@$(MAKE) --no-print-directory wait-ready
|
||||
|
||||
restore:
|
||||
./scripts/restore.sh
|
||||
|
||||
instances:
|
||||
./scripts/instances.sh
|
||||
|
||||
rolling-update:
|
||||
./scripts/rolling-update.sh
|
||||
|
||||
ps:
|
||||
docker compose ps
|
||||
|
||||
logs:
|
||||
docker compose logs -f api
|
||||
docker compose logs -f api nginx
|
||||
|
||||
wait-ready:
|
||||
@for i in $$(seq 1 60); do \
|
||||
@@ -65,7 +78,6 @@ 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
|
||||
@@ -83,3 +95,9 @@ explain:
|
||||
|
||||
sigterm-check:
|
||||
$(PYTHON) scripts/sigterm_check.py --base-url "$(BASE_URL)"
|
||||
|
||||
experiment-failover:
|
||||
$(PYTHON) scripts/experiment.py failover --base-url "$(BASE_URL)" --output evidence/experiment-failover.json
|
||||
|
||||
experiment-rolling:
|
||||
$(PYTHON) scripts/experiment.py rolling --base-url "$(BASE_URL)" --output evidence/experiment-rolling.json
|
||||
|
||||
Reference in New Issue
Block a user