forked from mtusi2026/mtusi2026lab2
docs: add lab2 report and recovery evidence
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
Container lab2study20261204200345-cache-1 Stopping
|
||||
Container lab2study20261204200345-cache-1 Stopped
|
||||
Container lab2study20261204200345-cache-1 Starting
|
||||
Container lab2study20261204200345-cache-1 Started
|
||||
Container lab2study20261204200345-db-1 Stopping
|
||||
Container lab2study20261204200345-db-1 Stopped
|
||||
Container lab2study20261204200345-db-1 Starting
|
||||
Container lab2study20261204200345-db-1 Started
|
||||
Container lab2study20261204200345-api-1 Recreate
|
||||
Container lab2study20261204200345-api-1 Recreated
|
||||
Container lab2study20261204200345-api-1 Starting
|
||||
Container lab2study20261204200345-api-1 Started
|
||||
Container lab2study20261204200345-api-1 Recreate
|
||||
Container lab2study20261204200345-api-1 Recreated
|
||||
Container lab2study20261204200345-api-1 Starting
|
||||
Container lab2study20261204200345-api-1 Started
|
||||
Concurrent registration, rollback, cache outage, DB outage and session expiry passed.
|
||||
@@ -0,0 +1,2 @@
|
||||
keyspace_hits:11
|
||||
keyspace_misses:3
|
||||
@@ -0,0 +1,2 @@
|
||||
keyspace_hits:0
|
||||
keyspace_misses:0
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,123 @@
|
||||
Cloning into '/tmp/tmp.M3y0Dvfxys/lab2'...
|
||||
4abfcf2cd90042cc613e237af5c513f5250d9409
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
#0 building with "default" instance using docker driver
|
||||
|
||||
#1 [migrate internal] load build definition from Dockerfile
|
||||
#1 transferring dockerfile: 1.09kB done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [migrate internal] load metadata for docker.io/library/node:24.22.1-bookworm-slim
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [migrate internal] load .dockerignore
|
||||
#3 transferring context: 196B done
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [migrate build 1/7] FROM docker.io/library/node:24.22.1-bookworm-slim
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [migrate internal] load build context
|
||||
#5 transferring context: 123.04kB done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [migrate build 4/7] RUN npm ci --ignore-scripts --no-audit --no-fund
|
||||
#6 CACHED
|
||||
|
||||
#7 [migrate build 3/7] COPY package.json package-lock.json ./
|
||||
#7 CACHED
|
||||
|
||||
#8 [migrate build 2/7] WORKDIR /app
|
||||
#8 CACHED
|
||||
|
||||
#9 [migrate build 5/7] COPY tsconfig.json ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [migrate build 6/7] COPY src ./src
|
||||
#10 DONE 0.0s
|
||||
|
||||
#11 [migrate build 7/7] RUN npm run build
|
||||
#11 0.289
|
||||
#11 0.289 > mtusi-messenger-lab2@1.0.0 build
|
||||
#11 0.289 > tsc -p tsconfig.json
|
||||
#11 0.289
|
||||
#11 DONE 3.9s
|
||||
|
||||
#12 [migrate runtime 4/7] COPY --from=build /app/dist ./dist
|
||||
#12 CACHED
|
||||
|
||||
#13 [migrate production-dependencies 4/4] RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund
|
||||
#13 CACHED
|
||||
|
||||
#14 [migrate runtime 5/7] COPY package.json ./
|
||||
#14 CACHED
|
||||
|
||||
#15 [migrate runtime 3/7] COPY --from=production-dependencies /app/node_modules ./node_modules
|
||||
#15 CACHED
|
||||
|
||||
#16 [migrate runtime 6/7] COPY contracts/openapi.json ./contracts/openapi.json
|
||||
#16 CACHED
|
||||
|
||||
#17 [migrate runtime 7/7] COPY migrations ./migrations
|
||||
#17 DONE 0.0s
|
||||
|
||||
#18 [migrate] exporting to image
|
||||
#18 exporting layers 0.0s done
|
||||
#18 writing image sha256:7ecaf69286572126c7ac4b338cee9abadb8bb249f54d079820efdf283d33f63d done
|
||||
#18 naming to docker.io/library/mtusi-lab2-app:local done
|
||||
#18 DONE 0.1s
|
||||
Network lab2clean20261204205817_default Creating
|
||||
Network lab2clean20261204205817_default Created
|
||||
Volume "lab2clean20261204205817_pg" Creating
|
||||
Volume "lab2clean20261204205817_pg" Created
|
||||
Volume "lab2clean20261204205817_cache" Creating
|
||||
Volume "lab2clean20261204205817_cache" Created
|
||||
Container lab2clean20261204205817-db-1 Creating
|
||||
Container lab2clean20261204205817-cache-1 Creating
|
||||
Container lab2clean20261204205817-db-1 Created
|
||||
Container lab2clean20261204205817-cache-1 Created
|
||||
Container lab2clean20261204205817-migrate-1 Creating
|
||||
Container lab2clean20261204205817-migrate-1 Created
|
||||
Container lab2clean20261204205817-api-1 Creating
|
||||
Container lab2clean20261204205817-api-1 Created
|
||||
Container lab2clean20261204205817-cache-1 Starting
|
||||
Container lab2clean20261204205817-db-1 Starting
|
||||
Container lab2clean20261204205817-cache-1 Started
|
||||
Container lab2clean20261204205817-db-1 Started
|
||||
Container lab2clean20261204205817-db-1 Waiting
|
||||
Container lab2clean20261204205817-db-1 Healthy
|
||||
Container lab2clean20261204205817-migrate-1 Starting
|
||||
Container lab2clean20261204205817-migrate-1 Started
|
||||
Container lab2clean20261204205817-migrate-1 Waiting
|
||||
Container lab2clean20261204205817-db-1 Waiting
|
||||
Container lab2clean20261204205817-db-1 Healthy
|
||||
Container lab2clean20261204205817-migrate-1 Exited
|
||||
Container lab2clean20261204205817-api-1 Starting
|
||||
Container lab2clean20261204205817-api-1 Started
|
||||
curl: (7) Failed to connect to 127.0.0.1 port 8080 after 0 ms: Could not connect to server
|
||||
{"status":"ok"}
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1: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.
|
||||
PASS: clean clone, smoke and persistence
|
||||
Container lab2clean20261204205817-api-1 Stopping
|
||||
Container lab2clean20261204205817-api-1 Stopped
|
||||
Container lab2clean20261204205817-api-1 Removing
|
||||
Container lab2clean20261204205817-api-1 Removed
|
||||
Container lab2clean20261204205817-migrate-1 Stopping
|
||||
Container lab2clean20261204205817-migrate-1 Stopped
|
||||
Container lab2clean20261204205817-migrate-1 Removing
|
||||
Container lab2clean20261204205817-migrate-1 Removed
|
||||
Container lab2clean20261204205817-cache-1 Stopping
|
||||
Container lab2clean20261204205817-db-1 Stopping
|
||||
Container lab2clean20261204205817-db-1 Stopped
|
||||
Container lab2clean20261204205817-db-1 Removing
|
||||
Container lab2clean20261204205817-db-1 Removed
|
||||
Container lab2clean20261204205817-cache-1 Stopped
|
||||
Container lab2clean20261204205817-cache-1 Removing
|
||||
Container lab2clean20261204205817-cache-1 Removed
|
||||
Network lab2clean20261204205817_default Removing
|
||||
Network lab2clean20261204205817_default Removed
|
||||
@@ -0,0 +1,11 @@
|
||||
2026-12-04T20:16:16+03:00
|
||||
project=lab2study20261204200345
|
||||
65003b61195361aac238f19c9bff0027ca58e09e
|
||||
client=26.1.4 server=26.1.4
|
||||
Docker Compose version v2.27.1-desktop.1
|
||||
cpus=8 ram_bytes=3948572672
|
||||
CONTAINER REPOSITORY TAG IMAGE ID SIZE
|
||||
lab2study20261204200345-api-1 mtusi-lab2-app local d59cebbd1962 240MB
|
||||
lab2study20261204200345-cache-1 valkey/valkey 8.1.3-alpine 49292cc259b2 47.9MB
|
||||
lab2study20261204200345-db-1 postgres 17.6-alpine d741b3768746 278MB
|
||||
lab2study20261204200345-migrate-1 mtusi-lab2-app local d59cebbd1962 240MB
|
||||
@@ -0,0 +1,22 @@
|
||||
List of relations
|
||||
Schema | Name | Type | Owner
|
||||
--------+------------+-------+-------
|
||||
public | chats | table | lab
|
||||
public | members | table | lab
|
||||
public | messages | table | lab
|
||||
public | migrations | table | lab
|
||||
public | sessions | table | lab
|
||||
public | users | table | lab
|
||||
(6 rows)
|
||||
|
||||
name
|
||||
---------
|
||||
001.sql
|
||||
(1 row)
|
||||
|
||||
Container lab2study20261204200345-db-1 Running
|
||||
Container lab2study20261204200345-cache-1 Running
|
||||
name | count
|
||||
---------+-------
|
||||
001.sql | 1
|
||||
(1 row)
|
||||
@@ -0,0 +1,2 @@
|
||||
/home/stepanov/study/vp/lab1/.venv/bin/python scripts/validate_openapi.py
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,3 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://127.0.0.1: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,12 @@
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Limit (cost=0.42..5.07 rows=51 width=68) (actual time=0.014..0.032 rows=51 loops=1)
|
||||
Buffers: shared hit=40
|
||||
-> Index Scan using history_key on messages (cost=0.42..7429.49 rows=81483 width=68) (actual time=0.013..0.029 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid) AND (ROW(created_at, id) > ROW('2026-12-04 17:45:54.914+00'::timestamp with time zone, '9a28ea29-1091-42e7-b44a-3872ced57edc'::uuid)))
|
||||
Buffers: shared hit=40
|
||||
Planning:
|
||||
Buffers: shared hit=6
|
||||
Planning Time: 0.112 ms
|
||||
Execution Time: 0.087 ms
|
||||
(9 rows)
|
||||
@@ -0,0 +1 @@
|
||||
100000|737f6db64b1a456f3f433b3c408f2a9c
|
||||
@@ -0,0 +1,13 @@
|
||||
chat_id | count
|
||||
--------------------------------------+-------
|
||||
10253fd7-f49d-4add-97e2-130e62ab0306 | 90000
|
||||
606e396f-a079-4d72-a249-2829fcebf542 | 1112
|
||||
5d840c9d-bee0-4fe0-9eb9-91368e28d7fe | 1111
|
||||
91610601-c5ca-4714-865a-fa76ff5df6e9 | 1111
|
||||
d36eefd0-6f0b-4561-9b33-dc3c3652502c | 1111
|
||||
e81a6804-79e7-4167-b831-a13b4ce50ad0 | 1111
|
||||
21059ea6-77da-42a7-9241-c3a4afcf4cf7 | 1111
|
||||
d44d420d-4c4c-4118-a135-fa868ddef743 | 1111
|
||||
9593d1a4-77d9-4175-81e2-44dc84101145 | 1111
|
||||
263f0414-8926-490e-bfa5-6ec08ed6a82d | 1111
|
||||
(10 rows)
|
||||
@@ -0,0 +1 @@
|
||||
PASS: selected rows on new volume
|
||||
@@ -0,0 +1 @@
|
||||
100000
|
||||
@@ -0,0 +1,66 @@
|
||||
Timing is on.
|
||||
INSERT 0 1
|
||||
Time: 3.601 ms
|
||||
INSERT 0 10
|
||||
Time: 2.276 ms
|
||||
SELECT 100000
|
||||
Time: 463.510 ms
|
||||
DROP INDEX
|
||||
Time: 3.420 ms
|
||||
CREATE TABLE
|
||||
Time: 5.623 ms
|
||||
ALTER TABLE
|
||||
Time: 4.390 ms
|
||||
CREATE INDEX
|
||||
Time: 2.480 ms
|
||||
INSERT 0 100000
|
||||
Time: 4284.598 ms (00:04.285)
|
||||
CREATE INDEX
|
||||
Time: 4.338 ms
|
||||
INSERT 0 100000
|
||||
Time: 4752.484 ms (00:04.752)
|
||||
ANALYZE
|
||||
Time: 67.604 ms
|
||||
ANALYZE
|
||||
Time: 66.671 ms
|
||||
Time: 0.725 ms
|
||||
QUERY PLAN
|
||||
--------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Limit (cost=4738.03..4743.89 rows=51 width=68) (actual time=23.277..31.083 rows=51 loops=1)
|
||||
Buffers: shared hit=1280
|
||||
-> Gather Merge (cost=4738.03..10831.42 rows=52986 width=68) (actual time=23.275..31.076 rows=51 loops=1)
|
||||
Workers Planned: 1
|
||||
Workers Launched: 1
|
||||
Buffers: shared hit=1280
|
||||
-> Sort (cost=3738.02..3870.48 rows=52986 width=68) (actual time=13.960..13.973 rows=40 loops=2)
|
||||
Sort Key: created_at DESC, id DESC
|
||||
Sort Method: top-N heapsort Memory: 36kB
|
||||
Buffers: shared hit=1280
|
||||
Worker 0: Sort Method: top-N heapsort Memory: 37kB
|
||||
-> Parallel Seq Scan on alternative (cost=0.00..1970.29 rows=52986 width=68) (actual time=0.008..6.159 rows=45000 loops=2)
|
||||
Filter: (chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid)
|
||||
Rows Removed by Filter: 5000
|
||||
Buffers: shared hit=1235
|
||||
Planning:
|
||||
Buffers: shared hit=49
|
||||
Planning Time: 0.391 ms
|
||||
Execution Time: 31.121 ms
|
||||
(19 rows)
|
||||
|
||||
Time: 32.904 ms
|
||||
QUERY PLAN
|
||||
----------------------------------------------------------------------------------------------------------------------------------------------
|
||||
Limit (cost=0.42..4.81 rows=51 width=68) (actual time=0.022..0.037 rows=51 loops=1)
|
||||
Buffers: shared hit=24
|
||||
-> Index Scan Backward using history_key on messages (cost=0.42..7736.02 rows=89770 width=68) (actual time=0.021..0.033 rows=51 loops=1)
|
||||
Index Cond: (chat_id = '10253fd7-f49d-4add-97e2-130e62ab0306'::uuid)
|
||||
Buffers: shared hit=24
|
||||
Planning:
|
||||
Buffers: shared hit=33
|
||||
Planning Time: 0.550 ms
|
||||
Execution Time: 0.058 ms
|
||||
(9 rows)
|
||||
|
||||
Time: 1.354 ms
|
||||
DROP TABLE
|
||||
Time: 8.325 ms
|
||||
@@ -0,0 +1,2 @@
|
||||
dump_seconds=1
|
||||
restore_seconds=0
|
||||
@@ -0,0 +1 @@
|
||||
100000|737f6db64b1a456f3f433b3c408f2a9c
|
||||
@@ -0,0 +1,5 @@
|
||||
000070d9-f6ca-4aec-82ed-6fdd8461df3f|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 86373|2026-12-04 17:45:55.373+00
|
||||
0000a738-48b6-4079-b568-30f07bd781ea|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 68540|2026-12-04 17:45:55.277+00
|
||||
00011c09-22d8-476b-bbdc-c649baf3c6fc|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 81174|2026-12-04 17:45:55.348+00
|
||||
000167a9-a525-40a5-a5e2-38f1e0e64ead|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 58751|2026-12-04 17:45:55.181+00
|
||||
0001d9f2-4d6b-4baf-bc2e-9d1719f748ab|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 6471|2026-12-04 17:45:54.904+00
|
||||
@@ -0,0 +1,5 @@
|
||||
000070d9-f6ca-4aec-82ed-6fdd8461df3f|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 86373|2026-12-04 17:45:55.373+00
|
||||
0000a738-48b6-4079-b568-30f07bd781ea|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 68540|2026-12-04 17:45:55.277+00
|
||||
00011c09-22d8-476b-bbdc-c649baf3c6fc|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 81174|2026-12-04 17:45:55.348+00
|
||||
000167a9-a525-40a5-a5e2-38f1e0e64ead|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 58751|2026-12-04 17:45:55.181+00
|
||||
0001d9f2-4d6b-4baf-bc2e-9d1719f748ab|10253fd7-f49d-4add-97e2-130e62ab0306|4ecdf46b-ab81-4ca3-a3b3-99c93329a548|sample 6471|2026-12-04 17:45:54.904+00
|
||||
@@ -0,0 +1,3 @@
|
||||
/lab2study20261204200345-db-1 2026-12-04T17:33:40.865833502Z
|
||||
/lab2study20261204200345-cache-1 2026-12-04T17:33:40.910297061Z
|
||||
/lab2study20261204200345-api-1 2026-12-04T17:33:40.910330464Z
|
||||
@@ -0,0 +1,3 @@
|
||||
/lab2study20261204200345-db-1 2026-12-04T17:13:05.443309776Z
|
||||
/lab2study20261204200345-cache-1 2026-12-04T17:13:05.440414023Z
|
||||
/lab2study20261204200345-api-1 2026-12-04T17:13:08.906507742Z
|
||||
@@ -0,0 +1,2 @@
|
||||
python3 tests/smoke.py --base-url "http://127.0.0.1:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,34 @@
|
||||
TAP version 13
|
||||
# Subtest: Basic preserves UTF-8 and colons in the password
|
||||
ok 1 - Basic preserves UTF-8 and colons in the password
|
||||
---
|
||||
duration_ms: 2.656599
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: malformed Basic and invalid UTF-8 fail before the KDF
|
||||
ok 2 - malformed Basic and invalid UTF-8 fail before the KDF
|
||||
---
|
||||
duration_ms: 0.913669
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: cursor binds the page to its resource
|
||||
ok 3 - cursor binds the page to its resource
|
||||
---
|
||||
duration_ms: 6.925018
|
||||
type: 'test'
|
||||
...
|
||||
# Subtest: strict query and UUID
|
||||
ok 4 - strict query and UUID
|
||||
---
|
||||
duration_ms: 0.444833
|
||||
type: 'test'
|
||||
...
|
||||
1..4
|
||||
# tests 4
|
||||
# suites 0
|
||||
# pass 4
|
||||
# fail 0
|
||||
# cancelled 0
|
||||
# skipped 0
|
||||
# todo 0
|
||||
# duration_ms 99.552651
|
||||
Reference in New Issue
Block a user