forked from mtusi2026/mtusi2026lab4
feat: Саватеев А трек 4
This commit is contained in:
@@ -0,0 +1,254 @@
|
||||
{
|
||||
"environment": {
|
||||
"host": "Darwin arm64",
|
||||
"docker": "29.0.1",
|
||||
"docker_vm_cpus": 10,
|
||||
"docker_vm_memory_gib": 7.7,
|
||||
"api_limits": "cpus 1.0, memory 512M per replica (compose.yaml)",
|
||||
"s3": "chrislusf/seaweedfs:4.48",
|
||||
"settings": {
|
||||
"API_REPLICAS": "2",
|
||||
"MAX_UPLOAD_BYTES": "10485760",
|
||||
"MAX_IMAGE_PIXELS": "40000000",
|
||||
"S3_POOL_MAX_SIZE": "20",
|
||||
"UPLOAD_SPOOL_MEMORY_BYTES": "1048576",
|
||||
"IMAGE_INSPECT_WORKERS": "1"
|
||||
}
|
||||
},
|
||||
"rounds": [
|
||||
{
|
||||
"profile": "png",
|
||||
"file_bytes": 9192108,
|
||||
"concurrency": 10,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 10
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"d5c1cf9c56c0": 5,
|
||||
"c194122992eb": 5
|
||||
},
|
||||
"wall_seconds": 2.09,
|
||||
"latency_seconds": {
|
||||
"p50": 2.01,
|
||||
"p95": 2.09,
|
||||
"max": 2.09
|
||||
},
|
||||
"throughput_mib_per_second": 41.9,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 5,
|
||||
"rss_before_mib": 99.1,
|
||||
"rss_peak_process_vmhwm_mib": 156.5,
|
||||
"rss_peak_sampled_mib": 121.5,
|
||||
"cgroup_peak_sampled_mib": 152.6,
|
||||
"samples": 20
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 5,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 156.5,
|
||||
"rss_peak_sampled_mib": 125.7,
|
||||
"cgroup_peak_sampled_mib": 165.6,
|
||||
"samples": 20
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"profile": "png",
|
||||
"file_bytes": 9192108,
|
||||
"concurrency": 20,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 20
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"f6aa4c07652a": 10,
|
||||
"3b495b150936": 10
|
||||
},
|
||||
"wall_seconds": 3.89,
|
||||
"latency_seconds": {
|
||||
"p50": 3.456,
|
||||
"p95": 3.881,
|
||||
"max": 3.888
|
||||
},
|
||||
"throughput_mib_per_second": 45.1,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 10,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 156.6,
|
||||
"rss_peak_sampled_mib": 123.6,
|
||||
"cgroup_peak_sampled_mib": 214.6,
|
||||
"samples": 29
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 10,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 156.4,
|
||||
"rss_peak_sampled_mib": 126.1,
|
||||
"cgroup_peak_sampled_mib": 216.3,
|
||||
"samples": 29
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"profile": "png",
|
||||
"file_bytes": 9192108,
|
||||
"concurrency": 30,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 30
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"5d4554045abd": 15,
|
||||
"51a1d5ba826c": 15
|
||||
},
|
||||
"wall_seconds": 7.21,
|
||||
"latency_seconds": {
|
||||
"p50": 4.62,
|
||||
"p95": 4.979,
|
||||
"max": 7.206
|
||||
},
|
||||
"throughput_mib_per_second": 36.5,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 15,
|
||||
"rss_before_mib": 99.1,
|
||||
"rss_peak_process_vmhwm_mib": 156.6,
|
||||
"rss_peak_sampled_mib": 127.1,
|
||||
"cgroup_peak_sampled_mib": 254.8,
|
||||
"samples": 45
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 15,
|
||||
"rss_before_mib": 99.1,
|
||||
"rss_peak_process_vmhwm_mib": 156.6,
|
||||
"rss_peak_sampled_mib": 142.0,
|
||||
"cgroup_peak_sampled_mib": 279.8,
|
||||
"samples": 46
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"profile": "jpeg",
|
||||
"file_bytes": 4980814,
|
||||
"concurrency": 10,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 10
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"68c5e652faea": 5,
|
||||
"647da7ba9c11": 5
|
||||
},
|
||||
"wall_seconds": 1.42,
|
||||
"latency_seconds": {
|
||||
"p50": 0.958,
|
||||
"p95": 1.416,
|
||||
"max": 1.416
|
||||
},
|
||||
"throughput_mib_per_second": 33.5,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 5,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 333.4,
|
||||
"rss_peak_sampled_mib": 334.0,
|
||||
"cgroup_peak_sampled_mib": 338.4,
|
||||
"samples": 17
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 5,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 332.6,
|
||||
"rss_peak_sampled_mib": 333.4,
|
||||
"cgroup_peak_sampled_mib": 337.7,
|
||||
"samples": 17
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"profile": "jpeg",
|
||||
"file_bytes": 4980814,
|
||||
"concurrency": 20,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 20
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"a54206764ef9": 10,
|
||||
"b85fe6e9cbd7": 10
|
||||
},
|
||||
"wall_seconds": 2.74,
|
||||
"latency_seconds": {
|
||||
"p50": 1.768,
|
||||
"p95": 2.593,
|
||||
"max": 2.738
|
||||
},
|
||||
"throughput_mib_per_second": 34.6,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 10,
|
||||
"rss_before_mib": 93.5,
|
||||
"rss_peak_process_vmhwm_mib": 335.0,
|
||||
"rss_peak_sampled_mib": 336.0,
|
||||
"cgroup_peak_sampled_mib": 362.0,
|
||||
"samples": 24
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 10,
|
||||
"rss_before_mib": 93.5,
|
||||
"rss_peak_process_vmhwm_mib": 337.4,
|
||||
"rss_peak_sampled_mib": 336.0,
|
||||
"cgroup_peak_sampled_mib": 362.4,
|
||||
"samples": 24
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"profile": "jpeg",
|
||||
"file_bytes": 4980814,
|
||||
"concurrency": 30,
|
||||
"replicas_restarted_before": true,
|
||||
"status_counts": {
|
||||
"201": 30
|
||||
},
|
||||
"uploads_by_instance": {
|
||||
"da06b29a8834": 15,
|
||||
"0ff93f8a6fd8": 15
|
||||
},
|
||||
"wall_seconds": 6.64,
|
||||
"latency_seconds": {
|
||||
"p50": 2.981,
|
||||
"p95": 6.635,
|
||||
"max": 6.635
|
||||
},
|
||||
"throughput_mib_per_second": 21.5,
|
||||
"download_sha256_matches": true,
|
||||
"replicas": {
|
||||
"messenger-lab4-api-1": {
|
||||
"uploads_served": 15,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 337.4,
|
||||
"rss_peak_sampled_mib": 337.9,
|
||||
"cgroup_peak_sampled_mib": 390.6,
|
||||
"samples": 43
|
||||
},
|
||||
"messenger-lab4-api-2": {
|
||||
"uploads_served": 15,
|
||||
"rss_before_mib": 99.2,
|
||||
"rss_peak_process_vmhwm_mib": 339.1,
|
||||
"rss_peak_sampled_mib": 339.7,
|
||||
"cgroup_peak_sampled_mib": 393.1,
|
||||
"samples": 43
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
## instances before
|
||||
CONTAINER STATE INSTANCE PID REVISION
|
||||
messenger-lab4-api-1 running/healthy 0fd6b920cefc 2735 dev
|
||||
messenger-lab4-api-2 running/healthy 5a67f0c47be1 2687 dev
|
||||
## make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
||||
{"observed_instances_before": 2, "successful_writes": 130, "failed_attempts": 0, "first_recovery_seconds": 2.058}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
## instances after (stopped replica stays stopped)
|
||||
CONTAINER STATE INSTANCE PID REVISION
|
||||
messenger-lab4-api-1 exited/unhealthy - 0 dev
|
||||
messenger-lab4-api-2 running/healthy 5a67f0c47be1 2687 dev
|
||||
|
||||
## second run after scripts/restore.sh
|
||||
CONTAINER STATE INSTANCE PID REVISION
|
||||
messenger-lab4-api-1 running/healthy 04c6c919ec65 5688 dev
|
||||
messenger-lab4-api-2 running/healthy 5a67f0c47be1 2687 dev
|
||||
{"observed_instances_before": 2, "successful_writes": 129, "failed_attempts": 0, "first_recovery_seconds": 1.618}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
CONTAINER STATE INSTANCE PID REVISION
|
||||
messenger-lab4-api-1 exited/unhealthy - 0 dev
|
||||
messenger-lab4-api-2 running/healthy 5a67f0c47be1 2687 dev
|
||||
@@ -0,0 +1,19 @@
|
||||
# make test-failures (PostgreSQL, Valkey, S3, остановка реплики, принявшей файл)
|
||||
#
|
||||
# 2026-10-20 ~12:05 MSK — 6 passed (до включения S3 в readiness, отключения
|
||||
# буферизации nginx и лимитов SeaweedFS).
|
||||
student-tests/test_dependency_failures.py::test_valkey_down_cache_is_bypassed PASSED
|
||||
student-tests/test_dependency_failures.py::test_logout_during_valkey_outage_is_not_resurrected PASSED
|
||||
student-tests/test_dependency_failures.py::test_postgres_down_returns_bounded_503_and_no_anonymous_access PASSED
|
||||
student-tests/test_dependency_failures.py::test_session_survives_postgres_restart PASSED
|
||||
student-tests/test_storage_failures.py::test_s3_outage_is_isolated_and_leaves_no_garbage PASSED
|
||||
student-tests/test_attachment_failover.py::test_download_survives_stop_of_uploading_replica
|
||||
UPLOADED BY 5a67f0c47be1, DOWNLOADED FROM ['da68a0e82155']
|
||||
PASSED
|
||||
========================= 6 passed in 70.80s (0:01:10) =========================
|
||||
|
||||
# 2026-10-20 12:32 MSK — повторный прогон НЕДЕЙСТВИТЕЛЕН (5 passed, 1 failed):
|
||||
# во время прогона стенд lab4 был остановлен извне и порт 8080 занял стенд lab3.
|
||||
# test_attachment_failover отдельно на lab4 после этого: 1 passed
|
||||
# (UPLOADED BY 67c813dd874b, DOWNLOADED FROM ['82dc3cadef5c']).
|
||||
# Повторить make test-failures на финальной конфигурации перед сдачей.
|
||||
@@ -0,0 +1,27 @@
|
||||
# make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
#
|
||||
# 2026-10-20 ~12:17 MSK — PASS (readiness с проверкой S3, до отключения
|
||||
# буферизации nginx и лимитов SeaweedFS; эти изменения не касаются сохранности).
|
||||
## containers before
|
||||
api messenger-lab4-api-1 Up 10 seconds (healthy)
|
||||
api messenger-lab4-api-2 Up 10 seconds (healthy)
|
||||
janitor messenger-lab4-janitor-1 Up 10 seconds (healthy)
|
||||
nginx messenger-lab4-nginx-1 Up About a minute (healthy)
|
||||
postgres messenger-lab4-postgres-1 Up About a minute (healthy)
|
||||
s3 messenger-lab4-s3-1 Up About a minute (healthy)
|
||||
valkey messenger-lab4-valkey-1 Up About a minute (healthy)
|
||||
## make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
## containers after (uptime сброшен у всех: реально перезапущены PostgreSQL, Valkey, S3, API, janitor, nginx)
|
||||
api messenger-lab4-api-1 Up 15 seconds (healthy)
|
||||
api messenger-lab4-api-2 Up 15 seconds (health: starting)
|
||||
janitor messenger-lab4-janitor-1 Up 16 seconds (healthy)
|
||||
nginx messenger-lab4-nginx-1 Up 15 seconds (healthy)
|
||||
postgres messenger-lab4-postgres-1 Up 42 seconds (healthy)
|
||||
s3 messenger-lab4-s3-1 Up 17 seconds (health: starting)
|
||||
valkey messenger-lab4-valkey-1 Up 42 seconds (healthy)
|
||||
|
||||
# 2026-10-20 12:33 MSK — повторный прогон НЕДЕЙСТВИТЕЛЕН: во время прогона стенд
|
||||
# lab4 был остановлен извне, на 127.0.0.1:8080 работал стенд lab3 (его ответы
|
||||
# без attachment_ids). Повторить на финальной конфигурации перед сдачей.
|
||||
@@ -0,0 +1,9 @@
|
||||
## make check
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
## make test
|
||||
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
||||
## make student-test (unit + black-box)
|
||||
======================= 187 passed, 16 skipped in 23.48s =======================
|
||||
## make test-storage
|
||||
JANITOR REPORT: {"dry_run": false, "unfinished_claimed": 2, "unfinished_objects_deleted": 2, "unfinished_rows_deleted": 2, "objects_scanned": 381, "orphan_objects_found": 1, "orphan_objects_deleted": 1}
|
||||
======================== 8 passed in 114.70s (0:01:54) =========================
|
||||
Reference in New Issue
Block a user