forked from mtusi2026/mtusi2026lab2
ЛР 2 — БПИ-2304 — Саламатин — на 4
This commit is contained in:
+5
-5
@@ -1,5 +1,5 @@
|
||||
# Доказательства
|
||||
|
||||
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
|
||||
|
||||
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
|
||||
# Доказательства
|
||||
|
||||
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
|
||||
|
||||
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 994B 0.1s done
|
||||
#1 DONE 0.1s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.20kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/python:3.13.15-slim-bookworm
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [internal] load .dockerignore
|
||||
#4 transferring context: 155B done
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:ed86c82274b3c69b52fb5820f358f0bd7df0b603332063cb5c6e32bd220c3e6e
|
||||
#5 resolve docker.io/library/python:3.13.15-slim-bookworm@sha256:ed86c82274b3c69b52fb5820f358f0bd7df0b603332063cb5c6e32bd220c3e6e 0.0s done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [internal] load build context
|
||||
#6 transferring context: 144.46kB 0.0s done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [runtime 2/7] WORKDIR /app
|
||||
#7 CACHED
|
||||
|
||||
#8 [runtime 3/7] COPY requirements.txt .
|
||||
#8 CACHED
|
||||
|
||||
#9 [runtime 4/7] RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home messenger
|
||||
#9 CACHED
|
||||
|
||||
#10 [runtime 5/7] COPY app ./app
|
||||
#10 DONE 0.1s
|
||||
|
||||
#11 [runtime 6/7] COPY migrations ./migrations
|
||||
#11 DONE 0.1s
|
||||
|
||||
#12 [runtime 7/7] COPY contracts/openapi.json ./contracts/openapi.json
|
||||
#12 DONE 0.1s
|
||||
|
||||
#13 exporting to image
|
||||
#13 exporting layers
|
||||
#13 exporting layers 0.2s done
|
||||
#13 exporting manifest sha256:eabb6884a68e4d764d61d946a247e898543ffd0b0f83fadbffe9b0f51e402923 0.0s done
|
||||
#13 exporting config sha256:b9bb26dbe47aeeaf9edf195d019c7fd878d2c385e9a8e49536df8b213b068991 0.0s done
|
||||
#13 exporting attestation manifest sha256:69e5892af7011393aaa969ec7fc9c4b97b3daad4675ea8e646b3e405478b0db3 0.0s done
|
||||
#13 exporting manifest list sha256:925ffec97353c6a6533ff61927bbce197e8b4a0ab26fe7e84c76d3ba3366a879 0.0s done
|
||||
#13 naming to docker.io/library/mtusi-messenger:lab2
|
||||
#13 naming to docker.io/library/mtusi-messenger:lab2 done
|
||||
#13 unpacking to docker.io/library/mtusi-messenger:lab2
|
||||
#13 unpacking to docker.io/library/mtusi-messenger:lab2 0.4s done
|
||||
#13 DONE 0.7s
|
||||
|
||||
#14 resolving provenance for metadata file
|
||||
#14 DONE 0.0s
|
||||
Image mtusi-messenger:lab2 Building
|
||||
Image mtusi-messenger:lab2 Built
|
||||
@@ -0,0 +1,221 @@
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.67kB 0.1s done
|
||||
#1 DONE 0.1s
|
||||
|
||||
#2 [api internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 1.23kB done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [api internal] load metadata for docker.io/library/python:3.13.15-slim-bookworm
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [checks internal] load metadata for docker.io/library/docker:28.5.1-cli
|
||||
#4 DONE 0.1s
|
||||
|
||||
#5 [api internal] load .dockerignore
|
||||
#5 transferring context: 164B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [api internal] load build context
|
||||
#6 transferring context: 95.03kB 0.0s done
|
||||
#6 transferring context: 95.03kB 0.0s done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [checks runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:ed86c82274b3c69b52fb5820f358f0bd7df0b603332063cb5c6e32bd220c3e6e
|
||||
#7 resolve docker.io/library/python:3.13.15-slim-bookworm@sha256:ed86c82274b3c69b52fb5820f358f0bd7df0b603332063cb5c6e32bd220c3e6e 0.1s done
|
||||
#7 DONE 0.1s
|
||||
|
||||
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
|
||||
#8 resolve docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad 0.1s done
|
||||
#8 CACHED
|
||||
|
||||
#9 [checks runtime 2/7] WORKDIR /app
|
||||
#9 CACHED
|
||||
|
||||
#10 [api runtime 3/7] COPY requirements.txt .
|
||||
#10 DONE 0.1s
|
||||
|
||||
#11 [checks runtime 4/7] RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home messenger
|
||||
#11 1.859 Ignoring colorama: markers 'sys_platform == "win32"' don't match your environment
|
||||
#11 2.149 Collecting annotated-doc==0.0.5 (from -r requirements.txt (line 1))
|
||||
#11 7.503 Downloading annotated_doc-0.0.5-py3-none-any.whl.metadata (6.5 kB)
|
||||
#11 7.565 Collecting annotated-types==0.8.0 (from -r requirements.txt (line 2))
|
||||
#11 7.622 Downloading annotated_types-0.8.0-py3-none-any.whl.metadata (15 kB)
|
||||
#11 7.710 Collecting anyio==4.15.1 (from -r requirements.txt (line 3))
|
||||
#11 7.770 Downloading anyio-4.15.1-py3-none-any.whl.metadata (4.7 kB)
|
||||
#11 7.847 Collecting click==8.5.0 (from -r requirements.txt (line 4))
|
||||
#11 7.899 Downloading click-8.5.0-py3-none-any.whl.metadata (2.6 kB)
|
||||
#11 8.059 Collecting fastapi==0.141.1 (from -r requirements.txt (line 6))
|
||||
#11 8.109 Downloading fastapi-0.141.1-py3-none-any.whl.metadata (27 kB)
|
||||
#11 8.195 Collecting h11==0.16.0 (from -r requirements.txt (line 7))
|
||||
#11 8.246 Downloading h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
|
||||
#11 8.312 Collecting idna==3.20 (from -r requirements.txt (line 8))
|
||||
#11 8.363 Downloading idna-3.20-py3-none-any.whl.metadata (7.2 kB)
|
||||
#11 8.594 Collecting pydantic==2.13.5 (from -r requirements.txt (line 9))
|
||||
#11 8.646 Downloading pydantic-2.13.5-py3-none-any.whl.metadata (110 kB)
|
||||
#11 9.596 Collecting pydantic-core==2.46.5 (from -r requirements.txt (line 10))
|
||||
#11 9.647 Downloading pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
|
||||
#11 9.717 Collecting starlette==1.6.0 (from -r requirements.txt (line 11))
|
||||
#11 9.769 Downloading starlette-1.6.0-py3-none-any.whl.metadata (6.4 kB)
|
||||
#11 9.831 Collecting typing-extensions==4.16.0 (from -r requirements.txt (line 12))
|
||||
#11 9.882 Downloading typing_extensions-4.16.0-py3-none-any.whl.metadata (3.3 kB)
|
||||
#11 9.939 Collecting typing-inspection==0.4.4 (from -r requirements.txt (line 13))
|
||||
#11 9.989 Downloading typing_inspection-0.4.4-py3-none-any.whl.metadata (2.6 kB)
|
||||
#11 10.06 Collecting uvicorn==0.53.0 (from -r requirements.txt (line 14))
|
||||
#11 10.11 Downloading uvicorn-0.53.0-py3-none-any.whl.metadata (6.6 kB)
|
||||
#11 10.17 Collecting psycopg==3.2.10 (from psycopg[binary]==3.2.10->-r requirements.txt (line 15))
|
||||
#11 10.22 Downloading psycopg-3.2.10-py3-none-any.whl.metadata (4.6 kB)
|
||||
#11 10.29 Collecting psycopg-pool==3.2.6 (from -r requirements.txt (line 16))
|
||||
#11 10.35 Downloading psycopg_pool-3.2.6-py3-none-any.whl.metadata (2.6 kB)
|
||||
#11 10.42 Collecting redis==6.4.0 (from -r requirements.txt (line 17))
|
||||
#11 10.47 Downloading redis-6.4.0-py3-none-any.whl.metadata (10 kB)
|
||||
#11 10.72 Collecting psycopg-binary==3.2.10 (from psycopg[binary]==3.2.10->-r requirements.txt (line 15))
|
||||
#11 10.77 Downloading psycopg_binary-3.2.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (3.0 kB)
|
||||
#11 10.82 Downloading annotated_doc-0.0.5-py3-none-any.whl (5.3 kB)
|
||||
#11 10.88 Downloading annotated_types-0.8.0-py3-none-any.whl (13 kB)
|
||||
#11 10.93 Downloading anyio-4.15.1-py3-none-any.whl (132 kB)
|
||||
#11 11.02 Downloading click-8.5.0-py3-none-any.whl (125 kB)
|
||||
#11 11.09 Downloading fastapi-0.141.1-py3-none-any.whl (131 kB)
|
||||
#11 11.16 Downloading h11-0.16.0-py3-none-any.whl (37 kB)
|
||||
#11 11.22 Downloading idna-3.20-py3-none-any.whl (69 kB)
|
||||
#11 11.28 Downloading pydantic-2.13.5-py3-none-any.whl (472 kB)
|
||||
#11 11.40 Downloading pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
|
||||
#11 11.53 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 17.4 MB/s 0:00:00
|
||||
#11 11.58 Downloading starlette-1.6.0-py3-none-any.whl (75 kB)
|
||||
#11 11.63 Downloading typing_extensions-4.16.0-py3-none-any.whl (45 kB)
|
||||
#11 11.69 Downloading typing_inspection-0.4.4-py3-none-any.whl (14 kB)
|
||||
#11 11.74 Downloading uvicorn-0.53.0-py3-none-any.whl (87 kB)
|
||||
#11 11.80 Downloading psycopg-3.2.10-py3-none-any.whl (206 kB)
|
||||
#11 11.86 Downloading psycopg_pool-3.2.6-py3-none-any.whl (38 kB)
|
||||
#11 11.91 Downloading redis-6.4.0-py3-none-any.whl (279 kB)
|
||||
#11 12.00 Downloading psycopg_binary-3.2.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.4 MB)
|
||||
#11 12.16 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 27.5 MB/s 0:00:00
|
||||
#11 12.31 Installing collected packages: typing-extensions, redis, psycopg-binary, psycopg, idna, h11, click, annotated-types, annotated-doc, uvicorn, typing-inspection, pydantic-core, psycopg-pool, anyio, starlette, pydantic, fastapi
|
||||
#11 13.78
|
||||
#11 13.78 Successfully installed annotated-doc-0.0.5 annotated-types-0.8.0 anyio-4.15.1 click-8.5.0 fastapi-0.141.1 h11-0.16.0 idna-3.20 psycopg-3.2.10 psycopg-binary-3.2.10 psycopg-pool-3.2.6 pydantic-2.13.5 pydantic-core-2.46.5 redis-6.4.0 starlette-1.6.0 typing-extensions-4.16.0 typing-inspection-0.4.4 uvicorn-0.53.0
|
||||
#11 13.78 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
|
||||
#11 13.78
|
||||
#11 13.78 [notice] A new release of pip is available: 26.2.1 -> 26.2.2
|
||||
#11 13.78 [notice] To update, run: pip install --upgrade pip
|
||||
#11 DONE 15.2s
|
||||
|
||||
#11 [api runtime 4/7] RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home messenger
|
||||
#11 DONE 15.2s
|
||||
|
||||
#12 [api runtime 5/7] COPY app ./app
|
||||
#12 DONE 0.1s
|
||||
|
||||
#12 [checks runtime 5/7] COPY app ./app
|
||||
#12 DONE 0.1s
|
||||
|
||||
#13 [api runtime 6/7] COPY migrations ./migrations
|
||||
#13 DONE 0.1s
|
||||
|
||||
#13 [checks runtime 6/7] COPY migrations ./migrations
|
||||
#13 DONE 0.1s
|
||||
|
||||
#14 [checks runtime 7/7] COPY contracts/openapi.json ./contracts/openapi.json
|
||||
#14 DONE 0.1s
|
||||
|
||||
#14 [api runtime 7/7] COPY contracts/openapi.json ./contracts/openapi.json
|
||||
#14 DONE 0.1s
|
||||
|
||||
#15 [api] exporting to image
|
||||
#15 exporting layers
|
||||
#15 ...
|
||||
|
||||
#16 [checks checks 1/4] COPY --from=docker_cli /usr/local/bin/docker /usr/local/bin/docker
|
||||
#16 DONE 0.7s
|
||||
|
||||
#17 [checks checks 2/4] COPY --from=docker_cli /usr/local/libexec/docker/cli-plugins/docker-compose /usr/local/libexec/docker/cli-plugins/docker-compose
|
||||
#17 DONE 0.4s
|
||||
|
||||
#15 [api] exporting to image
|
||||
#15 exporting layers 1.9s done
|
||||
#15 exporting manifest sha256:88629bd895cdfe4491719cd197009564003e40c7cc2bfb55a17ac03ddf0a6b5b 0.0s done
|
||||
#15 exporting config sha256:469b05afaf80badba696a75e674adf0714ffc38f07a869cc88a5dcb17990d33d 0.0s done
|
||||
#15 exporting attestation manifest sha256:f202ed4c417fa9a384abaf2228985367c07dff7c1d0a71bfb9ea9e3e93e7a2ac 0.0s done
|
||||
#15 exporting manifest list sha256:dab3ec7c7d69de21873d119e07d6348bce002537737d1265baf0908c206fc29d 0.0s done
|
||||
#15 naming to docker.io/library/mtusi-messenger:lab2 done
|
||||
#15 unpacking to docker.io/library/mtusi-messenger:lab2
|
||||
#15 unpacking to docker.io/library/mtusi-messenger:lab2 0.4s done
|
||||
#15 DONE 2.4s
|
||||
|
||||
#18 [checks checks 3/4] RUN apt-get update && apt-get install -y --no-install-recommends make && rm -rf /var/lib/apt/lists/*
|
||||
#18 0.680 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
|
||||
#18 0.922 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
|
||||
#18 1.154 Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [34.8 kB]
|
||||
#18 ...
|
||||
|
||||
#19 [api] resolving provenance for metadata file
|
||||
#19 DONE 0.0s
|
||||
|
||||
#18 [checks checks 3/4] RUN apt-get update && apt-get install -y --no-install-recommends make && rm -rf /var/lib/apt/lists/*
|
||||
#18 1.704 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8790 kB]
|
||||
#18 2.174 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [6924 B]
|
||||
#18 2.500 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [359 kB]
|
||||
#18 2.917 Fetched 9398 kB in 3s (3541 kB/s)
|
||||
#18 2.917 Reading package lists...
|
||||
#18 3.394 Reading package lists...
|
||||
#18 3.847 Building dependency tree...
|
||||
#18 3.985 Reading state information...
|
||||
#18 4.133 Suggested packages:
|
||||
#18 4.133 make-doc
|
||||
#18 4.160 The following NEW packages will be installed:
|
||||
#18 4.160 make
|
||||
#18 4.506 0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
|
||||
#18 4.506 Need to get 396 kB of archives.
|
||||
#18 4.506 After this operation, 1630 kB of additional disk space will be used.
|
||||
#18 4.506 Get:1 http://deb.debian.org/debian bookworm/main amd64 make amd64 4.3-4.1 [396 kB]
|
||||
#18 4.624 debconf: delaying package configuration, since apt-utils is not installed
|
||||
#18 4.652 Fetched 396 kB in 0s (1129 kB/s)
|
||||
#18 4.680 Selecting previously unselected package make.
|
||||
#18 4.680 (Reading database ...
|
||||
(Reading database ... 5%
|
||||
(Reading database ... 10%
|
||||
(Reading database ... 15%
|
||||
(Reading database ... 20%
|
||||
(Reading database ... 25%
|
||||
(Reading database ... 30%
|
||||
(Reading database ... 35%
|
||||
(Reading database ... 40%
|
||||
(Reading database ... 45%
|
||||
(Reading database ... 50%
|
||||
(Reading database ... 55%
|
||||
(Reading database ... 60%
|
||||
(Reading database ... 65%
|
||||
(Reading database ... 70%
|
||||
(Reading database ... 75%
|
||||
(Reading database ... 80%
|
||||
(Reading database ... 85%
|
||||
(Reading database ... 90%
|
||||
(Reading database ... 95%
|
||||
(Reading database ... 100%
|
||||
(Reading database ... 6647 files and directories currently installed.)
|
||||
#18 4.683 Preparing to unpack .../make_4.3-4.1_amd64.deb ...
|
||||
#18 4.689 Unpacking make (4.3-4.1) ...
|
||||
#18 4.773 Setting up make (4.3-4.1) ...
|
||||
#18 DONE 6.3s
|
||||
|
||||
#20 [checks checks 4/4] WORKDIR /checks
|
||||
#20 DONE 0.1s
|
||||
|
||||
#21 [checks] exporting to image
|
||||
#21 exporting layers
|
||||
#21 exporting layers 2.9s done
|
||||
#21 exporting manifest sha256:49d6d008bb2c3cb03b97fe58083398e88721321a85a9aa84c8ea336b20c44762 0.0s done
|
||||
#21 exporting config sha256:ddb92bb96530abdc7d8ec600f3cec2e343316c4264847262460e1821895ee1ab 0.0s done
|
||||
#21 exporting attestation manifest sha256:697058f72f4a5bda4c65bbec5924e1f324bda75c8a159347ae5a8346cb153291 0.0s done
|
||||
#21 exporting manifest list sha256:191de4b93466a8945a8e8653f764d4473d9ab919c8b925c86b902b7df5d9da7e 0.0s done
|
||||
#21 naming to docker.io/library/mtusi-messenger:lab2-checks
|
||||
#21 naming to docker.io/library/mtusi-messenger:lab2-checks done
|
||||
#21 unpacking to docker.io/library/mtusi-messenger:lab2-checks
|
||||
#21 unpacking to docker.io/library/mtusi-messenger:lab2-checks 0.7s done
|
||||
#21 DONE 3.8s
|
||||
|
||||
#22 [checks] resolving provenance for metadata file
|
||||
#22 DONE 0.0s
|
||||
Image mtusi-messenger:lab2-checks Building
|
||||
Image mtusi-messenger:lab2 Building
|
||||
Image mtusi-messenger:lab2-checks Built
|
||||
Image mtusi-messenger:lab2 Built
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"session_ttl_seconds": 2,
|
||||
"wait_seconds": 2.3,
|
||||
"before_expiry_status": 200,
|
||||
"after_expiry_status": 401,
|
||||
"result": "PASS"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
FIRST
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..4.29 rows=51 width=70) (actual time=0.010..0.023 rows=51 loops=1)
|
||||
Buffers: shared hit=4
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..786.29 rows=10000 width=70) (actual time=0.010..0.019 rows=51 loops=1)
|
||||
Index Cond: (chat_id = 'e430ecd3-d167-42cf-923e-9d8864aa454a'::uuid)
|
||||
Buffers: shared hit=4
|
||||
Planning Time: 0.057 ms
|
||||
Execution Time: 0.032 ms
|
||||
|
||||
MIDDLE
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..5.65 rows=51 width=70) (actual time=0.013..0.022 rows=51 loops=1)
|
||||
Buffers: shared hit=4
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..520.50 rows=4945 width=70) (actual time=0.012..0.019 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = 'e430ecd3-d167-42cf-923e-9d8864aa454a'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:47:47.309662+00'::timestamp with time zone, '09540584-a18b-4d60-8a4d-6090097999ba'::uuid)))
|
||||
Buffers: shared hit=4
|
||||
Planning Time: 0.055 ms
|
||||
Execution Time: 0.033 ms
|
||||
|
||||
LATE
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..70.42 rows=51 width=70) (actual time=0.017..0.027 rows=51 loops=1)
|
||||
Buffers: shared hit=3
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..135.06 rows=98 width=70) (actual time=0.017..0.023 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = 'e430ecd3-d167-42cf-923e-9d8864aa454a'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:47:47.314562+00'::timestamp with time zone, '6a60bce1-7a0f-45d3-9836-95b9d7797e39'::uuid)))
|
||||
Buffers: shared hit=3
|
||||
Planning Time: 0.072 ms
|
||||
Execution Time: 0.041 ms
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"redis": {
|
||||
"ready_status": 503,
|
||||
"protected_status": 503,
|
||||
"elapsed_seconds": 2.002,
|
||||
"anonymous_status": 401
|
||||
},
|
||||
"postgres": {
|
||||
"ready_status": 503,
|
||||
"protected_status": 503,
|
||||
"elapsed_seconds": 1.004,
|
||||
"anonymous_status": 401
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://api: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.
|
||||
Container mtusi-lab2-clean-v2-checks-run-75cfed86c889 Creating
|
||||
Container mtusi-lab2-clean-v2-checks-run-75cfed86c889 Created
|
||||
@@ -0,0 +1 @@
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "c999209e71f1e05cf73dd96ed6a8d332f1d7bdb81961b3fdf44656c54207ddb3",
|
||||
"started_at": "2026-10-30T21:46:56.799081876Z",
|
||||
"image_id": "sha256:dab3ec7c7d69de21873d119e07d6348bce002537737d1265baf0908c206fc29d",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "921d8a5c2d722009d9946de24218aad6ca7ab83dcb1b5e3291793830bf7dfd0b",
|
||||
"started_at": "2026-10-30T21:47:18.268247786Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "eee46ebafd47d00f403ef05b6630ce26559ffcb81f33414f2d08712149a3100d",
|
||||
"started_at": "2026-10-30T21:47:21.369108706Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "c999209e71f1e05cf73dd96ed6a8d332f1d7bdb81961b3fdf44656c54207ddb3",
|
||||
"started_at": "2026-10-30T21:47:30.173918792Z",
|
||||
"image_id": "sha256:dab3ec7c7d69de21873d119e07d6348bce002537737d1265baf0908c206fc29d",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "921d8a5c2d722009d9946de24218aad6ca7ab83dcb1b5e3291793830bf7dfd0b",
|
||||
"started_at": "2026-10-30T21:47:30.087996017Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "eee46ebafd47d00f403ef05b6630ce26559ffcb81f33414f2d08712149a3100d",
|
||||
"started_at": "2026-10-30T21:47:29.894086274Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"commit": "3b65e93a4996f5093315ff935ccbd8ec53cddeb5",
|
||||
"status_before": "",
|
||||
"secrets_present_before": false,
|
||||
"project": "mtusi-lab2-clean-v2",
|
||||
"published_port": 18082,
|
||||
"build_no_cache": true,
|
||||
"sql_checkout_lf": true,
|
||||
"result": "PASS",
|
||||
"independent_secrets": true,
|
||||
"restart_services": [
|
||||
"api",
|
||||
"postgres",
|
||||
"redis"
|
||||
],
|
||||
"public_smoke_through_published_port": "PASS",
|
||||
"source_clone": "local git clone --no-local"
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
Network mtusi-lab2-clean-v2_default Creating
|
||||
Network mtusi-lab2-clean-v2_default Creating
|
||||
Volume mtusi-lab2-clean-v2_redis_data Creating
|
||||
Volume mtusi-lab2-clean-v2_redis_data Creating
|
||||
Volume mtusi-lab2-clean-v2_postgres_data Creating
|
||||
Volume mtusi-lab2-clean-v2_postgres_data Creating
|
||||
Volume mtusi-lab2-clean-v2_postgres_data Created
|
||||
Volume mtusi-lab2-clean-v2_postgres_data Created
|
||||
Volume mtusi-lab2-clean-v2_redis_data Created
|
||||
Volume mtusi-lab2-clean-v2_redis_data Created
|
||||
Network mtusi-lab2-clean-v2_default Created
|
||||
Network mtusi-lab2-clean-v2_default Created
|
||||
Container mtusi-lab2-clean-v2-redis-1 Creating
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Creating
|
||||
Container mtusi-lab2-clean-v2-redis-1 Created
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Created
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Creating
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Created
|
||||
Container mtusi-lab2-clean-v2-api-1 Creating
|
||||
Container mtusi-lab2-clean-v2-api-1 Created
|
||||
Container mtusi-lab2-clean-v2-redis-1 Starting
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Starting
|
||||
Container mtusi-lab2-clean-v2-redis-1 Started
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Started
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Healthy
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Starting
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Started
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-redis-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-redis-1 Healthy
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Exited
|
||||
Container mtusi-lab2-clean-v2-api-1 Starting
|
||||
Container mtusi-lab2-clean-v2-api-1 Started
|
||||
Container mtusi-lab2-clean-v2-api-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-redis-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Waiting
|
||||
Container mtusi-lab2-clean-v2-migrate-1 Exited
|
||||
Container mtusi-lab2-clean-v2-redis-1 Healthy
|
||||
Container mtusi-lab2-clean-v2-postgres-1 Healthy
|
||||
Container mtusi-lab2-clean-v2-api-1 Healthy
|
||||
@@ -0,0 +1,21 @@
|
||||
python3 -m unittest discover -s student-tests -v
|
||||
ROLLBACK: invalid second member left no chat or membership rows
|
||||
CONCURRENCY: 10 clients, 100 confirmations, 100 unique messages
|
||||
FAILURES: Redis/PostgreSQL -> bounded 503, live 200, anonymous 401, recovery with old session
|
||||
REDIS CRASH: old session survived SIGKILL/AOF replay, expiry deadline unchanged
|
||||
RACE: 10 requests, 1 created, 9 conflicts, 1 database row
|
||||
Container mtusi-lab2-clean-v2-checks-run-05a68e33bccb Creating
|
||||
Container mtusi-lab2-clean-v2-checks-run-05a68e33bccb Created
|
||||
test_composite_chat_rollback (test_api.APITests.test_composite_chat_rollback) ... ok
|
||||
test_concurrent_messages (test_api.APITests.test_concurrent_messages) ... ok
|
||||
test_cursor_binding_and_chat_pages (test_api.APITests.test_cursor_binding_and_chat_pages) ... ok
|
||||
test_dependency_failures (test_api.APITests.test_dependency_failures) ... ok
|
||||
test_passwords_and_authentication (test_api.APITests.test_passwords_and_authentication) ... ok
|
||||
test_redis_crash_durability (test_api.APITests.test_redis_crash_durability) ... ok
|
||||
test_registration_race (test_api.APITests.test_registration_race) ... ok
|
||||
test_validation_and_access (test_api.APITests.test_validation_and_access) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 8 tests in 12.384s
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"utc": "2026-10-30T21:47:57.331317+00:00",
|
||||
"checks": [
|
||||
"contract",
|
||||
"public_smoke",
|
||||
"8_student_tests",
|
||||
"all_stores_restart",
|
||||
"short_expiry",
|
||||
"explain_10000",
|
||||
"migration_replay",
|
||||
"final_smoke"
|
||||
],
|
||||
"versions": {
|
||||
"python": "3.13.15",
|
||||
"packages": {
|
||||
"fastapi": "0.141.1",
|
||||
"pydantic": "2.13.5",
|
||||
"uvicorn": "0.53.0",
|
||||
"psycopg": "3.2.10",
|
||||
"psycopg-pool": "3.2.6",
|
||||
"redis": "6.4.0"
|
||||
}
|
||||
},
|
||||
"migration_counts_before": "27|12|10113",
|
||||
"migration_counts_after": "27|12|10113",
|
||||
"deployment": {
|
||||
"api": {
|
||||
"id": "c999209e71f1e05cf73dd96ed6a8d332f1d7bdb81961b3fdf44656c54207ddb3",
|
||||
"started_at": "2026-10-30T21:47:30.173918792Z",
|
||||
"image_id": "sha256:dab3ec7c7d69de21873d119e07d6348bce002537737d1265baf0908c206fc29d",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "921d8a5c2d722009d9946de24218aad6ca7ab83dcb1b5e3291793830bf7dfd0b",
|
||||
"started_at": "2026-10-30T21:47:30.087996017Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "eee46ebafd47d00f403ef05b6630ce26559ffcb81f33414f2d08712149a3100d",
|
||||
"started_at": "2026-10-30T21:47:29.894086274Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2-clean-v2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
},
|
||||
"published_base_url": "http://127.0.0.1:18082"
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
Container mtusi-lab2-checks-run-b4e1706cc8d3 Creating
|
||||
Container mtusi-lab2-checks-run-b4e1706cc8d3 Created
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"session_ttl_seconds": 2,
|
||||
"wait_seconds": 2.3,
|
||||
"before_expiry_status": 200,
|
||||
"after_expiry_status": 401,
|
||||
"result": "PASS"
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
PASS: TTL=2s, initial 200, after 2.3s -> 401; normal API TTL unchanged
|
||||
Container mtusi-lab2-checks-run-7bb72261a3d9 Creating
|
||||
Container mtusi-lab2-checks-run-7bb72261a3d9 Created
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 scripts/explain_history.py
|
||||
PASS: 10000 messages, first/middle/late pages use history index; 51 SQL rows for 50 HTTP items
|
||||
Container mtusi-lab2-checks-run-ce830e513aa3 Creating
|
||||
Container mtusi-lab2-checks-run-ce830e513aa3 Created
|
||||
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"messages_in_chat": 10000,
|
||||
"page_limit": 50,
|
||||
"index": "messages_chat_created_id_idx",
|
||||
"cases": {
|
||||
"first": {
|
||||
"after_message": 0,
|
||||
"sql": "SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s ORDER BY created_at, id LIMIT %s",
|
||||
"plan": {
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 5.58,
|
||||
"Plan Rows": 51,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.009,
|
||||
"Actual Total Time": 0.017,
|
||||
"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_chat_created_id_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 1038.88,
|
||||
"Plan Rows": 10000,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.008,
|
||||
"Actual Total Time": 0.014,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "(chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::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": 107,
|
||||
"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.214,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.036
|
||||
}
|
||||
},
|
||||
"middle": {
|
||||
"after_message": 5000,
|
||||
"sql": "SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s",
|
||||
"plan": {
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 7.15,
|
||||
"Plan Rows": 51,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.019,
|
||||
"Actual Total Time": 0.029,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Shared Hit Blocks": 4,
|
||||
"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_chat_created_id_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 665.89,
|
||||
"Plan Rows": 4945,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.018,
|
||||
"Actual Total Time": 0.025,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "((chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:30:51.163748+00'::timestamp with time zone, '49e8083b-b366-420a-a42e-7dd94e84e990'::uuid)))",
|
||||
"Rows Removed by Index Recheck": 0,
|
||||
"Shared Hit Blocks": 4,
|
||||
"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.044,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.05
|
||||
}
|
||||
},
|
||||
"late": {
|
||||
"after_message": 9900,
|
||||
"sql": "SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s",
|
||||
"plan": {
|
||||
"Plan": {
|
||||
"Node Type": "Limit",
|
||||
"Parallel Aware": false,
|
||||
"Async Capable": false,
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 83.03,
|
||||
"Plan Rows": 51,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.006,
|
||||
"Actual Total Time": 0.017,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Shared Hit Blocks": 4,
|
||||
"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_chat_created_id_idx",
|
||||
"Relation Name": "messages",
|
||||
"Alias": "messages",
|
||||
"Startup Cost": 0.29,
|
||||
"Total Cost": 159.29,
|
||||
"Plan Rows": 98,
|
||||
"Plan Width": 70,
|
||||
"Actual Startup Time": 0.006,
|
||||
"Actual Total Time": 0.014,
|
||||
"Actual Rows": 51,
|
||||
"Actual Loops": 1,
|
||||
"Index Cond": "((chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:30:51.168648+00'::timestamp with time zone, '15bb3004-514a-4d41-b783-327659c3269a'::uuid)))",
|
||||
"Rows Removed by Index Recheck": 0,
|
||||
"Shared Hit Blocks": 4,
|
||||
"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.032,
|
||||
"Triggers": [],
|
||||
"Execution Time": 0.025
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
FIRST
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..5.58 rows=51 width=70) (actual time=0.012..0.020 rows=51 loops=1)
|
||||
Buffers: shared hit=3
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..1038.88 rows=10000 width=70) (actual time=0.011..0.017 rows=51 loops=1)
|
||||
Index Cond: (chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::uuid)
|
||||
Buffers: shared hit=3
|
||||
Planning Time: 0.053 ms
|
||||
Execution Time: 0.030 ms
|
||||
|
||||
MIDDLE
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..7.15 rows=51 width=70) (actual time=0.011..0.021 rows=51 loops=1)
|
||||
Buffers: shared hit=4
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..665.89 rows=4945 width=70) (actual time=0.011..0.017 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:30:51.163748+00'::timestamp with time zone, '49e8083b-b366-420a-a42e-7dd94e84e990'::uuid)))
|
||||
Buffers: shared hit=4
|
||||
Planning Time: 0.052 ms
|
||||
Execution Time: 0.031 ms
|
||||
|
||||
LATE
|
||||
SELECT id, chat_id, sender_id, text, created_at FROM messages WHERE chat_id=%s AND (created_at, id) > (%s, %s) ORDER BY created_at, id LIMIT %s
|
||||
Limit (cost=0.29..83.03 rows=51 width=70) (actual time=0.008..0.020 rows=51 loops=1)
|
||||
Buffers: shared hit=4
|
||||
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..159.29 rows=98 width=70) (actual time=0.007..0.016 rows=51 loops=1)
|
||||
Index Cond: ((chat_id = '24b671da-2531-454f-9569-2d97c3d3b45e'::uuid) AND (ROW(created_at, id) > ROW('2026-10-30 21:30:51.168648+00'::timestamp with time zone, '15bb3004-514a-4d41-b783-327659c3269a'::uuid)))
|
||||
Buffers: shared hit=4
|
||||
Planning Time: 0.043 ms
|
||||
Execution Time: 0.029 ms
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"redis": {
|
||||
"ready_status": 503,
|
||||
"protected_status": 503,
|
||||
"elapsed_seconds": 1.003,
|
||||
"anonymous_status": 401
|
||||
},
|
||||
"postgres": {
|
||||
"ready_status": 503,
|
||||
"protected_status": 503,
|
||||
"elapsed_seconds": 1.003,
|
||||
"anonymous_status": 401
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"api_url": "http://127.0.0.1:18080",
|
||||
"ready_status": 200,
|
||||
"services": {
|
||||
"api": {
|
||||
"id": "d7b43b2f4a744721ee10aea864bb3defbb13c84e5c242e37cbf79956dc626261",
|
||||
"started_at": "2026-10-30T21:48:46.355604781Z",
|
||||
"image_id": "sha256:dab3ec7c7d69de21873d119e07d6348bce002537737d1265baf0908c206fc29d",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "d8375ea156feb08c83f85a4b94e192b60e61d6f3df09f671e9c50750b9f2b46e",
|
||||
"started_at": "2026-10-30T21:35:48.155522719Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "ddd6a9fad24efbcb9c3025fe4cd10ce2500772d417379bccb35c7c3a90bfee97",
|
||||
"started_at": "2026-10-30T21:35:48.37486311Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"cpu": [
|
||||
{
|
||||
"Name": "Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz",
|
||||
"NumberOfCores": 6,
|
||||
"NumberOfLogicalProcessors": 6
|
||||
}
|
||||
],
|
||||
"memory_gib": 31.9,
|
||||
"docker_server": "29.8.1",
|
||||
"compose": "5.5.1",
|
||||
"published_port": "127.0.0.1:18080",
|
||||
"readiness": 200,
|
||||
"default_port_8080": "Connection reset on this host; local API_PORT overridden to 18080"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
Unchanged: 001_initial.sql
|
||||
PASS: migrations committed
|
||||
PASS: LF checkout kept migration ledger unchanged
|
||||
Unchanged: 001_initial.sql
|
||||
PASS: migrations committed
|
||||
PASS: CRLF checkout kept migration ledger unchanged
|
||||
@@ -0,0 +1,4 @@
|
||||
Unchanged: 001_initial.sql
|
||||
PASS: migrations committed
|
||||
Container mtusi-lab2-migrate-run-ebe3f2f5eae7 Creating
|
||||
Container mtusi-lab2-migrate-run-ebe3f2f5eae7 Created
|
||||
@@ -0,0 +1,5 @@
|
||||
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://api: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.
|
||||
Container mtusi-lab2-checks-run-c6a8abec432a Creating
|
||||
Container mtusi-lab2-checks-run-c6a8abec432a Created
|
||||
@@ -0,0 +1 @@
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,68 @@
|
||||
{
|
||||
"before": {
|
||||
"api": {
|
||||
"id": "afbb0567726afe4b878da238a10d935f05860485b3b8d538303fe87ec8a09480",
|
||||
"started_at": "2026-10-30T21:30:01.813974621Z",
|
||||
"image_id": "sha256:fb326ae35c17b3e6e8eac43b314a198acc0cb35768a89afbbc1dad80089004c5",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "d8375ea156feb08c83f85a4b94e192b60e61d6f3df09f671e9c50750b9f2b46e",
|
||||
"started_at": "2026-10-30T21:30:21.917882257Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "ddd6a9fad24efbcb9c3025fe4cd10ce2500772d417379bccb35c7c3a90bfee97",
|
||||
"started_at": "2026-10-30T21:30:25.782358865Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
},
|
||||
"after": {
|
||||
"api": {
|
||||
"id": "afbb0567726afe4b878da238a10d935f05860485b3b8d538303fe87ec8a09480",
|
||||
"started_at": "2026-10-30T21:30:34.407753279Z",
|
||||
"image_id": "sha256:fb326ae35c17b3e6e8eac43b314a198acc0cb35768a89afbbc1dad80089004c5",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "d8375ea156feb08c83f85a4b94e192b60e61d6f3df09f671e9c50750b9f2b46e",
|
||||
"started_at": "2026-10-30T21:30:34.034926172Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "ddd6a9fad24efbcb9c3025fe4cd10ce2500772d417379bccb35c7c3a90bfee97",
|
||||
"started_at": "2026-10-30T21:30:34.206318985Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 tests/smoke.py --base-url "http://api:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
Container mtusi-lab2-checks-run-942aef800efa Creating
|
||||
Container mtusi-lab2-checks-run-942aef800efa Created
|
||||
@@ -0,0 +1,4 @@
|
||||
python3 tests/smoke.py --base-url "http://api:8080"
|
||||
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
|
||||
Container mtusi-lab2-checks-run-b2982f811b3b Creating
|
||||
Container mtusi-lab2-checks-run-b2982f811b3b Created
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"files_checked": 9,
|
||||
"scope": "all original contracts and public tests",
|
||||
"sha256": {
|
||||
"contracts\\examples.json": "0A71CEC72903AF556DF85F939C7E347FC73A86A1A4FFC39FB9C8DED169B7DF45",
|
||||
"contracts\\infrastructure.json": "7EFD8B1E6023DDC3FF9747D4F663EE772C1293B782BB9E74BD1C3FBCCA9C68D8",
|
||||
"contracts\\openapi.json": "CFF3AA6B34855B573401B0AC393FDFE327B6A12DA51F315FBBD67168CE3762C4",
|
||||
"contracts\\README.md": "72DF27A559F88FFA3FD8C3C79D3C32F6DB2C5986A0602677C51994C434A3FC4F",
|
||||
"tests\\client.py": "8D50976FC7C7BBB81E88A152F613C61AB25EAF53DBA33C6A9DFAB19F868D546D",
|
||||
"tests\\load.py": "6D3511EA719C7A7E841083E73D435C86DCBFD9F4E5C2A07D62EB9614B01D9933",
|
||||
"tests\\README.md": "E0BFA7E196797F6A5BF6E44D8AD2FFEB82651927FF5D8484EB1C2DDA1EC7DEC5",
|
||||
"tests\\resilience.py": "1F96663A174B3978D24EFF66F2741F5F8C9B788D3242261D37A972720C52788B",
|
||||
"tests\\smoke.py": "52AC38EB343FF7D43E7543588E1DA58CA06C9FCE74B2B0D0BF0E4982BC23C1DB"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
Container mtusi-lab2-postgres-1 Running
|
||||
Container mtusi-lab2-redis-1 Running
|
||||
Container mtusi-lab2-migrate-1 Recreate
|
||||
Container mtusi-lab2-migrate-1 Recreated
|
||||
Container mtusi-lab2-api-1 Recreate
|
||||
Container mtusi-lab2-api-1 Recreated
|
||||
Container mtusi-lab2-postgres-1 Waiting
|
||||
Container mtusi-lab2-postgres-1 Healthy
|
||||
Container mtusi-lab2-migrate-1 Starting
|
||||
Container mtusi-lab2-migrate-1 Started
|
||||
Container mtusi-lab2-migrate-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Healthy
|
||||
Container mtusi-lab2-migrate-1 Exited
|
||||
Container mtusi-lab2-api-1 Starting
|
||||
Container mtusi-lab2-api-1 Started
|
||||
Container mtusi-lab2-api-1 Waiting
|
||||
Container mtusi-lab2-postgres-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Waiting
|
||||
Container mtusi-lab2-migrate-1 Waiting
|
||||
Container mtusi-lab2-redis-1 Healthy
|
||||
Container mtusi-lab2-migrate-1 Exited
|
||||
Container mtusi-lab2-postgres-1 Healthy
|
||||
Container mtusi-lab2-api-1 Healthy
|
||||
@@ -0,0 +1,21 @@
|
||||
python3 -m unittest discover -s student-tests -v
|
||||
ROLLBACK: invalid second member left no chat or membership rows
|
||||
CONCURRENCY: 10 clients, 100 confirmations, 100 unique messages
|
||||
FAILURES: Redis/PostgreSQL -> bounded 503, live 200, anonymous 401, recovery with old session
|
||||
REDIS CRASH: old session survived SIGKILL/AOF replay, expiry deadline unchanged
|
||||
RACE: 10 requests, 1 created, 9 conflicts, 1 database row
|
||||
Container mtusi-lab2-checks-run-7f723776bde2 Creating
|
||||
Container mtusi-lab2-checks-run-7f723776bde2 Created
|
||||
test_composite_chat_rollback (test_api.APITests.test_composite_chat_rollback) ... ok
|
||||
test_concurrent_messages (test_api.APITests.test_concurrent_messages) ... ok
|
||||
test_cursor_binding_and_chat_pages (test_api.APITests.test_cursor_binding_and_chat_pages) ... ok
|
||||
test_dependency_failures (test_api.APITests.test_dependency_failures) ... ok
|
||||
test_passwords_and_authentication (test_api.APITests.test_passwords_and_authentication) ... ok
|
||||
test_redis_crash_durability (test_api.APITests.test_redis_crash_durability) ... ok
|
||||
test_registration_race (test_api.APITests.test_registration_race) ... ok
|
||||
test_validation_and_access (test_api.APITests.test_validation_and_access) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
Ran 8 tests in 12.538s
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"result": "PASS",
|
||||
"utc": "2026-10-30T21:30:59.870582+00:00",
|
||||
"checks": [
|
||||
"contract",
|
||||
"public_smoke",
|
||||
"8_student_tests",
|
||||
"all_stores_restart",
|
||||
"short_expiry",
|
||||
"explain_10000",
|
||||
"migration_replay",
|
||||
"final_smoke"
|
||||
],
|
||||
"versions": {
|
||||
"python": "3.13.15",
|
||||
"packages": {
|
||||
"fastapi": "0.141.1",
|
||||
"pydantic": "2.13.5",
|
||||
"uvicorn": "0.53.0",
|
||||
"psycopg": "3.2.10",
|
||||
"psycopg-pool": "3.2.6",
|
||||
"redis": "6.4.0"
|
||||
}
|
||||
},
|
||||
"migration_counts_before": "27|12|10113",
|
||||
"migration_counts_after": "27|12|10113",
|
||||
"deployment": {
|
||||
"api": {
|
||||
"id": "afbb0567726afe4b878da238a10d935f05860485b3b8d538303fe87ec8a09480",
|
||||
"started_at": "2026-10-30T21:30:34.407753279Z",
|
||||
"image_id": "sha256:fb326ae35c17b3e6e8eac43b314a198acc0cb35768a89afbbc1dad80089004c5",
|
||||
"user": "messenger",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"postgres": {
|
||||
"id": "d8375ea156feb08c83f85a4b94e192b60e61d6f3df09f671e9c50750b9f2b46e",
|
||||
"started_at": "2026-10-30T21:30:34.034926172Z",
|
||||
"image_id": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_postgres_data"
|
||||
],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000
|
||||
},
|
||||
"redis": {
|
||||
"id": "ddd6a9fad24efbcb9c3025fe4cd10ce2500772d417379bccb35c7c3a90bfee97",
|
||||
"started_at": "2026-10-30T21:30:34.206318985Z",
|
||||
"image_id": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
|
||||
"user": "",
|
||||
"volumes": [
|
||||
"mtusi-lab2_redis_data"
|
||||
],
|
||||
"memory_limit_bytes": 201326592,
|
||||
"nano_cpus": 500000000
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user