forked from mtusi2026/mtusi2026lab3
Второй прогон scripts/collect_evidence.py на новом clone (коммит 2708732):
make check/validate/test, test-persistence (новые PID у lb, api x2,
postgres, valkey), test-failover для обеих реплик по очереди (0 неудачных
попыток), 201 свой тест, серия отказов stop/kill/pause x 2 реплики,
rolling update под нагрузкой (0 ошибок), tests/load.py. Таблица
критерий -> команда -> результат -> файл, раздел уровня 4 с периодами
проверок и временем обнаружения.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
267 lines
11 KiB
Plaintext
267 lines
11 KiB
Plaintext
# Clean clone: secrets, config, build, migrations from zero, start, versions
|
|
# 2026-10-19T15:10:17Z, commit 2708732 fix: LB и на [::1] — localhost на Windows стоил 2 с на запрос; сдвиг цели failover
|
|
|
|
$ git status --short --branch
|
|
## solution/bvt2302-bodanyuk...origin/solution/bvt2302-bodanyuk
|
|
[exit 0, 0.1 s]
|
|
|
|
$ C:\Users\wfa22\AppData\Local\Python\pythoncore-3.14-64\python.exe --version
|
|
Python 3.14.6
|
|
[exit 0, 0.0 s]
|
|
|
|
$ docker version --format client {{.Client.Version}} / server {{.Server.Version}}
|
|
client 29.8.0 / server 29.8.0
|
|
[exit 0, 0.1 s]
|
|
|
|
$ docker compose version
|
|
Docker Compose version v5.5.1
|
|
[exit 0, 0.1 s]
|
|
|
|
$ make --version
|
|
GNU Make 4.4.1
|
|
Built for Windows32
|
|
Copyright (C) 1988-2023 Free Software Foundation, Inc.
|
|
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
|
|
This is free software: you are free to change and redistribute it.
|
|
There is NO WARRANTY, to the extent permitted by law.
|
|
[exit 0, 0.0 s]
|
|
|
|
$ python scripts/init_secrets.py
|
|
created secrets/postgres_password
|
|
created secrets/valkey_password
|
|
created secrets/database_url
|
|
created secrets/cache_url
|
|
[exit 0, 0.1 s]
|
|
|
|
$ cp .env.example .env
|
|
|
|
$ docker compose --env-file .env config --quiet
|
|
|
|
[exit 0, 0.2 s]
|
|
|
|
$ docker compose --env-file .env up -d --build --wait
|
|
#1 [internal] load local bake definitions
|
|
#1 reading from stdin 1.36kB 0.1s done
|
|
#1 DONE 0.1s
|
|
|
|
#2 [migrate internal] load build definition from Dockerfile
|
|
#2 transferring dockerfile: 2.52kB 0.0s done
|
|
#2 DONE 0.0s
|
|
|
|
#3 [api] resolve image config for docker-image://docker.io/docker/dockerfile:1
|
|
#3 DONE 4.0s
|
|
|
|
#4 [api] docker-image://docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e
|
|
#4 resolve docker.io/docker/dockerfile:1@sha256:4edf897a3ffa55b89f906fc8cc78afdb3f1834cc9c7083565e611a8a7d5fe99e 0.1s done
|
|
#4 CACHED
|
|
|
|
#5 [migrate internal] load metadata for docker.io/library/python:3.13.16-slim-bookworm@sha256:a1165e272e578941b84abc79e4ab38a0305cd12803a5c4247979ac7655f4d641
|
|
#5 DONE 0.1s
|
|
|
|
#6 [api internal] load .dockerignore
|
|
#6 transferring context: 196B done
|
|
#6 DONE 0.0s
|
|
|
|
#7 [migrate internal] load build context
|
|
#7 transferring context: 219.60kB 0.0s done
|
|
#7 DONE 0.1s
|
|
|
|
#8 [api 1/8] FROM docker.io/library/python:3.13.16-slim-bookworm@sha256:a1165e272e578941b84abc79e4ab38a0305cd12803a5c4247979ac7655f4d641
|
|
#8 resolve docker.io/library/python:3.13.16-slim-bookworm@sha256:a1165e272e578941b84abc79e4ab38a0305cd12803a5c4247979ac7655f4d641 0.1s done
|
|
#8 DONE 0.1s
|
|
|
|
#9 [migrate 7/8] COPY migrations/ ./migrations/
|
|
#9 CACHED
|
|
|
|
#10 [migrate 2/8] WORKDIR /app
|
|
#10 CACHED
|
|
|
|
#11 [migrate 3/8] COPY requirements.txt ./
|
|
#11 CACHED
|
|
|
|
#12 [migrate 5/8] RUN groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --no-create-home --shell /usr/sbin/nologin app
|
|
#12 CACHED
|
|
|
|
#13 [migrate 4/8] RUN pip install --root-user-action=ignore --require-hashes --no-deps -r requirements.txt
|
|
#13 CACHED
|
|
|
|
#14 [migrate 6/8] COPY src/ ./src/
|
|
#14 CACHED
|
|
|
|
#15 [migrate 8/8] COPY contracts/openapi.json ./contracts/openapi.json
|
|
#15 CACHED
|
|
|
|
#12 [api 5/8] RUN groupadd --system --gid 10001 app && useradd --system --uid 10001 --gid app --no-create-home --shell /usr/sbin/nologin app
|
|
#12 CACHED
|
|
|
|
#14 [api 6/8] COPY src/ ./src/
|
|
#14 CACHED
|
|
|
|
#10 [api 2/8] WORKDIR /app
|
|
#10 CACHED
|
|
|
|
#11 [api 3/8] COPY requirements.txt ./
|
|
#11 CACHED
|
|
|
|
#9 [api 7/8] COPY migrations/ ./migrations/
|
|
#9 CACHED
|
|
|
|
#13 [api 4/8] RUN pip install --root-user-action=ignore --require-hashes --no-deps -r requirements.txt
|
|
#13 CACHED
|
|
|
|
#16 [api] exporting to image
|
|
#16 exporting layers 0.0s done
|
|
#16 exporting manifest sha256:2e7919b4c60cf9f2135cb5523cf47bc6456f92675261377cb3a312868c357738 0.0s done
|
|
#16 exporting config sha256:986458b901447acf8fa6913d7b9548d1fb0b4335f4169158ad6eb2c5e050c1fc 0.0s done
|
|
#16 exporting attestation manifest sha256:712b9fac08d59b57dc8931284b52c54ddf116bc5ad39d17e789a98a04499f68d
|
|
#16 exporting attestation manifest sha256:712b9fac08d59b57dc8931284b52c54ddf116bc5ad39d17e789a98a04499f68d 0.1s done
|
|
#16 exporting manifest list sha256:331feed9c7da600658f524637b0ed8aa919c68e0372b0191d89b3d45e37122e0
|
|
#16 exporting manifest list sha256:331feed9c7da600658f524637b0ed8aa919c68e0372b0191d89b3d45e37122e0 0.1s done
|
|
#16 naming to docker.io/library/mtusi-messenger:lab3 0.0s done
|
|
#16 unpacking to docker.io/library/mtusi-messenger:lab3 0.0s done
|
|
#16 DONE 0.4s
|
|
|
|
#17 [migrate] exporting to image
|
|
#17 exporting layers 0.0s done
|
|
#17 exporting manifest sha256:06ff1601ca5b94a5b839cf1b1db979c3b1be6f371a81a349c64a49eba4aa718d 0.0s done
|
|
#17 exporting config sha256:e415695b978557fe5a23bf1d0a4a95e3e24651ab739b95088dfa124dd115d26a 0.0s done
|
|
#17 exporting attestation manifest sha256:3d9641bd01df9b87cdebd4f0b07e8f90504f14b9d3a090c6d8794e121b69c3d7 0.1s done
|
|
#17 exporting manifest list sha256:e7940cf7f96b1b5f7c63645c54e1774d32d1408edcfced01dd5b57e93bcb64c4 0.1s done
|
|
#17 naming to docker.io/library/mtusi-messenger:lab3 0.0s done
|
|
#17 unpacking to docker.io/library/mtusi-messenger:lab3 0.0s done
|
|
#17 DONE 0.3s
|
|
|
|
#18 [migrate] resolving provenance for metadata file
|
|
#18 DONE 0.0s
|
|
|
|
#19 [api] resolving provenance for metadata file
|
|
#19 DONE 0.0s
|
|
Image mtusi-messenger:lab3 Building
|
|
Image mtusi-messenger:lab3 Building
|
|
Image mtusi-messenger:lab3 Built
|
|
Image mtusi-messenger:lab3 Built
|
|
Network mtusi-lab3_edge Creating
|
|
Network mtusi-lab3_edge Creating
|
|
Volume mtusi-lab3_pgdata Creating
|
|
Volume mtusi-lab3_pgdata Creating
|
|
Volume mtusi-lab3_valkeydata Creating
|
|
Volume mtusi-lab3_valkeydata Creating
|
|
Network mtusi-lab3_data Creating
|
|
Network mtusi-lab3_data Creating
|
|
Volume mtusi-lab3_valkeydata Created
|
|
Volume mtusi-lab3_valkeydata Created
|
|
Volume mtusi-lab3_pgdata Created
|
|
Volume mtusi-lab3_pgdata Created
|
|
Network mtusi-lab3_edge Created
|
|
Network mtusi-lab3_edge Created
|
|
Network mtusi-lab3_data Created
|
|
Network mtusi-lab3_data Created
|
|
Container mtusi-lab3-postgres-1 Creating
|
|
Container mtusi-lab3-valkey-1 Creating
|
|
Container mtusi-lab3-valkey-1 Created
|
|
Container mtusi-lab3-postgres-1 Created
|
|
Container mtusi-lab3-migrate-1 Creating
|
|
Container mtusi-lab3-migrate-1 Created
|
|
Container mtusi-lab3-api-1 Creating
|
|
Container mtusi-lab3-api-2 Creating
|
|
Container mtusi-lab3-api-1 Created
|
|
Container mtusi-lab3-api-2 Created
|
|
Container mtusi-lab3-lb-1 Creating
|
|
Container mtusi-lab3-lb-1 Created
|
|
Container mtusi-lab3-postgres-1 Starting
|
|
Container mtusi-lab3-valkey-1 Starting
|
|
Container mtusi-lab3-postgres-1 Started
|
|
Container mtusi-lab3-postgres-1 Waiting
|
|
Container mtusi-lab3-valkey-1 Started
|
|
Container mtusi-lab3-postgres-1 Healthy
|
|
Container mtusi-lab3-migrate-1 Starting
|
|
Container mtusi-lab3-migrate-1 Started
|
|
Container mtusi-lab3-migrate-1 Waiting
|
|
Container mtusi-lab3-postgres-1 Waiting
|
|
Container mtusi-lab3-valkey-1 Waiting
|
|
Container mtusi-lab3-valkey-1 Healthy
|
|
Container mtusi-lab3-postgres-1 Healthy
|
|
Container mtusi-lab3-migrate-1 Exited
|
|
Container mtusi-lab3-api-2 Starting
|
|
Container mtusi-lab3-api-2 Started
|
|
Container mtusi-lab3-api-1 Starting
|
|
Container mtusi-lab3-api-1 Started
|
|
Container mtusi-lab3-api-2 Waiting
|
|
Container mtusi-lab3-api-1 Waiting
|
|
Container mtusi-lab3-api-2 Healthy
|
|
Container mtusi-lab3-api-1 Healthy
|
|
Container mtusi-lab3-lb-1 Starting
|
|
Container mtusi-lab3-lb-1 Started
|
|
Container mtusi-lab3-valkey-1 Waiting
|
|
Container mtusi-lab3-migrate-1 Waiting
|
|
Container mtusi-lab3-api-2 Waiting
|
|
Container mtusi-lab3-api-1 Waiting
|
|
Container mtusi-lab3-lb-1 Waiting
|
|
Container mtusi-lab3-postgres-1 Waiting
|
|
Container mtusi-lab3-postgres-1 Healthy
|
|
Container mtusi-lab3-valkey-1 Healthy
|
|
Container mtusi-lab3-migrate-1 Exited
|
|
Container mtusi-lab3-api-2 Healthy
|
|
Container mtusi-lab3-api-1 Healthy
|
|
Container mtusi-lab3-lb-1 Healthy
|
|
[exit 0, 28.2 s]
|
|
|
|
$ docker compose ps -a --format table {{.Service}} {{.Image}} {{.Status}}
|
|
SERVICE IMAGE STATUS
|
|
api mtusi-messenger:lab3 Up 11 seconds (healthy)
|
|
api mtusi-messenger:lab3 Up 12 seconds (healthy)
|
|
lb haproxy:3.2.26-alpine@sha256:254e6370f01cd654e0744edf607c67f33777c1b6a9dc0d4b28bcba7171460122 Up 6 seconds (healthy)
|
|
migrate mtusi-messenger:lab3 Exited (0) 12 seconds ago
|
|
postgres postgres:18.6-bookworm@sha256:afc7e2d441324c0388fa80c3d24f733b4194a4eb7f47dd8ee2b08eb1a24a647c Up 20 seconds (healthy)
|
|
valkey valkey/valkey:8.1.3-bookworm@sha256:fea8b3e67b15729d4bb70589eb03367bab9ad1ee89c876f54327fc7c6e618571 Up 19 seconds (healthy)
|
|
[exit 0, 0.3 s]
|
|
|
|
$ docker compose logs --no-log-prefix migrate
|
|
migrate: 0001_init: applied
|
|
migrate: 0002_idempotency_keys: applied
|
|
migrate: 0003_post_message_function: applied
|
|
migrate: done, 3 migration file(s) checked
|
|
[exit 0, 0.3 s]
|
|
|
|
$ C:\Users\wfa22\AppData\Local\Python\pythoncore-3.14-64\python.exe scripts/lbctl.py replicas
|
|
mtusi-lab3-api-1 X-Instance-Id=94b38b941a8d running health=healthy pid=23944 started=2026-10-19T15:10:34.257 ip=172.23.0.3,172.24.0.5
|
|
mtusi-lab3-api-2 X-Instance-Id=a8d9cffd7a6e running health=healthy pid=23887 started=2026-10-19T15:10:33.970 ip=172.23.0.2,172.24.0.4
|
|
[exit 0, 0.7 s]
|
|
|
|
$ C:\Users\wfa22\AppData\Local\Python\pythoncore-3.14-64\python.exe scripts/lbctl.py status
|
|
api1 172.23.0.3 UP mtusi-lab3-api-1 X-Instance-Id=94b38b941a8d
|
|
api2 172.23.0.2 UP mtusi-lab3-api-2 X-Instance-Id=a8d9cffd7a6e
|
|
(other slots: MAINT, no container)
|
|
[exit 0, 0.9 s]
|
|
|
|
$ C:\Users\wfa22\AppData\Local\Python\pythoncore-3.14-64\python.exe -m venv .venv
|
|
|
|
[exit 0, 6.9 s]
|
|
|
|
$ C:\Users\wfa22\Desktop\Высоконагруженные приложения\mtusi2026lab3-clean\.venv\Scripts\python.exe -m pip install -q --require-hashes --no-deps -r requirements.txt
|
|
|
|
[notice] A new release of pip is available: 26.1.2 -> 26.2.1
|
|
[notice] To update, run: C:\Users\wfa22\Desktop\Высоконагруженные приложения\mtusi2026lab3-clean\.venv\Scripts\python.exe -m pip install --upgrade pip
|
|
[exit 0, 15.8 s]
|
|
|
|
$ C:\Users\wfa22\Desktop\Высоконагруженные приложения\mtusi2026lab3-clean\.venv\Scripts\python.exe -m pip install -q -r requirements-test.txt -r requirements-dev.txt
|
|
|
|
[notice] A new release of pip is available: 26.1.2 -> 26.2.1
|
|
[notice] To update, run: C:\Users\wfa22\Desktop\Высоконагруженные приложения\mtusi2026lab3-clean\.venv\Scripts\python.exe -m pip install --upgrade pip
|
|
[exit 0, 22.3 s]
|
|
|
|
$ git check-ignore -v secrets/database_url .env
|
|
.gitignore:5:secrets/ secrets/database_url
|
|
.gitignore:2:.env .env
|
|
$ git status --short # secrets/ и .env не попадают в Git
|
|
?? evidence/clean-clone.txt
|
|
?? evidence/failover/
|
|
?? evidence/level4-runs.txt
|
|
?? evidence/load.json
|
|
?? evidence/make-check-validate-test.txt
|
|
?? evidence/rolling-update/
|
|
?? evidence/student-tests.txt
|
|
?? evidence/test-failover.txt
|
|
?? evidence/test-persistence.txt
|
|
[exit 0]
|