Добавил результаты проверок
This commit is contained in:
@@ -34,6 +34,7 @@ HAProxy 3.2.26 распределяет запросы round-robin без sticky
|
||||
|
||||
| Проверка | Результат |
|
||||
| --- | --- |
|
||||
| Чистый клон, новая БД и новые секреты | [clean-clone-summary.json](evidence/clean-clone-summary.json), [лог](evidence/clean-clone-verification.txt) |
|
||||
| Структура, OpenAPI, публичный smoke, 27 собственных тестов | [verification.txt](evidence/verification.txt) |
|
||||
| 20 одновременных повторов через обе реплики, rollback сообщения и ключа при ошибке БД | Собственные тесты в общем логе |
|
||||
| Рестарт обеих API, БД и LB; прежние сессия, курсор и результат отправки | [persistence.json](evidence/persistence.json), [restart.json](evidence/restart.json) |
|
||||
@@ -52,3 +53,5 @@ HAProxy 3.2.26 распределяет запросы round-robin без sticky
|
||||
Проверено в Windows, Docker 29.9.3, Compose 5.7.0; Docker видит 12 CPU и 15,5 GiB RAM, отдельные CPU/RAM-лимиты контейнеров не заданы.
|
||||
|
||||
Источники: [HAProxy](https://docs.haproxy.org/3.2/configuration.html), [PostgreSQL](https://www.postgresql.org/docs/17/explicit-locking.html#ADVISORY-LOCKS), [Psycopg](https://www.psycopg.org/psycopg3/docs/).
|
||||
|
||||
Чистый клон коммита 11820b50118254b80f610a86bda292a4a81a78b5 проверен командой `python -X utf8 scripts/lab.py verify --project mtusi-lab3-clean --port 18082 --test-port 18083`. Git при начале проверки был чистым. После прогона временный стенд остановлен.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ttl_seconds": 2,
|
||||
"expiry_unchanged_on_restart": true,
|
||||
"before_restart": 200,
|
||||
"after_expiry_and_restart": 401,
|
||||
"new_login": 201
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
{
|
||||
"public": {
|
||||
"service": "api2",
|
||||
"target_instance": "e442e8be308340be8739851b9bfe86e4",
|
||||
"before": {
|
||||
"api1": {
|
||||
"instance_id": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"container_id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f"
|
||||
},
|
||||
"api2": {
|
||||
"instance_id": "e442e8be308340be8739851b9bfe86e4",
|
||||
"container_id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.737924076Z",
|
||||
"running": false,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"stop_seconds": 2.686,
|
||||
"metrics": {
|
||||
"observed_instances_before": 2,
|
||||
"successful_writes": 103,
|
||||
"failed_attempts": 5,
|
||||
"first_recovery_seconds": 6.03
|
||||
}
|
||||
},
|
||||
"second_replica": {
|
||||
"service": "api1",
|
||||
"target_instance": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"before": {
|
||||
"api1": {
|
||||
"instance_id": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"container_id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f"
|
||||
},
|
||||
"api2": {
|
||||
"instance_id": "429aa7fad2a6453f9d7bfb4ab2b348c6",
|
||||
"container_id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": false,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:03:19.390894304Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"stop_seconds": 2.574,
|
||||
"metrics": {
|
||||
"successful_writes": 112,
|
||||
"failed_attempts": 3,
|
||||
"first_recovery_seconds": 5.911,
|
||||
"replay_on_survivor": "PASS"
|
||||
}
|
||||
},
|
||||
"status": "PASS"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"idempotency_after_restart": "PASS",
|
||||
"public_persistence": "PASS",
|
||||
"cursor_after_restart": "PASS",
|
||||
"logout_after_restart": "PASS",
|
||||
"migration_replay": "PASS",
|
||||
"database": {
|
||||
"users": 85,
|
||||
"chats": 30,
|
||||
"members": 59,
|
||||
"messages": 132,
|
||||
"sessions": 81,
|
||||
"migrations": 2,
|
||||
"idempotency_keys": 131,
|
||||
"expiry_fingerprint": "f977292482fc2edf750e05fb72a4f602",
|
||||
"passwords_are_argon2id": true,
|
||||
"session_hashes_only": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
{
|
||||
"project": "mtusi-lab3-clean",
|
||||
"before": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:30.601511846Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:30.428970298Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:26.569906563Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:30.77975811Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.737924076Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"service": "api1",
|
||||
"target_instance": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"before": {
|
||||
"api1": {
|
||||
"instance_id": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"container_id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f"
|
||||
},
|
||||
"api2": {
|
||||
"instance_id": "429aa7fad2a6453f9d7bfb4ab2b348c6",
|
||||
"container_id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": false,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:03:19.390894304Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"stop_seconds": 2.574
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
{
|
||||
"date_utc": "2026-11-09T18:01:28.192475+00:00",
|
||||
"platform": "Windows-11-10.0.26200-SP0",
|
||||
"source_commit": "11820b50118254b80f610a86bda292a4a81a78b5",
|
||||
"worktree_dirty_at_start": false,
|
||||
"project": "mtusi-lab3-clean",
|
||||
"status": "PASS",
|
||||
"persistence": {
|
||||
"idempotency_after_restart": "PASS",
|
||||
"public_persistence": "PASS",
|
||||
"cursor_after_restart": "PASS",
|
||||
"logout_after_restart": "PASS",
|
||||
"migration_replay": "PASS",
|
||||
"database": {
|
||||
"users": 85,
|
||||
"chats": 30,
|
||||
"members": 59,
|
||||
"messages": 132,
|
||||
"sessions": 81,
|
||||
"migrations": 2,
|
||||
"idempotency_keys": 131,
|
||||
"expiry_fingerprint": "f977292482fc2edf750e05fb72a4f602",
|
||||
"passwords_are_argon2id": true,
|
||||
"session_hashes_only": true
|
||||
}
|
||||
},
|
||||
"failover": {
|
||||
"public": {
|
||||
"service": "api2",
|
||||
"target_instance": "e442e8be308340be8739851b9bfe86e4",
|
||||
"before": {
|
||||
"api1": {
|
||||
"instance_id": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"container_id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f"
|
||||
},
|
||||
"api2": {
|
||||
"instance_id": "e442e8be308340be8739851b9bfe86e4",
|
||||
"container_id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.737924076Z",
|
||||
"running": false,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"stop_seconds": 2.686,
|
||||
"metrics": {
|
||||
"observed_instances_before": 2,
|
||||
"successful_writes": 103,
|
||||
"failed_attempts": 5,
|
||||
"first_recovery_seconds": 6.03
|
||||
}
|
||||
},
|
||||
"second_replica": {
|
||||
"service": "api1",
|
||||
"target_instance": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"before": {
|
||||
"api1": {
|
||||
"instance_id": "1409d9a5ac7d4ff880fd94f7c00014b6",
|
||||
"container_id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f"
|
||||
},
|
||||
"api2": {
|
||||
"instance_id": "429aa7fad2a6453f9d7bfb4ab2b348c6",
|
||||
"container_id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30"
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:02:50.669843165Z",
|
||||
"running": false,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:03:19.390894304Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:02:50.567177201Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"stop_seconds": 2.574,
|
||||
"metrics": {
|
||||
"successful_writes": 112,
|
||||
"failed_attempts": 3,
|
||||
"first_recovery_seconds": 5.911,
|
||||
"replay_on_survivor": "PASS"
|
||||
}
|
||||
},
|
||||
"status": "PASS"
|
||||
},
|
||||
"expiry": {
|
||||
"ttl_seconds": 2,
|
||||
"expiry_unchanged_on_restart": true,
|
||||
"before_restart": 200,
|
||||
"after_expiry_and_restart": 401,
|
||||
"new_login": 201
|
||||
},
|
||||
"dependency": {
|
||||
"live_without_db": 200,
|
||||
"ready_without_db": 503,
|
||||
"business_without_db": 503,
|
||||
"recovered": 200
|
||||
},
|
||||
"containers": {
|
||||
"api1": {
|
||||
"id": "062cbc41b6324c747f8d3f08f2070ad6da2dbd0de22bf05a07541d0e0be4c84f",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:03:41.293358872Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"api2": {
|
||||
"id": "8999278f24df8c3067430ab62bd5756b25cf12c74763919effb9983443173f30",
|
||||
"image": "sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20",
|
||||
"started_at": "2026-11-09T18:03:19.390894304Z",
|
||||
"running": true,
|
||||
"user": "messenger",
|
||||
"volumes": []
|
||||
},
|
||||
"db": {
|
||||
"id": "653f94ebbd08ad702f53651e583f1d20dc6d0f389998d66acdba12e564bc53d5",
|
||||
"image": "sha256:665dc7b37ac52a17e298511414c21d23ffa4e6a6ef6225b3e5d59c7afb35e994",
|
||||
"started_at": "2026-11-09T18:04:07.187682231Z",
|
||||
"running": true,
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab3-clean_pgdata"
|
||||
]
|
||||
},
|
||||
"lb": {
|
||||
"id": "f79d1c2cbd4d468027924e92015f0caf3ebe02d1609b94273612b13d6fcfa02e",
|
||||
"image": "sha256:1242e4006ac3f1ed15871efadca3d8d089e76f720017a1c51747133ee40cc953",
|
||||
"started_at": "2026-11-09T18:02:50.483625792Z",
|
||||
"running": true,
|
||||
"user": "haproxy",
|
||||
"volumes": []
|
||||
}
|
||||
},
|
||||
"docker": "29.9.3",
|
||||
"resources": {
|
||||
"cpus": 12,
|
||||
"memory_bytes": 16591400960
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
$ .\.venv\Scripts\python.exe -X utf8 -m pip install --disable-pip-version-check --no-input --progress-bar off --quiet -r .\requirements.lock -r .\requirements-validation.lock
|
||||
Environment ready; existing settings and secrets preserved
|
||||
$ .\.venv\Scripts\python.exe -X utf8 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
$ .\.venv\Scripts\python.exe -X utf8 scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env config --quiet
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env config --quiet
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env build api1
|
||||
Image mtusi-messenger:lab3 Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.14kB 0.0s done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 728B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/python:3.13.14-slim-bookworm@sha256:67a1e1f215ccda113cfc024e8639049257e88f273898f595b61476d128d387e8
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load .dockerignore
|
||||
#4 transferring context: 224B 0.0s done
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [1/6] FROM docker.io/library/python:3.13.14-slim-bookworm@sha256:67a1e1f215ccda113cfc024e8639049257e88f273898f595b61476d128d387e8
|
||||
#5 resolve docker.io/library/python:3.13.14-slim-bookworm@sha256:67a1e1f215ccda113cfc024e8639049257e88f273898f595b61476d128d387e8 0.0s done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [internal] load build context
|
||||
#6 transferring context: 29.41kB 0.0s done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [3/6] COPY requirements.lock .
|
||||
#7 CACHED
|
||||
|
||||
#8 [5/6] COPY src ./src
|
||||
#8 CACHED
|
||||
|
||||
#9 [2/6] WORKDIR /app
|
||||
#9 CACHED
|
||||
|
||||
#10 [4/6] RUN python -m pip install --no-cache-dir -r requirements.lock && useradd --uid 10001 --create-home messenger
|
||||
#10 CACHED
|
||||
|
||||
#11 [6/6] COPY migrations ./migrations
|
||||
#11 CACHED
|
||||
|
||||
#12 exporting to image
|
||||
#12 exporting layers done
|
||||
#12 exporting manifest sha256:000b75a8b998d9327e8f3bfeb8a8594e6cbf763cc1afacba1f6fc6f9f08b0a36 0.0s done
|
||||
#12 exporting config sha256:559d7010df4af580a416ed184531e185aba6d3bce6a071d74b53084f6aa27340 0.0s done
|
||||
#12 exporting attestation manifest sha256:19f01810aeb39eb44f9362db94e13aaa5d6b6a743a8d10258b02726dc1211d52 0.0s done
|
||||
#12 exporting manifest list sha256:ee9e896f1628ac2e9a67396b9ff487cb3de9cf68ee3330093f32f9592dbaaf20 0.0s done
|
||||
#12 naming to docker.io/library/mtusi-messenger:lab3 done
|
||||
#12 unpacking to docker.io/library/mtusi-messenger:lab3 done
|
||||
#12 DONE 0.1s
|
||||
|
||||
#13 resolving provenance for metadata file
|
||||
#13 DONE 0.0s
|
||||
Image mtusi-messenger:lab3 Built
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env run --rm --no-deps lb haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
|
||||
Volume mtusi-lab3-clean_pgdata Creating
|
||||
Volume mtusi-lab3-clean_pgdata Creating
|
||||
Network mtusi-lab3-clean_default Creating
|
||||
Network mtusi-lab3-clean_default Creating
|
||||
Volume mtusi-lab3-clean_pgdata Created
|
||||
Volume mtusi-lab3-clean_pgdata Created
|
||||
Network mtusi-lab3-clean_default Created
|
||||
Network mtusi-lab3-clean_default Created
|
||||
Container mtusi-lab3-clean-lb-run-ca43e732982f Creating
|
||||
Container mtusi-lab3-clean-lb-run-ca43e732982f Created
|
||||
[NOTICE] (1) : [/usr/local/etc/haproxy/haproxy.cfg:35] : 'server api_ready/first' : could not resolve address 'api1', disabling server.
|
||||
[NOTICE] (1) : [/usr/local/etc/haproxy/haproxy.cfg:36] : 'server api_ready/second' : could not resolve address 'api2', disabling server.
|
||||
[NOTICE] (1) : [/usr/local/etc/haproxy/haproxy.cfg:43] : 'server api_live/first' : could not resolve address 'api1', disabling server.
|
||||
[NOTICE] (1) : [/usr/local/etc/haproxy/haproxy.cfg:44] : 'server api_live/second' : could not resolve address 'api2', disabling server.
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env up -d --no-build db migrate api1 api2 lb
|
||||
Container mtusi-lab3-clean-db-1 Creating
|
||||
Container mtusi-lab3-clean-db-1 Created
|
||||
Container mtusi-lab3-clean-migrate-1 Creating
|
||||
Container mtusi-lab3-clean-migrate-1 Created
|
||||
Container mtusi-lab3-clean-api1-1 Creating
|
||||
Container mtusi-lab3-clean-api2-1 Creating
|
||||
Container mtusi-lab3-clean-api1-1 Created
|
||||
Container mtusi-lab3-clean-api2-1 Created
|
||||
Container mtusi-lab3-clean-lb-1 Creating
|
||||
Container mtusi-lab3-clean-lb-1 Created
|
||||
Container mtusi-lab3-clean-db-1 Starting
|
||||
Container mtusi-lab3-clean-db-1 Started
|
||||
Container mtusi-lab3-clean-db-1 Waiting
|
||||
Container mtusi-lab3-clean-db-1 Healthy
|
||||
Container mtusi-lab3-clean-migrate-1 Starting
|
||||
Container mtusi-lab3-clean-migrate-1 Started
|
||||
Container mtusi-lab3-clean-migrate-1 Waiting
|
||||
Container mtusi-lab3-clean-migrate-1 Exited
|
||||
Container mtusi-lab3-clean-api2-1 Starting
|
||||
Container mtusi-lab3-clean-api1-1 Starting
|
||||
Container mtusi-lab3-clean-api2-1 Started
|
||||
Container mtusi-lab3-clean-api1-1 Started
|
||||
Container mtusi-lab3-clean-lb-1 Starting
|
||||
Container mtusi-lab3-clean-lb-1 Started
|
||||
Two API replicas ready through LB: http://127.0.0.1:18082
|
||||
$ .\.venv\Scripts\python.exe -X utf8 tests/smoke.py --base-url http://127.0.0.1:18082
|
||||
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
$ .\.venv\Scripts\python.exe -X utf8 -m unittest discover -s student-tests -v
|
||||
test_auth_and_access (test_api.ApiTests.test_auth_and_access) ... ok
|
||||
test_bad_cursors_and_limits (test_api.ApiTests.test_bad_cursors_and_limits) ... ok
|
||||
test_chat_pagination (test_api.ApiTests.test_chat_pagination) ... ok
|
||||
test_chat_validation_is_atomic (test_api.ApiTests.test_chat_validation_is_atomic) ... ok
|
||||
test_invalid_json_and_content_type (test_api.ApiTests.test_invalid_json_and_content_type) ... ok
|
||||
test_message_fields_and_unicode (test_api.ApiTests.test_message_fields_and_unicode) ... ok
|
||||
test_message_pagination (test_api.ApiTests.test_message_pagination) ... ok
|
||||
test_parallel_messages (test_api.ApiTests.test_parallel_messages) ... ok
|
||||
test_parallel_username (test_api.ApiTests.test_parallel_username) ... ok
|
||||
test_read_after_write (test_api.ApiTests.test_read_after_write) ... ok
|
||||
test_user_fields (test_api.ApiTests.test_user_fields) ... ok
|
||||
test_different_body_conflicts (test_idempotency.IdempotencyTests.test_different_body_conflicts) ... ok
|
||||
test_failure_rolls_back_message_and_key (test_idempotency.IdempotencyTests.test_failure_rolls_back_message_and_key) ... ok
|
||||
test_invalid_body_does_not_reserve_key (test_idempotency.IdempotencyTests.test_invalid_body_does_not_reserve_key) ... ok
|
||||
test_key_required_and_format (test_idempotency.IdempotencyTests.test_key_required_and_format) ... ok
|
||||
test_replay_normalizes_json (test_idempotency.IdempotencyTests.test_replay_normalizes_json) ... ok
|
||||
test_replay_still_checks_access_and_session (test_idempotency.IdempotencyTests.test_replay_still_checks_access_and_session) ... ok
|
||||
test_retention_and_expired_key_reuse (test_idempotency.IdempotencyTests.test_retention_and_expired_key_reuse) ... ok
|
||||
test_same_session_on_both_instances (test_idempotency.IdempotencyTests.test_same_session_on_both_instances) ... ok
|
||||
test_scope_is_user_and_chat_not_session (test_idempotency.IdempotencyTests.test_scope_is_user_and_chat_not_session) ... ok
|
||||
test_twenty_concurrent_requests_use_both_replicas (test_idempotency.IdempotencyTests.test_twenty_concurrent_requests_use_both_replicas) ... ok
|
||||
test_logout_only_revokes_current_session (test_sessions.SessionTests.test_logout_only_revokes_current_session) ... ok
|
||||
test_malformed_basic_and_body (test_sessions.SessionTests.test_malformed_basic_and_body) ... ok
|
||||
test_only_bearer_identifies_user (test_sessions.SessionTests.test_only_bearer_identifies_user) ... ok
|
||||
test_password_boundaries_unicode_colon_spaces (test_sessions.SessionTests.test_password_boundaries_unicode_colon_spaces) ... ok
|
||||
test_password_required_and_limits (test_sessions.SessionTests.test_password_required_and_limits) ... ok
|
||||
test_wrong_and_unknown_credentials (test_sessions.SessionTests.test_wrong_and_unknown_credentials) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 27 tests in 10.970s
|
||||
|
||||
OK
|
||||
$ .\.venv\Scripts\python.exe -X utf8 tests/resilience.py --mode persistence --action-script .\scripts\restart.cmd --base-url http://127.0.0.1:18082
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env run --rm --no-deps migrate
|
||||
Container mtusi-lab3-clean-migrate-run-a2751d9509a0 Creating
|
||||
Container mtusi-lab3-clean-migrate-run-a2751d9509a0 Created
|
||||
Already applied: 001_initial.sql
|
||||
Already applied: 002_idempotency.sql
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env run --rm --no-deps migrate
|
||||
Container mtusi-lab3-clean-migrate-run-d913b2ad552a Creating
|
||||
Container mtusi-lab3-clean-migrate-run-d913b2ad552a Created
|
||||
Already applied: 001_initial.sql
|
||||
Already applied: 002_idempotency.sql
|
||||
PASS: old session/cursor, durable logout and repeatable migrations
|
||||
$ .\.venv\Scripts\python.exe -X utf8 tests/resilience.py --mode failover --action-script .\scripts\stop-one.cmd --base-url http://127.0.0.1:18082
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 103, "failed_attempts": 5, "first_recovery_seconds": 6.03}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env start api1 api2
|
||||
Container mtusi-lab3-clean-db-1 Waiting
|
||||
Container mtusi-lab3-clean-db-1 Healthy
|
||||
Container mtusi-lab3-clean-migrate-1 Starting
|
||||
Container mtusi-lab3-clean-migrate-1 Started
|
||||
Container mtusi-lab3-clean-migrate-1 Waiting
|
||||
Container mtusi-lab3-clean-migrate-1 Exited
|
||||
Container mtusi-lab3-clean-api2-1 Starting
|
||||
Container mtusi-lab3-clean-api2-1 Started
|
||||
PASS: both physical API replicas stopped separately; no lost messages or duplicates
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env start api1 api2
|
||||
Container mtusi-lab3-clean-db-1 Waiting
|
||||
Container mtusi-lab3-clean-db-1 Healthy
|
||||
Container mtusi-lab3-clean-migrate-1 Starting
|
||||
Container mtusi-lab3-clean-migrate-1 Started
|
||||
Container mtusi-lab3-clean-migrate-1 Waiting
|
||||
Container mtusi-lab3-clean-migrate-1 Exited
|
||||
Container mtusi-lab3-clean-api1-1 Starting
|
||||
Container mtusi-lab3-clean-api1-1 Started
|
||||
$ docker compose --project-name mtusi-lab3-clean-ttl --env-file .env up -d --no-build db migrate api1 api2 lb
|
||||
Network mtusi-lab3-clean-ttl_default Creating
|
||||
Volume mtusi-lab3-clean-ttl_pgdata Creating
|
||||
Network mtusi-lab3-clean-ttl_default Creating
|
||||
Volume mtusi-lab3-clean-ttl_pgdata Creating
|
||||
Volume mtusi-lab3-clean-ttl_pgdata Created
|
||||
Volume mtusi-lab3-clean-ttl_pgdata Created
|
||||
Network mtusi-lab3-clean-ttl_default Created
|
||||
Network mtusi-lab3-clean-ttl_default Created
|
||||
Container mtusi-lab3-clean-ttl-db-1 Creating
|
||||
Container mtusi-lab3-clean-ttl-db-1 Created
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Creating
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Created
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Creating
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Creating
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Created
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Created
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Creating
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Created
|
||||
Container mtusi-lab3-clean-ttl-db-1 Starting
|
||||
Container mtusi-lab3-clean-ttl-db-1 Started
|
||||
Container mtusi-lab3-clean-ttl-db-1 Waiting
|
||||
Container mtusi-lab3-clean-ttl-db-1 Healthy
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Starting
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Started
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Waiting
|
||||
Container mtusi-lab3-clean-ttl-migrate-1 Exited
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Starting
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Starting
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Started
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Started
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Starting
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Started
|
||||
Two API replicas ready through LB: http://127.0.0.1:18083
|
||||
$ docker compose --project-name mtusi-lab3-clean-ttl --env-file .env restart --timeout 3 api1 api2
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Restarting
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Restarting
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Started
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Started
|
||||
PASS: TTL=2, expired token rejected after API restart; fresh login works
|
||||
$ docker compose --project-name mtusi-lab3-clean-ttl --env-file .env stop --timeout 10 lb api1 api2 db
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Stopping
|
||||
Container mtusi-lab3-clean-ttl-lb-1 Stopped
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Stopping
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Stopping
|
||||
Container mtusi-lab3-clean-ttl-api1-1 Stopped
|
||||
Container mtusi-lab3-clean-ttl-api2-1 Stopped
|
||||
Container mtusi-lab3-clean-ttl-db-1 Stopping
|
||||
Container mtusi-lab3-clean-ttl-db-1 Stopped
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env stop --timeout 10 db
|
||||
Container mtusi-lab3-clean-db-1 Stopping
|
||||
Container mtusi-lab3-clean-db-1 Stopped
|
||||
$ docker compose --project-name mtusi-lab3-clean --env-file .env start db
|
||||
Container mtusi-lab3-clean-db-1 Starting
|
||||
Container mtusi-lab3-clean-db-1 Started
|
||||
PASS: DB outage -> live=200, ready/business=503; session works after recovery
|
||||
$ .\.venv\Scripts\python.exe -X utf8 tests/smoke.py --base-url http://127.0.0.1:18082
|
||||
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
PASS: full lab3 verification
|
||||
Reference in New Issue
Block a user