docs: write REPORT.md

This commit is contained in:
TAskMAster339
2026-10-19 00:20:43 +03:00
parent 95c2e78fe3
commit 84175cf1e2
68 changed files with 6629 additions and 38 deletions
View File
+25
View File
@@ -0,0 +1,25 @@
# Доказательства критериев
[REPORT.md](../../REPORT.md)
Последний запуск: `20261018T203755.405686Z`.
| Критерий | Результат |
| --- | --- |
| [Публичный smoke и структура контракта](public-smoke.md) | PASS |
| [Возможности lab3](baseline.md) | PASS |
| [Две API, PostgreSQL и приватный S3 в общем стенде](shared-storage.md) | PASS |
| [PNG/JPEG, ready, сообщение и побайтный download](proxy-attachments.md) | PASS |
| [Лимиты, MIME, filename и доступ к чужим вложениям](validation-access.md) | PASS |
| [Оригинал после остановки обслужившей API](replica-failover.md) | PASS |
| [Сессия, метаданные и оригинал после restart](persistence.md) | PASS |
| [Обрыв HTTP и отказ между S3 PUT и COMMIT](upload-recovery.md) | PASS |
| [Grace period, блокировки, защита готовых объектов и повтор](safe-cleanup.md) | PASS |
| [Потоковая обработка, лимиты и ≥10 клиентов](bounded-memory.md) | PASS |
| [Повторяемый bootstrap и ограниченные credentials](s3-permissions.md) | PASS |
| [Presigned POST и неизменяемый готовый оригинал](direct-flow.md) | PASS |
| [Подпись, владелец, размер, SHA-256, MIME и CORS](direct-validation-access.md) | PASS |
| [Повторы complete, crash и отмена ожидания](direct-recovery.md) | PASS |
| [Незавершённый staging, replay, dry-run и lifecycle](direct-cleanup.md) | PASS |
| [Гипотеза и сравнение трафика/RAM на четырёх профилях](upload-comparison.md) | PASS |
| [Сборка React UI](frontend.md) | PASS |
+52
View File
@@ -0,0 +1,52 @@
# Возможности lab3
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestStoredPasswordUsesArgon2id`, `TestShortSessionTTLAndLogout`, `TestIdempotencyConcurrentStoresAndScopes`, `TestChatTransactionRollsBackAfterMemberInsertFailure`, `TestListMessagesPagination`.
## baseline
```sh
make test-baseline
```
Начало: 2026-10-18T20:38:39.428018+00:00; длительность: 1.345 с; exit code: 0.
````text
python3 scripts/check_baseline.py --base-url "http://localhost:8080"
PASS: transferred API, shared sessions, chat, message, logout
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestChatTransactionRollsBackAfterMemberInsertFailure
--- PASS: TestChatTransactionRollsBackAfterMemberInsertFailure (1.30s)
=== RUN TestShortSessionTTLAndLogout
--- PASS: TestShortSessionTTLAndLogout (2.68s)
=== RUN TestIdempotencyConcurrentStoresAndScopes
--- PASS: TestIdempotencyConcurrentStoresAndScopes (1.24s)
=== RUN TestListMessagesPagination
--- PASS: TestListMessagesPagination (0.55s)
=== RUN TestStoredPasswordUsesArgon2id
--- PASS: TestStoredPasswordUsesArgon2id (0.62s)
PASS
````
## Реализация
- [src/backend/repositories/idempotency.go](../../src/backend/repositories/idempotency.go)
- [src/backend/repositories/redis.go](../../src/backend/repositories/redis.go)
- [src/backend/services/password.go](../../src/backend/services/password.go)
+257
View File
@@ -0,0 +1,257 @@
# Потоковая обработка, лимиты и ≥10 клиентов
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## inventory
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:38:15.728752+00:00; длительность: 0.679 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:36:24.367291372Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.89479619Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.043221163Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:50.058525711Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.399345399Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## experiment
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe experiment --campaign /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/upload-comparison/20261018T193626Z-formal-f49d61
```
Начало: 2026-10-18T20:43:13.717511+00:00; длительность: 3.393 с; exit code: 0.
````text
PASS: sealed protocol, archive, fixtures, raw records and recomputed decision match
Campaign: evidence/upload-comparison/20261018T193626Z-formal-f49d61
Ready/verified: 720 720
Errors: 0
{"profile": "small-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.5065773906213067, "min_traffic_ratio": 0.5063861055246678, "max_traffic_ratio": 0.5079907229528128}
{"profile": "large-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.49949754357270226, "min_traffic_ratio": 0.4991382402982068, "max_traffic_ratio": 0.49981732427785186}
{"profile": "small-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.5126058228037882, "min_traffic_ratio": 0.50707065100036, "max_traffic_ratio": 0.512817391975545}
{"profile": "large-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.49928261799970935, "min_traffic_ratio": 0.4992082132615818, "max_traffic_ratio": 0.49959788796606974}
{"profile": "small-moderate", "mode": "proxy", "median_api_MiB_per_ready": 2.0209168752034503, "median_api_window_peak_MiB": 136.0546875, "max_api_lifetime_peak_MiB": 141.2265625, "median_ready_rps": 7.894590746470929, "median_p50_s": 0.13762395, "median_p95_s": 0.349706212, "median_p99_s": 0.353454295}
{"profile": "small-moderate", "mode": "direct", "median_api_MiB_per_ready": 1.0233642260233562, "median_api_window_peak_MiB": 138.71875, "max_api_lifetime_peak_MiB": 140.8125, "median_ready_rps": 6.6154831177570035, "median_p50_s": 0.330249949, "median_p95_s": 0.664536392, "median_p99_s": 0.665379127}
{"profile": "large-moderate", "mode": "proxy", "median_api_MiB_per_ready": 20.11448278427124, "median_api_window_peak_MiB": 148.44140625, "max_api_lifetime_peak_MiB": 152.44921875, "median_ready_rps": 4.708766693021728, "median_p50_s": 0.623532216, "median_p95_s": 1.199421251, "median_p99_s": 1.370958831}
{"profile": "large-moderate", "mode": "direct", "median_api_MiB_per_ready": 10.044582716623943, "median_api_window_peak_MiB": 147.1796875, "max_api_lifetime_peak_MiB": 150.04296875, "median_ready_rps": 3.1121213975127984, "median_p50_s": 1.760060342, "median_p95_s": 2.429332421, "median_p99_s": 2.519360375}
{"profile": "small-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 2.0204983075459797, "median_api_window_peak_MiB": 381.2734375, "max_api_lifetime_peak_MiB": 384.3203125, "median_ready_rps": 3.145227806944573, "median_p50_s": 1.294338167, "median_p95_s": 2.522289981, "median_p99_s": 2.55024115}
{"profile": "small-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 1.0358009020487466, "median_api_window_peak_MiB": 384.0546875, "max_api_lifetime_peak_MiB": 387.94140625, "median_ready_rps": 2.8002143610390253, "median_p50_s": 1.645604573, "median_p95_s": 3.186833871, "median_p99_s": 3.235123098}
{"profile": "large-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 20.120631217956543, "median_api_window_peak_MiB": 391.99609375, "max_api_lifetime_peak_MiB": 393.2578125, "median_ready_rps": 2.3240187390207696, "median_p50_s": 1.835096441, "median_p95_s": 3.14764051, "median_p99_s": 3.996668065}
{"profile": "large-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 10.045849291483561, "median_api_window_peak_MiB": 393.05859375, "max_api_lifetime_peak_MiB": 397.359375, "median_ready_rps": 1.780860551975933, "median_p50_s": 3.21658326, "median_p95_s": 5.166217115, "median_p99_s": 5.44240128}
Decision: confirmed_in_tested_conditions
````
## Реализация
- [src/backend/services/attachment.go](../../src/backend/services/attachment.go)
- [src/backend/services/direct_upload.go](../../src/backend/services/direct_upload.go)
- [experiments/config/protocol.json](../../experiments/config/protocol.json)
Измерения не запускались повторно: проверены сохранённые сырые данные.
[Серия](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/metrics.json) · [Протокол](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/protocol.json) · [Графики](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/)
+49
View File
@@ -0,0 +1,49 @@
# Незавершённый staging, replay, dry-run и lifecycle
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadCleanupSafetyAndReplay`, `TestDirectUploadCleanupDependencyFailureAndMalformedKey`, `TestDirectUploadAccessPermissionsAndLifecycle`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestDirectUploadCleanupSafetyAndReplay
--- PASS: TestDirectUploadCleanupSafetyAndReplay (0.87s)
=== RUN TestDirectUploadCleanupDependencyFailureAndMalformedKey
--- PASS: TestDirectUploadCleanupDependencyFailureAndMalformedKey (0.66s)
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
PASS
````
## cleanup-dry-run
```sh
make attachments-cleanup
```
Начало: 2026-10-18T20:41:08.490906+00:00; длительность: 1.327 с; exit code: 0.
````text
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
````
## Реализация
- [src/backend/repositories/direct_cleanup.go](../../src/backend/repositories/direct_cleanup.go)
- [src/backend/repositories/s3_admin.go](../../src/backend/repositories/s3_admin.go)
+44
View File
@@ -0,0 +1,44 @@
# Presigned POST и неизменяемый готовый оригинал
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadFlow`, `TestDirectUploadRecoveryConcurrentComplete`.
## direct
```sh
/usr/bin/python3 scripts/check_direct_upload.py
```
Начало: 2026-10-18T20:41:05.039812+00:00; длительность: 2.394 с; exit code: 0.
````text
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestDirectUploadFlow
--- PASS: TestDirectUploadFlow (0.76s)
=== RUN TestDirectUploadRecoveryConcurrentComplete
--- PASS: TestDirectUploadRecoveryConcurrentComplete (0.61s)
PASS
````
## Реализация
- [src/backend/services/direct_upload.go](../../src/backend/services/direct_upload.go)
- [src/backend/repositories/s3_direct.go](../../src/backend/repositories/s3_direct.go)
+57
View File
@@ -0,0 +1,57 @@
# Повторы complete, crash и отмена ожидания
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadRecoveryFailures`, `TestDirectUploadRecoveryProcessExit`, `TestDirectUploadRecoverySharedSlotAndCancellation`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestDirectUploadRecoveryFailures
=== RUN TestDirectUploadRecoveryFailures/copy-result-loss
=== RUN TestDirectUploadRecoveryFailures/get-failure
=== RUN TestDirectUploadRecoveryFailures/metadata-rejection
=== RUN TestDirectUploadRecoveryFailures/database-disconnect
--- PASS: TestDirectUploadRecoveryFailures (2.66s)
--- PASS: TestDirectUploadRecoveryFailures/copy-result-loss (0.66s)
--- PASS: TestDirectUploadRecoveryFailures/get-failure (0.62s)
--- PASS: TestDirectUploadRecoveryFailures/metadata-rejection (0.67s)
--- PASS: TestDirectUploadRecoveryFailures/database-disconnect (0.71s)
=== RUN TestDirectUploadRecoveryProcessExit
--- PASS: TestDirectUploadRecoveryProcessExit (0.85s)
=== RUN TestDirectUploadRecoverySharedSlotAndCancellation
--- PASS: TestDirectUploadRecoverySharedSlotAndCancellation (0.63s)
PASS
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## Реализация
- [src/backend/repositories/direct_upload.go](../../src/backend/repositories/direct_upload.go)
- [src/frontend/src/directUpload.ts](../../src/frontend/src/directUpload.ts)
@@ -0,0 +1,39 @@
# Подпись, владелец, размер, SHA-256, MIME и CORS
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadValidationHTTP`, `TestDirectUploadValidationContents`, `TestDirectUploadAccess`, `TestDirectUploadAccessCORS`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
=== RUN TestDirectUploadAccessCORS
--- PASS: TestDirectUploadAccessCORS (0.02s)
=== RUN TestDirectUploadValidationHTTP
--- PASS: TestDirectUploadValidationHTTP (0.69s)
=== RUN TestDirectUploadValidationContents
--- PASS: TestDirectUploadValidationContents (0.82s)
=== RUN TestDirectUploadAccess
--- PASS: TestDirectUploadAccess (1.30s)
PASS
````
## Реализация
- [src/backend/handlers/direct_upload_http.go](../../src/backend/handlers/direct_upload_http.go)
- [src/backend/tests/direct_upload_test.go](../../src/backend/tests/direct_upload_test.go)
- [src/backend/tests/direct_permissions_test.go](../../src/backend/tests/direct_permissions_test.go)
+50
View File
@@ -0,0 +1,50 @@
[
{
"service": "api",
"hostname": "959dccd157e1",
"state": "running",
"health": "healthy"
},
{
"service": "api",
"hostname": "7bdd907a608a",
"state": "running",
"health": "healthy"
},
{
"service": "db",
"hostname": "259b35fab41e",
"state": "running",
"health": "healthy"
},
{
"service": "frontend",
"hostname": "c0bbd38841b9",
"state": "running",
"health": "healthy"
},
{
"service": "haproxy",
"hostname": "e21b07ae8881",
"state": "running",
"health": "healthy"
},
{
"service": "redis",
"hostname": "64a89a43e53b",
"state": "running",
"health": "healthy"
},
{
"service": "s3",
"hostname": "cc9133bc4406",
"state": "running",
"health": "healthy"
},
{
"service": "upload-cleanup",
"hostname": "e163dbec27d2",
"state": "running",
"health": null
}
]
+37
View File
@@ -0,0 +1,37 @@
# Сборка React UI
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## frontend-build
```sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml exec -T frontend npm run build
```
Начало: 2026-10-18T20:41:09.870085+00:00; длительность: 7.214 с; exit code: 0.
````text
> messenger-test-ui@1.0.0 build
> tsc --noEmit && vite build
vite v8.3.0 building client environment for production...
transforming...
✓ 21 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.42 kB │ gzip: 0.31 kB
dist/assets/index-DLiyty6M.css 9.50 kB │ gzip: 2.72 kB
dist/assets/index-_XVVkjP0.js 241.82 kB │ gzip: 75.95 kB
✓ built in 2.69s
````
## Реализация
- [src/frontend/src/App.tsx](../../src/frontend/src/App.tsx)
- [src/frontend/src/AttachmentImage.tsx](../../src/frontend/src/AttachmentImage.tsx)
- [src/frontend/src/directUpload.ts](../../src/frontend/src/directUpload.ts)
+481
View File
@@ -0,0 +1,481 @@
# Сессия, метаданные и оригинал после restart
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## before-restart
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:41:56.334689+00:00; длительность: 0.669 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:24.516118521Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:37.447855485Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:50.41521695Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:49.925277255Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:52.124509294Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## persistence
```sh
make test-persistence ACTION_SCRIPT=scripts/restart.sh
```
Начало: 2026-10-18T20:41:57.035205+00:00; длительность: 15.362 с; exit code: 0.
````text
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
````
## after-restart
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:42:12.429373+00:00; длительность: 0.660 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.941585408Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:06.080394151Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.024663538Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.39677266Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.1118558Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.349056081Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.681167653Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.78951003Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## restart-audit
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe restart --before /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/criteria/runs/20261018T203755.405686Z/before-restart.txt --after /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/criteria/runs/20261018T203755.405686Z/after-restart.txt
```
Начало: 2026-10-18T20:42:13.123287+00:00; длительность: 0.165 с; exit code: 0.
````text
PASS: real restart db; same containers and persistent volumes
PASS: real restart redis; same containers and persistent volumes
PASS: real restart s3; same containers and persistent volumes
PASS: real restart api; same containers and persistent volumes
PASS: real restart upload-cleanup; same containers and persistent volumes
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## Реализация
- [scripts/restart.sh](../../scripts/restart.sh)
- [tests/resilience.py](../../tests/resilience.py)
+44
View File
@@ -0,0 +1,44 @@
# PNG/JPEG, ready, сообщение и побайтный download
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentAccessHTTP`.
## proxy
```sh
make test-grade3
```
Начало: 2026-10-18T20:41:01.363701+00:00; длительность: 3.645 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080"
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestAttachmentAccessHTTP
--- PASS: TestAttachmentAccessHTTP (1.08s)
PASS
````
## Реализация
- [src/backend/services/attachment.go](../../src/backend/services/attachment.go)
- [src/backend/handlers/attachment_http.go](../../src/backend/handlers/attachment_http.go)
- [src/backend/repositories/attachment.go](../../src/backend/repositories/attachment.go)
+38
View File
@@ -0,0 +1,38 @@
# Публичный smoke и структура контракта
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## structure
```sh
make check
```
Начало: 2026-10-18T20:38:16.782745+00:00; длительность: 16.132 с; exit code: 0.
````text
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
````
## smoke
```sh
make test
```
Начало: 2026-10-18T20:38:32.945680+00:00; длительность: 8.175 с; exit code: 0.
````text
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
````
## Реализация
- [tests/smoke.py](../../tests/smoke.py)
- [contracts/openapi.json](../../contracts/openapi.json)
+128
View File
@@ -0,0 +1,128 @@
# Оригинал после остановки обслужившей API
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## proxy-failures
```sh
make test-grade3-failures
```
Начало: 2026-10-18T20:41:17.113921+00:00; длительность: 42.575 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080" --failures
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
PASS: stop the uploading replica, download from the other (both replicas)
PASS: S3 unavailable/recovery, private bucket
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## public-failover
```sh
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
```
Начало: 2026-10-18T20:42:54.991730+00:00; длительность: 18.692 с; exit code: 0.
````text
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 2, "first_recovery_seconds": 1.793}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
````
## restore
```sh
make app-start
```
Начало: 2026-10-18T20:43:17.143841+00:00; длительность: 9.220 с; exit code: 0.
````text
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --no-build --wait
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-frontend-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Starting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Started
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-redis-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Healthy
Container highload-lab4-redis-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
````
## Реализация
- [scripts/check_grade3.py](../../scripts/check_grade3.py)
- [scripts/check_direct_upload.py](../../scripts/check_direct_upload.py)
- [scripts/stop-one.sh](../../scripts/stop-one.sh)
@@ -0,0 +1,201 @@
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.941585408Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:06.080394151Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.024663538Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.39677266Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.1118558Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.349056081Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.681167653Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.78951003Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
@@ -0,0 +1,532 @@
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml --profile test run --build --rm backend-tests
Image highload-lab4-s3-bootstrap Building
Image highload-lab4-s3 Building
#1 [internal] load local bake definitions
#1 reading from stdin 1.08kB done
#1 DONE 0.0s
#2 [s3 internal] load build definition from minio.Dockerfile
#2 DONE 0.0s
#3 [s3-bootstrap internal] load build definition from Dockerfile
#3 transferring dockerfile: 661B 0.0s done
#3 DONE 0.1s
#4 [s3-bootstrap internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#4 DONE 0.0s
#2 [s3 internal] load build definition from minio.Dockerfile
#2 transferring dockerfile: 1.01kB 0.0s done
#2 DONE 0.1s
#5 [s3 internal] load metadata for docker.io/library/debian:12.15-slim
#5 DONE 0.0s
#6 [s3-bootstrap internal] load .dockerignore
#6 transferring context: 268B 0.0s done
#6 DONE 0.1s
#7 [s3 internal] load metadata for docker.io/library/golang:1.24.2-bookworm
#7 ...
#8 [s3-bootstrap stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#8 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.0s done
#8 DONE 0.0s
#9 [s3-bootstrap builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#9 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.0s done
#9 DONE 0.0s
#10 [s3-bootstrap internal] load build context
#10 ...
#7 [s3 internal] load metadata for docker.io/library/golang:1.24.2-bookworm
#7 DONE 0.6s
#10 [s3-bootstrap internal] load build context
#10 transferring context: 4.39kB 0.5s done
#10 DONE 0.5s
#8 [s3 stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#8 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.0s done
#8 DONE 0.0s
#11 [s3 internal] load .dockerignore
#11 transferring context: 2B 0.0s done
#11 DONE 0.0s
#12 [s3-bootstrap builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#12 CACHED
#13 [s3-bootstrap builder 3/6] COPY go.mod go.sum ./
#13 CACHED
#14 [s3-bootstrap builder 4/6] RUN go mod download
#14 CACHED
#15 [s3-bootstrap builder 2/6] WORKDIR /src
#15 CACHED
#16 [s3-bootstrap stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#16 CACHED
#17 [s3-bootstrap builder 5/6] COPY backend ./backend
#17 CACHED
#18 [s3-bootstrap stage-1 3/4] WORKDIR /app
#18 CACHED
#19 [s3-bootstrap stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#19 CACHED
#20 [s3 builder 1/4] FROM docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71
#20 resolve docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71 0.0s done
#20 DONE 0.1s
#21 [s3 builder 3/4] RUN git init . && git remote add origin https://github.com/minio/minio.git && git fetch --depth 1 origin 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e && git checkout --detach FETCH_HEAD
#21 CACHED
#22 [s3 builder 4/4] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e" -o /out/minio .
#22 CACHED
#23 [s3 stage-1 2/3] RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* && groupadd --system storage && useradd --system --gid storage storage && mkdir /data && chown storage:storage /data
#23 CACHED
#24 [s3 builder 2/4] WORKDIR /source
#24 CACHED
#25 [s3 stage-1 3/3] COPY --from=builder /out/minio /usr/local/bin/minio
#25 CACHED
#26 [s3-bootstrap] exporting to image
#26 exporting layers done
#26 exporting manifest sha256:dd2bbbd4483023e5124c00da1cc13633ac948721c55e0bf6a6bf7331c0cd06e4 done
#26 exporting config sha256:6c819718ab87aac477b0a779c7763274bbabe01223ec05eb372077f96b98adb3 done
#26 exporting attestation manifest sha256:4e1cb2592720a346fc681606478951a95ab5589711c24ef1b8fc42c20f4e3b75 0.0s done
#26 exporting manifest list sha256:c9a7613d41fc469eeb618c2f607be411e843916ca216449c6c9ce41ea0afadc7 0.0s done
#26 naming to docker.io/library/highload-lab4-s3-bootstrap:latest done
#26 unpacking to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#26 DONE 0.2s
#27 [s3] exporting to image
#27 exporting layers done
#27 exporting manifest sha256:cf1641bb428d024d81f932bd8ab277ade2790aa5cb2ec1b90238a00df54ccbee done
#27 exporting config sha256:b261b45a54ac72fb091ebba0c6b5e09aedc1239e48fe469c1d81ae7ea23621e6 0.0s done
#27 exporting attestation manifest sha256:d90f5c8d3d8cf65e8e6d336fc2c8212925adacea602e77273e6ea83e522f322d 0.0s done
#27 exporting manifest list sha256:abb33d1db0688c1b340efeafa81f0a188fae5d2e7d5104682908e1f8b67b546a 0.0s done
#27 naming to docker.io/library/highload-lab4-s3:latest done
#27 unpacking to docker.io/library/highload-lab4-s3:latest 0.0s done
#27 DONE 0.2s
#28 [s3-bootstrap] resolving provenance for metadata file
#28 DONE 0.0s
#29 [s3] resolving provenance for metadata file
#29 DONE 0.0s
Image highload-lab4-s3 Built
Image highload-lab4-s3-bootstrap Built
Container highload-lab4-db-1 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-s3-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-s3-bootstrap-1 Started
Image highload-lab4-backend-tests Building
#1 [internal] load local bake definitions
#1 reading from stdin 1.58kB done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.1s
#3 [internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#3 DONE 0.0s
#4 [internal] load .dockerignore
#4 transferring context: 33B
#4 transferring context: 268B 0.0s done
#4 DONE 0.0s
#5 [builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#5 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.0s done
#5 DONE 0.0s
#6 [internal] load build context
#6 transferring context: 4.39kB 0.5s done
#6 DONE 0.5s
#7 [builder 2/6] WORKDIR /src
#7 CACHED
#8 [builder 3/6] COPY go.mod go.sum ./
#8 CACHED
#9 [builder 4/6] RUN go mod download
#9 CACHED
#10 [builder 5/6] COPY backend ./backend
#10 CACHED
#11 [builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#11 CACHED
#12 exporting to image
#12 exporting layers done
#12 exporting manifest sha256:342fd07d626776537b397a8a6f8baa4b8bec9db010893bfeabc0e8a36b55cfd5 done
#12 exporting config sha256:45a05b24d4b61e41474a7ec0815634ba3ad8e46f9a02c6fd53f1c2d40b9d7429 done
#12 exporting attestation manifest sha256:b6e80a9d1751b9d695420b019bb354ec1ef2aee3464db8fa7a3193f12d326dae
#12 exporting attestation manifest sha256:b6e80a9d1751b9d695420b019bb354ec1ef2aee3464db8fa7a3193f12d326dae 0.0s done
#12 exporting manifest list sha256:f62521487a7e8ce67a1e92cae7a493447885d87d99c6ef8e28942a5e3af2c66e 0.0s done
#12 naming to docker.io/library/highload-lab4-backend-tests:latest done
#12 unpacking to docker.io/library/highload-lab4-backend-tests:latest 0.0s done
#12 DONE 0.1s
#13 resolving provenance for metadata file
#13 DONE 0.0s
Image highload-lab4-backend-tests Built
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-db-1 Healthy
Container highload-lab4-redis-1 Healthy
Container highload-lab4-backend-tests-run-3c4d84766446 Creating
Container highload-lab4-backend-tests-run-3c4d84766446 Created
? messenger/src/backend [no test files]
? messenger/src/backend/handlers [no test files]
? messenger/src/backend/repositories [no test files]
? messenger/src/backend/services [no test files]
=== RUN TestAttachmentCleanupGraceLocksProtectionAndRetry
--- PASS: TestAttachmentCleanupGraceLocksProtectionAndRetry (0.88s)
=== RUN TestAttachmentCleanupInvalidKeyIsNeverDeleted
--- PASS: TestAttachmentCleanupInvalidKeyIsNeverDeleted (0.61s)
=== RUN TestAttachmentValidationHTTP
--- PASS: TestAttachmentValidationHTTP (1.47s)
=== RUN TestAttachmentAccessHTTP
--- PASS: TestAttachmentAccessHTTP (1.08s)
=== RUN TestUploadRecoveryHTTPDisconnect
--- PASS: TestUploadRecoveryHTTPDisconnect (1.09s)
=== RUN TestAttachmentImageValidation
--- PASS: TestAttachmentImageValidation (0.00s)
=== RUN TestAttachmentFilenameValidation
--- PASS: TestAttachmentFilenameValidation (0.00s)
=== RUN TestAttachmentMessageRequiresStringText
--- PASS: TestAttachmentMessageRequiresStringText (0.59s)
=== RUN TestConcurrentMessageCreation
--- PASS: TestConcurrentMessageCreation (3.88s)
=== RUN TestConnectionFilesTakePrecedence
--- PASS: TestConnectionFilesTakePrecedence (0.00s)
=== RUN TestConfiguredIdempotencyTTL
--- PASS: TestConfiguredIdempotencyTTL (0.62s)
=== RUN TestInvalidIdempotencyTTL
--- PASS: TestInvalidIdempotencyTTL (0.00s)
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/user_id/not-a-uuid
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/chat_id/not-a-uuid
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/chat_id/not-a-uuid
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/message_id/not-a-uuid
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/user_id/ffffffff-ffff-ffff-ffff-fffffffffffz
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/chat_id/ffffffff-ffff-ffff-ffff-fffffffffffz
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/chat_id/ffffffff-ffff-ffff-ffff-fffffffffffz
=== RUN TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/message_id/ffffffff-ffff-ffff-ffff-fffffffffffz
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/user_id/not-a-uuid (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/chat_id/not-a-uuid (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/chat_id/not-a-uuid (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/message_id/not-a-uuid (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/user_id/ffffffff-ffff-ffff-ffff-fffffffffffz (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/chats/chat_id/ffffffff-ffff-ffff-ffff-fffffffffffz (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/chat_id/ffffffff-ffff-ffff-ffff-fffffffffffz (0.00s)
--- PASS: TestCursorRejectsInvalidUUIDBeforeDatabaseAccess/messages/message_id/ffffffff-ffff-ffff-ffff-fffffffffffz (0.00s)
=== RUN TestChatCursorPreservesPosition
--- PASS: TestChatCursorPreservesPosition (0.00s)
=== RUN TestDirectUploadCleanupSafetyAndReplay
--- PASS: TestDirectUploadCleanupSafetyAndReplay (0.87s)
=== RUN TestDirectUploadCleanupDependencyFailureAndMalformedKey
--- PASS: TestDirectUploadCleanupDependencyFailureAndMalformedKey (0.66s)
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
=== RUN TestDirectUploadAccessCORS
--- PASS: TestDirectUploadAccessCORS (0.02s)
=== RUN TestDirectUploadFlow
--- PASS: TestDirectUploadFlow (0.76s)
=== RUN TestDirectUploadValidationHTTP
--- PASS: TestDirectUploadValidationHTTP (0.69s)
=== RUN TestDirectUploadValidationContents
--- PASS: TestDirectUploadValidationContents (0.82s)
=== RUN TestDirectUploadAccess
--- PASS: TestDirectUploadAccess (1.30s)
=== RUN TestDirectUploadRecoveryConcurrentComplete
--- PASS: TestDirectUploadRecoveryConcurrentComplete (0.61s)
=== RUN TestDirectUploadRecoveryFailures
=== RUN TestDirectUploadRecoveryFailures/copy-result-loss
=== RUN TestDirectUploadRecoveryFailures/get-failure
=== RUN TestDirectUploadRecoveryFailures/metadata-rejection
=== RUN TestDirectUploadRecoveryFailures/database-disconnect
--- PASS: TestDirectUploadRecoveryFailures (2.66s)
--- PASS: TestDirectUploadRecoveryFailures/copy-result-loss (0.66s)
--- PASS: TestDirectUploadRecoveryFailures/get-failure (0.62s)
--- PASS: TestDirectUploadRecoveryFailures/metadata-rejection (0.67s)
--- PASS: TestDirectUploadRecoveryFailures/database-disconnect (0.71s)
=== RUN TestDirectUploadRecoveryProcessExit
--- PASS: TestDirectUploadRecoveryProcessExit (0.85s)
=== RUN TestDirectUploadCrashHelper
--- PASS: TestDirectUploadCrashHelper (0.00s)
=== RUN TestDirectUploadRecoverySharedSlotAndCancellation
--- PASS: TestDirectUploadRecoverySharedSlotAndCancellation (0.63s)
=== RUN TestConcurrentRegistrationSameUsername
--- PASS: TestConcurrentRegistrationSameUsername (1.18s)
=== RUN TestChatTransactionRollsBackAfterMemberInsertFailure
--- PASS: TestChatTransactionRollsBackAfterMemberInsertFailure (1.30s)
=== RUN TestShortSessionTTLAndLogout
grade4_lab2_test.go:118: GET /api/v1/users/me: HTTP 200
grade4_lab2_test.go:134: SESSION_TTL_SECONDS=2: expiry observed after 2.055101347s
grade4_lab2_test.go:135: GET /api/v1/users/me: HTTP 401
grade4_lab2_test.go:146: GET /api/v1/users/me: HTTP 401
--- PASS: TestShortSessionTTLAndLogout (2.68s)
=== RUN TestWrongPasswordAndLogoutHTTP
--- PASS: TestWrongPasswordAndLogoutHTTP (1.27s)
=== RUN TestDependencyFailuresReturnUnavailable
redis: 2026/10/18 20:40:44 pool.go:426: redis: connection pool: failed to dial after 5 attempts: dial tcp 127.0.0.1:1: connect: connection refused
redis: 2026/10/18 20:40:44 pool.go:426: redis: connection pool: failed to dial after 5 attempts: dial tcp 127.0.0.1:1: connect: connection refused
redis: 2026/10/18 20:40:45 pool.go:426: redis: connection pool: failed to dial after 5 attempts: dial tcp 127.0.0.1:1: connect: connection refused
--- PASS: TestDependencyFailuresReturnUnavailable (2.40s)
=== RUN TestHistoryQueryPlanAtTenThousandMessages
=== RUN TestHistoryQueryPlanAtTenThousandMessages/first
grade4_lab2_test.go:281: first page EXPLAIN (ANALYZE, BUFFERS): [
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 0.29,
"Total Cost": 4.29,
"Plan Rows": 51,
"Plan Width": 69,
"Actual Startup Time": 0.020,
"Actual Total Time": 0.033,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 3,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Plans": [
{
"Node Type": "Index Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Scan Direction": "Forward",
"Index Name": "messages_history_idx",
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.29,
"Total Cost": 784.70,
"Plan Rows": 9999,
"Plan Width": 69,
"Actual Startup Time": 0.019,
"Actual Total Time": 0.027,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = 'b223d993-d605-4bfe-8035-435c9ede3221'::uuid) AND (ROW(created_at, id) > ROW('0001-01-01 00:00:00+00'::timestamp with time zone, '00000000-0000-0000-0000-000000000000'::uuid)))",
"Rows Removed by Index Recheck": 0,
"Shared Hit Blocks": 3,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
}
]
},
"Planning": {
"Shared Hit Blocks": 6,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.144,
"Triggers": [
],
"Execution Time": 0.176
}
]
=== RUN TestHistoryQueryPlanAtTenThousandMessages/late
grade4_lab2_test.go:281: late page EXPLAIN (ANALYZE, BUFFERS): [
{
"Plan": {
"Node Type": "Limit",
"Parallel Aware": false,
"Async Capable": false,
"Startup Cost": 0.29,
"Total Cost": 14.48,
"Plan Rows": 51,
"Plan Width": 69,
"Actual Startup Time": 0.029,
"Actual Total Time": 0.049,
"Actual Rows": 51,
"Actual Loops": 1,
"Shared Hit Blocks": 3,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0,
"Plans": [
{
"Node Type": "Index Scan",
"Parent Relationship": "Outer",
"Parallel Aware": false,
"Async Capable": false,
"Scan Direction": "Forward",
"Index Name": "messages_history_idx",
"Relation Name": "messages",
"Alias": "messages",
"Startup Cost": 0.29,
"Total Cost": 278.27,
"Plan Rows": 999,
"Plan Width": 69,
"Actual Startup Time": 0.028,
"Actual Total Time": 0.042,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = 'b223d993-d605-4bfe-8035-435c9ede3221'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009001+00'::timestamp with time zone, '8d5d01eb-6729-47e0-a7c1-db170ff9ba40'::uuid)))",
"Rows Removed by Index Recheck": 0,
"Shared Hit Blocks": 3,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
}
]
},
"Planning": {
"Shared Hit Blocks": 0,
"Shared Read Blocks": 0,
"Shared Dirtied Blocks": 0,
"Shared Written Blocks": 0,
"Local Hit Blocks": 0,
"Local Read Blocks": 0,
"Local Dirtied Blocks": 0,
"Local Written Blocks": 0,
"Temp Read Blocks": 0,
"Temp Written Blocks": 0
},
"Planning Time": 0.124,
"Triggers": [
],
"Execution Time": 0.073
}
]
--- PASS: TestHistoryQueryPlanAtTenThousandMessages (0.75s)
--- PASS: TestHistoryQueryPlanAtTenThousandMessages/first (0.00s)
--- PASS: TestHistoryQueryPlanAtTenThousandMessages/late (0.00s)
=== RUN TestIdempotencyConcurrentStoresAndScopes
--- PASS: TestIdempotencyConcurrentStoresAndScopes (1.24s)
=== RUN TestIdempotencyRecordFailureRollsBackMessage
--- PASS: TestIdempotencyRecordFailureRollsBackMessage (0.58s)
=== RUN TestMessengerWorkflow
--- PASS: TestMessengerWorkflow (0.92s)
=== RUN TestDecodeJSONBodyRequiresExactFieldNames
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/canonical
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/escaped_canonical_name
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/uppercase_extra
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/uppercase_extra_first
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/mixed_case
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/uppercase_attachments
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/escaped_uppercase
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/unknown_field
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/wrong_type
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/null
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/array
=== RUN TestDecodeJSONBodyRequiresExactFieldNames/trailing_object
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames (0.58s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/canonical (0.01s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/escaped_canonical_name (0.01s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/uppercase_extra (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/uppercase_extra_first (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/mixed_case (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/uppercase_attachments (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/escaped_uppercase (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/unknown_field (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/wrong_type (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/null (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/array (0.00s)
--- PASS: TestDecodeJSONBodyRequiresExactFieldNames/trailing_object (0.00s)
=== RUN TestCreateMessageBlankText
--- PASS: TestCreateMessageBlankText (0.54s)
=== RUN TestCreateMessageFromChatOutsider
--- PASS: TestCreateMessageFromChatOutsider (0.88s)
=== RUN TestListMessagesPagination
--- PASS: TestListMessagesPagination (0.55s)
=== RUN TestListPageByChatUsesCursorAndLimit
--- PASS: TestListPageByChatUsesCursorAndLimit (0.53s)
=== RUN TestListPageByChatReturnsNonNilEmptyPage
--- PASS: TestListPageByChatReturnsNonNilEmptyPage (0.19s)
=== RUN TestS3PermissionsAndBootstrap
--- PASS: TestS3PermissionsAndBootstrap (0.92s)
=== RUN TestPasswordKDFUsesSaltAndFullUTF8Password
--- PASS: TestPasswordKDFUsesSaltAndFullUTF8Password (1.37s)
=== RUN TestStoredPasswordUsesArgon2id
--- PASS: TestStoredPasswordUsesArgon2id (0.62s)
=== RUN TestBearerRequiredIgnoresXUserID
--- PASS: TestBearerRequiredIgnoresXUserID (0.00s)
=== RUN TestMessageCursorPreservesPosition
--- PASS: TestMessageCursorPreservesPosition (0.00s)
=== RUN TestUploadRecoveryAfterPutFailure
--- PASS: TestUploadRecoveryAfterPutFailure (0.58s)
=== RUN TestUploadRecoveryMetadataRejection
--- PASS: TestUploadRecoveryMetadataRejection (0.60s)
=== RUN TestUploadRecoveryDatabaseConnectionLoss
--- PASS: TestUploadRecoveryDatabaseConnectionLoss (0.62s)
=== RUN TestUploadRecoveryProcessExit
--- PASS: TestUploadRecoveryProcessExit (0.67s)
=== RUN TestUploadCrashHelper
--- PASS: TestUploadCrashHelper (0.00s)
=== RUN TestUploadRecoveryInterruptedBody
--- PASS: TestUploadRecoveryInterruptedBody (0.55s)
=== RUN TestUploadRecoveryWaitingCancellation
--- PASS: TestUploadRecoveryWaitingCancellation (0.60s)
=== RUN TestCreateUserInvalidJSON
--- PASS: TestCreateUserInvalidJSON (0.00s)
=== RUN TestCreateUserDuplicateUsername
--- PASS: TestCreateUserDuplicateUsername (0.87s)
=== RUN TestCaseVariantExtraFieldsReturn400WithoutSaving
--- PASS: TestCaseVariantExtraFieldsReturn400WithoutSaving (0.60s)
=== RUN TestChatRejectsCaseVariantDuplicateMembersBeforeSQL
--- PASS: TestChatRejectsCaseVariantDuplicateMembersBeforeSQL (0.00s)
=== RUN TestChatNormalizesMemberUUIDsHTTP
--- PASS: TestChatNormalizesMemberUUIDsHTTP (0.56s)
PASS
ok messenger/src/backend/tests 46.524s
@@ -0,0 +1,52 @@
# Возможности lab3
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestStoredPasswordUsesArgon2id`, `TestShortSessionTTLAndLogout`, `TestIdempotencyConcurrentStoresAndScopes`, `TestChatTransactionRollsBackAfterMemberInsertFailure`, `TestListMessagesPagination`.
## baseline
```sh
make test-baseline
```
Начало: 2026-10-18T20:38:39.428018+00:00; длительность: 1.345 с; exit code: 0.
````text
python3 scripts/check_baseline.py --base-url "http://localhost:8080"
PASS: transferred API, shared sessions, chat, message, logout
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestChatTransactionRollsBackAfterMemberInsertFailure
--- PASS: TestChatTransactionRollsBackAfterMemberInsertFailure (1.30s)
=== RUN TestShortSessionTTLAndLogout
--- PASS: TestShortSessionTTLAndLogout (2.68s)
=== RUN TestIdempotencyConcurrentStoresAndScopes
--- PASS: TestIdempotencyConcurrentStoresAndScopes (1.24s)
=== RUN TestListMessagesPagination
--- PASS: TestListMessagesPagination (0.55s)
=== RUN TestStoredPasswordUsesArgon2id
--- PASS: TestStoredPasswordUsesArgon2id (0.62s)
PASS
````
## Реализация
- [src/backend/repositories/idempotency.go](../../../../src/backend/repositories/idempotency.go)
- [src/backend/repositories/redis.go](../../../../src/backend/repositories/redis.go)
- [src/backend/services/password.go](../../../../src/backend/services/password.go)
@@ -0,0 +1,2 @@
python3 scripts/check_baseline.py --base-url "http://localhost:8080"
PASS: transferred API, shared sessions, chat, message, logout
@@ -0,0 +1,201 @@
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:24.516118521Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:37.447855485Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:50.41521695Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:49.925277255Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:52.124509294Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
@@ -0,0 +1,257 @@
# Потоковая обработка, лимиты и ≥10 клиентов
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## inventory
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:38:15.728752+00:00; длительность: 0.679 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:36:24.367291372Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.89479619Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.043221163Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:50.058525711Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.399345399Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## experiment
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe experiment --campaign /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/upload-comparison/20261018T193626Z-formal-f49d61
```
Начало: 2026-10-18T20:43:13.717511+00:00; длительность: 3.393 с; exit code: 0.
````text
PASS: sealed protocol, archive, fixtures, raw records and recomputed decision match
Campaign: evidence/upload-comparison/20261018T193626Z-formal-f49d61
Ready/verified: 720 720
Errors: 0
{"profile": "small-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.5065773906213067, "min_traffic_ratio": 0.5063861055246678, "max_traffic_ratio": 0.5079907229528128}
{"profile": "large-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.49949754357270226, "min_traffic_ratio": 0.4991382402982068, "max_traffic_ratio": 0.49981732427785186}
{"profile": "small-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.5126058228037882, "min_traffic_ratio": 0.50707065100036, "max_traffic_ratio": 0.512817391975545}
{"profile": "large-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.49928261799970935, "min_traffic_ratio": 0.4992082132615818, "max_traffic_ratio": 0.49959788796606974}
{"profile": "small-moderate", "mode": "proxy", "median_api_MiB_per_ready": 2.0209168752034503, "median_api_window_peak_MiB": 136.0546875, "max_api_lifetime_peak_MiB": 141.2265625, "median_ready_rps": 7.894590746470929, "median_p50_s": 0.13762395, "median_p95_s": 0.349706212, "median_p99_s": 0.353454295}
{"profile": "small-moderate", "mode": "direct", "median_api_MiB_per_ready": 1.0233642260233562, "median_api_window_peak_MiB": 138.71875, "max_api_lifetime_peak_MiB": 140.8125, "median_ready_rps": 6.6154831177570035, "median_p50_s": 0.330249949, "median_p95_s": 0.664536392, "median_p99_s": 0.665379127}
{"profile": "large-moderate", "mode": "proxy", "median_api_MiB_per_ready": 20.11448278427124, "median_api_window_peak_MiB": 148.44140625, "max_api_lifetime_peak_MiB": 152.44921875, "median_ready_rps": 4.708766693021728, "median_p50_s": 0.623532216, "median_p95_s": 1.199421251, "median_p99_s": 1.370958831}
{"profile": "large-moderate", "mode": "direct", "median_api_MiB_per_ready": 10.044582716623943, "median_api_window_peak_MiB": 147.1796875, "max_api_lifetime_peak_MiB": 150.04296875, "median_ready_rps": 3.1121213975127984, "median_p50_s": 1.760060342, "median_p95_s": 2.429332421, "median_p99_s": 2.519360375}
{"profile": "small-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 2.0204983075459797, "median_api_window_peak_MiB": 381.2734375, "max_api_lifetime_peak_MiB": 384.3203125, "median_ready_rps": 3.145227806944573, "median_p50_s": 1.294338167, "median_p95_s": 2.522289981, "median_p99_s": 2.55024115}
{"profile": "small-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 1.0358009020487466, "median_api_window_peak_MiB": 384.0546875, "max_api_lifetime_peak_MiB": 387.94140625, "median_ready_rps": 2.8002143610390253, "median_p50_s": 1.645604573, "median_p95_s": 3.186833871, "median_p99_s": 3.235123098}
{"profile": "large-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 20.120631217956543, "median_api_window_peak_MiB": 391.99609375, "max_api_lifetime_peak_MiB": 393.2578125, "median_ready_rps": 2.3240187390207696, "median_p50_s": 1.835096441, "median_p95_s": 3.14764051, "median_p99_s": 3.996668065}
{"profile": "large-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 10.045849291483561, "median_api_window_peak_MiB": 393.05859375, "max_api_lifetime_peak_MiB": 397.359375, "median_ready_rps": 1.780860551975933, "median_p50_s": 3.21658326, "median_p95_s": 5.166217115, "median_p99_s": 5.44240128}
Decision: confirmed_in_tested_conditions
````
## Реализация
- [src/backend/services/attachment.go](../../../../src/backend/services/attachment.go)
- [src/backend/services/direct_upload.go](../../../../src/backend/services/direct_upload.go)
- [experiments/config/protocol.json](../../../../experiments/config/protocol.json)
Измерения не запускались повторно: проверены сохранённые сырые данные.
[Серия](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/metrics.json) · [Протокол](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/protocol.json) · [Графики](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/)
@@ -0,0 +1,4 @@
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
File diff suppressed because one or more lines are too long
@@ -0,0 +1,49 @@
# Незавершённый staging, replay, dry-run и lifecycle
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadCleanupSafetyAndReplay`, `TestDirectUploadCleanupDependencyFailureAndMalformedKey`, `TestDirectUploadAccessPermissionsAndLifecycle`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestDirectUploadCleanupSafetyAndReplay
--- PASS: TestDirectUploadCleanupSafetyAndReplay (0.87s)
=== RUN TestDirectUploadCleanupDependencyFailureAndMalformedKey
--- PASS: TestDirectUploadCleanupDependencyFailureAndMalformedKey (0.66s)
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
PASS
````
## cleanup-dry-run
```sh
make attachments-cleanup
```
Начало: 2026-10-18T20:41:08.490906+00:00; длительность: 1.327 с; exit code: 0.
````text
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
````
## Реализация
- [src/backend/repositories/direct_cleanup.go](../../../../src/backend/repositories/direct_cleanup.go)
- [src/backend/repositories/s3_admin.go](../../../../src/backend/repositories/s3_admin.go)
@@ -0,0 +1,4 @@
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
@@ -0,0 +1,44 @@
# Presigned POST и неизменяемый готовый оригинал
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadFlow`, `TestDirectUploadRecoveryConcurrentComplete`.
## direct
```sh
/usr/bin/python3 scripts/check_direct_upload.py
```
Начало: 2026-10-18T20:41:05.039812+00:00; длительность: 2.394 с; exit code: 0.
````text
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestDirectUploadFlow
--- PASS: TestDirectUploadFlow (0.76s)
=== RUN TestDirectUploadRecoveryConcurrentComplete
--- PASS: TestDirectUploadRecoveryConcurrentComplete (0.61s)
PASS
````
## Реализация
- [src/backend/services/direct_upload.go](../../../../src/backend/services/direct_upload.go)
- [src/backend/repositories/s3_direct.go](../../../../src/backend/repositories/s3_direct.go)
@@ -0,0 +1,57 @@
# Повторы complete, crash и отмена ожидания
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadRecoveryFailures`, `TestDirectUploadRecoveryProcessExit`, `TestDirectUploadRecoverySharedSlotAndCancellation`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestDirectUploadRecoveryFailures
=== RUN TestDirectUploadRecoveryFailures/copy-result-loss
=== RUN TestDirectUploadRecoveryFailures/get-failure
=== RUN TestDirectUploadRecoveryFailures/metadata-rejection
=== RUN TestDirectUploadRecoveryFailures/database-disconnect
--- PASS: TestDirectUploadRecoveryFailures (2.66s)
--- PASS: TestDirectUploadRecoveryFailures/copy-result-loss (0.66s)
--- PASS: TestDirectUploadRecoveryFailures/get-failure (0.62s)
--- PASS: TestDirectUploadRecoveryFailures/metadata-rejection (0.67s)
--- PASS: TestDirectUploadRecoveryFailures/database-disconnect (0.71s)
=== RUN TestDirectUploadRecoveryProcessExit
--- PASS: TestDirectUploadRecoveryProcessExit (0.85s)
=== RUN TestDirectUploadRecoverySharedSlotAndCancellation
--- PASS: TestDirectUploadRecoverySharedSlotAndCancellation (0.63s)
PASS
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## Реализация
- [src/backend/repositories/direct_upload.go](../../../../src/backend/repositories/direct_upload.go)
- [src/frontend/src/directUpload.ts](../../../../src/frontend/src/directUpload.ts)
@@ -0,0 +1,39 @@
# Подпись, владелец, размер, SHA-256, MIME и CORS
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestDirectUploadValidationHTTP`, `TestDirectUploadValidationContents`, `TestDirectUploadAccess`, `TestDirectUploadAccessCORS`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
=== RUN TestDirectUploadAccessCORS
--- PASS: TestDirectUploadAccessCORS (0.02s)
=== RUN TestDirectUploadValidationHTTP
--- PASS: TestDirectUploadValidationHTTP (0.69s)
=== RUN TestDirectUploadValidationContents
--- PASS: TestDirectUploadValidationContents (0.82s)
=== RUN TestDirectUploadAccess
--- PASS: TestDirectUploadAccess (1.30s)
PASS
````
## Реализация
- [src/backend/handlers/direct_upload_http.go](../../../../src/backend/handlers/direct_upload_http.go)
- [src/backend/tests/direct_upload_test.go](../../../../src/backend/tests/direct_upload_test.go)
- [src/backend/tests/direct_permissions_test.go](../../../../src/backend/tests/direct_permissions_test.go)
@@ -0,0 +1 @@
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
@@ -0,0 +1,17 @@
PASS: sealed protocol, archive, fixtures, raw records and recomputed decision match
Campaign: evidence/upload-comparison/20261018T193626Z-formal-f49d61
Ready/verified: 720 720
Errors: 0
{"profile": "small-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.5065773906213067, "min_traffic_ratio": 0.5063861055246678, "max_traffic_ratio": 0.5079907229528128}
{"profile": "large-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.49949754357270226, "min_traffic_ratio": 0.4991382402982068, "max_traffic_ratio": 0.49981732427785186}
{"profile": "small-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.5126058228037882, "min_traffic_ratio": 0.50707065100036, "max_traffic_ratio": 0.512817391975545}
{"profile": "large-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.49928261799970935, "min_traffic_ratio": 0.4992082132615818, "max_traffic_ratio": 0.49959788796606974}
{"profile": "small-moderate", "mode": "proxy", "median_api_MiB_per_ready": 2.0209168752034503, "median_api_window_peak_MiB": 136.0546875, "max_api_lifetime_peak_MiB": 141.2265625, "median_ready_rps": 7.894590746470929, "median_p50_s": 0.13762395, "median_p95_s": 0.349706212, "median_p99_s": 0.353454295}
{"profile": "small-moderate", "mode": "direct", "median_api_MiB_per_ready": 1.0233642260233562, "median_api_window_peak_MiB": 138.71875, "max_api_lifetime_peak_MiB": 140.8125, "median_ready_rps": 6.6154831177570035, "median_p50_s": 0.330249949, "median_p95_s": 0.664536392, "median_p99_s": 0.665379127}
{"profile": "large-moderate", "mode": "proxy", "median_api_MiB_per_ready": 20.11448278427124, "median_api_window_peak_MiB": 148.44140625, "max_api_lifetime_peak_MiB": 152.44921875, "median_ready_rps": 4.708766693021728, "median_p50_s": 0.623532216, "median_p95_s": 1.199421251, "median_p99_s": 1.370958831}
{"profile": "large-moderate", "mode": "direct", "median_api_MiB_per_ready": 10.044582716623943, "median_api_window_peak_MiB": 147.1796875, "max_api_lifetime_peak_MiB": 150.04296875, "median_ready_rps": 3.1121213975127984, "median_p50_s": 1.760060342, "median_p95_s": 2.429332421, "median_p99_s": 2.519360375}
{"profile": "small-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 2.0204983075459797, "median_api_window_peak_MiB": 381.2734375, "max_api_lifetime_peak_MiB": 384.3203125, "median_ready_rps": 3.145227806944573, "median_p50_s": 1.294338167, "median_p95_s": 2.522289981, "median_p99_s": 2.55024115}
{"profile": "small-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 1.0358009020487466, "median_api_window_peak_MiB": 384.0546875, "max_api_lifetime_peak_MiB": 387.94140625, "median_ready_rps": 2.8002143610390253, "median_p50_s": 1.645604573, "median_p95_s": 3.186833871, "median_p99_s": 3.235123098}
{"profile": "large-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 20.120631217956543, "median_api_window_peak_MiB": 391.99609375, "max_api_lifetime_peak_MiB": 393.2578125, "median_ready_rps": 2.3240187390207696, "median_p50_s": 1.835096441, "median_p95_s": 3.14764051, "median_p99_s": 3.996668065}
{"profile": "large-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 10.045849291483561, "median_api_window_peak_MiB": 393.05859375, "max_api_lifetime_peak_MiB": 397.359375, "median_ready_rps": 1.780860551975933, "median_p50_s": 3.21658326, "median_p95_s": 5.166217115, "median_p99_s": 5.44240128}
Decision: confirmed_in_tested_conditions
@@ -0,0 +1,201 @@
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:43:18.169537722Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:48.242355675Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:44.953066075Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:43:16.829481289Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:44.819950417Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:45.129321274Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:43:16.556487286Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:42:47.900470304Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
@@ -0,0 +1,14 @@
> messenger-test-ui@1.0.0 build
> tsc --noEmit && vite build
vite v8.3.0 building client environment for production...
transforming...
✓ 21 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.42 kB │ gzip: 0.31 kB
dist/assets/index-DLiyty6M.css 9.50 kB │ gzip: 2.72 kB
dist/assets/index-_XVVkjP0.js 241.82 kB │ gzip: 75.95 kB
✓ built in 2.69s
@@ -0,0 +1,37 @@
# Сборка React UI
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## frontend-build
```sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml exec -T frontend npm run build
```
Начало: 2026-10-18T20:41:09.870085+00:00; длительность: 7.214 с; exit code: 0.
````text
> messenger-test-ui@1.0.0 build
> tsc --noEmit && vite build
vite v8.3.0 building client environment for production...
transforming...
✓ 21 modules transformed.
rendering chunks...
computing gzip size...
dist/index.html 0.42 kB │ gzip: 0.31 kB
dist/assets/index-DLiyty6M.css 9.50 kB │ gzip: 2.72 kB
dist/assets/index-_XVVkjP0.js 241.82 kB │ gzip: 75.95 kB
✓ built in 2.69s
````
## Реализация
- [src/frontend/src/App.tsx](../../../../src/frontend/src/App.tsx)
- [src/frontend/src/AttachmentImage.tsx](../../../../src/frontend/src/AttachmentImage.tsx)
- [src/frontend/src/directUpload.ts](../../../../src/frontend/src/directUpload.ts)
@@ -0,0 +1,14 @@
PASS: real restart db; same containers and persistent volumes
PASS: real restart redis; same containers and persistent volumes
PASS: real restart s3; same containers and persistent volumes
PASS: real restart api; same containers and persistent volumes
PASS: real restart upload-cleanup; same containers and persistent volumes
test_every_report_criterion_and_code_link_has_a_definition (test_generate_evidence.EvidenceTests.test_every_report_criterion_and_code_link_has_a_definition) ... ok
test_exit_zero_without_required_test_pass_is_not_evidence (test_generate_evidence.EvidenceTests.test_exit_zero_without_required_test_pass_is_not_evidence) ... ok
test_restart_audit_requires_actual_restart_not_just_ready (test_generate_evidence.EvidenceTests.test_restart_audit_requires_actual_restart_not_just_ready) ... ok
test_secrets_and_signed_fields_are_redacted (test_generate_evidence.EvidenceTests.test_secrets_and_signed_fields_are_redacted) ... ok
----------------------------------------------------------------------
Ran 4 tests in 0.101s
OK
@@ -0,0 +1,201 @@
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:36:24.367291372Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.89479619Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.043221163Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:50.058525711Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.399345399Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
@@ -0,0 +1 @@
PASS: loopback-only private S3, disabled console, restricted API mounts, bounded tmpfs
@@ -0,0 +1,481 @@
# Сессия, метаданные и оригинал после restart
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## before-restart
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:41:56.334689+00:00; длительность: 0.669 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:24.516118521Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:37.447855485Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:50.41521695Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:49.925277255Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:41:52.124509294Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## persistence
```sh
make test-persistence ACTION_SCRIPT=scripts/restart.sh
```
Начало: 2026-10-18T20:41:57.035205+00:00; длительность: 15.362 с; exit code: 0.
````text
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
````
## after-restart
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:42:12.429373+00:00; длительность: 0.660 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.941585408Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:06.080394151Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.024663538Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.39677266Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.1118558Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:01.349056081Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:42:07.681167653Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:42:05.78951003Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## restart-audit
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe restart --before /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/criteria/runs/20261018T203755.405686Z/before-restart.txt --after /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/criteria/runs/20261018T203755.405686Z/after-restart.txt
```
Начало: 2026-10-18T20:42:13.123287+00:00; длительность: 0.165 с; exit code: 0.
````text
PASS: real restart db; same containers and persistent volumes
PASS: real restart redis; same containers and persistent volumes
PASS: real restart s3; same containers and persistent volumes
PASS: real restart api; same containers and persistent volumes
PASS: real restart upload-cleanup; same containers and persistent volumes
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## Реализация
- [scripts/restart.sh](../../../../scripts/restart.sh)
- [tests/resilience.py](../../../../tests/resilience.py)
@@ -0,0 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
@@ -0,0 +1,44 @@
# PNG/JPEG, ready, сообщение и побайтный download
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentAccessHTTP`.
## proxy
```sh
make test-grade3
```
Начало: 2026-10-18T20:41:01.363701+00:00; длительность: 3.645 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080"
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestAttachmentAccessHTTP
--- PASS: TestAttachmentAccessHTTP (1.08s)
PASS
````
## Реализация
- [src/backend/services/attachment.go](../../../../src/backend/services/attachment.go)
- [src/backend/handlers/attachment_http.go](../../../../src/backend/handlers/attachment_http.go)
- [src/backend/repositories/attachment.go](../../../../src/backend/repositories/attachment.go)
@@ -0,0 +1,4 @@
python3 scripts/check_grade3.py --base-url "http://localhost:8080" --failures
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
PASS: stop the uploading replica, download from the other (both replicas)
PASS: S3 unavailable/recovery, private bucket
@@ -0,0 +1,2 @@
python3 scripts/check_grade3.py --base-url "http://localhost:8080"
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 2, "first_recovery_seconds": 1.793}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
@@ -0,0 +1,38 @@
# Публичный smoke и структура контракта
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## structure
```sh
make check
```
Начало: 2026-10-18T20:38:16.782745+00:00; длительность: 16.132 с; exit code: 0.
````text
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
````
## smoke
```sh
make test
```
Начало: 2026-10-18T20:38:32.945680+00:00; длительность: 8.175 с; exit code: 0.
````text
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
````
## Реализация
- [tests/smoke.py](../../../../tests/smoke.py)
- [contracts/openapi.json](../../../../contracts/openapi.json)
@@ -0,0 +1,128 @@
# Оригинал после остановки обслужившей API
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## proxy-failures
```sh
make test-grade3-failures
```
Начало: 2026-10-18T20:41:17.113921+00:00; длительность: 42.575 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080" --failures
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
PASS: stop the uploading replica, download from the other (both replicas)
PASS: S3 unavailable/recovery, private bucket
````
## direct-failures
```sh
/usr/bin/python3 scripts/check_direct_upload.py --failures --restart
```
Начало: 2026-10-18T20:42:13.319145+00:00; длительность: 45.039 с; exit code: 0.
````text
PASS: original survives stopping confirming replica 959dccd157e1
PASS: original survives stopping confirming replica 7bdd907a608a
PASS: session, direct upload receipt, metadata and bytes survive restart
PASS: real S3 form, concurrent complete through two replicas, authorized bytes and attachment-only message
````
## public-failover
```sh
make test-failover ACTION_SCRIPT=scripts/stop-one.sh
```
Начало: 2026-10-18T20:42:54.991730+00:00; длительность: 18.692 с; exit code: 0.
````text
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 124, "failed_attempts": 2, "first_recovery_seconds": 1.793}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
````
## restore
```sh
make app-start
```
Начало: 2026-10-18T20:43:17.143841+00:00; длительность: 9.220 с; exit code: 0.
````text
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --no-build --wait
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-frontend-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Starting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Started
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-redis-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Healthy
Container highload-lab4-redis-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
````
## Реализация
- [scripts/check_grade3.py](../../../../scripts/check_grade3.py)
- [scripts/check_direct_upload.py](../../../../scripts/check_direct_upload.py)
- [scripts/stop-one.sh](../../../../scripts/stop-one.sh)
@@ -0,0 +1,5 @@
PASS: real restart db; same containers and persistent volumes
PASS: real restart redis; same containers and persistent volumes
PASS: real restart s3; same containers and persistent volumes
PASS: real restart api; same containers and persistent volumes
PASS: real restart upload-cleanup; same containers and persistent volumes
@@ -0,0 +1,59 @@
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --no-build --wait
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-frontend-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Starting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-1 Started
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-redis-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Healthy
Container highload-lab4-redis-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
@@ -0,0 +1,44 @@
# Повторяемый bootstrap и ограниченные credentials
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestS3PermissionsAndBootstrap`, `TestDirectUploadAccessPermissionsAndLifecycle`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
=== RUN TestS3PermissionsAndBootstrap
--- PASS: TestS3PermissionsAndBootstrap (0.92s)
PASS
````
## isolation
```sh
/usr/bin/python3 scripts/check_s3_isolation.py
```
Начало: 2026-10-18T20:41:07.464744+00:00; длительность: 0.991 с; exit code: 0.
````text
PASS: loopback-only private S3, disabled console, restricted API mounts, bounded tmpfs
````
## Реализация
- [src/backend/repositories/s3_admin.go](../../../../src/backend/repositories/s3_admin.go)
- [scripts/check_s3_isolation.py](../../../../scripts/check_s3_isolation.py)
@@ -0,0 +1,48 @@
# Grace period, блокировки, защита готовых объектов и повтор
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentCleanupGraceLocksProtectionAndRetry`, `TestAttachmentCleanupInvalidKeyIsNeverDeleted`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestAttachmentCleanupGraceLocksProtectionAndRetry
--- PASS: TestAttachmentCleanupGraceLocksProtectionAndRetry (0.88s)
=== RUN TestAttachmentCleanupInvalidKeyIsNeverDeleted
--- PASS: TestAttachmentCleanupInvalidKeyIsNeverDeleted (0.61s)
PASS
````
## cleanup-dry-run
```sh
make attachments-cleanup
```
Начало: 2026-10-18T20:41:08.490906+00:00; длительность: 1.327 с; exit code: 0.
````text
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
````
## Реализация
- [src/backend/cleanup.go](../../../../src/backend/cleanup.go)
- [src/backend/repositories/cleanup_config.go](../../../../src/backend/repositories/cleanup_config.go)
- [src/backend/repositories/upload.go](../../../../src/backend/repositories/upload.go)
@@ -0,0 +1,5 @@
version | dirty
---------+-------
6 | f
(1 row)
@@ -0,0 +1,579 @@
# Две API, PostgreSQL и приватный S3 в общем стенде
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## startup
```sh
make app-up
```
Начало: 2026-10-18T20:37:55.408721+00:00; длительность: 21.944 с; exit code: 0.
````text
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --build --wait
Image highload-lab4-frontend Building
Image highload-lab4-migrate Building
Image highload-lab4-s3-bootstrap Building
Image highload-lab4-api Building
Image highload-lab4-s3 Building
Image highload-lab4-upload-cleanup Building
#1 [internal] load local bake definitions
#1 reading from stdin 3.08kB done
#1 DONE 0.0s
#2 [api internal] load build definition from Dockerfile
#2 transferring dockerfile:
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.2s
#3 [frontend internal] load build definition from Dockerfile
#3 transferring dockerfile: 181B 0.1s done
#3 DONE 0.2s
#4 [s3 internal] load build definition from minio.Dockerfile
#4 transferring dockerfile: 1.01kB 0.0s done
#4 DONE 0.2s
#5 [upload-cleanup internal] load metadata for docker.io/library/debian:12.15-slim
#5 ...
#6 [frontend internal] load metadata for docker.io/library/node:22-bookworm-slim
#6 DONE 0.5s
#5 [s3 internal] load metadata for docker.io/library/debian:12.15-slim
#5 DONE 0.5s
#7 [api internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#7 DONE 0.5s
#8 [migrate internal] load .dockerignore
#8 transferring context: 268B 0.0s done
#8 DONE 0.0s
#9 [frontend internal] load .dockerignore
#9 transferring context: 58B 0.0s done
#9 DONE 0.1s
#10 [api internal] load build context
#10 DONE 0.0s
#11 [s3-bootstrap stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#12 [s3-bootstrap builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#12 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.1s done
#12 DONE 0.1s
#13 [frontend 1/5] FROM docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c
#13 resolve docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c 0.1s done
#13 DONE 0.1s
#14 [frontend internal] load build context
#14 transferring context: 1.07kB 0.1s done
#14 DONE 0.1s
#15 [frontend 2/5] WORKDIR /app
#15 CACHED
#16 [frontend 3/5] COPY package.json package-lock.json ./
#16 CACHED
#17 [frontend 4/5] RUN npm ci
#17 CACHED
#10 [s3-bootstrap internal] load build context
#10 ...
#18 [frontend 5/5] COPY . .
#18 DONE 0.1s
#10 [s3-bootstrap internal] load build context
#10 ...
#19 [s3 internal] load metadata for docker.io/library/golang:1.24.2-bookworm
#19 DONE 1.0s
#20 [s3 internal] load .dockerignore
#20 transferring context: 2B 0.0s done
#20 DONE 0.0s
#10 [s3-bootstrap internal] load build context
#10 transferring context: 4.39kB 0.5s done
#10 DONE 0.5s
#11 [s3 stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#21 [s3 builder 1/4] FROM docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71
#21 resolve docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71 0.0s done
#21 DONE 0.0s
#22 [s3 stage-1 2/3] RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* && groupadd --system storage && useradd --system --gid storage storage && mkdir /data && chown storage:storage /data
#22 CACHED
#23 [s3 builder 3/4] RUN git init . && git remote add origin https://github.com/minio/minio.git && git fetch --depth 1 origin 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e && git checkout --detach FETCH_HEAD
#23 CACHED
#24 [s3 builder 4/4] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e" -o /out/minio .
#24 CACHED
#25 [s3 builder 2/4] WORKDIR /source
#25 CACHED
#26 [s3 stage-1 3/3] COPY --from=builder /out/minio /usr/local/bin/minio
#26 CACHED
#27 [api stage-1 3/4] WORKDIR /app
#27 CACHED
#28 [api builder 4/6] RUN go mod download
#28 CACHED
#29 [api builder 2/6] WORKDIR /src
#29 CACHED
#30 [api builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#31 [api stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#32 [api builder 5/6] COPY backend ./backend
#32 CACHED
#33 [api builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#34 [api stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#35 [s3] exporting to image
#35 exporting layers done
#35 exporting manifest sha256:cf1641bb428d024d81f932bd8ab277ade2790aa5cb2ec1b90238a00df54ccbee done
#35 exporting config sha256:b261b45a54ac72fb091ebba0c6b5e09aedc1239e48fe469c1d81ae7ea23621e6 done
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9
#35 ...
#28 [s3-bootstrap builder 4/6] RUN go mod download
#28 CACHED
#29 [s3-bootstrap builder 2/6] WORKDIR /src
#29 CACHED
#33 [s3-bootstrap builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#27 [s3-bootstrap stage-1 3/4] WORKDIR /app
#27 CACHED
#31 [s3-bootstrap stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#30 [s3-bootstrap builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#32 [s3-bootstrap builder 5/6] COPY backend ./backend
#32 CACHED
#34 [upload-cleanup stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#36 [frontend] exporting to image
#36 exporting layers 0.1s done
#36 exporting manifest sha256:d59faebffe67b578ba0786caed54363bffa894312c0787d714977eb9bec9799a 0.0s done
#36 exporting config sha256:fb3ba9317f8efad41b9927e041302762863ea60e513b286942022cd88a4ccf3f 0.0s done
#36 exporting attestation manifest sha256:d4458fdb5f8220753cb7ac6be3561ff06e61c9d49e1ef60947bda4fe49215f3b 0.0s done
#36 exporting manifest list sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c 0.0s done
#36 naming to docker.io/library/highload-lab4-frontend:latest done
#36 unpacking to docker.io/library/highload-lab4-frontend:latest 0.1s done
#36 DONE 0.4s
#35 [s3] exporting to image
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9 0.0s done
#35 exporting manifest list sha256:4ba76dc492ca964bc6d3702e4dcd6e7befbe17fb39ac169860624139962b7825 0.1s done
#35 naming to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 unpacking to docker.io/library/highload-lab4-s3:latest
#35 unpacking to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 DONE 0.4s
#37 [upload-cleanup] exporting to image
#37 exporting layers done
#37 exporting manifest sha256:7d4f622a2a83dd1aec3b761e2eaa48032ec8594af604c57033d2b78ab0516eba 0.0s done
#37 exporting config sha256:650babbe6357784df8340e53537cec18e70beebc11d5a478528daf3c4a46800b 0.0s done
#37 exporting attestation manifest sha256:66d7cb5be9afd6a4fb83c889db7d4f168f479593edebbf627245ba3e617755f6 0.1s done
#37 exporting manifest list sha256:64ccebc0240289b7f87b7f15f05b4a5cefa3a62c0dc1487f58a80ca4dff51ffb 0.1s done
#37 naming to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 DONE 0.5s
#38 [s3-bootstrap] exporting to image
#38 exporting layers done
#38 exporting manifest sha256:dd2bbbd4483023e5124c00da1cc13633ac948721c55e0bf6a6bf7331c0cd06e4 0.0s done
#38 exporting config sha256:6c819718ab87aac477b0a779c7763274bbabe01223ec05eb372077f96b98adb3 0.0s done
#38 exporting attestation manifest sha256:5c621aa3c04fb990da97dc1fb103feb5fbb8c3c3c7495589efd9001a823298df 0.1s done
#38 exporting manifest list sha256:87530453dc25cf26f9aab7bb3167e0831af3e0e9233b17eaaa59be4d780f5fa9 0.1s done
#38 naming to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 unpacking to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 DONE 0.5s
#39 [migrate] exporting to image
#39 exporting layers done
#39 exporting manifest sha256:72b55ff56061496e227a3f2d6159efd7619d4ebac3e62a7a292ca38c0aa430e5 0.0s done
#39 exporting config sha256:717f0c6505d0f59b5ff8b1ae4a2ae07241dfd835b97f85ebd54812db3f40df02 0.0s done
#39 exporting attestation manifest sha256:eb8048635d5a2fe19319f95e751bacb7484d8357992fc324e2e5c401359d2df9 0.1s done
#39 exporting manifest list sha256:776406956564b03c4c68fcb0273a0e1d6b86e2c0e2cf9ce3fa82a85762ac0f42 0.1s done
#39 naming to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 unpacking to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 DONE 0.5s
#40 [api] exporting to image
#40 exporting layers done
#40 exporting manifest sha256:9c7d0be760523e4c4a8775f30d52c18f04c9290528e99d8b542474a6941c2843 0.0s done
#40 exporting config sha256:b3dcf18403a7675697043933aee1a0a0f297c459658ffc1dd6f5372060d04942 0.0s done
#40 exporting attestation manifest sha256:8f285c1fdf78dbe48b37e4f39354817556369f0840f24e91a8671ebf84b2ba25 0.1s done
#40 exporting manifest list sha256:e5149bb9db200a2bcfeadde9eb676add0e9fa7f2a6018069212387cce6467dba 0.1s done
#40 naming to docker.io/library/highload-lab4-api:latest 0.0s done
#40 unpacking to docker.io/library/highload-lab4-api:latest 0.1s done
#40 DONE 0.5s
#41 [frontend] resolving provenance for metadata file
#41 ...
#42 [s3] resolving provenance for metadata file
#42 DONE 0.2s
#43 [api] resolving provenance for metadata file
#43 DONE 0.0s
#41 [frontend] resolving provenance for metadata file
#41 DONE 0.4s
#44 [migrate] resolving provenance for metadata file
#44 DONE 0.2s
#45 [upload-cleanup] resolving provenance for metadata file
#45 DONE 0.3s
#46 [s3-bootstrap] resolving provenance for metadata file
#46 DONE 0.3s
Image highload-lab4-s3 Built
Image highload-lab4-s3-bootstrap Built
Image highload-lab4-api Built
Image highload-lab4-frontend Built
Image highload-lab4-upload-cleanup Built
Image highload-lab4-migrate Built
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-api-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-frontend-1 Recreate
Container highload-lab4-frontend-1 Recreated
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-migrate-1 Started
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-db-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Starting
Container highload-lab4-frontend-1 Started
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-frontend-1 Healthy
````
## inventory
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:38:15.728752+00:00; длительность: 0.679 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:36:24.367291372Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.89479619Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.043221163Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:50.058525711Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.399345399Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## schema
```sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml exec -T db sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT version, dirty FROM schema_migrations;"'
```
Начало: 2026-10-18T20:38:16.439436+00:00; длительность: 0.315 с; exit code: 0.
````text
version | dirty
---------+-------
6 | f
(1 row)
````
## isolation
```sh
/usr/bin/python3 scripts/check_s3_isolation.py
```
Начало: 2026-10-18T20:41:07.464744+00:00; длительность: 0.991 с; exit code: 0.
````text
PASS: loopback-only private S3, disabled console, restricted API mounts, bounded tmpfs
````
## Реализация
- [compose.yml](../../../../compose.yml)
- [infra/minio.Dockerfile](../../../../infra/minio.Dockerfile)
- [src/backend/repositories/migrations/000004_attachments.up.sql](../../../../src/backend/repositories/migrations/000004_attachments.up.sql)
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
@@ -0,0 +1,316 @@
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --build --wait
Image highload-lab4-frontend Building
Image highload-lab4-migrate Building
Image highload-lab4-s3-bootstrap Building
Image highload-lab4-api Building
Image highload-lab4-s3 Building
Image highload-lab4-upload-cleanup Building
#1 [internal] load local bake definitions
#1 reading from stdin 3.08kB done
#1 DONE 0.0s
#2 [api internal] load build definition from Dockerfile
#2 transferring dockerfile:
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.2s
#3 [frontend internal] load build definition from Dockerfile
#3 transferring dockerfile: 181B 0.1s done
#3 DONE 0.2s
#4 [s3 internal] load build definition from minio.Dockerfile
#4 transferring dockerfile: 1.01kB 0.0s done
#4 DONE 0.2s
#5 [upload-cleanup internal] load metadata for docker.io/library/debian:12.15-slim
#5 ...
#6 [frontend internal] load metadata for docker.io/library/node:22-bookworm-slim
#6 DONE 0.5s
#5 [s3 internal] load metadata for docker.io/library/debian:12.15-slim
#5 DONE 0.5s
#7 [api internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#7 DONE 0.5s
#8 [migrate internal] load .dockerignore
#8 transferring context: 268B 0.0s done
#8 DONE 0.0s
#9 [frontend internal] load .dockerignore
#9 transferring context: 58B 0.0s done
#9 DONE 0.1s
#10 [api internal] load build context
#10 DONE 0.0s
#11 [s3-bootstrap stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#12 [s3-bootstrap builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#12 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.1s done
#12 DONE 0.1s
#13 [frontend 1/5] FROM docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c
#13 resolve docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c 0.1s done
#13 DONE 0.1s
#14 [frontend internal] load build context
#14 transferring context: 1.07kB 0.1s done
#14 DONE 0.1s
#15 [frontend 2/5] WORKDIR /app
#15 CACHED
#16 [frontend 3/5] COPY package.json package-lock.json ./
#16 CACHED
#17 [frontend 4/5] RUN npm ci
#17 CACHED
#10 [s3-bootstrap internal] load build context
#10 ...
#18 [frontend 5/5] COPY . .
#18 DONE 0.1s
#10 [s3-bootstrap internal] load build context
#10 ...
#19 [s3 internal] load metadata for docker.io/library/golang:1.24.2-bookworm
#19 DONE 1.0s
#20 [s3 internal] load .dockerignore
#20 transferring context: 2B 0.0s done
#20 DONE 0.0s
#10 [s3-bootstrap internal] load build context
#10 transferring context: 4.39kB 0.5s done
#10 DONE 0.5s
#11 [s3 stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#21 [s3 builder 1/4] FROM docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71
#21 resolve docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71 0.0s done
#21 DONE 0.0s
#22 [s3 stage-1 2/3] RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* && groupadd --system storage && useradd --system --gid storage storage && mkdir /data && chown storage:storage /data
#22 CACHED
#23 [s3 builder 3/4] RUN git init . && git remote add origin https://github.com/minio/minio.git && git fetch --depth 1 origin 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e && git checkout --detach FETCH_HEAD
#23 CACHED
#24 [s3 builder 4/4] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e" -o /out/minio .
#24 CACHED
#25 [s3 builder 2/4] WORKDIR /source
#25 CACHED
#26 [s3 stage-1 3/3] COPY --from=builder /out/minio /usr/local/bin/minio
#26 CACHED
#27 [api stage-1 3/4] WORKDIR /app
#27 CACHED
#28 [api builder 4/6] RUN go mod download
#28 CACHED
#29 [api builder 2/6] WORKDIR /src
#29 CACHED
#30 [api builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#31 [api stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#32 [api builder 5/6] COPY backend ./backend
#32 CACHED
#33 [api builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#34 [api stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#35 [s3] exporting to image
#35 exporting layers done
#35 exporting manifest sha256:cf1641bb428d024d81f932bd8ab277ade2790aa5cb2ec1b90238a00df54ccbee done
#35 exporting config sha256:b261b45a54ac72fb091ebba0c6b5e09aedc1239e48fe469c1d81ae7ea23621e6 done
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9
#35 ...
#28 [s3-bootstrap builder 4/6] RUN go mod download
#28 CACHED
#29 [s3-bootstrap builder 2/6] WORKDIR /src
#29 CACHED
#33 [s3-bootstrap builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#27 [s3-bootstrap stage-1 3/4] WORKDIR /app
#27 CACHED
#31 [s3-bootstrap stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#30 [s3-bootstrap builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#32 [s3-bootstrap builder 5/6] COPY backend ./backend
#32 CACHED
#34 [upload-cleanup stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#36 [frontend] exporting to image
#36 exporting layers 0.1s done
#36 exporting manifest sha256:d59faebffe67b578ba0786caed54363bffa894312c0787d714977eb9bec9799a 0.0s done
#36 exporting config sha256:fb3ba9317f8efad41b9927e041302762863ea60e513b286942022cd88a4ccf3f 0.0s done
#36 exporting attestation manifest sha256:d4458fdb5f8220753cb7ac6be3561ff06e61c9d49e1ef60947bda4fe49215f3b 0.0s done
#36 exporting manifest list sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c 0.0s done
#36 naming to docker.io/library/highload-lab4-frontend:latest done
#36 unpacking to docker.io/library/highload-lab4-frontend:latest 0.1s done
#36 DONE 0.4s
#35 [s3] exporting to image
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9 0.0s done
#35 exporting manifest list sha256:4ba76dc492ca964bc6d3702e4dcd6e7befbe17fb39ac169860624139962b7825 0.1s done
#35 naming to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 unpacking to docker.io/library/highload-lab4-s3:latest
#35 unpacking to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 DONE 0.4s
#37 [upload-cleanup] exporting to image
#37 exporting layers done
#37 exporting manifest sha256:7d4f622a2a83dd1aec3b761e2eaa48032ec8594af604c57033d2b78ab0516eba 0.0s done
#37 exporting config sha256:650babbe6357784df8340e53537cec18e70beebc11d5a478528daf3c4a46800b 0.0s done
#37 exporting attestation manifest sha256:66d7cb5be9afd6a4fb83c889db7d4f168f479593edebbf627245ba3e617755f6 0.1s done
#37 exporting manifest list sha256:64ccebc0240289b7f87b7f15f05b4a5cefa3a62c0dc1487f58a80ca4dff51ffb 0.1s done
#37 naming to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 DONE 0.5s
#38 [s3-bootstrap] exporting to image
#38 exporting layers done
#38 exporting manifest sha256:dd2bbbd4483023e5124c00da1cc13633ac948721c55e0bf6a6bf7331c0cd06e4 0.0s done
#38 exporting config sha256:6c819718ab87aac477b0a779c7763274bbabe01223ec05eb372077f96b98adb3 0.0s done
#38 exporting attestation manifest sha256:5c621aa3c04fb990da97dc1fb103feb5fbb8c3c3c7495589efd9001a823298df 0.1s done
#38 exporting manifest list sha256:87530453dc25cf26f9aab7bb3167e0831af3e0e9233b17eaaa59be4d780f5fa9 0.1s done
#38 naming to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 unpacking to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 DONE 0.5s
#39 [migrate] exporting to image
#39 exporting layers done
#39 exporting manifest sha256:72b55ff56061496e227a3f2d6159efd7619d4ebac3e62a7a292ca38c0aa430e5 0.0s done
#39 exporting config sha256:717f0c6505d0f59b5ff8b1ae4a2ae07241dfd835b97f85ebd54812db3f40df02 0.0s done
#39 exporting attestation manifest sha256:eb8048635d5a2fe19319f95e751bacb7484d8357992fc324e2e5c401359d2df9 0.1s done
#39 exporting manifest list sha256:776406956564b03c4c68fcb0273a0e1d6b86e2c0e2cf9ce3fa82a85762ac0f42 0.1s done
#39 naming to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 unpacking to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 DONE 0.5s
#40 [api] exporting to image
#40 exporting layers done
#40 exporting manifest sha256:9c7d0be760523e4c4a8775f30d52c18f04c9290528e99d8b542474a6941c2843 0.0s done
#40 exporting config sha256:b3dcf18403a7675697043933aee1a0a0f297c459658ffc1dd6f5372060d04942 0.0s done
#40 exporting attestation manifest sha256:8f285c1fdf78dbe48b37e4f39354817556369f0840f24e91a8671ebf84b2ba25 0.1s done
#40 exporting manifest list sha256:e5149bb9db200a2bcfeadde9eb676add0e9fa7f2a6018069212387cce6467dba 0.1s done
#40 naming to docker.io/library/highload-lab4-api:latest 0.0s done
#40 unpacking to docker.io/library/highload-lab4-api:latest 0.1s done
#40 DONE 0.5s
#41 [frontend] resolving provenance for metadata file
#41 ...
#42 [s3] resolving provenance for metadata file
#42 DONE 0.2s
#43 [api] resolving provenance for metadata file
#43 DONE 0.0s
#41 [frontend] resolving provenance for metadata file
#41 DONE 0.4s
#44 [migrate] resolving provenance for metadata file
#44 DONE 0.2s
#45 [upload-cleanup] resolving provenance for metadata file
#45 DONE 0.3s
#46 [s3-bootstrap] resolving provenance for metadata file
#46 DONE 0.3s
Image highload-lab4-s3 Built
Image highload-lab4-s3-bootstrap Built
Image highload-lab4-api Built
Image highload-lab4-frontend Built
Image highload-lab4-upload-cleanup Built
Image highload-lab4-migrate Built
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-api-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-frontend-1 Recreate
Container highload-lab4-frontend-1 Recreated
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-migrate-1 Started
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-db-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Starting
Container highload-lab4-frontend-1 Started
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-frontend-1 Healthy
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
@@ -0,0 +1,28 @@
{
"run": "20261018T203755.405686Z",
"python": "3.12.3",
"platform": "Linux-6.6.87.1-microsoft-standard-WSL2-x86_64-with-glibc2.39",
"script_sha256": "590edec359e8641ff0723c2be4352f3363b0ef8d2b2bf24509dcd88be0eed102",
"report_sha256": "a389b2e9d05ae7a35a6e1096f70561937dbd004151fa5b2874f5b2b22e46d20b",
"campaign": "evidence/upload-comparison/20261018T193626Z-formal-f49d61",
"criteria": {
"public-smoke": "PASS",
"baseline": "PASS",
"shared-storage": "PASS",
"proxy-attachments": "PASS",
"validation-access": "PASS",
"replica-failover": "PASS",
"persistence": "PASS",
"upload-recovery": "PASS",
"safe-cleanup": "PASS",
"bounded-memory": "PASS",
"s3-permissions": "PASS",
"direct-flow": "PASS",
"direct-validation-access": "PASS",
"direct-recovery": "PASS",
"direct-cleanup": "PASS",
"upload-comparison": "PASS",
"frontend": "PASS"
},
"restored": true
}
@@ -0,0 +1,46 @@
# Гипотеза и сравнение трафика/RAM на четырёх профилях
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## experiment
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe experiment --campaign /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/upload-comparison/20261018T193626Z-formal-f49d61
```
Начало: 2026-10-18T20:43:13.717511+00:00; длительность: 3.393 с; exit code: 0.
````text
PASS: sealed protocol, archive, fixtures, raw records and recomputed decision match
Campaign: evidence/upload-comparison/20261018T193626Z-formal-f49d61
Ready/verified: 720 720
Errors: 0
{"profile": "small-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.5065773906213067, "min_traffic_ratio": 0.5063861055246678, "max_traffic_ratio": 0.5079907229528128}
{"profile": "large-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.49949754357270226, "min_traffic_ratio": 0.4991382402982068, "max_traffic_ratio": 0.49981732427785186}
{"profile": "small-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.5126058228037882, "min_traffic_ratio": 0.50707065100036, "max_traffic_ratio": 0.512817391975545}
{"profile": "large-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.49928261799970935, "min_traffic_ratio": 0.4992082132615818, "max_traffic_ratio": 0.49959788796606974}
{"profile": "small-moderate", "mode": "proxy", "median_api_MiB_per_ready": 2.0209168752034503, "median_api_window_peak_MiB": 136.0546875, "max_api_lifetime_peak_MiB": 141.2265625, "median_ready_rps": 7.894590746470929, "median_p50_s": 0.13762395, "median_p95_s": 0.349706212, "median_p99_s": 0.353454295}
{"profile": "small-moderate", "mode": "direct", "median_api_MiB_per_ready": 1.0233642260233562, "median_api_window_peak_MiB": 138.71875, "max_api_lifetime_peak_MiB": 140.8125, "median_ready_rps": 6.6154831177570035, "median_p50_s": 0.330249949, "median_p95_s": 0.664536392, "median_p99_s": 0.665379127}
{"profile": "large-moderate", "mode": "proxy", "median_api_MiB_per_ready": 20.11448278427124, "median_api_window_peak_MiB": 148.44140625, "max_api_lifetime_peak_MiB": 152.44921875, "median_ready_rps": 4.708766693021728, "median_p50_s": 0.623532216, "median_p95_s": 1.199421251, "median_p99_s": 1.370958831}
{"profile": "large-moderate", "mode": "direct", "median_api_MiB_per_ready": 10.044582716623943, "median_api_window_peak_MiB": 147.1796875, "max_api_lifetime_peak_MiB": 150.04296875, "median_ready_rps": 3.1121213975127984, "median_p50_s": 1.760060342, "median_p95_s": 2.429332421, "median_p99_s": 2.519360375}
{"profile": "small-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 2.0204983075459797, "median_api_window_peak_MiB": 381.2734375, "max_api_lifetime_peak_MiB": 384.3203125, "median_ready_rps": 3.145227806944573, "median_p50_s": 1.294338167, "median_p95_s": 2.522289981, "median_p99_s": 2.55024115}
{"profile": "small-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 1.0358009020487466, "median_api_window_peak_MiB": 384.0546875, "max_api_lifetime_peak_MiB": 387.94140625, "median_ready_rps": 2.8002143610390253, "median_p50_s": 1.645604573, "median_p95_s": 3.186833871, "median_p99_s": 3.235123098}
{"profile": "large-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 20.120631217956543, "median_api_window_peak_MiB": 391.99609375, "max_api_lifetime_peak_MiB": 393.2578125, "median_ready_rps": 2.3240187390207696, "median_p50_s": 1.835096441, "median_p95_s": 3.14764051, "median_p99_s": 3.996668065}
{"profile": "large-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 10.045849291483561, "median_api_window_peak_MiB": 393.05859375, "max_api_lifetime_peak_MiB": 397.359375, "median_ready_rps": 1.780860551975933, "median_p50_s": 3.21658326, "median_p95_s": 5.166217115, "median_p99_s": 5.44240128}
Decision: confirmed_in_tested_conditions
````
## Реализация
- [experiments/docs/HYPOTHESIS.md](../../../../experiments/docs/HYPOTHESIS.md)
- [experiments/docs/METHODOLOGY.md](../../../../experiments/docs/METHODOLOGY.md)
- [experiments/docs/LIMITATIONS.md](../../../../experiments/docs/LIMITATIONS.md)
- [experiments/run.py](../../../../experiments/run.py)
Измерения не запускались повторно: проверены сохранённые сырые данные.
[Серия](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/metrics.json) · [Протокол](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/protocol.json) · [Графики](../../../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/)
@@ -0,0 +1,38 @@
# Обрыв HTTP и отказ между S3 PUT и COMMIT
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestUploadRecoveryHTTPDisconnect`, `TestUploadRecoveryAfterPutFailure`, `TestUploadRecoveryMetadataRejection`, `TestUploadRecoveryDatabaseConnectionLoss`, `TestUploadRecoveryProcessExit`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestUploadRecoveryHTTPDisconnect
--- PASS: TestUploadRecoveryHTTPDisconnect (1.09s)
=== RUN TestUploadRecoveryAfterPutFailure
--- PASS: TestUploadRecoveryAfterPutFailure (0.58s)
=== RUN TestUploadRecoveryMetadataRejection
--- PASS: TestUploadRecoveryMetadataRejection (0.60s)
=== RUN TestUploadRecoveryDatabaseConnectionLoss
--- PASS: TestUploadRecoveryDatabaseConnectionLoss (0.62s)
=== RUN TestUploadRecoveryProcessExit
--- PASS: TestUploadRecoveryProcessExit (0.67s)
PASS
````
## Реализация
- [src/backend/repositories/upload.go](../../../../src/backend/repositories/upload.go)
- [src/backend/tests/upload_recovery_test.go](../../../../src/backend/tests/upload_recovery_test.go)
@@ -0,0 +1,49 @@
# Лимиты, MIME, filename и доступ к чужим вложениям
[Отчёт](../../../../REPORT.md) · [Все критерии](../../README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentValidationHTTP`, `TestAttachmentImageValidation`, `TestAttachmentFilenameValidation`, `TestAttachmentAccessHTTP`.
## proxy
```sh
make test-grade3
```
Начало: 2026-10-18T20:41:01.363701+00:00; длительность: 3.645 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080"
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](backend.txt).
````text
=== RUN TestAttachmentValidationHTTP
--- PASS: TestAttachmentValidationHTTP (1.47s)
=== RUN TestAttachmentAccessHTTP
--- PASS: TestAttachmentAccessHTTP (1.08s)
=== RUN TestAttachmentImageValidation
--- PASS: TestAttachmentImageValidation (0.00s)
=== RUN TestAttachmentFilenameValidation
--- PASS: TestAttachmentFilenameValidation (0.00s)
PASS
````
## Реализация
- [src/backend/tests/attachment_http_test.go](../../../../src/backend/tests/attachment_http_test.go)
- [src/backend/services/attachment.go](../../../../src/backend/services/attachment.go)
+44
View File
@@ -0,0 +1,44 @@
# Повторяемый bootstrap и ограниченные credentials
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestS3PermissionsAndBootstrap`, `TestDirectUploadAccessPermissionsAndLifecycle`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestDirectUploadAccessPermissionsAndLifecycle
--- PASS: TestDirectUploadAccessPermissionsAndLifecycle (0.98s)
=== RUN TestS3PermissionsAndBootstrap
--- PASS: TestS3PermissionsAndBootstrap (0.92s)
PASS
````
## isolation
```sh
/usr/bin/python3 scripts/check_s3_isolation.py
```
Начало: 2026-10-18T20:41:07.464744+00:00; длительность: 0.991 с; exit code: 0.
````text
PASS: loopback-only private S3, disabled console, restricted API mounts, bounded tmpfs
````
## Реализация
- [src/backend/repositories/s3_admin.go](../../src/backend/repositories/s3_admin.go)
- [scripts/check_s3_isolation.py](../../scripts/check_s3_isolation.py)
+48
View File
@@ -0,0 +1,48 @@
# Grace period, блокировки, защита готовых объектов и повтор
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentCleanupGraceLocksProtectionAndRetry`, `TestAttachmentCleanupInvalidKeyIsNeverDeleted`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestAttachmentCleanupGraceLocksProtectionAndRetry
--- PASS: TestAttachmentCleanupGraceLocksProtectionAndRetry (0.88s)
=== RUN TestAttachmentCleanupInvalidKeyIsNeverDeleted
--- PASS: TestAttachmentCleanupInvalidKeyIsNeverDeleted (0.61s)
PASS
````
## cleanup-dry-run
```sh
make attachments-cleanup
```
Начало: 2026-10-18T20:41:08.490906+00:00; длительность: 1.327 с; exit code: 0.
````text
docker compose --project-name highload-lab4 --env-file .env -f compose.yml run --rm --no-deps upload-cleanup ./messenger attachments-cleanup --dry-run
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Creating
Container highload-lab4-upload-cleanup-run-ee9c8bded59f Created
{"direct":{"candidates":1,"deleted":0,"eligible":1,"protected":0,"skipped":0,"failed":0,"dry_run":true},"originals":{"candidates":0,"deleted":0,"eligible":0,"protected":0,"skipped":0,"failed":0,"dry_run":true}}
````
## Реализация
- [src/backend/cleanup.go](../../src/backend/cleanup.go)
- [src/backend/repositories/cleanup_config.go](../../src/backend/repositories/cleanup_config.go)
- [src/backend/repositories/upload.go](../../src/backend/repositories/upload.go)
+579
View File
@@ -0,0 +1,579 @@
# Две API, PostgreSQL и приватный S3 в общем стенде
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## startup
```sh
make app-up
```
Начало: 2026-10-18T20:37:55.408721+00:00; длительность: 21.944 с; exit code: 0.
````text
python3 scripts/init_env.py
Local .env and connection files ready; existing values and files preserved.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml up -d --build --wait
Image highload-lab4-frontend Building
Image highload-lab4-migrate Building
Image highload-lab4-s3-bootstrap Building
Image highload-lab4-api Building
Image highload-lab4-s3 Building
Image highload-lab4-upload-cleanup Building
#1 [internal] load local bake definitions
#1 reading from stdin 3.08kB done
#1 DONE 0.0s
#2 [api internal] load build definition from Dockerfile
#2 transferring dockerfile:
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.2s
#3 [frontend internal] load build definition from Dockerfile
#3 transferring dockerfile: 181B 0.1s done
#3 DONE 0.2s
#4 [s3 internal] load build definition from minio.Dockerfile
#4 transferring dockerfile: 1.01kB 0.0s done
#4 DONE 0.2s
#5 [upload-cleanup internal] load metadata for docker.io/library/debian:12.15-slim
#5 ...
#6 [frontend internal] load metadata for docker.io/library/node:22-bookworm-slim
#6 DONE 0.5s
#5 [s3 internal] load metadata for docker.io/library/debian:12.15-slim
#5 DONE 0.5s
#7 [api internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#7 DONE 0.5s
#8 [migrate internal] load .dockerignore
#8 transferring context: 268B 0.0s done
#8 DONE 0.0s
#9 [frontend internal] load .dockerignore
#9 transferring context: 58B 0.0s done
#9 DONE 0.1s
#10 [api internal] load build context
#10 DONE 0.0s
#11 [s3-bootstrap stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#12 [s3-bootstrap builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#12 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.1s done
#12 DONE 0.1s
#13 [frontend 1/5] FROM docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c
#13 resolve docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c 0.1s done
#13 DONE 0.1s
#14 [frontend internal] load build context
#14 transferring context: 1.07kB 0.1s done
#14 DONE 0.1s
#15 [frontend 2/5] WORKDIR /app
#15 CACHED
#16 [frontend 3/5] COPY package.json package-lock.json ./
#16 CACHED
#17 [frontend 4/5] RUN npm ci
#17 CACHED
#10 [s3-bootstrap internal] load build context
#10 ...
#18 [frontend 5/5] COPY . .
#18 DONE 0.1s
#10 [s3-bootstrap internal] load build context
#10 ...
#19 [s3 internal] load metadata for docker.io/library/golang:1.24.2-bookworm
#19 DONE 1.0s
#20 [s3 internal] load .dockerignore
#20 transferring context: 2B 0.0s done
#20 DONE 0.0s
#10 [s3-bootstrap internal] load build context
#10 transferring context: 4.39kB 0.5s done
#10 DONE 0.5s
#11 [s3 stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#11 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.1s done
#11 DONE 0.1s
#21 [s3 builder 1/4] FROM docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71
#21 resolve docker.io/library/golang:1.24.2-bookworm@sha256:79390b5e5af9ee6e7b1173ee3eac7fadf6751a545297672916b59bfa0ecf6f71 0.0s done
#21 DONE 0.0s
#22 [s3 stage-1 2/3] RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/* && groupadd --system storage && useradd --system --gid storage storage && mkdir /data && chown storage:storage /data
#22 CACHED
#23 [s3 builder 3/4] RUN git init . && git remote add origin https://github.com/minio/minio.git && git fetch --depth 1 origin 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e && git checkout --detach FETCH_HEAD
#23 CACHED
#24 [s3 builder 4/4] RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e" -o /out/minio .
#24 CACHED
#25 [s3 builder 2/4] WORKDIR /source
#25 CACHED
#26 [s3 stage-1 3/3] COPY --from=builder /out/minio /usr/local/bin/minio
#26 CACHED
#27 [api stage-1 3/4] WORKDIR /app
#27 CACHED
#28 [api builder 4/6] RUN go mod download
#28 CACHED
#29 [api builder 2/6] WORKDIR /src
#29 CACHED
#30 [api builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#31 [api stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#32 [api builder 5/6] COPY backend ./backend
#32 CACHED
#33 [api builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#34 [api stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#35 [s3] exporting to image
#35 exporting layers done
#35 exporting manifest sha256:cf1641bb428d024d81f932bd8ab277ade2790aa5cb2ec1b90238a00df54ccbee done
#35 exporting config sha256:b261b45a54ac72fb091ebba0c6b5e09aedc1239e48fe469c1d81ae7ea23621e6 done
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9
#35 ...
#28 [s3-bootstrap builder 4/6] RUN go mod download
#28 CACHED
#29 [s3-bootstrap builder 2/6] WORKDIR /src
#29 CACHED
#33 [s3-bootstrap builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#33 CACHED
#27 [s3-bootstrap stage-1 3/4] WORKDIR /app
#27 CACHED
#31 [s3-bootstrap stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#31 CACHED
#30 [s3-bootstrap builder 3/6] COPY go.mod go.sum ./
#30 CACHED
#32 [s3-bootstrap builder 5/6] COPY backend ./backend
#32 CACHED
#34 [upload-cleanup stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#34 CACHED
#36 [frontend] exporting to image
#36 exporting layers 0.1s done
#36 exporting manifest sha256:d59faebffe67b578ba0786caed54363bffa894312c0787d714977eb9bec9799a 0.0s done
#36 exporting config sha256:fb3ba9317f8efad41b9927e041302762863ea60e513b286942022cd88a4ccf3f 0.0s done
#36 exporting attestation manifest sha256:d4458fdb5f8220753cb7ac6be3561ff06e61c9d49e1ef60947bda4fe49215f3b 0.0s done
#36 exporting manifest list sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c 0.0s done
#36 naming to docker.io/library/highload-lab4-frontend:latest done
#36 unpacking to docker.io/library/highload-lab4-frontend:latest 0.1s done
#36 DONE 0.4s
#35 [s3] exporting to image
#35 exporting attestation manifest sha256:5f4beb93e7723dcab160781dab716c739459a829c31e7d26e443fb017974f3b9 0.0s done
#35 exporting manifest list sha256:4ba76dc492ca964bc6d3702e4dcd6e7befbe17fb39ac169860624139962b7825 0.1s done
#35 naming to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 unpacking to docker.io/library/highload-lab4-s3:latest
#35 unpacking to docker.io/library/highload-lab4-s3:latest 0.1s done
#35 DONE 0.4s
#37 [upload-cleanup] exporting to image
#37 exporting layers done
#37 exporting manifest sha256:7d4f622a2a83dd1aec3b761e2eaa48032ec8594af604c57033d2b78ab0516eba 0.0s done
#37 exporting config sha256:650babbe6357784df8340e53537cec18e70beebc11d5a478528daf3c4a46800b 0.0s done
#37 exporting attestation manifest sha256:66d7cb5be9afd6a4fb83c889db7d4f168f479593edebbf627245ba3e617755f6 0.1s done
#37 exporting manifest list sha256:64ccebc0240289b7f87b7f15f05b4a5cefa3a62c0dc1487f58a80ca4dff51ffb 0.1s done
#37 naming to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest
#37 unpacking to docker.io/library/highload-lab4-upload-cleanup:latest 0.0s done
#37 DONE 0.5s
#38 [s3-bootstrap] exporting to image
#38 exporting layers done
#38 exporting manifest sha256:dd2bbbd4483023e5124c00da1cc13633ac948721c55e0bf6a6bf7331c0cd06e4 0.0s done
#38 exporting config sha256:6c819718ab87aac477b0a779c7763274bbabe01223ec05eb372077f96b98adb3 0.0s done
#38 exporting attestation manifest sha256:5c621aa3c04fb990da97dc1fb103feb5fbb8c3c3c7495589efd9001a823298df 0.1s done
#38 exporting manifest list sha256:87530453dc25cf26f9aab7bb3167e0831af3e0e9233b17eaaa59be4d780f5fa9 0.1s done
#38 naming to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 unpacking to docker.io/library/highload-lab4-s3-bootstrap:latest 0.0s done
#38 DONE 0.5s
#39 [migrate] exporting to image
#39 exporting layers done
#39 exporting manifest sha256:72b55ff56061496e227a3f2d6159efd7619d4ebac3e62a7a292ca38c0aa430e5 0.0s done
#39 exporting config sha256:717f0c6505d0f59b5ff8b1ae4a2ae07241dfd835b97f85ebd54812db3f40df02 0.0s done
#39 exporting attestation manifest sha256:eb8048635d5a2fe19319f95e751bacb7484d8357992fc324e2e5c401359d2df9 0.1s done
#39 exporting manifest list sha256:776406956564b03c4c68fcb0273a0e1d6b86e2c0e2cf9ce3fa82a85762ac0f42 0.1s done
#39 naming to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 unpacking to docker.io/library/highload-lab4-migrate:latest 0.0s done
#39 DONE 0.5s
#40 [api] exporting to image
#40 exporting layers done
#40 exporting manifest sha256:9c7d0be760523e4c4a8775f30d52c18f04c9290528e99d8b542474a6941c2843 0.0s done
#40 exporting config sha256:b3dcf18403a7675697043933aee1a0a0f297c459658ffc1dd6f5372060d04942 0.0s done
#40 exporting attestation manifest sha256:8f285c1fdf78dbe48b37e4f39354817556369f0840f24e91a8671ebf84b2ba25 0.1s done
#40 exporting manifest list sha256:e5149bb9db200a2bcfeadde9eb676add0e9fa7f2a6018069212387cce6467dba 0.1s done
#40 naming to docker.io/library/highload-lab4-api:latest 0.0s done
#40 unpacking to docker.io/library/highload-lab4-api:latest 0.1s done
#40 DONE 0.5s
#41 [frontend] resolving provenance for metadata file
#41 ...
#42 [s3] resolving provenance for metadata file
#42 DONE 0.2s
#43 [api] resolving provenance for metadata file
#43 DONE 0.0s
#41 [frontend] resolving provenance for metadata file
#41 DONE 0.4s
#44 [migrate] resolving provenance for metadata file
#44 DONE 0.2s
#45 [upload-cleanup] resolving provenance for metadata file
#45 DONE 0.3s
#46 [s3-bootstrap] resolving provenance for metadata file
#46 DONE 0.3s
Image highload-lab4-s3 Built
Image highload-lab4-s3-bootstrap Built
Image highload-lab4-api Built
Image highload-lab4-frontend Built
Image highload-lab4-upload-cleanup Built
Image highload-lab4-migrate Built
Container highload-lab4-upload-cleanup-1 Running
Container highload-lab4-s3-1 Running
Container highload-lab4-haproxy-1 Running
Container highload-lab4-api-1 Running
Container highload-lab4-api-2 Running
Container highload-lab4-redis-1 Running
Container highload-lab4-db-1 Running
Container highload-lab4-frontend-1 Recreate
Container highload-lab4-frontend-1 Recreated
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-db-1 Healthy
Container highload-lab4-migrate-1 Starting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-s3-bootstrap-1 Starting
Container highload-lab4-migrate-1 Started
Container highload-lab4-s3-bootstrap-1 Started
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-migrate-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-db-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-frontend-1 Starting
Container highload-lab4-frontend-1 Started
Container highload-lab4-s3-bootstrap-1 Waiting
Container highload-lab4-redis-1 Waiting
Container highload-lab4-api-2 Waiting
Container highload-lab4-api-1 Waiting
Container highload-lab4-haproxy-1 Waiting
Container highload-lab4-migrate-1 Waiting
Container highload-lab4-upload-cleanup-1 Waiting
Container highload-lab4-s3-1 Waiting
Container highload-lab4-db-1 Waiting
Container highload-lab4-frontend-1 Waiting
Container highload-lab4-s3-1 Healthy
Container highload-lab4-db-1 Healthy
Container highload-lab4-upload-cleanup-1 Healthy
Container highload-lab4-s3-bootstrap-1 Exited
Container highload-lab4-redis-1 Healthy
Container highload-lab4-haproxy-1 Healthy
Container highload-lab4-migrate-1 Exited
Container highload-lab4-api-2 Healthy
Container highload-lab4-api-1 Healthy
Container highload-lab4-frontend-1 Healthy
````
## inventory
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe inventory
```
Начало: 2026-10-18T20:38:15.728752+00:00; длительность: 0.679 с; exit code: 0.
````text
[
{
"id": "959dccd157e188cd60f6db860ea20700cc2dd8c27805d55952d53c7b5471598e",
"hostname": "959dccd157e1",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:36:24.367291372Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "7bdd907a608af31577bd5510a41375cf26d9c3076545109c447c9e54024fb011",
"hostname": "7bdd907a608a",
"service": "api",
"image": "sha256:ffc389d196c2b7ed2a25cc6dc40c3c379f039142825e99c51afb58505bad734e",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.89479619Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {
"/tmp/uploads": "rw,noexec,nosuid,size=16m,mode=1777"
},
"volumes": []
},
{
"id": "259b35fab41e7e1790ac49e31fcff0e461ff512a95cd722c6f677d5058d86303",
"hostname": "259b35fab41e",
"service": "db",
"image": "sha256:38471f330eb885e04de130b768d6db4e10469e2311879c7e5c699f6d2d8a1c74",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.416387316Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_postgres_data"
]
},
{
"id": "c0bbd38841b949b916226af63ada5d8c855ab59c67e4a06ef51ad8d51b2839b7",
"hostname": "c0bbd38841b9",
"service": "frontend",
"image": "sha256:f5b74ea208d8858de6d2174c5b42f2c470a511252641e29ef98aff6dedf6ed8c",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:09.864159664Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 500000000,
"ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
},
"tmpfs": {},
"volumes": [
"b9f1bd167d18e267c37863a052b4aed0a20f0b82b7680e0b92c6d6a78d83345c"
]
},
{
"id": "e21b07ae8881dac719504c3f9377931815597fe4460eac747ce25ddf52027a9a",
"hostname": "e21b07ae8881",
"service": "haproxy",
"image": "sha256:5d97434a423c2533cfeb42874d45cf6d69a840b60334582dfbfd5008e94c80be",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T15:32:54.031245659Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
},
"tmpfs": {},
"volumes": []
},
{
"id": "a5c6efa8b9b37c253baa4aff4e710d75f1fb263956bdcb18658b69224a563a43",
"hostname": "a5c6efa8b9b3",
"service": "migrate",
"image": "sha256:3924dbfb81da76fca449bd32819e6ca36a3fdbf8490a0c1c1b50fd81a324103d",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.043221163Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "64a89a43e53bb359e2e41fea25f15b8b91a7ce67ed8a2a7b2c9e5105d9350aed",
"hostname": "64a89a43e53b",
"service": "redis",
"image": "sha256:c6eabf748fc7a61dbb5a705c78bcf3d6377b1127a97d0ce965c11c44ba46896f",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:49.786499611Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": [
"highload-lab4_redis_data"
]
},
{
"id": "cc9133bc44063407356aabc39a7efcfe12ffed39046dbb7868a390b2926757d4",
"hostname": "cc9133bc4406",
"service": "s3",
"image": "sha256:1ba45e373544d1351cdc5623067181bd21185a6487e53c026f8cfaf2330d155d",
"state": "running",
"health": "healthy",
"exit_code": 0,
"started_at": "2026-10-18T20:35:50.058525711Z",
"restarts": 0,
"memory": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9000"
}
]
},
"tmpfs": {},
"volumes": [
"highload-lab4_s3_data"
]
},
{
"id": "cd964756deb6c3898420c382b33394ea602426da7ae405e6925863107a3c01e5",
"hostname": "cd964756deb6",
"service": "s3-bootstrap",
"image": "sha256:759e9a688eb1bd82330ff43eb8f0fec811d4dcf8f9ff784489a41e87f8622a13",
"state": "exited",
"health": "unhealthy",
"exit_code": 0,
"started_at": "2026-10-18T20:38:06.399345399Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 500000000,
"ports": {},
"tmpfs": {},
"volumes": []
},
{
"id": "e163dbec27d202308dbda1a0f2c1804695870d07f99b4fea4d48335294c2eb35",
"hostname": "e163dbec27d2",
"service": "upload-cleanup",
"image": "sha256:003cb186865f57ed75ca7eb742995ee65674a68c64afadca5fba7649d522e8c3",
"state": "running",
"health": null,
"exit_code": 0,
"started_at": "2026-10-18T20:35:54.81722101Z",
"restarts": 0,
"memory": 134217728,
"nano_cpus": 250000000,
"ports": {},
"tmpfs": {},
"volumes": []
}
]
````
## schema
```sh
docker compose --project-name highload-lab4 --env-file .env -f compose.yml exec -T db sh -c 'psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" -c "SELECT version, dirty FROM schema_migrations;"'
```
Начало: 2026-10-18T20:38:16.439436+00:00; длительность: 0.315 с; exit code: 0.
````text
version | dirty
---------+-------
6 | f
(1 row)
````
## isolation
```sh
/usr/bin/python3 scripts/check_s3_isolation.py
```
Начало: 2026-10-18T20:41:07.464744+00:00; длительность: 0.991 с; exit code: 0.
````text
PASS: loopback-only private S3, disabled console, restricted API mounts, bounded tmpfs
````
## Реализация
- [compose.yml](../../compose.yml)
- [infra/minio.Dockerfile](../../infra/minio.Dockerfile)
- [src/backend/repositories/migrations/000004_attachments.up.sql](../../src/backend/repositories/migrations/000004_attachments.up.sql)
+46
View File
@@ -0,0 +1,46 @@
# Гипотеза и сравнение трафика/RAM на четырёх профилях
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
## experiment
```sh
/usr/bin/python3 scripts/generate_evidence.py --probe experiment --campaign /mnt/c/projects/Highload-systems/mtusi2026lab4-fork/evidence/upload-comparison/20261018T193626Z-formal-f49d61
```
Начало: 2026-10-18T20:43:13.717511+00:00; длительность: 3.393 с; exit code: 0.
````text
PASS: sealed protocol, archive, fixtures, raw records and recomputed decision match
Campaign: evidence/upload-comparison/20261018T193626Z-formal-f49d61
Ready/verified: 720 720
Errors: 0
{"profile": "small-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.5065773906213067, "min_traffic_ratio": 0.5063861055246678, "max_traffic_ratio": 0.5079907229528128}
{"profile": "large-moderate", "valid_pairs": 3, "median_traffic_ratio": 0.49949754357270226, "min_traffic_ratio": 0.4991382402982068, "max_traffic_ratio": 0.49981732427785186}
{"profile": "small-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.5126058228037882, "min_traffic_ratio": 0.50707065100036, "max_traffic_ratio": 0.512817391975545}
{"profile": "large-pixels40m", "valid_pairs": 3, "median_traffic_ratio": 0.49928261799970935, "min_traffic_ratio": 0.4992082132615818, "max_traffic_ratio": 0.49959788796606974}
{"profile": "small-moderate", "mode": "proxy", "median_api_MiB_per_ready": 2.0209168752034503, "median_api_window_peak_MiB": 136.0546875, "max_api_lifetime_peak_MiB": 141.2265625, "median_ready_rps": 7.894590746470929, "median_p50_s": 0.13762395, "median_p95_s": 0.349706212, "median_p99_s": 0.353454295}
{"profile": "small-moderate", "mode": "direct", "median_api_MiB_per_ready": 1.0233642260233562, "median_api_window_peak_MiB": 138.71875, "max_api_lifetime_peak_MiB": 140.8125, "median_ready_rps": 6.6154831177570035, "median_p50_s": 0.330249949, "median_p95_s": 0.664536392, "median_p99_s": 0.665379127}
{"profile": "large-moderate", "mode": "proxy", "median_api_MiB_per_ready": 20.11448278427124, "median_api_window_peak_MiB": 148.44140625, "max_api_lifetime_peak_MiB": 152.44921875, "median_ready_rps": 4.708766693021728, "median_p50_s": 0.623532216, "median_p95_s": 1.199421251, "median_p99_s": 1.370958831}
{"profile": "large-moderate", "mode": "direct", "median_api_MiB_per_ready": 10.044582716623943, "median_api_window_peak_MiB": 147.1796875, "max_api_lifetime_peak_MiB": 150.04296875, "median_ready_rps": 3.1121213975127984, "median_p50_s": 1.760060342, "median_p95_s": 2.429332421, "median_p99_s": 2.519360375}
{"profile": "small-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 2.0204983075459797, "median_api_window_peak_MiB": 381.2734375, "max_api_lifetime_peak_MiB": 384.3203125, "median_ready_rps": 3.145227806944573, "median_p50_s": 1.294338167, "median_p95_s": 2.522289981, "median_p99_s": 2.55024115}
{"profile": "small-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 1.0358009020487466, "median_api_window_peak_MiB": 384.0546875, "max_api_lifetime_peak_MiB": 387.94140625, "median_ready_rps": 2.8002143610390253, "median_p50_s": 1.645604573, "median_p95_s": 3.186833871, "median_p99_s": 3.235123098}
{"profile": "large-pixels40m", "mode": "proxy", "median_api_MiB_per_ready": 20.120631217956543, "median_api_window_peak_MiB": 391.99609375, "max_api_lifetime_peak_MiB": 393.2578125, "median_ready_rps": 2.3240187390207696, "median_p50_s": 1.835096441, "median_p95_s": 3.14764051, "median_p99_s": 3.996668065}
{"profile": "large-pixels40m", "mode": "direct", "median_api_MiB_per_ready": 10.045849291483561, "median_api_window_peak_MiB": 393.05859375, "max_api_lifetime_peak_MiB": 397.359375, "median_ready_rps": 1.780860551975933, "median_p50_s": 3.21658326, "median_p95_s": 5.166217115, "median_p99_s": 5.44240128}
Decision: confirmed_in_tested_conditions
````
## Реализация
- [experiments/docs/HYPOTHESIS.md](../../experiments/docs/HYPOTHESIS.md)
- [experiments/docs/METHODOLOGY.md](../../experiments/docs/METHODOLOGY.md)
- [experiments/docs/LIMITATIONS.md](../../experiments/docs/LIMITATIONS.md)
- [experiments/run.py](../../experiments/run.py)
Измерения не запускались повторно: проверены сохранённые сырые данные.
[Серия](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/metrics.json) · [Протокол](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/protocol.json) · [Графики](../../evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/)
+38
View File
@@ -0,0 +1,38 @@
# Обрыв HTTP и отказ между S3 PUT и COMMIT
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestUploadRecoveryHTTPDisconnect`, `TestUploadRecoveryAfterPutFailure`, `TestUploadRecoveryMetadataRejection`, `TestUploadRecoveryDatabaseConnectionLoss`, `TestUploadRecoveryProcessExit`.
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestUploadRecoveryHTTPDisconnect
--- PASS: TestUploadRecoveryHTTPDisconnect (1.09s)
=== RUN TestUploadRecoveryAfterPutFailure
--- PASS: TestUploadRecoveryAfterPutFailure (0.58s)
=== RUN TestUploadRecoveryMetadataRejection
--- PASS: TestUploadRecoveryMetadataRejection (0.60s)
=== RUN TestUploadRecoveryDatabaseConnectionLoss
--- PASS: TestUploadRecoveryDatabaseConnectionLoss (0.62s)
=== RUN TestUploadRecoveryProcessExit
--- PASS: TestUploadRecoveryProcessExit (0.67s)
PASS
````
## Реализация
- [src/backend/repositories/upload.go](../../src/backend/repositories/upload.go)
- [src/backend/tests/upload_recovery_test.go](../../src/backend/tests/upload_recovery_test.go)
+49
View File
@@ -0,0 +1,49 @@
# Лимиты, MIME, filename и доступ к чужим вложениям
[Отчёт](../../REPORT.md) · [Все критерии](README.md)
Статус: **PASS**. Запуск: `20261018T203755.405686Z`.
Тесты создают синтетические данные. Интеграционные Go-тесты используют отдельные схемы БД и собственные S3-ключи.
Проверенные сценарии: `TestAttachmentValidationHTTP`, `TestAttachmentImageValidation`, `TestAttachmentFilenameValidation`, `TestAttachmentAccessHTTP`.
## proxy
```sh
make test-grade3
```
Начало: 2026-10-18T20:41:01.363701+00:00; длительность: 3.645 с; exit code: 0.
````text
python3 scripts/check_grade3.py --base-url "http://localhost:8080"
PASS: image limits, chunked upload, ACL, message attachments, concurrent replay across replicas
````
## backend
```sh
make test-backend
```
Начало: 2026-10-18T20:38:40.802787+00:00; длительность: 148.987 с; exit code: 0.
Фрагмент; полный вывод: [backend.txt](runs/20261018T203755.405686Z/backend.txt).
````text
=== RUN TestAttachmentValidationHTTP
--- PASS: TestAttachmentValidationHTTP (1.47s)
=== RUN TestAttachmentAccessHTTP
--- PASS: TestAttachmentAccessHTTP (1.08s)
=== RUN TestAttachmentImageValidation
--- PASS: TestAttachmentImageValidation (0.00s)
=== RUN TestAttachmentFilenameValidation
--- PASS: TestAttachmentFilenameValidation (0.00s)
PASS
````
## Реализация
- [src/backend/tests/attachment_http_test.go](../../src/backend/tests/attachment_http_test.go)
- [src/backend/services/attachment.go](../../src/backend/services/attachment.go)
+13
View File
@@ -0,0 +1,13 @@
{
"checked_utc": "2026-10-18T20:44:47.784359+00:00",
"run": "20261018T203755.405686Z",
"criteria_passed": 17,
"markdown_files_checked": 53,
"all_links_resolve": true,
"generator_unit_tests_passed": 4,
"no_frontend_tests": true,
"report_sections_preserved": true,
"commit_pr_field_unchanged": true,
"no_secret_values_in_current_evidence": true,
"pdf_count": 0
}
@@ -1,20 +0,0 @@
{
"purpose": "png_only_plot_validation",
"application_uploads": 0,
"hypothesis_tested": false,
"removed_pdf_files": [
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/api-memory-lifetime.pdf",
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/api-memory-window.pdf",
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/api-traffic.pdf",
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/errors.pdf",
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/latency-p95.pdf",
"evidence/upload-comparison/20261018T193141Z-pilot-980ab7/plots/20261018T193517.348234Z/traffic-ratio.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/api-memory-lifetime.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/api-memory-window.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/api-traffic.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/errors.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/latency-p95.pdf",
"evidence/upload-comparison/20261018T193626Z-formal-f49d61/plots/20261018T195401.869811Z/traffic-ratio.pdf"
],
"test_exit_code": 0
}