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
312 lines
13 KiB
Plaintext
312 lines
13 KiB
Plaintext
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 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
|
|
$ make secrets
|
|
sh scripts/secrets.sh
|
|
создан secrets/postgres_password
|
|
создан secrets/database_url
|
|
создан secrets/cursor_secret
|
|
создан secrets/valkey_password
|
|
создан secrets/valkey.conf
|
|
создан secrets/cache_url
|
|
создан .env из .env.example
|
|
exit=0
|
|
$ sed LB_HTTP_PORT=18083 LB_STATS_PORT=23083 .env # 8080 на этой машине занят стендами других лаб
|
|
$ git status --short --ignored secrets .env
|
|
!! .env
|
|
!! secrets/
|
|
exit=0
|
|
$ docker compose --env-file .env config --quiet && echo valid
|
|
valid
|
|
exit=0
|
|
$ make up
|
|
sh scripts/secrets.sh
|
|
docker compose up -d --build --wait
|
|
#1 [internal] load local bake definitions
|
|
#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 docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
|
#3 DONE 0.0s
|
|
|
|
#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 [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 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: 281.44kB 0.0s done
|
|
#8 DONE 0.0s
|
|
|
|
#9 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
|
#9 CACHED
|
|
|
|
#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 3/7] WORKDIR /build
|
|
#11 CACHED
|
|
|
|
#12 [builder 5/7] RUN uv sync --locked --no-dev --no-install-project --no-editable
|
|
#12 CACHED
|
|
|
|
#13 [builder 6/7] COPY src ./src
|
|
#13 DONE 0.0s
|
|
|
|
#14 [builder 7/7] RUN uv sync --locked --no-dev --no-editable
|
|
#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.2s
|
|
|
|
#17 [runtime 4/4] WORKDIR /app
|
|
#17 DONE 0.0s
|
|
|
|
#18 exporting to image
|
|
#18 exporting layers
|
|
#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_backend Creating
|
|
Network mtusi2026lab3-clean_backend 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-valkey-1 Creating
|
|
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-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
|
|
Container mtusi2026lab3-clean-lb-1 Started
|
|
Container mtusi2026lab3-clean-postgres-1 Healthy
|
|
Container mtusi2026lab3-clean-migrate-1 Starting
|
|
Container mtusi2026lab3-clean-migrate-1 Started
|
|
Container mtusi2026lab3-clean-migrate-1 Waiting
|
|
Container mtusi2026lab3-clean-migrate-1 Exited
|
|
Container mtusi2026lab3-clean-api-1 Starting
|
|
Container mtusi2026lab3-clean-api-1 Started
|
|
Container mtusi2026lab3-clean-api-2 Starting
|
|
Container mtusi2026lab3-clean-api-2 Started
|
|
Container mtusi2026lab3-clean-api-1 Waiting
|
|
Container mtusi2026lab3-clean-api-2 Waiting
|
|
Container mtusi2026lab3-clean-migrate-1 Waiting
|
|
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): 10 s
|
|
$ docker compose logs --no-log-prefix migrate
|
|
{"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 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"}
|
|
LB: 2 api UP
|
|
$ make test
|
|
python3 tests/smoke.py --base-url "http://127.0.0.1:18083"
|
|
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
|
exit=0
|
|
$ python3 scripts/probe.py check --rounds 20
|
|
{
|
|
"instances_one_token": {
|
|
"7bed64a93042": 20,
|
|
"7dcb3b8e69c8": 20
|
|
},
|
|
"same_key": {
|
|
"rounds": 20,
|
|
"parallel": 8,
|
|
"statuses": {
|
|
"201": 160
|
|
},
|
|
"instances": {
|
|
"7dcb3b8e69c8": 80,
|
|
"7bed64a93042": 80
|
|
},
|
|
"identical_bodies_rounds": 20,
|
|
"single_copy_rounds": 20,
|
|
"conflict_rounds": 20
|
|
},
|
|
"pass": true
|
|
}
|
|
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": 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 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
|
|
scripts/restore.sh
|
|
Container mtusi2026lab3-clean-api-1 Running
|
|
Container mtusi2026lab3-clean-api-2 Starting
|
|
Container mtusi2026lab3-clean-api-2 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 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-29T23:54:18.438982Z"}
|
|
exit=0
|
|
$ make storage-evidence && tail -4 evidence/secrets.txt
|
|
sh scripts/evidence-storage.sh
|
|
evidence/{schema,migrations,kdf,secrets}.txt обновлены
|
|
$ docker volume ls --filter label=com.docker.compose.project=mtusi2026lab3-clean
|
|
DRIVER VOLUME NAME
|
|
local mtusi2026lab3-clean_pgdata
|
|
local mtusi2026lab3-clean_valkeydata
|
|
exit=0
|
|
$ make down
|
|
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
|
|
Container mtusi2026lab3-clean-lb-1 Removed
|
|
Container mtusi2026lab3-clean-api-2 Stopped
|
|
Container mtusi2026lab3-clean-api-2 Removing
|
|
Container mtusi2026lab3-clean-api-1 Stopped
|
|
Container mtusi2026lab3-clean-api-1 Removing
|
|
Container mtusi2026lab3-clean-api-2 Removed
|
|
Container mtusi2026lab3-clean-api-1 Removed
|
|
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-postgres-1 Stopped
|
|
Container mtusi2026lab3-clean-postgres-1 Removing
|
|
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
|
|
Network mtusi2026lab3-clean_edge Removed
|
|
exit=0
|
|
$ docker volume ls --format '{{.Name}}' --filter name=mtusi2026lab3-clean
|
|
mtusi2026lab3-clean_pgdata
|
|
mtusi2026lab3-clean_valkeydata
|
|
exit=0
|
|
$ make reset-data
|
|
Удаляются volumes с учебными данными стенда
|
|
docker compose --profile bench down -v --remove-orphans
|
|
Volume mtusi2026lab3-clean_valkeydata Removing
|
|
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
|
|
exit=0
|