feat: add 5 experiment

This commit is contained in:
TAskMAster339
2026-10-10 21:32:33 +03:00
parent 6892af8842
commit 715f6c4175
1397 changed files with 271651 additions and 56 deletions
+183
View File
@@ -0,0 +1,183 @@
python3 scripts/init_env.py
Using existing .env.
chmod +x scripts/restart.sh scripts/stop-one.sh
docker compose --project-name highload-lab3 --env-file .env -f compose.yml up -d --build --wait
Image highload-lab3-api Building
Image highload-lab3-frontend Building
Image highload-lab3-migrate Building
#1 [internal] load local bake definitions
#1 reading from stdin 1.57kB done
#1 DONE 0.0s
#2 [migrate internal] load build definition from Dockerfile
#2 transferring dockerfile: 30B 0.0s
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.1s
#3 [frontend internal] load build definition from Dockerfile
#3 transferring dockerfile: 181B 0.0s done
#3 DONE 0.1s
#4 [frontend internal] load metadata for docker.io/library/node:22-bookworm-slim
#4 DONE 0.1s
#5 [migrate internal] load metadata for docker.io/library/debian:12.15-slim
#5 DONE 0.1s
#6 [api internal] load metadata for docker.io/library/golang:1.22.2-bookworm
#6 DONE 0.1s
#7 [api internal] load .dockerignore
#7 transferring context: 268B 0.0s done
#7 DONE 0.1s
#8 [frontend internal] load .dockerignore
#8 transferring context: 58B 0.0s done
#8 DONE 0.1s
#9 [api internal] load build context
#9 DONE 0.0s
#10 [api stage-1 1/4] FROM docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#10 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171
#10 resolve docker.io/library/debian:12.15-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 0.0s done
#10 DONE 0.1s
#11 [migrate builder 1/6] FROM docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f
#11 resolve docker.io/library/golang:1.22.2-bookworm@sha256:d0902bacefdde1cf45528c098d14e55d78c107def8a22d148eabd71582d7a99f 0.0s done
#11 DONE 0.1s
#12 [frontend 1/5] FROM docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c
#12 resolve docker.io/library/node:22-bookworm-slim@sha256:43ac6c60b8f89723f746e8a92ce91abd5017e627ce1ddfe4238355d3a30b772c 0.0s done
#12 DONE 0.0s
#13 [frontend internal] load build context
#13 transferring context: 488B 0.1s done
#13 DONE 0.1s
#14 [frontend 2/5] WORKDIR /app
#14 CACHED
#15 [frontend 3/5] COPY package.json package-lock.json ./
#15 CACHED
#16 [frontend 4/5] RUN npm ci
#16 CACHED
#17 [frontend 5/5] COPY . .
#17 CACHED
#18 [frontend] exporting to image
#18 exporting layers done
#18 exporting manifest sha256:303590eadf3b10cf82f8bd69752f2911a2233affa4482282a49a491c63dc2ee4 done
#18 exporting config sha256:95f58e78b76bf059bd9c63abd93221f66173e28c1f647fafd5697f88374851ab done
#18 exporting attestation manifest sha256:dfc2cb14647e021f8a0c6a810c4f71fea04df87e212557ef3ee8d3b745b9bc03 0.0s done
#18 exporting manifest list sha256:44ce2a7dc78c9a4bee6dfe6dbf0bcfd7b6bcdb8793e0a0739eb0d81727b5913b 0.0s done
#18 naming to docker.io/library/highload-lab3-frontend:latest done
#18 unpacking to docker.io/library/highload-lab3-frontend:latest 0.0s done
#18 DONE 0.1s
#9 [migrate internal] load build context
#9 transferring context: 2.49kB 0.2s done
#9 DONE 0.2s
#19 [migrate builder 4/6] RUN go mod download
#19 CACHED
#20 [migrate stage-1 2/4] RUN groupadd --system app && useradd --system --gid app --no-create-home app
#20 CACHED
#21 [migrate stage-1 3/4] WORKDIR /app
#21 CACHED
#22 [migrate builder 3/6] COPY go.mod go.sum ./
#22 CACHED
#23 [migrate builder 6/6] RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/messenger ./backend
#23 CACHED
#24 [migrate builder 2/6] WORKDIR /src
#24 CACHED
#25 [migrate builder 5/6] COPY backend ./backend
#25 CACHED
#26 [migrate stage-1 4/4] COPY --from=builder /out/messenger ./messenger
#26 CACHED
#27 [migrate] exporting to image
#27 exporting layers done
#27 exporting manifest sha256:6296df6ec63b814077cadf060d8955639bb5d9e2e9d10857665ebbc28ec5259e 0.0s done
#27 exporting config sha256:da5f66eb24dfae3c80d13346f6d9b5fcdc54843ae70886e5707cd255919166ba 0.0s done
#27 exporting attestation manifest sha256:f8a4e67264283e8dc26dddbfda2279763c3b4ab70183c62557fef9e186b0709c 0.0s done
#27 exporting manifest list sha256:1ee13f041c1c22da2a22ba31d0a83d705ecb20af3bfa1e86386fb40b45f3cd56 0.0s done
#27 naming to docker.io/library/highload-lab3-migrate:latest
#27 naming to docker.io/library/highload-lab3-migrate:latest done
#27 unpacking to docker.io/library/highload-lab3-migrate:latest 0.0s done
#27 DONE 0.2s
#28 [api] exporting to image
#28 exporting layers done
#28 exporting manifest sha256:8478f2a21479a514ce17a3192fb68f10b4ed12cd7221518569f924b08bf687ee 0.0s done
#28 exporting config sha256:ce142312cfb72e7dc18d91c693280ec6c7c4b2cd61342e7b9f0e194f143d5674 0.0s done
#28 exporting attestation manifest sha256:8fd67031db6063568c3fe174257fe9334a53894aa34595fadbc0b59ea130e0f7 0.0s done
#28 exporting manifest list sha256:a848c99c9f123fd4eab5437d2bded35ff91fc98a8e6b98bb5f346f22faba7c61 0.0s done
#28 naming to docker.io/library/highload-lab3-api:latest done
#28 unpacking to docker.io/library/highload-lab3-api:latest 0.0s done
#28 DONE 0.2s
#29 [frontend] resolving provenance for metadata file
#29 DONE 0.0s
#30 [migrate] resolving provenance for metadata file
#30 DONE 0.1s
#31 [api] resolving provenance for metadata file
#31 DONE 0.0s
Image highload-lab3-migrate Built
Image highload-lab3-api Built
Image highload-lab3-frontend Built
Container highload-lab3-haproxy-1 Running
Container highload-lab3-frontend-1 Running
Container highload-lab3-redis-1 Running
Container highload-lab3-db-1 Running
Container highload-lab3-migrate-1 Recreate
Container highload-lab3-migrate-1 Recreated
Container highload-lab3-api-10 Recreate
Container highload-lab3-api-9 Recreate
Container highload-lab3-api-10 Recreated
Container highload-lab3-api-9 Recreated
Container highload-lab3-db-1 Waiting
Container highload-lab3-db-1 Healthy
Container highload-lab3-migrate-1 Starting
Container highload-lab3-migrate-1 Started
Container highload-lab3-redis-1 Waiting
Container highload-lab3-migrate-1 Waiting
Container highload-lab3-db-1 Waiting
Container highload-lab3-redis-1 Healthy
Container highload-lab3-db-1 Healthy
Container highload-lab3-migrate-1 Exited
Container highload-lab3-api-9 Starting
Container highload-lab3-api-9 Started
Container highload-lab3-api-10 Starting
Container highload-lab3-api-10 Started
Container highload-lab3-api-9 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-9 Healthy
Container highload-lab3-api-10 Healthy
Container highload-lab3-haproxy-1 Waiting
Container highload-lab3-haproxy-1 Healthy
Container highload-lab3-migrate-1 Waiting
Container highload-lab3-api-9 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-haproxy-1 Waiting
Container highload-lab3-frontend-1 Waiting
Container highload-lab3-redis-1 Waiting
Container highload-lab3-db-1 Waiting
Container highload-lab3-frontend-1 Healthy
Container highload-lab3-migrate-1 Exited
Container highload-lab3-redis-1 Healthy
Container highload-lab3-db-1 Healthy
Container highload-lab3-haproxy-1 Healthy
Container highload-lab3-api-9 Healthy
Container highload-lab3-api-10 Healthy
+453
View File
@@ -0,0 +1,453 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 tests/smoke.py --base-url "http://localhost:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
docker compose --project-name highload-lab3 --env-file .env -f compose.yml --profile test run --build --rm backend-tests
Container highload-lab3-db-1 Running
Container highload-lab3-redis-1 Running
Image highload-lab3-backend-tests Building
#1 [internal] load local bake definitions
#1 reading from stdin 629B done
#1 DONE 0.0s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 661B 0.0s done
#2 DONE 0.0s
#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.2s
#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: 2.49kB 0.2s done
#6 DONE 0.2s
#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
#12 exporting layers 10.9s done
#12 exporting manifest sha256:4bd45c73a0da989b49052aa8050de520bf58aec57ea4df0596741bae3c1224d7 0.0s done
#12 exporting config sha256:37436eaab83b2bd6086c7f26cc412f7df6ae3d992339866ca29907f65fd1e477 0.0s done
#12 exporting attestation manifest sha256:41e8f1268bdd0593e88c8643aaff71be090ba4958657225440a14f8a665cdec0 0.0s done
#12 exporting manifest list sha256:afe26f12e4b9e826438564039760304347620cc5ce2ac6fe2822e916955e6884 0.0s done
#12 naming to docker.io/library/highload-lab3-backend-tests:latest
#12 naming to docker.io/library/highload-lab3-backend-tests:latest done
#12 unpacking to docker.io/library/highload-lab3-backend-tests:latest
#12 unpacking to docker.io/library/highload-lab3-backend-tests:latest 3.5s done
#12 DONE 14.6s
#13 resolving provenance for metadata file
#13 DONE 0.0s
Image highload-lab3-backend-tests Built
Container highload-lab3-redis-1 Waiting
Container highload-lab3-db-1 Waiting
Container highload-lab3-db-1 Healthy
Container highload-lab3-redis-1 Healthy
Container highload-lab3-backend-tests-run-5686bbb150cd Creating
Container highload-lab3-backend-tests-run-5686bbb150cd 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 TestConcurrentMessageCreation
--- PASS: TestConcurrentMessageCreation (4.08s)
=== RUN TestConcurrentRegistrationSameUsername
--- PASS: TestConcurrentRegistrationSameUsername (2.54s)
=== RUN TestChatTransactionRollsBackAfterMemberInsertFailure
--- PASS: TestChatTransactionRollsBackAfterMemberInsertFailure (1.37s)
=== 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.06287094s
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.75s)
=== RUN TestWrongPasswordAndLogoutHTTP
--- PASS: TestWrongPasswordAndLogoutHTTP (1.20s)
=== RUN TestDependencyFailuresReturnUnavailable
redis: 2026/10/10 15:21:21 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/10 15:21:21 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/10 15:21:22 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.32s)
=== 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.024,
"Actual Total Time": 0.036,
"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.023,
"Actual Total Time": 0.030,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = '4ac64013-bb9b-43d6-a152-8af364484845'::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.245,
"Triggers": [
],
"Execution Time": 0.390
}
]
=== 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.034,
"Actual Total Time": 0.052,
"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.032,
"Actual Total Time": 0.043,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = '4ac64013-bb9b-43d6-a152-8af364484845'::uuid) AND (ROW(created_at, id) > ROW('2026-01-01 00:00:00.009001+00'::timestamp with time zone, '1156bfaa-b184-46bc-bcd4-3067c12301ad'::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.142,
"Triggers": [
],
"Execution Time": 0.082
}
]
--- PASS: TestHistoryQueryPlanAtTenThousandMessages (0.76s)
--- PASS: TestHistoryQueryPlanAtTenThousandMessages/first (0.01s)
--- PASS: TestHistoryQueryPlanAtTenThousandMessages/late (0.00s)
=== RUN TestIdempotencyConcurrentStoresAndScopes
--- PASS: TestIdempotencyConcurrentStoresAndScopes (1.08s)
=== RUN TestIdempotencyRecordFailureRollsBackMessage
--- PASS: TestIdempotencyRecordFailureRollsBackMessage (0.54s)
=== RUN TestMessengerWorkflow
--- PASS: TestMessengerWorkflow (1.06s)
=== RUN TestCreateMessageBlankText
--- PASS: TestCreateMessageBlankText (0.48s)
=== RUN TestCreateMessageFromChatOutsider
--- PASS: TestCreateMessageFromChatOutsider (0.84s)
=== RUN TestListMessagesPagination
--- PASS: TestListMessagesPagination (0.46s)
=== RUN TestMessageLessUsesIDForEqualTimestamps
--- PASS: TestMessageLessUsesIDForEqualTimestamps (0.00s)
=== RUN TestListPageByChatUsesCursorAndLimit
--- PASS: TestListPageByChatUsesCursorAndLimit (0.44s)
=== RUN TestListPageByChatReturnsNonNilEmptyPage
--- PASS: TestListPageByChatReturnsNonNilEmptyPage (0.12s)
=== RUN TestPasswordKDFUsesSaltAndFullUTF8Password
--- PASS: TestPasswordKDFUsesSaltAndFullUTF8Password (1.26s)
=== RUN TestStoredPasswordUsesArgon2id
--- PASS: TestStoredPasswordUsesArgon2id (0.48s)
=== RUN TestBearerRequiredIgnoresXUserID
--- PASS: TestBearerRequiredIgnoresXUserID (0.00s)
=== RUN TestMessageCursorPreservesPosition
--- PASS: TestMessageCursorPreservesPosition (0.00s)
=== RUN TestCreateUserInvalidJSON
--- PASS: TestCreateUserInvalidJSON (0.00s)
=== RUN TestCreateUserDuplicateUsername
--- PASS: TestCreateUserDuplicateUsername (0.81s)
PASS
ok messenger/src/backend/tests 23.863s
python3 scripts/check_resources.py
[
{
"service": "db",
"instance": "edfcf3091ee4",
"cpu_limit": 1.0,
"memory_mib": 512,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "redis",
"instance": "9878e4b8eced",
"cpu_limit": 0.25,
"memory_mib": 128,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "migrate",
"instance": "d48adc3211d7",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "api",
"instance": "9d0505cca62a",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data",
"highload-lab3_proxy"
],
"public_ports": {}
},
{
"service": "api",
"instance": "d9e6ffbd1452",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data",
"highload-lab3_proxy"
],
"public_ports": {}
},
{
"service": "haproxy",
"instance": "1931592c46c7",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_edge",
"highload-lab3_proxy"
],
"public_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
}
},
{
"service": "frontend",
"instance": "ceb091ff4cee",
"cpu_limit": 0.5,
"memory_mib": 512,
"networks": [
"highload-lab3_edge"
],
"public_ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
}
}
]
PASS: effective CPU/RAM limits, two API replicas, private storage/API, isolated frontend
python3 scripts/check_idempotency.py --base-url "http://localhost:8080"
{"concurrent_requests": 24, "observed_instances": ["9d0505cca62a", "d9e6ffbd1452"], "messages_after_concurrent_repeat": 1}
PASS: shared session, concurrent replay across replicas, key/body validation, independent scopes, reauthentication on replay
python3 scripts/check_failover.py --base-url "http://localhost:8080"
{"stopped_instance": "9d0505cca62a", "container_state": "exited", "successful_writes": 120, "successful_reads": 117, "write_errors": 0, "read_errors": 3, "first_write_seconds": 1.749, "first_read_seconds": 1.756, "elapsed_seconds": 15.026, "lb_exclusion_seconds": 1.739, "successful_rps": 15.773, "attempted_rps": 15.972, "workload": "one sequential writer and reader, 100ms pause; not a capacity benchmark"}
Container highload-lab3-api-9 Running
Container highload-lab3-api-10 Starting
Container highload-lab3-api-10 Started
Container highload-lab3-api-9 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-9 Healthy
Container highload-lab3-api-10 Healthy
{"stopped_instance": "d9e6ffbd1452", "container_state": "exited", "successful_writes": 117, "successful_reads": 117, "write_errors": 2, "read_errors": 2, "first_write_seconds": 1.84, "first_read_seconds": 1.728, "elapsed_seconds": 15.02, "lb_exclusion_seconds": 1.831, "successful_rps": 15.579, "attempted_rps": 15.845, "workload": "one sequential writer and reader, 100ms pause; not a capacity benchmark"}
Container highload-lab3-api-10 Running
Container highload-lab3-api-9 Starting
Container highload-lab3-api-9 Started
Container highload-lab3-api-9 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-9 Healthy
Container highload-lab3-api-10 Healthy
PASS: each API replica stopped in turn; reads, writes, sessions and confirmed messages preserved
python3 scripts/check_rolling.py --base-url "http://localhost:8080"
Container highload-lab3-migrate-run-532e0d9e43fd Creating
Container highload-lab3-migrate-run-532e0d9e43fd Created
2026/10/10 15:22:45 migration up complete
Container highload-lab3-api-9 Running
Container highload-lab3-api-10 Creating
Container highload-lab3-api-10 Created
Container highload-lab3-api-10 Starting
Container highload-lab3-api-10 Started
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-9 Waiting
Container highload-lab3-api-10 Healthy
Container highload-lab3-api-9 Healthy
{"old_instance": "9d0505cca62a", "new_instance": "54723334925c", "survivor_instance": "d9e6ffbd1452", "replacement_seconds": 7.822, "graceful_shutdown": true}
Container highload-lab3-api-10 Running
Container highload-lab3-api-11 Creating
Container highload-lab3-api-11 Created
Container highload-lab3-api-11 Starting
Container highload-lab3-api-11 Started
Container highload-lab3-api-11 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-11 Healthy
Container highload-lab3-api-10 Healthy
{"old_instance": "d9e6ffbd1452", "new_instance": "818c316da5f1", "survivor_instance": "54723334925c", "replacement_seconds": 7.81, "graceful_shutdown": true}
{
"elapsed_seconds": 21.661,
"concurrency": 4,
"successful_writes": 1456,
"successful_reads": 1548,
"errors": 0,
"successful_rps": 138.685,
"replacements": [
{
"old_instance": "9d0505cca62a",
"new_instance": "54723334925c",
"survivor_instance": "d9e6ffbd1452",
"replacement_seconds": 7.822,
"graceful_shutdown": true
},
{
"old_instance": "d9e6ffbd1452",
"new_instance": "818c316da5f1",
"survivor_instance": "54723334925c",
"replacement_seconds": 7.81,
"graceful_shutdown": true
}
],
"confirmed_messages_preserved": true,
"session_preserved": true,
"workload": "two writers, two readers, 20ms pause per worker; not a capacity benchmark"
}
PASS: sequential replacement under load; all confirmed messages and sessions preserved
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.
+32
View File
@@ -0,0 +1,32 @@
[
{
"stopped_instance": "9d0505cca62a",
"container_state": "exited",
"successful_writes": 120,
"successful_reads": 117,
"write_errors": 0,
"read_errors": 3,
"first_write_seconds": 1.749,
"first_read_seconds": 1.756,
"elapsed_seconds": 15.026,
"lb_exclusion_seconds": 1.739,
"successful_rps": 15.773,
"attempted_rps": 15.972,
"workload": "one sequential writer and reader, 100ms pause; not a capacity benchmark"
},
{
"stopped_instance": "d9e6ffbd1452",
"container_state": "exited",
"successful_writes": 117,
"successful_reads": 117,
"write_errors": 2,
"read_errors": 2,
"first_write_seconds": 1.84,
"first_read_seconds": 1.728,
"elapsed_seconds": 15.02,
"lb_exclusion_seconds": 1.831,
"successful_rps": 15.579,
"attempted_rps": 15.845,
"workload": "one sequential writer and reader, 100ms pause; not a capacity benchmark"
}
]
@@ -0,0 +1,37 @@
Container highload-lab3-redis-1 Running
Container highload-lab3-db-1 Running
Container highload-lab3-api-10 Running
Container highload-lab3-haproxy-1 Running
Container highload-lab3-frontend-1 Running
Container highload-lab3-db-1 Waiting
Container highload-lab3-db-1 Healthy
Container highload-lab3-migrate-1 Starting
Container highload-lab3-migrate-1 Started
Container highload-lab3-migrate-1 Waiting
Container highload-lab3-db-1 Waiting
Container highload-lab3-redis-1 Waiting
Container highload-lab3-migrate-1 Exited
Container highload-lab3-db-1 Healthy
Container highload-lab3-redis-1 Healthy
Container highload-lab3-api-11 Starting
Container highload-lab3-api-11 Started
Container highload-lab3-api-11 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-api-11 Healthy
Container highload-lab3-api-10 Healthy
Container highload-lab3-haproxy-1 Waiting
Container highload-lab3-haproxy-1 Healthy
Container highload-lab3-db-1 Waiting
Container highload-lab3-migrate-1 Waiting
Container highload-lab3-api-11 Waiting
Container highload-lab3-api-10 Waiting
Container highload-lab3-haproxy-1 Waiting
Container highload-lab3-frontend-1 Waiting
Container highload-lab3-redis-1 Waiting
Container highload-lab3-db-1 Healthy
Container highload-lab3-haproxy-1 Healthy
Container highload-lab3-frontend-1 Healthy
Container highload-lab3-migrate-1 Exited
Container highload-lab3-redis-1 Healthy
Container highload-lab3-api-11 Healthy
Container highload-lab3-api-10 Healthy
@@ -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": 125, "failed_attempts": 2, "first_recovery_seconds": 1.881}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+95
View File
@@ -0,0 +1,95 @@
[
{
"service": "db",
"instance": "edfcf3091ee4",
"cpu_limit": 1.0,
"memory_mib": 512,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "redis",
"instance": "9878e4b8eced",
"cpu_limit": 0.25,
"memory_mib": 128,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "migrate",
"instance": "d48adc3211d7",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data"
],
"public_ports": {}
},
{
"service": "api",
"instance": "9d0505cca62a",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data",
"highload-lab3_proxy"
],
"public_ports": {}
},
{
"service": "api",
"instance": "d9e6ffbd1452",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_data",
"highload-lab3_proxy"
],
"public_ports": {}
},
{
"service": "haproxy",
"instance": "1931592c46c7",
"cpu_limit": 0.5,
"memory_mib": 128,
"networks": [
"highload-lab3_edge",
"highload-lab3_proxy"
],
"public_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
],
"8404/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8404"
}
]
}
},
{
"service": "frontend",
"instance": "ceb091ff4cee",
"cpu_limit": 0.5,
"memory_mib": 512,
"networks": [
"highload-lab3_edge"
],
"public_ports": {
"5173/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "5173"
}
]
}
}
]
+27
View File
@@ -0,0 +1,27 @@
{
"elapsed_seconds": 21.661,
"concurrency": 4,
"successful_writes": 1456,
"successful_reads": 1548,
"errors": 0,
"successful_rps": 138.685,
"replacements": [
{
"old_instance": "9d0505cca62a",
"new_instance": "54723334925c",
"survivor_instance": "d9e6ffbd1452",
"replacement_seconds": 7.822,
"graceful_shutdown": true
},
{
"old_instance": "d9e6ffbd1452",
"new_instance": "818c316da5f1",
"survivor_instance": "54723334925c",
"replacement_seconds": 7.81,
"graceful_shutdown": true
}
],
"confirmed_messages_preserved": true,
"session_preserved": true,
"workload": "two writers, two readers, 20ms pause per worker; not a capacity benchmark"
}
+90
View File
@@ -0,0 +1,90 @@
{
"finished_utc": "2026-10-10T15:24:50.674336+00:00",
"branch": "solution/BVT2303-Grishko",
"commands": [
{
"command": "make app-up",
"exit_code": 0
},
{
"command": "make check test test-backend test-grade4 test-persistence ACTION_SCRIPT=scripts/restart.sh",
"exit_code": 0
},
{
"command": "make test-failover ACTION_SCRIPT=scripts/stop-one.sh",
"exit_code": 0
},
{
"command": "docker compose --project-name highload-lab3 --env-file .env -f compose.yml up -d --wait",
"exit_code": 0
}
],
"go_race_tests_passed": 24,
"benchmark_running_containers": 0,
"normal_containers": [
{
"service": "api",
"instance": "54723334925c",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:23:15.427983388Z",
"cpu": 500000000,
"memory": 134217728,
"gomaxprocs": "1"
},
{
"service": "api",
"instance": "818c316da5f1",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:24:08.888220409Z",
"cpu": 500000000,
"memory": 134217728,
"gomaxprocs": "1"
},
{
"service": "db",
"instance": "edfcf3091ee4",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:23:10.948978594Z",
"cpu": 1000000000,
"memory": 536870912
},
{
"service": "frontend",
"instance": "ceb091ff4cee",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:19:04.418948251Z",
"cpu": 500000000,
"memory": 536870912
},
{
"service": "haproxy",
"instance": "1931592c46c7",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:19:01.399280337Z",
"cpu": 500000000,
"memory": 134217728
},
{
"service": "redis",
"instance": "9878e4b8eced",
"state": "running",
"health": "healthy",
"started": "2026-10-10T15:23:10.83203081Z",
"cpu": 250000000,
"memory": 134217728
}
],
"hook_scope": {
"restart": "scripts/restart.sh restarts db, redis, then all API; preserves volumes",
"failover": "scripts/stop-one.sh resolves only this project API by TARGET_INSTANCE_ID and stops that container"
},
"hook_sha256": {
"restart.sh": "0bdb05ec336f4e175ab2a76f172fcab06512003f70962adcd3e4c64567da1c43",
"stop-one.sh": "6eda7ff0eaaf521a2510e3b4ea2675ec7cd44851aeedf7300ca099ade9fa46f8"
}
}