ЛР 3: балансировка, идемпотентность и проверки на 4

This commit is contained in:
2026-11-01 17:02:42 +03:00
parent 0ab3a341aa
commit 412b1bb09d
64 changed files with 3904 additions and 53 deletions
+347
View File
@@ -0,0 +1,347 @@
#1 [internal] load local bake definitions
#1 reading from stdin 1.58kB 0.1s done
#1 DONE 0.1s
#2 [checks internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.23kB 0.0s done
#2 DONE 0.1s
#2 [api internal] load build definition from Dockerfile
#2 DONE 0.1s
#3 [checks internal] load metadata for docker.io/library/python:3.13.15-slim-bookworm
#3 ...
#4 [checks internal] load metadata for docker.io/library/docker:28.5.1-cli
#4 DONE 4.4s
#3 [api internal] load metadata for docker.io/library/python:3.13.15-slim-bookworm
#3 DONE 4.4s
#5 [api internal] load .dockerignore
#5 transferring context: 164B done
#5 DONE 0.1s
#5 [checks internal] load .dockerignore
#5 DONE 0.1s
#6 [checks internal] load build context
#6 transferring context: 182.88kB 0.0s done
#6 DONE 0.2s
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 resolve docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26 0.1s done
#7 DONE 0.5s
#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 sha256:2d7ba3afdf47b5c4691580b6f2e2e6e3e2b3bc9bd6a7c60aeacb0d907f06c339 0B / 116B 0.2s
#8 sha256:0a7ca70c232bfd9c484ad87453366b208174bdb0e87e457ce31db9b4511d07e7 0B / 1.01kB 0.2s
#8 sha256:2d7ba3afdf47b5c4691580b6f2e2e6e3e2b3bc9bd6a7c60aeacb0d907f06c339 116B / 116B 0.5s done
#8 sha256:4ca5c7282971aeea368a994cfaadb48e02c3fd851ae30db56495310f53c981ee 0B / 540B 0.2s
#8 sha256:0a7ca70c232bfd9c484ad87453366b208174bdb0e87e457ce31db9b4511d07e7 1.01kB / 1.01kB 0.5s done
#8 sha256:4ca5c7282971aeea368a994cfaadb48e02c3fd851ae30db56495310f53c981ee 540B / 540B 0.6s done
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 0B / 21.74MB 0.2s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 0B / 22.16MB 0.1s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 3.15MB / 21.74MB 1.3s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 6.29MB / 21.74MB 1.8s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 8.39MB / 21.74MB 2.1s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 0B / 20.43MB 0.2s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 12.58MB / 21.74MB 3.3s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 14.68MB / 21.74MB 4.0s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 16.78MB / 21.74MB 4.6s
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 18.87MB / 21.74MB 5.2s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 1.05MB / 22.16MB 5.2s
#8 ...
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 sha256:43dcef5051b0d747db428c3890841803fca6b253a38f1f66774f964ee0dbaa33 3.53MB / 3.53MB 1.1s done
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 4.19MB / 28.24MB 7.3s
#7 sha256:2e57034c052c6d059f36df62c9e6f4ee3630bb3a653a5f9e4a196159d53abb35 12.59MB / 12.59MB 3.7s done
#7 sha256:5483d2d2a330470f65f1ca5e1c6a9d4167051e32057624e31e13a9ec6392f42b 250B / 250B 1.2s done
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 6.29MB / 28.24MB 9.0s
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 8.39MB / 28.24MB 10.3s
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 10.49MB / 28.24MB 11.1s
#7 ...
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
#8 sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 21.74MB / 21.74MB 8.5s done
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 8.39MB / 22.16MB 10.3s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 1.05MB / 20.43MB 8.6s
#8 sha256:37009c416213bafe8d6e7c68aa4bc36688e1d7b2974ecd8118fa29dab8c9b0e0 457B / 457B 0.4s done
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 3.15MB / 8.23MB 1.5s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 4.19MB / 8.23MB 1.7s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 5.24MB / 8.23MB 1.8s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 2.10MB / 20.43MB 9.5s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 10.49MB / 22.16MB 11.7s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 6.29MB / 8.23MB 3.5s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 7.34MB / 8.23MB 3.6s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 12.58MB / 22.16MB 12.6s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 3.15MB / 20.43MB 11.0s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 8.23MB / 8.23MB 3.9s
#8 sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 8.23MB / 8.23MB 4.6s done
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 14.68MB / 22.16MB 13.5s
#8 extracting sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a
#8 extracting sha256:58bd06dfc6cd22322de7d4fca516b20c2b75730c5bc85c35e92c3f2056dbfe9a 0.4s done
#8 extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 0.1s done
#8 extracting sha256:37009c416213bafe8d6e7c68aa4bc36688e1d7b2974ecd8118fa29dab8c9b0e0 0.1s done
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 16.78MB / 22.16MB 14.1s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 4.19MB / 20.43MB 12.3s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 18.87MB / 22.16MB 15.0s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 5.24MB / 20.43MB 13.5s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 20.97MB / 22.16MB 15.4s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 22.16MB / 22.16MB 15.7s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 6.29MB / 20.43MB 14.3s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 7.34MB / 20.43MB 14.9s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 8.39MB / 20.43MB 15.3s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 9.44MB / 20.43MB 15.6s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 10.49MB / 20.43MB 15.9s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 11.53MB / 20.43MB 16.1s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 12.58MB / 20.43MB 16.4s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 13.63MB / 20.43MB 16.5s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 14.68MB / 20.43MB 16.7s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 15.73MB / 20.43MB 16.8s
#8 sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 22.16MB / 22.16MB 18.8s done
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 17.83MB / 20.43MB 17.1s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 18.87MB / 20.43MB 17.3s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 19.92MB / 20.43MB 17.4s
#8 ...
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 28.24MB / 28.24MB 22.5s
#7 sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 28.24MB / 28.24MB 25.8s done
#7 DONE 26.4s
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 20.43MB / 20.43MB 22.5s
#8 sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 20.43MB / 20.43MB 24.3s done
#8 extracting sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6
#8 extracting sha256:97fde3c329d3c913ca1405c177bffc2ecf02ddd298b32e4aa4489956fc2073e6 0.2s done
#8 DONE 28.8s
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 extracting sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150
#7 ...
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
#8 extracting sha256:cf58801a4522ea7409a3502e3295034b91bdc972cff8ab4bbd5290b68bc215f8 0.3s done
#8 DONE 29.1s
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
#8 extracting sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38
#8 extracting sha256:e12f523aba6af55cd482ed9070373420fd68a86a955abec7599b5be4a6da2a38 0.4s done
#8 DONE 29.5s
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 ...
#8 [checks docker_cli 1/1] FROM docker.io/library/docker:28.5.1-cli@sha256:9190b0613792e658a7783cf14b2d5ace5941bb68ede7276922ea36ee457d76ad
#8 extracting sha256:4ca5c7282971aeea368a994cfaadb48e02c3fd851ae30db56495310f53c981ee 0.0s done
#8 extracting sha256:0a7ca70c232bfd9c484ad87453366b208174bdb0e87e457ce31db9b4511d07e7 0.0s done
#8 extracting sha256:2d7ba3afdf47b5c4691580b6f2e2e6e3e2b3bc9bd6a7c60aeacb0d907f06c339 0.0s done
#8 DONE 29.6s
#7 [api runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 extracting sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 1.4s done
#7 DONE 27.8s
#7 [checks runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 extracting sha256:774043ccc8ccd0d0833a9ee0792142ab7ad93df971e59dd248fbf82db16d0150 1.4s done
#7 extracting sha256:43dcef5051b0d747db428c3890841803fca6b253a38f1f66774f964ee0dbaa33
#7 extracting sha256:43dcef5051b0d747db428c3890841803fca6b253a38f1f66774f964ee0dbaa33 0.2s done
#7 DONE 28.0s
#7 [checks runtime 1/7] FROM docker.io/library/python:3.13.15-slim-bookworm@sha256:2325bb286ec344af3e5898cc224b5844e2707ac6e26b1632516fd3edc84a5e26
#7 extracting sha256:43dcef5051b0d747db428c3890841803fca6b253a38f1f66774f964ee0dbaa33 0.2s done
#7 extracting sha256:2e57034c052c6d059f36df62c9e6f4ee3630bb3a653a5f9e4a196159d53abb35
#7 extracting sha256:2e57034c052c6d059f36df62c9e6f4ee3630bb3a653a5f9e4a196159d53abb35 0.7s done
#7 extracting sha256:5483d2d2a330470f65f1ca5e1c6a9d4167051e32057624e31e13a9ec6392f42b
#7 extracting sha256:2e57034c052c6d059f36df62c9e6f4ee3630bb3a653a5f9e4a196159d53abb35 0.7s done
#7 extracting sha256:5483d2d2a330470f65f1ca5e1c6a9d4167051e32057624e31e13a9ec6392f42b 0.0s done
#7 DONE 28.8s
#9 [checks runtime 2/7] WORKDIR /app
#9 DONE 1.0s
#9 [checks runtime 2/7] WORKDIR /app
#9 DONE 1.0s
#10 [api runtime 3/7] COPY requirements.txt .
#10 DONE 0.0s
#11 [api runtime 4/7] RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home messenger
#11 2.091 Ignoring colorama: markers 'sys_platform == "win32"' don't match your environment
#11 2.326 Collecting annotated-doc==0.0.5 (from -r requirements.txt (line 1))
#11 2.926 Downloading annotated_doc-0.0.5-py3-none-any.whl.metadata (6.5 kB)
#11 3.093 Collecting annotated-types==0.8.0 (from -r requirements.txt (line 2))
#11 3.167 Downloading annotated_types-0.8.0-py3-none-any.whl.metadata (15 kB)
#11 3.383 Collecting anyio==4.15.1 (from -r requirements.txt (line 3))
#11 3.459 Downloading anyio-4.15.1-py3-none-any.whl.metadata (4.7 kB)
#11 3.601 Collecting click==8.5.0 (from -r requirements.txt (line 4))
#11 3.676 Downloading click-8.5.0-py3-none-any.whl.metadata (2.6 kB)
#11 3.871 Collecting fastapi==0.141.1 (from -r requirements.txt (line 6))
#11 3.943 Downloading fastapi-0.141.1-py3-none-any.whl.metadata (27 kB)
#11 4.112 Collecting h11==0.16.0 (from -r requirements.txt (line 7))
#11 4.184 Downloading h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
#11 4.269 Collecting idna==3.20 (from -r requirements.txt (line 8))
#11 4.346 Downloading idna-3.20-py3-none-any.whl.metadata (7.2 kB)
#11 4.650 Collecting pydantic==2.13.5 (from -r requirements.txt (line 9))
#11 4.722 Downloading pydantic-2.13.5-py3-none-any.whl.metadata (110 kB)
#11 5.936 Collecting pydantic-core==2.46.5 (from -r requirements.txt (line 10))
#11 6.010 Downloading pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
#11 6.154 Collecting starlette==1.6.0 (from -r requirements.txt (line 11))
#11 6.227 Downloading starlette-1.6.0-py3-none-any.whl.metadata (6.4 kB)
#11 6.352 Collecting typing-extensions==4.16.0 (from -r requirements.txt (line 12))
#11 6.424 Downloading typing_extensions-4.16.0-py3-none-any.whl.metadata (3.3 kB)
#11 6.607 Collecting typing-inspection==0.4.4 (from -r requirements.txt (line 13))
#11 6.708 Downloading typing_inspection-0.4.4-py3-none-any.whl.metadata (2.6 kB)
#11 6.849 Collecting uvicorn==0.53.0 (from -r requirements.txt (line 14))
#11 6.920 Downloading uvicorn-0.53.0-py3-none-any.whl.metadata (6.6 kB)
#11 7.063 Collecting psycopg==3.2.10 (from psycopg[binary]==3.2.10->-r requirements.txt (line 15))
#11 7.137 Downloading psycopg-3.2.10-py3-none-any.whl.metadata (4.6 kB)
#11 7.220 Collecting psycopg-pool==3.2.6 (from -r requirements.txt (line 16))
#11 7.293 Downloading psycopg_pool-3.2.6-py3-none-any.whl.metadata (2.6 kB)
#11 7.386 Collecting redis==6.4.0 (from -r requirements.txt (line 17))
#11 7.460 Downloading redis-6.4.0-py3-none-any.whl.metadata (10 kB)
#11 7.781 Collecting psycopg-binary==3.2.10 (from psycopg[binary]==3.2.10->-r requirements.txt (line 15))
#11 7.853 Downloading psycopg_binary-3.2.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (3.0 kB)
#11 7.984 Downloading annotated_doc-0.0.5-py3-none-any.whl (5.3 kB)
#11 8.056 Downloading annotated_types-0.8.0-py3-none-any.whl (13 kB)
#11 8.136 Downloading anyio-4.15.1-py3-none-any.whl (132 kB)
#11 8.296 Downloading click-8.5.0-py3-none-any.whl (125 kB)
#11 8.428 Downloading fastapi-0.141.1-py3-none-any.whl (131 kB)
#11 8.561 Downloading h11-0.16.0-py3-none-any.whl (37 kB)
#11 8.693 Downloading idna-3.20-py3-none-any.whl (69 kB)
#11 8.772 Downloading pydantic-2.13.5-py3-none-any.whl (472 kB)
#11 8.981 Downloading pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
#11 9.281 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 7.4 MB/s 0:00:00
#11 9.359 Downloading starlette-1.6.0-py3-none-any.whl (75 kB)
#11 9.493 Downloading typing_extensions-4.16.0-py3-none-any.whl (45 kB)
#11 9.576 Downloading typing_inspection-0.4.4-py3-none-any.whl (14 kB)
#11 9.698 Downloading uvicorn-0.53.0-py3-none-any.whl (87 kB)
#11 9.789 Downloading psycopg-3.2.10-py3-none-any.whl (206 kB)
#11 9.881 Downloading psycopg_pool-3.2.6-py3-none-any.whl (38 kB)
#11 10.01 Downloading redis-6.4.0-py3-none-any.whl (279 kB)
#11 10.13 Downloading psycopg_binary-3.2.10-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.4 MB)
#11 10.76 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.4/4.4 MB 7.0 MB/s 0:00:00
#11 10.88 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 12.46
#11 12.46 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 12.46 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 12.46
#11 12.46 [notice] A new release of pip is available: 26.2.1 -> 26.2.2
#11 12.46 [notice] To update, run: pip install --upgrade pip
#11 DONE 12.8s
#11 [api runtime 4/7] RUN pip install --no-cache-dir -r requirements.txt && useradd --uid 10001 --create-home messenger
#11 DONE 12.8s
#12 [api 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
#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.3s
#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.5s done
#15 exporting manifest sha256:485f58e6ec80578fde7c7874080635b0af45b168452bd60283e9e73169a85232 0.0s done
#15 exporting config sha256:9bab07b6683f5e3e69635d80e5db8ff21ea57eb089a9c35bd826ef08817f1590
#15 exporting config sha256:9bab07b6683f5e3e69635d80e5db8ff21ea57eb089a9c35bd826ef08817f1590 0.0s done
#15 exporting attestation manifest sha256:189ff66057b7f64b45184dbbc370dd2fa38ea18ba9317966ffee5812c3b60087 0.0s done
#15 exporting manifest list sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8 0.0s done
#15 naming to docker.io/library/mtusi-messenger:lab3 done
#15 unpacking to docker.io/library/mtusi-messenger:lab3
#15 unpacking to docker.io/library/mtusi-messenger:lab3 0.7s done
#15 DONE 2.5s
#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.808 Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB]
#18 0.952 Get:2 http://deb.debian.org/debian bookworm-updates InRelease [55.4 kB]
#18 1.086 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 2.156 Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8790 kB]
#18 3.340 Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [6924 B]
#18 3.509 Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [360 kB]
#18 4.117 Fetched 9398 kB in 4s (2492 kB/s)
#18 4.117 Reading package lists...
#18 4.649 Reading package lists...
#18 5.153 Building dependency tree...
#18 5.292 Reading state information...
#18 5.511 Suggested packages:
#18 5.511 make-doc
#18 5.547 The following NEW packages will be installed:
#18 5.548 make
#18 6.203 0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
#18 6.203 Need to get 396 kB of archives.
#18 6.203 After this operation, 1630 kB of additional disk space will be used.
#18 6.203 Get:1 http://deb.debian.org/debian bookworm/main amd64 make amd64 4.3-4.1 [396 kB]
#18 6.348 debconf: delaying package configuration, since apt-utils is not installed
#18 6.387 Fetched 396 kB in 1s (604 kB/s)
#18 6.419 Selecting previously unselected package make.
#18 6.419 (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 6.429 Preparing to unpack .../make_4.3-4.1_amd64.deb ...
#18 6.434 Unpacking make (4.3-4.1) ...
#18 6.521 Setting up make (4.3-4.1) ...
#18 DONE 6.7s
#20 [checks checks 4/4] WORKDIR /checks
#20 DONE 0.0s
#21 [checks] exporting to image
#21 exporting layers
#21 exporting layers 2.5s done
#21 exporting manifest sha256:7d139777a4f9668222d1eaa10c2b725b012d44f7b9733dbe922692ca70c3f671 0.0s done
#21 exporting config sha256:ac219e35d292624b83e4e99111364e4b9490c14b2bcf6f84bf4660b58942c764 0.0s done
#21 exporting attestation manifest sha256:0f58b6134d663547706803962889ceffa18ee5a95e104418cb5d53cb0ad38632 0.0s done
#21 exporting manifest list sha256:352ce6fc20614470d7a12eca4cd30e65c997babd643284f5ac5d9da84e10902a 0.0s done
#21 naming to docker.io/library/mtusi-messenger:lab3-checks done
#21 unpacking to docker.io/library/mtusi-messenger:lab3-checks
#21 unpacking to docker.io/library/mtusi-messenger:lab3-checks 0.6s done
#21 DONE 3.3s
#22 [checks] resolving provenance for metadata file
#22 DONE 0.0s
mtusi-messenger:lab3 Built
mtusi-messenger:lab3-checks Built
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+38
View File
@@ -0,0 +1,38 @@
[
{
"scenario": "failure-api-1",
"successful_rps": 105.235,
"failed_attempts": 51,
"first_write_after_action_seconds": 1.715,
"confirmed_writes_checked": 2350,
"successful_latency_ms": {
"p50": 32.652,
"p95": 75.027,
"p99": 96.705
}
},
{
"scenario": "failure-api-2",
"successful_rps": 108.762,
"failed_attempts": 57,
"first_write_after_action_seconds": 1.697,
"confirmed_writes_checked": 2429,
"successful_latency_ms": {
"p50": 32.088,
"p95": 65.561,
"p99": 97.489
}
},
{
"scenario": "rolling-update",
"successful_rps": 107.276,
"failed_attempts": 0,
"first_write_after_action_seconds": 23.527,
"confirmed_writes_checked": 4475,
"successful_latency_ms": {
"p50": 28.249,
"p95": 82.882,
"p99": 127.075
}
}
]
+3
View File
@@ -0,0 +1,3 @@
failure-api-1: 105.235 RPS; 51 errors
failure-api-2: 108.762 RPS; 57 errors
rolling-update: 107.276 RPS; 0 errors
+7
View File
@@ -0,0 +1,7 @@
{
"session_ttl_seconds": 2,
"wait_seconds": 2.3,
"before_expiry_status": 200,
"after_expiry_status": 401,
"result": "PASS"
}
+1
View File
@@ -0,0 +1 @@
PASS: TTL=2s, initial 200, after 2.3s -> 401; normal API TTL unchanged
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/explain_history.py
PASS: 10000 messages, first/middle/late pages use history index; 51 SQL rows for 50 HTTP items
+235
View File
@@ -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.85,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.024,
"Actual Total Time": 0.033,
"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": 1091.76,
"Plan Rows": 10000,
"Plan Width": 71,
"Actual Startup Time": 0.023,
"Actual Total Time": 0.029,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "(chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::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": 117,
"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.485,
"Triggers": [],
"Execution Time": 0.068
}
},
"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.76,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.018,
"Actual Total Time": 0.034,
"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": 707.54,
"Plan Rows": 4827,
"Plan Width": 71,
"Actual Startup Time": 0.017,
"Actual Total Time": 0.027,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::uuid) AND (ROW(created_at, id) > ROW('2026-11-01 13:55:23.37413+00'::timestamp with time zone, '8527233a-bd37-41c0-92ab-a83710dbaf42'::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.121,
"Triggers": [],
"Execution Time": 0.082
}
},
"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": 87.97,
"Plan Rows": 51,
"Plan Width": 71,
"Actual Startup Time": 0.016,
"Actual Total Time": 0.024,
"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": 165.33,
"Plan Rows": 96,
"Plan Width": 71,
"Actual Startup Time": 0.016,
"Actual Total Time": 0.02,
"Actual Rows": 51,
"Actual Loops": 1,
"Index Cond": "((chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::uuid) AND (ROW(created_at, id) > ROW('2026-11-01 13:55:23.37903+00'::timestamp with time zone, '2cb28284-13ea-47b3-9eda-45aeb4bda794'::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.073,
"Triggers": [],
"Execution Time": 0.035
}
}
}
}
+29
View File
@@ -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.85 rows=51 width=71) (actual time=0.020..0.028 rows=51 loops=1)
Buffers: shared hit=3
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..1091.76 rows=10000 width=71) (actual time=0.019..0.024 rows=51 loops=1)
Index Cond: (chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::uuid)
Buffers: shared hit=3
Planning Time: 0.093 ms
Execution Time: 0.040 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.76 rows=51 width=71) (actual time=0.029..0.046 rows=51 loops=1)
Buffers: shared hit=3
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..707.54 rows=4827 width=71) (actual time=0.028..0.038 rows=51 loops=1)
Index Cond: ((chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::uuid) AND (ROW(created_at, id) > ROW('2026-11-01 13:55:23.37413+00'::timestamp with time zone, '8527233a-bd37-41c0-92ab-a83710dbaf42'::uuid)))
Buffers: shared hit=3
Planning Time: 0.116 ms
Execution Time: 0.067 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..87.97 rows=51 width=71) (actual time=0.014..0.023 rows=51 loops=1)
Buffers: shared hit=4
-> Index Scan using messages_chat_created_id_idx on messages (cost=0.29..165.33 rows=96 width=71) (actual time=0.013..0.019 rows=51 loops=1)
Index Cond: ((chat_id = '77be5bc0-11e0-4330-a660-198fe31253f8'::uuid) AND (ROW(created_at, id) > ROW('2026-11-01 13:55:23.37903+00'::timestamp with time zone, '2cb28284-13ea-47b3-9eda-45aeb4bda794'::uuid)))
Buffers: shared hit=4
Planning Time: 0.079 ms
Execution Time: 0.035 ms
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://lb:8080"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 117, "failed_attempts": 2, "first_recovery_seconds": 2.064}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+225
View File
@@ -0,0 +1,225 @@
{
"scenario": "failure-api-1",
"utc": "2026-11-01T13:55:54.273960+00:00",
"duration_seconds": 24.041,
"concurrency": 4,
"successful_requests": 2530,
"failed_attempts": 51,
"error_ratio": 0.01976,
"successful_rps": 105.235,
"successful_latency_ms": {
"p50": 32.652,
"p95": 75.027,
"p99": 96.705
},
"first_write_after_action_seconds": 1.715,
"action": {
"started_seconds": 4.1060343000572175,
"detail": {
"container": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"hostname": "56279f26a490",
"stop_seconds": 1.299,
"exit_code": 0
},
"finished_seconds": 5.409909900045022,
"resources_during_load": [
{
"BlockIO": "0B / 0B",
"CPUPerc": "101.13%",
"Container": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"ID": "eebe2ed46169",
"MemPerc": "27.80%",
"MemUsage": "71.18MiB / 256MiB",
"Name": "mtusi-lab3-api-2",
"NetIO": "4.12MB / 3.61MB",
"PIDs": "4"
},
{
"BlockIO": "0B / 422kB",
"CPUPerc": "27.80%",
"Container": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"ID": "62fe1bac69db",
"MemPerc": "7.14%",
"MemUsage": "36.57MiB / 512MiB",
"Name": "mtusi-lab3-postgres-1",
"NetIO": "3.27MB / 3.98MB",
"PIDs": "11"
},
{
"BlockIO": "0B / 24.6kB",
"CPUPerc": "4.90%",
"Container": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"ID": "8ce27a874af3",
"MemPerc": "1.92%",
"MemUsage": "3.695MiB / 192MiB",
"Name": "mtusi-lab3-redis-1",
"NetIO": "274kB / 236kB",
"PIDs": "6"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "14.96%",
"Container": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"ID": "c28b6968210f",
"MemPerc": "11.01%",
"MemUsage": "14.09MiB / 128MiB",
"Name": "mtusi-lab3-lb-1",
"NetIO": "2.36MB / 2.45MB",
"PIDs": "17"
}
]
},
"confirmed_writes_checked": 2350,
"history_messages": 2350,
"unique_history_messages": 2350,
"instances_before": [
"56279f26a490-6279063680e4",
"eebe2ed46169-28ea6dbaf5ae"
],
"series_2_seconds": [
{
"start_seconds": 0,
"rps": 147.5,
"errors": 0
},
{
"start_seconds": 2,
"rps": 154.0,
"errors": 0
},
{
"start_seconds": 4,
"rps": 43.5,
"errors": 51
},
{
"start_seconds": 6,
"rps": 114.0,
"errors": 0
},
{
"start_seconds": 8,
"rps": 105.0,
"errors": 0
},
{
"start_seconds": 10,
"rps": 94.0,
"errors": 0
},
{
"start_seconds": 12,
"rps": 121.5,
"errors": 0
},
{
"start_seconds": 14,
"rps": 96.0,
"errors": 0
},
{
"start_seconds": 16,
"rps": 78.0,
"errors": 0
},
{
"start_seconds": 18,
"rps": 93.0,
"errors": 0
},
{
"start_seconds": 20,
"rps": 115.0,
"errors": 0
},
{
"start_seconds": 22,
"rps": 101.5,
"errors": 0
},
{
"start_seconds": 24,
"rps": 2.0,
"errors": 0
}
],
"deployment_after": [
{
"service": "api",
"id": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"name": "mtusi-lab3-api-1",
"started_at": "2026-11-01T13:55:11.890726782Z",
"status": "exited",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"name": "mtusi-lab3-api-2",
"started_at": "2026-11-01T13:54:45.672968999Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:45.014430269Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:44.838374892Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:45.212099737Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
],
"note": "Closed-loop mixed HTTP load, 4 clients; failures are attempts, retries retain keys; latency covers successes only."
}
+225
View File
@@ -0,0 +1,225 @@
{
"scenario": "failure-api-2",
"utc": "2026-11-01T13:56:24.941179+00:00",
"duration_seconds": 24.034,
"concurrency": 4,
"successful_requests": 2614,
"failed_attempts": 57,
"error_ratio": 0.02134,
"successful_rps": 108.762,
"successful_latency_ms": {
"p50": 32.088,
"p95": 65.561,
"p99": 97.489
},
"first_write_after_action_seconds": 1.697,
"action": {
"started_seconds": 4.083422699943185,
"detail": {
"container": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"hostname": "eebe2ed46169",
"stop_seconds": 1.24,
"exit_code": 0
},
"finished_seconds": 5.323327000020072,
"resources_during_load": [
{
"BlockIO": "0B / 0B",
"CPUPerc": "98.17%",
"Container": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"ID": "56279f26a490",
"MemPerc": "23.93%",
"MemUsage": "61.27MiB / 256MiB",
"Name": "mtusi-lab3-api-1",
"NetIO": "3.35MB / 2.87MB",
"PIDs": "2"
},
{
"BlockIO": "0B / 34.2MB",
"CPUPerc": "41.46%",
"Container": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"ID": "62fe1bac69db",
"MemPerc": "7.64%",
"MemUsage": "39.11MiB / 512MiB",
"Name": "mtusi-lab3-postgres-1",
"NetIO": "9.11MB / 11.6MB",
"PIDs": "11"
},
{
"BlockIO": "0B / 41kB",
"CPUPerc": "4.70%",
"Container": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"ID": "8ce27a874af3",
"MemPerc": "1.96%",
"MemUsage": "3.762MiB / 192MiB",
"Name": "mtusi-lab3-redis-1",
"NetIO": "692kB / 625kB",
"PIDs": "6"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "17.56%",
"Container": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"ID": "c28b6968210f",
"MemPerc": "11.73%",
"MemUsage": "15.02MiB / 128MiB",
"Name": "mtusi-lab3-lb-1",
"NetIO": "7.23MB / 7.58MB",
"PIDs": "17"
}
]
},
"confirmed_writes_checked": 2429,
"history_messages": 2429,
"unique_history_messages": 2429,
"instances_before": [
"eebe2ed46169-28ea6dbaf5ae",
"56279f26a490-b1a72fdd0fd8"
],
"series_2_seconds": [
{
"start_seconds": 0,
"rps": 145.5,
"errors": 0
},
{
"start_seconds": 2,
"rps": 135.5,
"errors": 0
},
{
"start_seconds": 4,
"rps": 56.5,
"errors": 57
},
{
"start_seconds": 6,
"rps": 113.5,
"errors": 0
},
{
"start_seconds": 8,
"rps": 87.5,
"errors": 0
},
{
"start_seconds": 10,
"rps": 118.0,
"errors": 0
},
{
"start_seconds": 12,
"rps": 118.5,
"errors": 0
},
{
"start_seconds": 14,
"rps": 95.5,
"errors": 0
},
{
"start_seconds": 16,
"rps": 116.5,
"errors": 0
},
{
"start_seconds": 18,
"rps": 100.5,
"errors": 0
},
{
"start_seconds": 20,
"rps": 106.0,
"errors": 0
},
{
"start_seconds": 22,
"rps": 111.5,
"errors": 0
},
{
"start_seconds": 24,
"rps": 2.0,
"errors": 0
}
],
"deployment_after": [
{
"service": "api",
"id": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"name": "mtusi-lab3-api-1",
"started_at": "2026-11-01T13:55:57.397791954Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"name": "mtusi-lab3-api-2",
"started_at": "2026-11-01T13:54:45.672968999Z",
"status": "exited",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:45.014430269Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:44.838374892Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:45.212099737Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
],
"note": "Closed-loop mixed HTTP load, 4 clients; failures are attempts, retries retain keys; latency covers successes only."
}
+14
View File
@@ -0,0 +1,14 @@
{
"redis": {
"ready_status": 503,
"protected_status": 503,
"elapsed_seconds": 2.003,
"anonymous_status": 401
},
"postgres": {
"ready_status": 503,
"protected_status": 503,
"elapsed_seconds": 1.006,
"anonymous_status": 401
}
}
+27
View File
@@ -0,0 +1,27 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 tests/smoke.py --base-url "http://lb:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
python3 -m unittest discover -s student-tests -v
ROLLBACK: invalid second member left no chat or membership rows
test_composite_chat_rollback (test_api.APITests.test_composite_chat_rollback) ... ok
CONCURRENCY: 10 clients, 100 confirmations, 100 unique messages
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
FAILURES: Redis/PostgreSQL -> bounded 503, live 200, anonymous 401, recovery with old session
test_passwords_and_authentication (test_api.APITests.test_passwords_and_authentication) ... ok
REDIS CRASH: old session survived SIGKILL/AOF replay, expiry deadline unchanged
test_redis_crash_durability (test_api.APITests.test_redis_crash_durability) ... ok
RACE: 10 requests, 1 created, 9 conflicts, 1 database row
test_registration_race (test_api.APITests.test_registration_race) ... ok
test_validation_and_access (test_api.APITests.test_validation_and_access) ... ok
test_expired_key_and_same_session_on_all_instances (test_replication.ReplicationTests.test_expired_key_and_same_session_on_all_instances) ... ok
test_failed_transaction_does_not_save_message_or_replay (test_replication.ReplicationTests.test_failed_transaction_does_not_save_message_or_replay) ... ok
test_key_validation_scope_conflict_and_logout (test_replication.ReplicationTests.test_key_validation_scope_conflict_and_logout) ... ok
test_parallel_replay_across_real_replicas (test_replication.ReplicationTests.test_parallel_replay_across_real_replicas) ... ok
----------------------------------------------------------------------
Ran 12 tests in 18.855s
OK
+9
View File
@@ -0,0 +1,9 @@
{
"requests": 100,
"clients": 10,
"real_containers": 2,
"observed_instances": 2,
"messages": 1,
"replay_records": 1,
"lb_replays": 12
}
+7
View File
@@ -0,0 +1,7 @@
{
"target_instance": "56279f26a490-cd4fe5da999e",
"container": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"exit_code": 0,
"stop_seconds": 0.774,
"remains_stopped": true
}
+3
View File
@@ -0,0 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://lb: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.
+1
View File
@@ -0,0 +1 @@
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+158
View File
@@ -0,0 +1,158 @@
{
"before": [
{
"service": "api",
"id": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"name": "mtusi-lab3-api-1",
"started_at": "2026-11-01T13:52:02.178367306Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"name": "mtusi-lab3-api-2",
"started_at": "2026-11-01T13:52:02.607123306Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:30.359656882Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:33.555645547Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:10.199664374Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
],
"after": [
{
"service": "api",
"id": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"name": "mtusi-lab3-api-1",
"started_at": "2026-11-01T13:54:45.563795974Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"name": "mtusi-lab3-api-2",
"started_at": "2026-11-01T13:54:45.672968999Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:45.014430269Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:44.838374892Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:45.212099737Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
]
}
+298
View File
@@ -0,0 +1,298 @@
{
"scenario": "rolling-update",
"utc": "2026-11-01T13:57:17.630617+00:00",
"duration_seconds": 45.015,
"concurrency": 4,
"successful_requests": 4829,
"failed_attempts": 0,
"error_ratio": 0.0,
"successful_rps": 107.276,
"successful_latency_ms": {
"p50": 28.249,
"p95": 82.882,
"p99": 127.075
},
"first_write_after_action_seconds": 23.527,
"action": {
"started_seconds": 4.1119035999290645,
"detail": {
"updates": [
{
"old_container": "56279f26a490e9c62b51ddd24d14d35e26c3069385f3d80d3360d17fa37a5523",
"new_container": "918d3851dffce737d07c642d85b7f3332167a48c66314296605ccc0164ec97c5",
"backend_slot": "messenger/api1",
"new_image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8"
},
{
"old_container": "eebe2ed461699e48f987d0f9f51e0331d2f5dcd0e54f6264efd45dab26d24040",
"new_container": "113f897e60a031968c8eb7db3ca995df858af91ea8e49a23a9e74bbe896e3705",
"backend_slot": "messenger/api2",
"new_image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8"
}
],
"migration": "Unchanged: 001_initial.sql\nUnchanged: 002_message_requests.sql\nPASS: migrations committed",
"method": "drain, stop, remove and recreate each container; same application image, new APP_VERSION configuration"
},
"finished_seconds": 27.62092129990924,
"resources_during_load": [
{
"BlockIO": "0B / 0B",
"CPUPerc": "75.87%",
"Container": "113f897e60a031968c8eb7db3ca995df858af91ea8e49a23a9e74bbe896e3705",
"ID": "113f897e60a0",
"MemPerc": "17.73%",
"MemUsage": "45.39MiB / 256MiB",
"Name": "mtusi-lab3-api-4",
"NetIO": "1.82MB / 1.57MB",
"PIDs": "2"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "79.24%",
"Container": "918d3851dffce737d07c642d85b7f3332167a48c66314296605ccc0164ec97c5",
"ID": "918d3851dffc",
"MemPerc": "17.90%",
"MemUsage": "45.82MiB / 256MiB",
"Name": "mtusi-lab3-api-3",
"NetIO": "4.12MB / 3.52MB",
"PIDs": "2"
},
{
"BlockIO": "0B / 76.6MB",
"CPUPerc": "61.03%",
"Container": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"ID": "62fe1bac69db",
"MemPerc": "9.98%",
"MemUsage": "51.12MiB / 512MiB",
"Name": "mtusi-lab3-postgres-1",
"NetIO": "19.9MB / 25.3MB",
"PIDs": "15"
},
{
"BlockIO": "0B / 61.4kB",
"CPUPerc": "3.11%",
"Container": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"ID": "8ce27a874af3",
"MemPerc": "1.97%",
"MemUsage": "3.785MiB / 192MiB",
"Name": "mtusi-lab3-redis-1",
"NetIO": "1.5MB / 1.37MB",
"PIDs": "6"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "23.63%",
"Container": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"ID": "c28b6968210f",
"MemPerc": "13.55%",
"MemUsage": "17.34MiB / 128MiB",
"Name": "mtusi-lab3-lb-1",
"NetIO": "15.4MB / 16.3MB",
"PIDs": "17"
}
]
},
"confirmed_writes_checked": 4475,
"history_messages": 4475,
"unique_history_messages": 4475,
"instances_before": [
"eebe2ed46169-7f2687009ab0",
"56279f26a490-b1a72fdd0fd8"
],
"series_2_seconds": [
{
"start_seconds": 0,
"rps": 138.5,
"errors": 0
},
{
"start_seconds": 2,
"rps": 129.5,
"errors": 0
},
{
"start_seconds": 4,
"rps": 116.0,
"errors": 0
},
{
"start_seconds": 6,
"rps": 108.5,
"errors": 0
},
{
"start_seconds": 8,
"rps": 77.5,
"errors": 0
},
{
"start_seconds": 10,
"rps": 93.5,
"errors": 0
},
{
"start_seconds": 12,
"rps": 62.5,
"errors": 0
},
{
"start_seconds": 14,
"rps": 52.5,
"errors": 0
},
{
"start_seconds": 16,
"rps": 86.0,
"errors": 0
},
{
"start_seconds": 18,
"rps": 50.5,
"errors": 0
},
{
"start_seconds": 20,
"rps": 80.0,
"errors": 0
},
{
"start_seconds": 22,
"rps": 79.0,
"errors": 0
},
{
"start_seconds": 24,
"rps": 52.5,
"errors": 0
},
{
"start_seconds": 26,
"rps": 102.0,
"errors": 0
},
{
"start_seconds": 28,
"rps": 119.5,
"errors": 0
},
{
"start_seconds": 30,
"rps": 121.5,
"errors": 0
},
{
"start_seconds": 32,
"rps": 162.5,
"errors": 0
},
{
"start_seconds": 34,
"rps": 139.5,
"errors": 0
},
{
"start_seconds": 36,
"rps": 122.5,
"errors": 0
},
{
"start_seconds": 38,
"rps": 160.0,
"errors": 0
},
{
"start_seconds": 40,
"rps": 139.5,
"errors": 0
},
{
"start_seconds": 42,
"rps": 138.0,
"errors": 0
},
{
"start_seconds": 44,
"rps": 83.0,
"errors": 0
}
],
"deployment_after": [
{
"service": "api",
"id": "113f897e60a031968c8eb7db3ca995df858af91ea8e49a23a9e74bbe896e3705",
"name": "mtusi-lab3-api-4",
"started_at": "2026-11-01T13:56:54.417531752Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "918d3851dffce737d07c642d85b7f3332167a48c66314296605ccc0164ec97c5",
"name": "mtusi-lab3-api-3",
"started_at": "2026-11-01T13:56:44.055659428Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:45.014430269Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:44.838374892Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:45.212099737Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
],
"note": "Closed-loop mixed HTTP load, 4 clients; failures are attempts, retries retain keys; latency covers successes only."
}
+5
View File
@@ -0,0 +1,5 @@
Checking contract, HTTP API and student tests
Running public failover scenario
Checking short session expiry and indexed history
Measuring failure of each replica and sequential replacement under load
PASS: lab3 checks completed; evidence/verification.json
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://lb:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "http://lb:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
+21
View File
@@ -0,0 +1,21 @@
{
"baseline_commit": "0ab3a341aa7ba32363ce43061d4ff02b1f2964af",
"normalized_eol": "LF",
"unchanged_files": {
"CONTRIBUTING.md": "2c01dd698cc9653dece49a94c9fd3f58d36e84764aaa643b46e26d7e599dc12e",
"COURSE.md": "c34d53cd082d194aa4b58f504c4e0348d25b6afec3d6a9c0963dd01c9c81e971",
"README.md": "7622c956ad4508d10d1807b4190461e3a7911a22759108ecf812d5bc477ff7a2",
"contracts/README.md": "72df27a559f88ffa3fd8c3c79d3c32f6db2c5986a0602677c51994c434a3fc4f",
"contracts/examples.json": "0a71cec72903af556df85f939c7e347fc73a86a1a4ffc39fb9c8ded169b7df45",
"contracts/infrastructure.json": "99320becab20381c3d31983336dd4e0aef4bca992d672538f049b6684714a577",
"contracts/openapi.json": "9c3787e5d08a60c59ae67eeb429e9d75fbf134992a4e1f0954e926db49e111be",
"lab.json": "acf873f5132bbd0af78dc878852baeb49dbfa026c072932f8bd70b958114e938",
"scripts/check_contract.py": "7c4402c2a6ab80d3b4676e1866d6ecc87b6daea14c080bcb9be9a7e8b959d671",
"scripts/validate_openapi.py": "4e981acbfc10dac58817bf922d5896e996798551fedc1b2385130e1cddb13d54",
"tests/README.md": "e0bfa7e196797f6a5bf6e44d8ad2ffeb82651927ff5d8484eb1c2dda1ec7dec5",
"tests/client.py": "8d50976fc7c7bbb81e88a152f613c61ab25eaf53dba33c6a9dfab19f868d546d",
"tests/load.py": "6d3511ea719c7a7e841083e73d435c86dcbfd9f4e5c2a07d62eb9614b01d9933",
"tests/resilience.py": "1f96663a174b3978d24eff66f2741f5f8c9b788d3242261d37a972720c52788b",
"tests/smoke.py": "52ac38eb343ff7d43e7543588e1da58ca06c9fce74b2b0d0bf0e4982bc23c1db"
}
}
+32
View File
@@ -0,0 +1,32 @@
Container mtusi-lab3-redis-1 Running
Container mtusi-lab3-postgres-1 Running
Container mtusi-lab3-api-1 Running
Container mtusi-lab3-api-2 Running
Container mtusi-lab3-lb-1 Recreate
Container mtusi-lab3-lb-1 Recreated
Container mtusi-lab3-postgres-1 Waiting
Container mtusi-lab3-postgres-1 Healthy
Container mtusi-lab3-migrate-1 Starting
Container mtusi-lab3-migrate-1 Started
Container mtusi-lab3-migrate-1 Waiting
Container mtusi-lab3-redis-1 Waiting
Container mtusi-lab3-redis-1 Healthy
Container mtusi-lab3-migrate-1 Exited
Container mtusi-lab3-api-1 Waiting
Container mtusi-lab3-api-2 Waiting
Container mtusi-lab3-api-1 Healthy
Container mtusi-lab3-api-2 Healthy
Container mtusi-lab3-lb-1 Starting
Container mtusi-lab3-lb-1 Started
Container mtusi-lab3-api-1 Waiting
Container mtusi-lab3-api-2 Waiting
Container mtusi-lab3-lb-1 Waiting
Container mtusi-lab3-postgres-1 Waiting
Container mtusi-lab3-redis-1 Waiting
Container mtusi-lab3-migrate-1 Waiting
Container mtusi-lab3-redis-1 Healthy
Container mtusi-lab3-postgres-1 Healthy
Container mtusi-lab3-api-1 Healthy
Container mtusi-lab3-api-2 Healthy
Container mtusi-lab3-migrate-1 Exited
Container mtusi-lab3-lb-1 Healthy
+27
View File
@@ -0,0 +1,27 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 tests/smoke.py --base-url "http://lb:8080"
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
python3 -m unittest discover -s student-tests -v
ROLLBACK: invalid second member left no chat or membership rows
test_composite_chat_rollback (test_api.APITests.test_composite_chat_rollback) ... ok
CONCURRENCY: 10 clients, 100 confirmations, 100 unique messages
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
FAILURES: Redis/PostgreSQL -> bounded 503, live 200, anonymous 401, recovery with old session
test_dependency_failures (test_api.APITests.test_dependency_failures) ... ok
test_passwords_and_authentication (test_api.APITests.test_passwords_and_authentication) ... ok
REDIS CRASH: old session survived SIGKILL/AOF replay, expiry deadline unchanged
test_redis_crash_durability (test_api.APITests.test_redis_crash_durability) ... ok
RACE: 10 requests, 1 created, 9 conflicts, 1 database row
test_registration_race (test_api.APITests.test_registration_race) ... ok
test_validation_and_access (test_api.APITests.test_validation_and_access) ... ok
test_expired_key_and_same_session_on_all_instances (test_replication.ReplicationTests.test_expired_key_and_same_session_on_all_instances) ... ok
test_failed_transaction_does_not_save_message_or_replay (test_replication.ReplicationTests.test_failed_transaction_does_not_save_message_or_replay) ... ok
test_key_validation_scope_conflict_and_logout (test_replication.ReplicationTests.test_key_validation_scope_conflict_and_logout) ... ok
test_parallel_replay_across_real_replicas (test_replication.ReplicationTests.test_parallel_replay_across_real_replicas) ... ok
----------------------------------------------------------------------
Ran 12 tests in 19.357s
OK
+23
View File
@@ -0,0 +1,23 @@
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
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
test_expired_key_and_same_session_on_all_instances (test_replication.ReplicationTests.test_expired_key_and_same_session_on_all_instances) ... ok
test_failed_transaction_does_not_save_message_or_replay (test_replication.ReplicationTests.test_failed_transaction_does_not_save_message_or_replay) ... ok
test_key_validation_scope_conflict_and_logout (test_replication.ReplicationTests.test_key_validation_scope_conflict_and_logout) ... ok
test_parallel_replay_across_real_replicas (test_replication.ReplicationTests.test_parallel_replay_across_real_replicas) ... ok
----------------------------------------------------------------------
Ran 12 tests in 17.871s
OK
+101
View File
@@ -0,0 +1,101 @@
{
"result": "PASS",
"utc": "2026-11-01T13:57:24.463073+00:00",
"base_url": "http://127.0.0.1:8080",
"checks": [
"public_smoke",
"student_tests",
"full_restart",
"public_failover",
"expiry",
"index_10000",
"published_smoke",
"each_replica_failure",
"sequential_replacement_under_load"
],
"docker": {
"ServerVersion": "28.5.1",
"OperatingSystem": "Docker Desktop",
"Architecture": "x86_64",
"NCPU": 16,
"MemTotal": 8017608704
},
"deployment": [
{
"service": "api",
"id": "113f897e60a031968c8eb7db3ca995df858af91ea8e49a23a9e74bbe896e3705",
"name": "mtusi-lab3-api-4",
"started_at": "2026-11-01T13:56:54.417531752Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "api",
"id": "918d3851dffce737d07c642d85b7f3332167a48c66314296605ccc0164ec97c5",
"name": "mtusi-lab3-api-3",
"started_at": "2026-11-01T13:56:44.055659428Z",
"status": "running",
"image": "sha256:d37648c74d3fad854c3620bdfe611a43dd76c7aef672b0045759d82876a27dd8",
"user": "messenger",
"memory_bytes": 268435456,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": []
},
{
"service": "postgres",
"id": "62fe1bac69db36ae9f836e897aab943cb4abdc0cb891b542a6cd2c50f9320a17",
"name": "mtusi-lab3-postgres-1",
"started_at": "2026-11-01T13:54:45.014430269Z",
"status": "running",
"image": "sha256:f3bd19c606e442c3d7bdfa8002e03fe260a1023351e0ea4598032022b68dd6e3",
"user": "",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_postgres_data"
]
},
{
"service": "redis",
"id": "8ce27a874af3533ce9fc95ca050970c901ec67bd9ed8b0956e2367ff1e0b9dd7",
"name": "mtusi-lab3-redis-1",
"started_at": "2026-11-01T13:54:44.838374892Z",
"status": "running",
"image": "sha256:90e7a336d044f1abc9e9dbc05d65566850896d11453bbd1dd0fb7e5059f0e8fb",
"user": "",
"memory_bytes": 201326592,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab3_redis_data"
]
},
{
"service": "lb",
"id": "c28b6968210fe5872afd276cb25e31c1356518975896402ab8b49ea984cec4dc",
"name": "mtusi-lab3-lb-1",
"started_at": "2026-11-01T13:54:45.212099737Z",
"status": "running",
"image": "sha256:e3229153dd6429fc71f8a9a1f1ccbf8dab6962422d7043c81e84dd6a075e90ee",
"user": "haproxy",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8080/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8080"
}
]
},
"volumes": []
}
]
}