ЛР 5: очередь и асинхронная обработка изображений

This commit is contained in:
2026-11-11 19:59:42 +03:00
parent 276dbdad8a
commit af485c93d4
54 changed files with 1966 additions and 34 deletions
+1
View File
@@ -0,0 +1 @@
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+9
View File
@@ -0,0 +1,9 @@
Run 1
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 60, "failed_attempts": 0, "first_recovery_seconds": 1.388}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
Run 2
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 60, "failed_attempts": 0, "first_recovery_seconds": 1.154}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+96
View File
@@ -0,0 +1,96 @@
{
"before": {
"api1": {
"id": "612826f4ec33",
"started_at": "2026-11-11T16:46:45.590637906Z",
"image": "mtusi2026lab5-app:local"
},
"api2": {
"id": "9b599b4254f8",
"started_at": "2026-11-11T16:46:45.61923996Z",
"image": "mtusi2026lab5-app:local"
},
"broker": {
"id": "20286d777e33",
"started_at": "2026-11-11T16:46:46.290586048Z",
"image": "rabbitmq:4.1.0-alpine"
},
"db": {
"id": "2b1781c64aa8",
"started_at": "2026-11-11T16:39:05.943120027Z",
"image": "postgres:16.8-alpine"
},
"dispatcher": {
"id": "0439349883a7",
"started_at": "2026-11-11T16:47:01.419374194Z",
"image": "mtusi2026lab5-app:local"
},
"lb": {
"id": "480f671d010d",
"started_at": "2026-11-11T16:39:17.798819925Z",
"image": "nginx:1.27.5-alpine"
},
"s3": {
"id": "812c644b3b10",
"started_at": "2026-11-11T16:39:06.338675931Z",
"image": "cgr.dev/chainguard/minio@sha256:fb893e36fc369d41e92f678b17ec27378fa5bf0576aeef7ac15460c13629ab5a"
},
"worker": {
"id": "a50091a0b7a8",
"started_at": "2026-11-11T16:47:25.220191928Z",
"image": "mtusi2026lab5-app:local"
}
},
"after": {
"api1": {
"id": "612826f4ec33",
"started_at": "2026-11-11T16:50:07.527403019Z",
"image": "mtusi2026lab5-app:local"
},
"api2": {
"id": "9b599b4254f8",
"started_at": "2026-11-11T16:50:07.595331041Z",
"image": "mtusi2026lab5-app:local"
},
"broker": {
"id": "20286d777e33",
"started_at": "2026-11-11T16:50:08.421072775Z",
"image": "rabbitmq:4.1.0-alpine"
},
"db": {
"id": "2b1781c64aa8",
"started_at": "2026-11-11T16:50:07.211588868Z",
"image": "postgres:16.8-alpine"
},
"dispatcher": {
"id": "0439349883a7",
"started_at": "2026-11-11T16:50:10.075120403Z",
"image": "mtusi2026lab5-app:local"
},
"lb": {
"id": "480f671d010d",
"started_at": "2026-11-11T16:50:07.299916262Z",
"image": "nginx:1.27.5-alpine"
},
"s3": {
"id": "812c644b3b10",
"started_at": "2026-11-11T16:50:07.088841496Z",
"image": "cgr.dev/chainguard/minio@sha256:fb893e36fc369d41e92f678b17ec27378fa5bf0576aeef7ac15460c13629ab5a"
},
"worker": {
"id": "a50091a0b7a8",
"started_at": "2026-11-11T16:50:10.148806874Z",
"image": "mtusi2026lab5-app:local"
}
},
"restarted": {
"api1": true,
"api2": true,
"db": true,
"s3": true,
"broker": true,
"worker": true,
"dispatcher": true,
"lb": true
}
}
+2
View File
@@ -0,0 +1,2 @@
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+46
View File
@@ -0,0 +1,46 @@
[
{
"scenario": "stopped_worker_and_api_broker_restart",
"attachment_id": "44188ba6-770d-4abc-9f87-c12b6c970953",
"message_id": "3cec2bb3-2ead-43a3-8b02-e14e0bb90b9b",
"queued_before": 1,
"queued_after": 1,
"broker_restart_verified": true,
"started_before": {
"api1": "2026-11-11T16:45:34.793026679Z",
"api2": "2026-11-11T16:45:34.851702Z",
"broker": "2026-11-11T16:45:35.58734277Z"
},
"started_after": {
"api1": "2026-11-11T16:46:45.590637906Z",
"api2": "2026-11-11T16:46:45.61923996Z",
"broker": "2026-11-11T16:46:46.290586048Z"
},
"ready_seconds": 1.923,
"thumbnail": [
256,
160
],
"result": "PASS"
},
{
"scenario": "five_duplicate_deliveries",
"attachment_id": "44188ba6-770d-4abc-9f87-c12b6c970953",
"attempts": 1,
"final_objects": [
"results/44188ba6-770d-4abc-9f87-c12b6c970953/v1/original",
"results/44188ba6-770d-4abc-9f87-c12b6c970953/v1/thumbnail"
],
"unchanged_metadata": true,
"result": "PASS"
},
{
"scenario": "bounded_retry",
"attachment_id": "ae50b181-c8d0-4ac9-bda1-312a1ac7ea18",
"attempts": 5,
"error_code": "retry_exhausted",
"download_status": 409,
"attach_status": 409,
"result": "PASS"
}
]
+47
View File
@@ -0,0 +1,47 @@
[
{
"scenario": "stopped_worker_and_api_broker_restart",
"attachment_id": "44188ba6-770d-4abc-9f87-c12b6c970953",
"message_id": "3cec2bb3-2ead-43a3-8b02-e14e0bb90b9b",
"queued_before": 1,
"queued_after": 1,
"broker_restart_verified": true,
"started_before": {
"api1": "2026-11-11T16:45:34.793026679Z",
"api2": "2026-11-11T16:45:34.851702Z",
"broker": "2026-11-11T16:45:35.58734277Z"
},
"started_after": {
"api1": "2026-11-11T16:46:45.590637906Z",
"api2": "2026-11-11T16:46:45.61923996Z",
"broker": "2026-11-11T16:46:46.290586048Z"
},
"ready_seconds": 1.923,
"thumbnail": [
256,
160
],
"result": "PASS"
},
{
"scenario": "five_duplicate_deliveries",
"attachment_id": "44188ba6-770d-4abc-9f87-c12b6c970953",
"attempts": 1,
"final_objects": [
"results/44188ba6-770d-4abc-9f87-c12b6c970953/v1/original",
"results/44188ba6-770d-4abc-9f87-c12b6c970953/v1/thumbnail"
],
"unchanged_metadata": true,
"result": "PASS"
},
{
"scenario": "bounded_retry",
"attachment_id": "ae50b181-c8d0-4ac9-bda1-312a1ac7ea18",
"attempts": 5,
"error_code": "retry_exhausted",
"download_status": 409,
"attach_status": 409,
"result": "PASS"
}
]
PASS: lab5 durable queue, restart, redelivery and retry scenarios
+120
View File
@@ -0,0 +1,120 @@
{
"python": "3.15.0",
"host": "Windows-11-10.0.26200-SP0",
"docker": {
"Client": {
"Version": "29.9.2",
"ApiVersion": "1.56",
"DefaultAPIVersion": "1.56",
"GitCommit": "a82e528",
"GoVersion": "go1.26.10",
"Os": "windows",
"Arch": "amd64",
"BuildTime": "Tue Oct 20 19:44:07 2026",
"Context": "desktop-linux"
},
"Server": {
"Platform": {
"Name": "Docker Desktop 4.97.0 (244584)"
},
"Version": "29.9.2",
"ApiVersion": "1.56",
"MinAPIVersion": "1.40",
"Os": "linux",
"Arch": "amd64",
"Components": [
{
"Name": "Engine",
"Version": "29.9.2",
"Details": {
"ApiVersion": "1.56",
"Arch": "amd64",
"BuildTime": "Tue Oct 20 18:45:02 2026",
"Experimental": "false",
"GitCommit": "0367cbe",
"GoVersion": "go1.26.10",
"KernelVersion": "6.18.58.1-microsoft-standard-WSL2",
"MinAPIVersion": "1.40",
"Module": "github.com/moby/moby/v2",
"ModuleVersion": "v2.0.0+unknown",
"Os": "linux"
}
},
{
"Name": "containerd",
"Version": "v2.4.2",
"Details": {
"GitCommit": "b7a25261e029d68978bbf290df0a62fc819b3c51"
}
},
{
"Name": "runc",
"Version": "1.5.2",
"Details": {
"GitCommit": "v1.5.2-0-g29dd3dc2"
}
},
{
"Name": "docker-init",
"Version": "0.19.0",
"Details": {
"GitCommit": "de40ad0"
}
}
],
"GitCommit": "0367cbe",
"GoVersion": "go1.26.10",
"KernelVersion": "6.18.58.1-microsoft-standard-WSL2",
"BuildTime": "2026-10-20T18:45:02.000000000+00:00"
}
},
"engine": {
"NCPU": 8,
"MemTotal": 8266620928,
"OSType": "linux",
"Architecture": "x86_64",
"OperatingSystem": "Docker Desktop"
},
"containers": {
"api1": {
"id": "612826f4ec33",
"started_at": "2026-11-11T16:51:24.765371526Z",
"image": "mtusi2026lab5-app:local"
},
"api2": {
"id": "9b599b4254f8",
"started_at": "2026-11-11T16:51:04.198535827Z",
"image": "mtusi2026lab5-app:local"
},
"broker": {
"id": "20286d777e33",
"started_at": "2026-11-11T16:50:08.421072775Z",
"image": "rabbitmq:4.1.0-alpine"
},
"db": {
"id": "2b1781c64aa8",
"started_at": "2026-11-11T16:50:07.211588868Z",
"image": "postgres:16.8-alpine"
},
"dispatcher": {
"id": "0439349883a7",
"started_at": "2026-11-11T16:50:10.075120403Z",
"image": "mtusi2026lab5-app:local"
},
"lb": {
"id": "480f671d010d",
"started_at": "2026-11-11T16:50:07.299916262Z",
"image": "nginx:1.27.5-alpine"
},
"s3": {
"id": "812c644b3b10",
"started_at": "2026-11-11T16:50:07.088841496Z",
"image": "cgr.dev/chainguard/minio@sha256:fb893e36fc369d41e92f678b17ec27378fa5bf0576aeef7ac15460c13629ab5a"
},
"worker": {
"id": "a50091a0b7a8",
"started_at": "2026-11-11T16:50:10.148806874Z",
"image": "mtusi2026lab5-app:local"
}
}
}
+1
View File
@@ -0,0 +1 @@
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.