forked from mtusi2026/mtusi2026lab3
Report levels 3 and 4 on the code after the lab 2 carry over
The report now namesa59e3a3as the last change of the application code andb1c80eeas the commit of every level 3 and 4 record, with the new replica IDs and numbers: three detection runs within the formula without the measurement slack, failover-each and both rolling updates without a failed request, 12 stack tests and 243 own tests. The shutdown section and the timeout chain follow the carried over budget: drain 2 s, then 3 s for accepted requests and a 500 for a stuck one, graceful timeout 6 s, stop hooks 7 s. make validate runs from .venv, faults evidence has its own target, AGENTS.md lists the control runs of track 1. The clean clone is taken again onf5fea5cwithout an explicit BASE_URL. The track 1 part keeps the review fixes of the H2 verdict, the grid bounds and the rounded numbers; the control runs follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1d3RLHNBBMA6UqBLLJv27
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f5fea5c59c
commit
a67bc6526a
+28
-24
@@ -1,43 +1,46 @@
|
||||
# Доказательства
|
||||
|
||||
Обезличенные результаты прогонов лабы 3. Пользователи, чаты и тексты синтетические; паролей, токенов, `.env`,
|
||||
содержимого `secrets/` и дампов здесь нет. В первой строке каждого текстового файла — дата (UTC) и коммит
|
||||
прогона. Проверки через балансировщик шли с `BASE_URL=http://localhost:18083` (порт 8080 на машине был занят
|
||||
стендами других лаб). Hostname реплики = `X-Instance-Id`; ID контейнеров меняются между прогонами.
|
||||
содержимого `secrets/` и дампов здесь нет. В первой строке каждого текстового файла (`*.txt`) — дата (UTC) и
|
||||
коммит прогона; у JSON и CSV (`lb-check.json`, `detection/`, `failover-each/`, `rolling*/`, `track1/*/summary.csv`)
|
||||
даты и коммита внутри нет: коммит — в столбце «Коммит» таблиц ниже, время прогона CSV трека — в поле `started`. Проверки через балансировщик шли на порт
|
||||
18083 (`LB_HTTP_PORT`; 8080 на машине был занят стендами других лаб): цели `make` берут `BASE_URL` из
|
||||
`docker compose port lb 8080`. Hostname реплики = `X-Instance-Id`; ID контейнеров меняются между прогонами.
|
||||
|
||||
## Уровень «3» и перенос лабы 2
|
||||
|
||||
| Файл | Что доказывает | Команда | Коммит |
|
||||
| --- | --- | --- | --- |
|
||||
| `clean-clone.txt` | запуск из свежего clone на пустых volumes: секреты, `config`, `make up` с миграциями `0001`/`0002`, готовность, smoke, ≥2 реплики и гонки ключа, failover, persistence, повтор миграций, `make down` (volumes остаются), `make reset-data` (volumes удалены) | последовательность из `REPORT.md`, раздел «Запуск» | `e88673d` |
|
||||
| `smoke.txt` | публичный smoke через LB | `make test BASE_URL=…` | `e00eb6c` |
|
||||
| `stack.txt` | сервисы, только `lb` публикует порты, `container_name` 0, `docker port` реплик пуст, hostname ↔ `X-Instance-Id`, лимиты, сети, uid, взгляд LB | `make stack-evidence` | `e00eb6c` |
|
||||
| `environment.txt` | host, Docker, образы по digest, версии пакетов, uid процессов | `make stack-evidence` | `e00eb6c` |
|
||||
| `lb-check.json` | 40 `GET /users/me` одним токеном — 20 + 20 по двум репликам; 20 раундов × 8 параллельных POST с одним ключом — 160 × `201`, одна копия, `409` на другой body | `make lb-check` | `e00eb6c` |
|
||||
| `failover-27de23496b0f.txt`, `failover-a3536e394b3f.txt` | `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` для каждой реплики: `docker inspect` до/после, остановлен именно target, лог его остановки, `restore` | `make failover-evidence BASE_URL=…` | `e00eb6c` |
|
||||
| `hooks.txt` | `stop-one.sh`: длительность, код, остановлен только target; неизвестный ID → 3; без переменной → 1; все реплики остановлены → `503` LB в формате контракта | команды внутри файла | `e00eb6c` |
|
||||
| `persistence.txt` | `make test-persistence ACTION_SCRIPT=scripts/restart.sh` и `StartedAt` всех контейнеров до и после | `make persistence-evidence BASE_URL=…` | `e00eb6c` |
|
||||
| `faults.txt` | тесты стенда лабы 2 через LB: гонка регистрации, остановка Valkey и PostgreSQL, рестарт API | `make test-faults BASE_URL=…` | `e00eb6c` |
|
||||
| `student-tests.txt` | все собственные тесты по именам (идемпотентность, `X-Instance-Id`, сессии, конвейер) и вывод теста `SIGTERM`-окна и цепочки таймаутов | `PYTEST_ADDOPTS=-vv make student-test`; `pytest -s` двух файлов | `e88673d` |
|
||||
| `schema.txt` | `\d+` всех таблиц и применённые миграции | `make storage-evidence` | `0796e29` |
|
||||
| `migrations.txt` | повторный `migrate` → `up to date`, счётчики строк до и после равны | `make storage-evidence` | `0796e29` |
|
||||
| `kdf.txt` | Argon2id у всех пользователей, в `sessions` только 32-байтовые SHA-256 | `make storage-evidence` | `0796e29` |
|
||||
| `secrets.txt` | секреты, `.env`, дампы и volumes не в Git и игнорируются | `make storage-evidence` | `0796e29` |
|
||||
| `clean-clone.txt` | запуск из свежего clone на пустых volumes: секреты, `config`, `make up` с миграциями `0001`/`0002`, готовность, smoke, ≥2 реплики и гонки ключа, failover обеих реплик, persistence (всё без явного `BASE_URL` при `LB_HTTP_PORT=18083`), `storage-evidence` в клоне, повтор миграций, `make down` (volumes остаются), `make reset-data` (volumes удалены) | последовательность из `REPORT.md`, раздел «Запуск» | `f5fea5c` (код `b1c80ee`) |
|
||||
| `checks.txt` | реальный вывод `make check`, `make validate` (`openapi-spec-validator` из dev-группы `.venv`) и `make lint` | команды внутри файла | `b1c80ee` |
|
||||
| `smoke.txt` | публичный smoke через LB | `make test` | `b1c80ee` |
|
||||
| `stack.txt` | сервисы, только `lb` публикует порты, `container_name` 0, `docker port` реплик пуст, hostname ↔ `X-Instance-Id`, лимиты, сети, uid, взгляд LB | `make stack-evidence` | `b1c80ee` |
|
||||
| `environment.txt` | host, Docker, образы по digest, версии пакетов, uid процессов | `make stack-evidence` | `b1c80ee` |
|
||||
| `lb-check.json` | 40 `GET /users/me` одним токеном — 20 + 20 по двум репликам; 20 раундов × 8 параллельных POST с одним ключом — 160 × `201`, одна копия, `409` на другой body | `make lb-check` | `b1c80ee` |
|
||||
| `failover-286766bf2b32.txt`, `failover-fa81adafcb69.txt` | `make test-failover ACTION_SCRIPT=scripts/stop-one.sh` для каждой реплики: `docker inspect` до/после, остановлен именно target, лог его остановки, `restore` | `make failover-evidence`, затем `make failover-evidence SHIFT=1` | `b1c80ee` |
|
||||
| `hooks.txt` | `stop-one.sh`: длительность, код, остановлен только target; неизвестный ID → 3; без переменной → 1; все реплики остановлены → `503` LB в формате контракта | команды внутри файла | `b1c80ee` |
|
||||
| `persistence.txt` | `make test-persistence ACTION_SCRIPT=scripts/restart.sh` и `StartedAt` всех контейнеров до и после | `make persistence-evidence` | `b1c80ee` |
|
||||
| `faults.txt` | тесты стенда лабы 2 через LB: гонка регистрации, остановка Valkey и PostgreSQL, рестарт API, полный рестарт с выходом, срок сессии после рестарта | `make faults-evidence` | `b1c80ee` |
|
||||
| `student-tests.txt` | все собственные тесты по именам (идемпотентность, `X-Instance-Id`, сессии, конвейер) и вывод теста `SIGTERM`-окна и цепочки таймаутов | `PYTEST_ADDOPTS=-vv make student-test`; `pytest -s` двух файлов | `b1c80ee` |
|
||||
| `schema.txt` | `\d+` всех таблиц и применённые миграции | `make storage-evidence` | `b1c80ee` |
|
||||
| `migrations.txt` | повторный `migrate` → `up to date`, счётчики строк до и после равны | `make storage-evidence` | `b1c80ee` |
|
||||
| `kdf.txt` | Argon2id у всех пользователей, в `sessions` только 32-байтовые SHA-256 | `make storage-evidence` | `b1c80ee` |
|
||||
| `secrets.txt` | секреты, `.env`, дампы и volumes не в Git и игнорируются | `make storage-evidence` | `b1c80ee` |
|
||||
|
||||
## Уровень «4»
|
||||
|
||||
| Файл | Что доказывает | Команда | Коммит |
|
||||
| --- | --- | --- | --- |
|
||||
| `limits.txt` | лимиты CPU/RAM всех сервисов (объявлены и применены), порты только у LB на `127.0.0.1`, секреты, volumes и сети по политике | `make limits` | `e88673d` |
|
||||
| `limits-violations.txt` | та же проверка ловит подмешанные нарушения (5 штук, код 1) | `COMPOSE_FILE=compose.yaml:violations.yaml python3 scripts/limits.py` | `e00eb6c` |
|
||||
| `detection/{sigterm,kill,pause,postgres}.json` | время исключения backend из ротации против заявленного максимума, ответ LB после исключения, время возврата | `make detection` | `e00eb6c` |
|
||||
| `failover-each/summary.json`, `failover-each/<hostname>/` | поочерёдная остановка каждой реплики под k6 100 rps: RPS, ошибки, p50/p95/p99, обнаружение, возврат, зонд записи, счётчики LB; сырьё — `k6/`, `lb_up.csv`, `probe.csv`, `action.txt` | `make failover-each` | `e00eb6c` |
|
||||
| `rolling-from-8d28d45/` | rolling update с образа уровня «3» на текущий под k6: ёмкость, ошибки, замена всех реплик, `migrate` один раз | `make rolling-update FROM_REV=8d28d45` | `e00eb6c` |
|
||||
| `rolling/` | rolling update текущей сборкой под k6 | `make rolling-update` | `e00eb6c` |
|
||||
| `limits.txt` | лимиты CPU/RAM всех сервисов (объявлены и применены), порты только у LB на `127.0.0.1`, секреты, volumes и сети по политике | `make limits` | `b1c80ee` |
|
||||
| `limits-violations.txt` | та же проверка ловит подмешанные нарушения (5 штук, код 1) | `COMPOSE_FILE=compose.yaml:violations.yaml python3 scripts/limits.py` | `b1c80ee` |
|
||||
| `detection/run{1,2,3}/{sigterm,kill,pause,postgres}.json` | три прогона: время исключения backend из ротации против заявленного максимума (допуск замера 0,25 с), ответ LB после исключения, время возврата | `make detection` | `b1c80ee` |
|
||||
| `failover-each/summary.json`, `failover-each/<hostname>/` | поочерёдная остановка каждой реплики под k6 100 rps: RPS, ошибки, p50/p95/p99, обнаружение, возврат, зонд записи, счётчики LB; сырьё — `k6/`, `lb_up.csv`, `probe.csv`, `action.txt` (вывод действия: `docker compose ps -a` реплик сразу после хука, затем `restore`) | `make failover-each` | `b1c80ee` |
|
||||
| `rolling-from-8d28d45/` | rolling update с образа уровня «3» на текущий под k6: ёмкость, ошибки, замена всех реплик, `migrate` один раз | `make rolling-update FROM_REV=8d28d45` | `b1c80ee` |
|
||||
| `rolling/` | rolling update текущей сборкой под k6 | `make rolling-update` | `b1c80ee` |
|
||||
|
||||
## Трек 1 «Цена масштабирования»
|
||||
|
||||
`track1/` — серии A и B, сравнение до/после, графики и проверки после улучшения; состав и поля CSV —
|
||||
`track1/` — серии A и B, сравнение до/после, контрольные прогоны, графики и проверки после улучшения; состав и поля CSV —
|
||||
`track1/README.md`.
|
||||
|
||||
| Файл | Что доказывает | Команда |
|
||||
@@ -46,6 +49,7 @@
|
||||
| `track1/series-a/` | 1×4, 2×2, 4×1 при 4 CPU / 2 GiB API | `make track1-a` |
|
||||
| `track1/series-b/` | 1×1, 2×1, 8×1 по 1 CPU (4×1 — из серии A) | `make track1-b` |
|
||||
| `track1/compare/` | улучшение: «до» (`edc091d`) и «после» на 8×1 | `make track1-compare` |
|
||||
| `track1/control-pool/`, `track1/control-cpus/` | контроль: пул и `maxconn` на 8×1; 8×0,5 против 4×1 на одних CPU (итоговый код, `f5fea5c`) | `make track1-control` |
|
||||
| `track1/plots/` | графики и сводка потолков `capacity.md` | `make plots` |
|
||||
| `track1/after-checks.txt` | уровни «3» и «4» на коде с улучшением (`dde113b`) | команды внутри файла |
|
||||
| `track1/host-others.csv`, `track1/aborted/` | нагрузка соседних стендов во время замеров и прерванная первая попытка серии A | см. `track1/README.md` |
|
||||
|
||||
+92
-92
@@ -1,6 +1,6 @@
|
||||
date: 2026-10-29T20:23:35Z commit: a02d442 dir: mtusi2026lab3-clean (свой compose-проект и volumes)
|
||||
date: 2026-10-29T23:53:18Z commit: f5fea5c dir: mtusi2026lab3-clean (свой compose-проект и volumes)
|
||||
$ git clone … mtusi2026lab3-clean && cd mtusi2026lab3-clean && git checkout solution/bpi2303-kostylev
|
||||
HEAD a02d442 Trim the scaling cost proposal to the word limit
|
||||
HEAD f5fea5c Record levels 3 and 4 again after the lab 2 carry over
|
||||
$ docker volume ls -q --filter name=mtusi2026lab3-clean | wc -l | tr -d ' '
|
||||
0
|
||||
exit=0
|
||||
@@ -26,42 +26,42 @@ $ make up
|
||||
sh scripts/secrets.sh
|
||||
docker compose up -d --build --wait
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 591B done
|
||||
#1 reading from stdin 606B done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.57kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#3 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#4 [internal] load metadata for ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load .dockerignore
|
||||
#5 transferring context: 437B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#6 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 done
|
||||
#6 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#6 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d done
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [builder 1/7] FROM docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#7 resolve docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d done
|
||||
#7 FROM ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142
|
||||
#7 resolve ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 done
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 236.57kB 0.0s done
|
||||
#8 transferring context: 281.44kB 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [builder 3/7] WORKDIR /build
|
||||
#9 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#10 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#11 [builder 3/7] WORKDIR /build
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
||||
@@ -71,62 +71,62 @@ docker compose up -d --build --wait
|
||||
#13 DONE 0.0s
|
||||
|
||||
#14 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
||||
#14 0.141 Resolved 44 packages in 0.62ms
|
||||
#14 0.143 Building mtusi-messenger @ file:///build
|
||||
#14 1.992 Built mtusi-messenger @ file:///build
|
||||
#14 1.995 Prepared 1 package in 1.85s
|
||||
#14 1.998 Installed 1 package in 3ms
|
||||
#14 2.060 Bytecode compiled 888 files in 61ms
|
||||
#14 2.060 + mtusi-messenger==1.3.0 (from file:///build)
|
||||
#14 DONE 2.1s
|
||||
#14 0.228 Resolved 59 packages in 9ms
|
||||
#14 0.241 Building mtusi-messenger @ file:///build
|
||||
#14 2.148 Built mtusi-messenger @ file:///build
|
||||
#14 2.152 Prepared 1 package in 1.91s
|
||||
#14 2.157 Installed 1 package in 4ms
|
||||
#14 2.243 Bytecode compiled 888 files in 86ms
|
||||
#14 2.243 + mtusi-messenger==1.3.0 (from file:///build)
|
||||
#14 DONE 2.3s
|
||||
|
||||
#15 [runtime 2/4] RUN groupadd --system --gid 10001 messenger && useradd --system --uid 10001 --gid messenger --no-create-home --shell /usr/sbin/nologin messenger
|
||||
#15 CACHED
|
||||
|
||||
#16 [runtime 3/4] COPY --from=builder --chown=root:root /opt/venv /opt/venv
|
||||
#16 DONE 0.1s
|
||||
#16 DONE 0.2s
|
||||
|
||||
#17 [runtime 4/4] WORKDIR /app
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 exporting to image
|
||||
#18 exporting layers
|
||||
#18 exporting layers 1.5s done
|
||||
#18 exporting manifest sha256:c3e6090559d5482c87f329d260e08065b5f8a5d5dc65c607f89733a82ddddbcf done
|
||||
#18 exporting config sha256:dd65081a5c150d5f128bd2cdeeb642852a65e7b7a4a672a2b4ef196f4e20f82f done
|
||||
#18 exporting attestation manifest sha256:2cfd6ab7e9b71c465dae98c768bf8e7dd4474f3e8edeae77433641275854423e done
|
||||
#18 exporting manifest list sha256:b35f152d0bde9f4bfe3672b917a873cf3f04bbf7402b5251c29c224768584579 done
|
||||
#18 naming to docker.io/library/mtusi-messenger:lab3 done
|
||||
#18 unpacking to docker.io/library/mtusi-messenger:lab3
|
||||
#18 unpacking to docker.io/library/mtusi-messenger:lab3 0.2s done
|
||||
#18 DONE 1.7s
|
||||
#18 exporting layers 1.3s done
|
||||
#18 exporting manifest sha256:70f59989a44aa91279868eda8d3be8e0190c77105c73991af97ce4bacd31671f done
|
||||
#18 exporting config sha256:f0e6baec9e0953031a2fcce0c3d7e51f43a86bc862d6b906ef83c07ebd24d86a done
|
||||
#18 exporting attestation manifest sha256:2602ec09576cca80e4818a6e4b3de34c457dc91ad59602388f2e6af8b5565e35 done
|
||||
#18 exporting manifest list sha256:a8a3477e428fb32254f1294cf857b6e428fe388f44cd3a900b410f1e2a340764 done
|
||||
#18 naming to docker.io/library/mtusi-messenger:mtusi2026lab3-clean done
|
||||
#18 unpacking to docker.io/library/mtusi-messenger:mtusi2026lab3-clean
|
||||
#18 unpacking to docker.io/library/mtusi-messenger:mtusi2026lab3-clean 0.2s done
|
||||
#18 DONE 1.6s
|
||||
|
||||
#19 resolving provenance for metadata file
|
||||
#19 DONE 0.0s
|
||||
api Built
|
||||
Network mtusi2026lab3-clean_edge Creating
|
||||
Network mtusi2026lab3-clean_edge Created
|
||||
Network mtusi2026lab3-clean_backend Creating
|
||||
Network mtusi2026lab3-clean_backend Created
|
||||
Volume "mtusi2026lab3-clean_pgdata" Creating
|
||||
Volume "mtusi2026lab3-clean_pgdata" Created
|
||||
Network mtusi2026lab3-clean_edge Creating
|
||||
Network mtusi2026lab3-clean_edge Created
|
||||
Volume "mtusi2026lab3-clean_valkeydata" Creating
|
||||
Volume "mtusi2026lab3-clean_valkeydata" Created
|
||||
Volume "mtusi2026lab3-clean_pgdata" Creating
|
||||
Volume "mtusi2026lab3-clean_pgdata" Created
|
||||
Container mtusi2026lab3-clean-postgres-1 Creating
|
||||
Container mtusi2026lab3-clean-lb-1 Creating
|
||||
Container mtusi2026lab3-clean-valkey-1 Creating
|
||||
Container mtusi2026lab3-clean-valkey-1 Created
|
||||
Container mtusi2026lab3-clean-lb-1 Creating
|
||||
Container mtusi2026lab3-clean-lb-1 Created
|
||||
Container mtusi2026lab3-clean-postgres-1 Created
|
||||
Container mtusi2026lab3-clean-migrate-1 Creating
|
||||
Container mtusi2026lab3-clean-valkey-1 Created
|
||||
Container mtusi2026lab3-clean-migrate-1 Created
|
||||
Container mtusi2026lab3-clean-api-2 Creating
|
||||
Container mtusi2026lab3-clean-api-1 Creating
|
||||
Container mtusi2026lab3-clean-api-2 Created
|
||||
Container mtusi2026lab3-clean-api-1 Created
|
||||
Container mtusi2026lab3-clean-lb-1 Starting
|
||||
Container mtusi2026lab3-clean-postgres-1 Starting
|
||||
Container mtusi2026lab3-clean-valkey-1 Starting
|
||||
Container mtusi2026lab3-clean-lb-1 Starting
|
||||
Container mtusi2026lab3-clean-valkey-1 Started
|
||||
Container mtusi2026lab3-clean-postgres-1 Started
|
||||
Container mtusi2026lab3-clean-postgres-1 Waiting
|
||||
@@ -140,32 +140,32 @@ docker compose up -d --build --wait
|
||||
Container mtusi2026lab3-clean-api-1 Started
|
||||
Container mtusi2026lab3-clean-api-2 Starting
|
||||
Container mtusi2026lab3-clean-api-2 Started
|
||||
Container mtusi2026lab3-clean-postgres-1 Waiting
|
||||
Container mtusi2026lab3-clean-valkey-1 Waiting
|
||||
Container mtusi2026lab3-clean-lb-1 Waiting
|
||||
Container mtusi2026lab3-clean-api-1 Waiting
|
||||
Container mtusi2026lab3-clean-api-2 Waiting
|
||||
Container mtusi2026lab3-clean-migrate-1 Waiting
|
||||
Container mtusi2026lab3-clean-valkey-1 Healthy
|
||||
Container mtusi2026lab3-clean-postgres-1 Waiting
|
||||
Container mtusi2026lab3-clean-valkey-1 Waiting
|
||||
Container mtusi2026lab3-clean-lb-1 Waiting
|
||||
Container mtusi2026lab3-clean-migrate-1 Exited
|
||||
Container mtusi2026lab3-clean-postgres-1 Healthy
|
||||
Container mtusi2026lab3-clean-valkey-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-2 Healthy
|
||||
Container mtusi2026lab3-clean-lb-1 Healthy
|
||||
exit=0
|
||||
make up (build, migrate, wait healthy): 15 s
|
||||
make up (build, migrate, wait healthy): 10 s
|
||||
$ docker compose logs --no-log-prefix migrate
|
||||
{"version":"0001_init","event":"migration.applied","level":"info","ts":"2026-10-29T20:23:48.391612Z"}
|
||||
{"version":"0002_idempotency_keys","event":"migration.applied","level":"info","ts":"2026-10-29T20:23:48.391717Z"}
|
||||
{"reason":"applied","event":"migration.completed","level":"info","ts":"2026-10-29T20:23:48.391758Z"}
|
||||
{"version":"0001_init","event":"migration.applied","level":"info","ts":"2026-10-29T23:53:27.339042Z"}
|
||||
{"version":"0002_idempotency_keys","event":"migration.applied","level":"info","ts":"2026-10-29T23:53:27.339142Z"}
|
||||
{"reason":"applied","event":"migration.completed","level":"info","ts":"2026-10-29T23:53:27.339185Z"}
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.State}} {{.Status}} {{.Ports}}'
|
||||
api running Up 3 seconds (healthy)
|
||||
api running Up 3 seconds (healthy)
|
||||
lb running Up 10 seconds (healthy) 127.0.0.1:18083->8080/tcp, 127.0.0.1:23083->8404/tcp
|
||||
migrate exited Exited (0) 4 seconds ago
|
||||
postgres running Up 10 seconds (healthy)
|
||||
valkey running Up 10 seconds (healthy)
|
||||
lb running Up 5 seconds (healthy) 127.0.0.1:18083->8080/tcp, 127.0.0.1:23083->8404/tcp
|
||||
migrate exited Exited (0) 3 seconds ago
|
||||
postgres running Up 5 seconds (healthy)
|
||||
valkey running Up 5 seconds (healthy)
|
||||
exit=0
|
||||
$ until curl -fsS http://$(docker compose port lb 8080)/health/ready; do sleep 1; done; scripts/lb-wait.sh 2
|
||||
{"status":"ok"}
|
||||
@@ -177,8 +177,8 @@ exit=0
|
||||
$ python3 scripts/probe.py check --rounds 20
|
||||
{
|
||||
"instances_one_token": {
|
||||
"b354701120c8": 20,
|
||||
"80019af4c42f": 20
|
||||
"7bed64a93042": 20,
|
||||
"7dcb3b8e69c8": 20
|
||||
},
|
||||
"same_key": {
|
||||
"rounds": 20,
|
||||
@@ -187,8 +187,8 @@ $ python3 scripts/probe.py check --rounds 20
|
||||
"201": 160
|
||||
},
|
||||
"instances": {
|
||||
"b354701120c8": 80,
|
||||
"80019af4c42f": 80
|
||||
"7dcb3b8e69c8": 80,
|
||||
"7bed64a93042": 80
|
||||
},
|
||||
"identical_bodies_rounds": 20,
|
||||
"single_copy_rounds": 20,
|
||||
@@ -200,11 +200,31 @@ exit=0
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:18083"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 135, "failed_attempts": 0, "first_recovery_seconds": 2.895}
|
||||
{"observed_instances_before": 2, "successful_writes": 134, "failed_attempts": 0, "first_recovery_seconds": 2.934}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.Name}} {{.State}} {{.Status}}' api
|
||||
api mtusi2026lab3-clean-api-1 running Up 21 seconds (healthy)
|
||||
api mtusi2026lab3-clean-api-1 exited Exited (0) 12 seconds ago
|
||||
api mtusi2026lab3-clean-api-2 running Up 20 seconds (healthy)
|
||||
exit=0
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container mtusi2026lab3-clean-api-2 Running
|
||||
Container mtusi2026lab3-clean-api-1 Starting
|
||||
Container mtusi2026lab3-clean-api-1 Started
|
||||
Container mtusi2026lab3-clean-api-1 Waiting
|
||||
Container mtusi2026lab3-clean-api-2 Waiting
|
||||
Container mtusi2026lab3-clean-api-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-2 Healthy
|
||||
exit=0
|
||||
$ curl -s -o /dev/null http://$(docker compose port lb 8080)/health/live && make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:18083"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 132, "failed_attempts": 0, "first_recovery_seconds": 2.736}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.Name}} {{.State}} {{.Status}}' api
|
||||
api mtusi2026lab3-clean-api-1 running Up 17 seconds (healthy)
|
||||
api mtusi2026lab3-clean-api-2 exited Exited (0) 12 seconds ago
|
||||
exit=0
|
||||
$ make restore
|
||||
@@ -217,43 +237,23 @@ scripts/restore.sh
|
||||
Container mtusi2026lab3-clean-api-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-2 Healthy
|
||||
exit=0
|
||||
$ curl -s -o /dev/null http://$(docker compose port lb 8080)/health/live && make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://127.0.0.1:18083"
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 135, "failed_attempts": 0, "first_recovery_seconds": 2.674}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.Name}} {{.State}} {{.Status}}' api
|
||||
api mtusi2026lab3-clean-api-1 exited Exited (0) 12 seconds ago
|
||||
api mtusi2026lab3-clean-api-2 running Up 17 seconds (healthy)
|
||||
exit=0
|
||||
$ make restore
|
||||
scripts/restore.sh
|
||||
Container mtusi2026lab3-clean-api-2 Running
|
||||
Container mtusi2026lab3-clean-api-1 Starting
|
||||
Container mtusi2026lab3-clean-api-1 Started
|
||||
Container mtusi2026lab3-clean-api-1 Waiting
|
||||
Container mtusi2026lab3-clean-api-2 Waiting
|
||||
Container mtusi2026lab3-clean-api-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-2 Healthy
|
||||
exit=0
|
||||
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1:18083"
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.State}} {{.RunningFor}} {{.Status}}'
|
||||
api running About a minute ago Up 4 seconds (healthy)
|
||||
api running About a minute ago Up 4 seconds (healthy)
|
||||
lb running About a minute ago Up 10 seconds (healthy)
|
||||
migrate exited About a minute ago Exited (0) 4 seconds ago
|
||||
postgres running About a minute ago Up 10 seconds (healthy)
|
||||
valkey running About a minute ago Up 10 seconds (healthy)
|
||||
api running 52 seconds ago Up 3 seconds (healthy)
|
||||
api running 52 seconds ago Up 3 seconds (healthy)
|
||||
lb running 52 seconds ago Up 5 seconds (healthy)
|
||||
migrate exited 52 seconds ago Exited (0) 4 seconds ago
|
||||
postgres running 52 seconds ago Up 5 seconds (healthy)
|
||||
valkey running 52 seconds ago Up 5 seconds (healthy)
|
||||
exit=0
|
||||
$ make migrate
|
||||
docker compose run --rm migrate
|
||||
Container mtusi2026lab3-clean-postgres-1 Running
|
||||
{"reason":"up to date","event":"migration.completed","level":"info","ts":"2026-10-29T20:24:45.560465Z"}
|
||||
{"reason":"up to date","event":"migration.completed","level":"info","ts":"2026-10-29T23:54:18.438982Z"}
|
||||
exit=0
|
||||
$ make storage-evidence && tail -4 evidence/secrets.txt
|
||||
sh scripts/evidence-storage.sh
|
||||
@@ -264,9 +264,9 @@ local mtusi2026lab3-clean_pgdata
|
||||
local mtusi2026lab3-clean_valkeydata
|
||||
exit=0
|
||||
$ make down
|
||||
docker compose down
|
||||
Container mtusi2026lab3-clean-lb-1 Stopping
|
||||
docker compose --profile bench down
|
||||
Container mtusi2026lab3-clean-api-2 Stopping
|
||||
Container mtusi2026lab3-clean-lb-1 Stopping
|
||||
Container mtusi2026lab3-clean-api-1 Stopping
|
||||
Container mtusi2026lab3-clean-lb-1 Stopped
|
||||
Container mtusi2026lab3-clean-lb-1 Removing
|
||||
@@ -277,18 +277,18 @@ docker compose down
|
||||
Container mtusi2026lab3-clean-api-1 Removing
|
||||
Container mtusi2026lab3-clean-api-2 Removed
|
||||
Container mtusi2026lab3-clean-api-1 Removed
|
||||
Container mtusi2026lab3-clean-valkey-1 Stopping
|
||||
Container mtusi2026lab3-clean-migrate-1 Stopping
|
||||
Container mtusi2026lab3-clean-valkey-1 Stopping
|
||||
Container mtusi2026lab3-clean-migrate-1 Stopped
|
||||
Container mtusi2026lab3-clean-migrate-1 Removing
|
||||
Container mtusi2026lab3-clean-migrate-1 Removed
|
||||
Container mtusi2026lab3-clean-postgres-1 Stopping
|
||||
Container mtusi2026lab3-clean-valkey-1 Stopped
|
||||
Container mtusi2026lab3-clean-valkey-1 Removing
|
||||
Container mtusi2026lab3-clean-postgres-1 Stopped
|
||||
Container mtusi2026lab3-clean-postgres-1 Removing
|
||||
Container mtusi2026lab3-clean-valkey-1 Removed
|
||||
Container mtusi2026lab3-clean-valkey-1 Stopped
|
||||
Container mtusi2026lab3-clean-valkey-1 Removing
|
||||
Container mtusi2026lab3-clean-postgres-1 Removed
|
||||
Container mtusi2026lab3-clean-valkey-1 Removed
|
||||
Network mtusi2026lab3-clean_edge Removing
|
||||
Network mtusi2026lab3-clean_backend Removing
|
||||
Network mtusi2026lab3-clean_backend Removed
|
||||
@@ -300,11 +300,11 @@ mtusi2026lab3-clean_valkeydata
|
||||
exit=0
|
||||
$ make reset-data
|
||||
Удаляются volumes с учебными данными стенда
|
||||
docker compose down -v --remove-orphans
|
||||
Volume mtusi2026lab3-clean_pgdata Removing
|
||||
docker compose --profile bench down -v --remove-orphans
|
||||
Volume mtusi2026lab3-clean_valkeydata Removing
|
||||
Volume mtusi2026lab3-clean_pgdata Removed
|
||||
Volume mtusi2026lab3-clean_pgdata Removing
|
||||
Volume mtusi2026lab3-clean_valkeydata Removed
|
||||
Volume mtusi2026lab3-clean_pgdata Removed
|
||||
exit=0
|
||||
$ docker volume ls --format '{{.Name}}' --filter name=mtusi2026lab3-clean | wc -l | tr -d ' '
|
||||
0
|
||||
|
||||
Reference in New Issue
Block a user