forked from mtusi2026/mtusi2026lab2
Record a clean clone run without an explicit BASE_URL
The launch block of the report now works verbatim with a changed LB_HTTP_PORT: in a fresh clone with port 18083 make test, both failovers, persistence and storage-evidence pass without BASE_URL, the second failover stops the other replica after one shifting request, and storage-evidence lists only the volumes of the clone project. 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
e722cb357d
commit
6fafc8a784
+150
-48
@@ -1,6 +1,6 @@
|
||||
date: 2026-10-28T23:57:41Z commit: e88673d dir: mtusi2026lab3-clean (свой compose-проект и volumes)
|
||||
date: 2026-10-29T20:23:35Z commit: a02d442 dir: mtusi2026lab3-clean (свой compose-проект и volumes)
|
||||
$ git clone … mtusi2026lab3-clean && cd mtusi2026lab3-clean && git checkout solution/bpi2303-kostylev
|
||||
HEAD e88673d Archive the scaling cost change
|
||||
HEAD a02d442 Trim the scaling cost proposal to the word limit
|
||||
$ docker volume ls -q --filter name=mtusi2026lab3-clean | wc -l | tr -d ' '
|
||||
0
|
||||
exit=0
|
||||
@@ -25,10 +25,84 @@ exit=0
|
||||
$ make up
|
||||
sh scripts/secrets.sh
|
||||
docker compose up -d --build --wait
|
||||
(вывод BuildKit сокращён: базовые слои из кэша, пересобран только пакет приложения)
|
||||
#18 exporting attestation manifest sha256:ed849b42694ed5a522c42c73051e106c02d36f3a6a8618af0a878222e35c20a5 done
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 591B 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 DONE 0.0s
|
||||
|
||||
#4 [internal] load metadata for docker.io/library/python:3.14-slim-trixie@sha256:51dafde81dbdb6ebde285137a295cf18a47ca95234fe388a343719cb97305b3d
|
||||
#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 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 DONE 0.0s
|
||||
|
||||
#8 [internal] load build context
|
||||
#8 transferring context: 236.57kB 0.0s done
|
||||
#8 DONE 0.0s
|
||||
|
||||
#9 [builder 3/7] WORKDIR /build
|
||||
#9 CACHED
|
||||
|
||||
#10 [builder 4/7] COPY pyproject.toml uv.lock README.md ./
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 2/7] COPY --from=ghcr.io/astral-sh/uv:0.9.7@sha256:ba4857bf2a068e9bc0e64eed8563b065908a4cd6bfb66b531a9c424c8e25e142 /uv /usr/local/bin/uv
|
||||
#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.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
|
||||
|
||||
#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
|
||||
|
||||
#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
|
||||
|
||||
#19 resolving provenance for metadata file
|
||||
#19 DONE 0.0s
|
||||
api Built
|
||||
Network mtusi2026lab3-clean_edge Creating
|
||||
Network mtusi2026lab3-clean_edge Created
|
||||
@@ -38,52 +112,52 @@ docker compose up -d --build --wait
|
||||
Volume "mtusi2026lab3-clean_pgdata" Created
|
||||
Volume "mtusi2026lab3-clean_valkeydata" Creating
|
||||
Volume "mtusi2026lab3-clean_valkeydata" Created
|
||||
Container mtusi2026lab3-clean-postgres-1 Creating
|
||||
Container mtusi2026lab3-clean-lb-1 Creating
|
||||
Container mtusi2026lab3-clean-valkey-1 Creating
|
||||
Container mtusi2026lab3-clean-postgres-1 Creating
|
||||
Container mtusi2026lab3-clean-valkey-1 Created
|
||||
Container mtusi2026lab3-clean-lb-1 Created
|
||||
Container mtusi2026lab3-clean-postgres-1 Created
|
||||
Container mtusi2026lab3-clean-migrate-1 Creating
|
||||
Container mtusi2026lab3-clean-lb-1 Created
|
||||
Container mtusi2026lab3-clean-migrate-1 Created
|
||||
Container mtusi2026lab3-clean-api-2 Creating
|
||||
Container mtusi2026lab3-clean-api-1 Creating
|
||||
Container mtusi2026lab3-clean-api-1 Created
|
||||
Container mtusi2026lab3-clean-api-2 Created
|
||||
Container mtusi2026lab3-clean-valkey-1 Starting
|
||||
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-valkey-1 Started
|
||||
Container mtusi2026lab3-clean-postgres-1 Started
|
||||
Container mtusi2026lab3-clean-postgres-1 Waiting
|
||||
Container mtusi2026lab3-clean-valkey-1 Started
|
||||
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-2 Starting
|
||||
Container mtusi2026lab3-clean-api-2 Started
|
||||
Container mtusi2026lab3-clean-api-1 Starting
|
||||
Container mtusi2026lab3-clean-api-1 Started
|
||||
Container mtusi2026lab3-clean-api-2 Waiting
|
||||
Container mtusi2026lab3-clean-api-1 Waiting
|
||||
Container mtusi2026lab3-clean-migrate-1 Waiting
|
||||
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-migrate-1 Exited
|
||||
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-migrate-1 Exited
|
||||
Container mtusi2026lab3-clean-postgres-1 Healthy
|
||||
Container mtusi2026lab3-clean-api-2 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): 17 s
|
||||
make up (build, migrate, wait healthy): 15 s
|
||||
$ docker compose logs --no-log-prefix migrate
|
||||
{"version":"0001_init","event":"migration.applied","level":"info","ts":"2026-10-28T23:57:55.908471Z"}
|
||||
{"version":"0002_idempotency_keys","event":"migration.applied","level":"info","ts":"2026-10-28T23:57:55.908551Z"}
|
||||
{"reason":"applied","event":"migration.completed","level":"info","ts":"2026-10-28T23:57:55.908595Z"}
|
||||
{"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"}
|
||||
exit=0
|
||||
$ docker compose ps -a --format '{{.Service}} {{.State}} {{.Status}} {{.Ports}}'
|
||||
api running Up 3 seconds (healthy)
|
||||
@@ -93,18 +167,18 @@ migrate exited Exited (0) 4 seconds ago
|
||||
postgres running Up 10 seconds (healthy)
|
||||
valkey running Up 10 seconds (healthy)
|
||||
exit=0
|
||||
$ until curl -fsS http://localhost:18083/health/ready; do sleep 1; done; scripts/lb-wait.sh 2
|
||||
$ 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 BASE_URL=http://localhost:18083
|
||||
python3 tests/smoke.py --base-url "http://localhost:18083"
|
||||
$ 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": {
|
||||
"8707058f0f3c": 20,
|
||||
"c7bbd4c000bd": 20
|
||||
"b354701120c8": 20,
|
||||
"80019af4c42f": 20
|
||||
},
|
||||
"same_key": {
|
||||
"rounds": 20,
|
||||
@@ -113,8 +187,8 @@ $ python3 scripts/probe.py check --rounds 20
|
||||
"201": 160
|
||||
},
|
||||
"instances": {
|
||||
"c7bbd4c000bd": 80,
|
||||
"8707058f0f3c": 80
|
||||
"b354701120c8": 80,
|
||||
"80019af4c42f": 80
|
||||
},
|
||||
"identical_bodies_rounds": 20,
|
||||
"single_copy_rounds": 20,
|
||||
@@ -123,57 +197,85 @@ $ python3 scripts/probe.py check --rounds 20
|
||||
"pass": true
|
||||
}
|
||||
exit=0
|
||||
$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh BASE_URL=http://localhost:18083
|
||||
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:18083"
|
||||
$ 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.985}
|
||||
{"observed_instances_before": 2, "successful_writes": 135, "failed_attempts": 0, "first_recovery_seconds": 2.895}
|
||||
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-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
|
||||
$ 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 21 seconds (healthy)
|
||||
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-2 Waiting
|
||||
Container mtusi2026lab3-clean-api-1 Waiting
|
||||
Container mtusi2026lab3-clean-api-2 Healthy
|
||||
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 BASE_URL=http://localhost:18083
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:18083"
|
||||
$ 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 44 seconds ago Up 4 seconds (healthy)
|
||||
api running 44 seconds ago Up 4 seconds (healthy)
|
||||
lb running 44 seconds ago Up 10 seconds (healthy)
|
||||
migrate exited 44 seconds ago Exited (0) 4 seconds ago
|
||||
postgres running 44 seconds ago Up 10 seconds (healthy)
|
||||
valkey running 44 seconds ago Up 10 seconds (healthy)
|
||||
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)
|
||||
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-28T23:58:35.296474Z"}
|
||||
{"reason":"up to date","event":"migration.completed","level":"info","ts":"2026-10-29T20:24:45.560465Z"}
|
||||
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 down
|
||||
Container mtusi2026lab3-clean-lb-1 Stopping
|
||||
Container mtusi2026lab3-clean-api-2 Stopping
|
||||
Container mtusi2026lab3-clean-api-1 Stopping
|
||||
Container mtusi2026lab3-clean-lb-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-2 Removed
|
||||
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-valkey-1 Stopping
|
||||
Container mtusi2026lab3-clean-migrate-1 Stopping
|
||||
@@ -183,14 +285,14 @@ docker compose down
|
||||
Container mtusi2026lab3-clean-postgres-1 Stopping
|
||||
Container mtusi2026lab3-clean-valkey-1 Stopped
|
||||
Container mtusi2026lab3-clean-valkey-1 Removing
|
||||
Container mtusi2026lab3-clean-valkey-1 Removed
|
||||
Container mtusi2026lab3-clean-postgres-1 Stopped
|
||||
Container mtusi2026lab3-clean-postgres-1 Removing
|
||||
Container mtusi2026lab3-clean-valkey-1 Removed
|
||||
Container mtusi2026lab3-clean-postgres-1 Removed
|
||||
Network mtusi2026lab3-clean_edge Removing
|
||||
Network mtusi2026lab3-clean_backend Removing
|
||||
Network mtusi2026lab3-clean_edge Removed
|
||||
Network mtusi2026lab3-clean_backend Removed
|
||||
Network mtusi2026lab3-clean_edge Removed
|
||||
exit=0
|
||||
$ docker volume ls --format '{{.Name}}' --filter name=mtusi2026lab3-clean
|
||||
mtusi2026lab3-clean_pgdata
|
||||
@@ -199,10 +301,10 @@ exit=0
|
||||
$ make reset-data
|
||||
Удаляются volumes с учебными данными стенда
|
||||
docker compose down -v --remove-orphans
|
||||
Volume mtusi2026lab3-clean_valkeydata Removing
|
||||
Volume mtusi2026lab3-clean_pgdata Removing
|
||||
Volume mtusi2026lab3-clean_valkeydata Removed
|
||||
Volume mtusi2026lab3-clean_valkeydata Removing
|
||||
Volume mtusi2026lab3-clean_pgdata Removed
|
||||
Volume mtusi2026lab3-clean_valkeydata Removed
|
||||
exit=0
|
||||
$ docker volume ls --format '{{.Name}}' --filter name=mtusi2026lab3-clean | wc -l | tr -d ' '
|
||||
0
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
- [x] 3.2 Стенд: `make test`, `make stack-evidence`, `make storage-evidence`, `make failover-evidence` ×2, `make persistence-evidence`, `make test-faults`
|
||||
- [x] 3.3 `make level4`: limits, lb-check, detection ×3, failover-each, rolling-update, rolling-update `FROM_REV=8d28d45`
|
||||
- [ ] 3.4 `make track1-control`: пул и `maxconn` на 8×1, 8×0,5 против 4×1
|
||||
- [ ] 3.5 Запуск из чистого clone с нестандартным портом без `BASE_URL`
|
||||
- [x] 3.5 Запуск из чистого clone с нестандартным портом без `BASE_URL`
|
||||
- [ ] 3.6 Проверка группы: все файлы `evidence/` несут коммит не раньше кода
|
||||
|
||||
## 4. Отчёт
|
||||
|
||||
Reference in New Issue
Block a user