Implement Lab 3 grade 4 messenger balancing
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.181,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1162,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 28.919,
|
||||
"successful_latency_ms": {
|
||||
"p50": 107.255,
|
||||
"p95": 352.709,
|
||||
"p99": 439.816
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
Recorded original distinct-instance run before a later retry overwrote the run-3 log path.
|
||||
Command: bash scripts/verify-failover.sh replica-run-3
|
||||
Console output:
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 50, "failed_attempts": 0, "first_recovery_seconds": 1.955}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
Selected instance ID: 3375d99fba8b, recorded at 2026-11-06T21:38:58Z in evidence/stopped-replicas.txt.
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.106,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1153,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 28.749,
|
||||
"successful_latency_ms": {
|
||||
"p50": 109.552,
|
||||
"p95": 339.41,
|
||||
"p99": 461.6
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.106,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1153,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 28.749,
|
||||
"successful_latency_ms": {
|
||||
"p50": 109.552,
|
||||
"p95": 339.41,
|
||||
"p99": 461.6
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 50, "failed_attempts": 0, "first_recovery_seconds": 1.927}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.248,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1123,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 27.902,
|
||||
"successful_latency_ms": {
|
||||
"p50": 109.335,
|
||||
"p95": 380.847,
|
||||
"p99": 509.395
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.248,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1123,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 27.902,
|
||||
"successful_latency_ms": {
|
||||
"p50": 109.335,
|
||||
"p95": 380.847,
|
||||
"p99": 509.395
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 51, "failed_attempts": 0, "first_recovery_seconds": 1.897}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.092,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1169,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 29.158,
|
||||
"successful_latency_ms": {
|
||||
"p50": 107.96,
|
||||
"p95": 330.054,
|
||||
"p99": 483.46
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.092,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1169,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 29.158,
|
||||
"successful_latency_ms": {
|
||||
"p50": 107.96,
|
||||
"p95": 330.054,
|
||||
"p99": 483.46
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 50, "failed_attempts": 0, "first_recovery_seconds": 1.672}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 40.0,
|
||||
"elapsed_seconds": 40.143,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1686,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 42.0,
|
||||
"successful_latency_ms": {
|
||||
"p50": 90.842,
|
||||
"p95": 202.354,
|
||||
"p99": 290.757
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
Command: python tests/idempotency_concurrency.py --base-url http://localhost:8080
|
||||
Console output:
|
||||
{"parallel_requests": 24, "workers": 12, "replicas_observed": 2, "unique_message_ids": 1, "stored_copies": 1, "result": "PASS"}
|
||||
@@ -0,0 +1,18 @@
|
||||
Lab 3 checks and runtime evidence
|
||||
|
||||
Offline checks:
|
||||
- python scripts/check_contract.py: PASS (structure, local references and Python syntax; does not run the application).
|
||||
- python -m compileall -q src tests scripts: PASS, exit code 0.
|
||||
- python scripts/validate_openapi.py: PASS, full OpenAPI 3.1 / JSON Schema validation.
|
||||
- docker compose --env-file .env config --quiet: PASS.
|
||||
- Configuration inspection: two API replicas; only loopback LB port is published; API ports are private; all five services have CPU/RAM limits.
|
||||
|
||||
Runtime checks:
|
||||
- Public smoke: PASS after the final persistence restart; see evidence/smoke.txt.
|
||||
- Concurrent idempotency: PASS; 24 requests, 12 workers, 2 replicas, one stored message; see evidence/idempotency.txt.
|
||||
- Persistence: PASS; confirmed data and existing session survived full-store restart; action scope is logged in evidence/persistence-hook.log.
|
||||
- Failover: PASS for distinct API instance IDs 46c9e552d0a0 and 3375d99fba8b. The later repeated run selected 74e4faa7a0f1 twice and is not counted as second-replica evidence.
|
||||
- Rolling update: PASS, with two new healthy replicas at completion. Latest 60-second concurrent workload recorded 1 failed request out of 1,055 total; see evidence/rolling-update-load.json.
|
||||
|
||||
Make targets must run in WSL/Ubuntu, where python3 and a POSIX shell are available. Windows PowerShell make attempts are not application test failures.
|
||||
Load tests are small closed-loop demonstrations. Host hardware and Docker Desktop allocation were not recorded; no capacity guarantee is claimed.
|
||||
@@ -0,0 +1,3 @@
|
||||
Command: make check
|
||||
python3 scripts/check_contract.py
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,3 @@
|
||||
Command: make test BASE_URL=http://localhost:8080
|
||||
python3 tests/smoke.py --base-url "http://localhost:8080"
|
||||
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,26 @@
|
||||
Container mtusi-messenger-lab3-api-3 Stopping
|
||||
Container mtusi-messenger-lab3-api-4 Stopping
|
||||
Container mtusi-messenger-lab3-api-4 Stopped
|
||||
Container mtusi-messenger-lab3-api-3 Stopped
|
||||
Container mtusi-messenger-lab3-redis-1 Stopping
|
||||
Container mtusi-messenger-lab3-db-1 Stopping
|
||||
Container mtusi-messenger-lab3-db-1 Stopped
|
||||
Container mtusi-messenger-lab3-redis-1 Stopped
|
||||
Container mtusi-messenger-lab3-redis-1 Starting
|
||||
Container mtusi-messenger-lab3-db-1 Starting
|
||||
Container mtusi-messenger-lab3-db-1 Started
|
||||
Container mtusi-messenger-lab3-redis-1 Started
|
||||
Container mtusi-messenger-lab3-db-1 Waiting
|
||||
Container mtusi-messenger-lab3-db-1 Healthy
|
||||
Container mtusi-messenger-lab3-migrate-1 Starting
|
||||
Container mtusi-messenger-lab3-migrate-1 Started
|
||||
Container mtusi-messenger-lab3-redis-1 Waiting
|
||||
Container mtusi-messenger-lab3-migrate-1 Waiting
|
||||
Container mtusi-messenger-lab3-db-1 Waiting
|
||||
Container mtusi-messenger-lab3-redis-1 Healthy
|
||||
Container mtusi-messenger-lab3-db-1 Healthy
|
||||
Container mtusi-messenger-lab3-migrate-1 Exited
|
||||
Container mtusi-messenger-lab3-api-4 Starting
|
||||
Container mtusi-messenger-lab3-api-4 Started
|
||||
Container mtusi-messenger-lab3-api-3 Starting
|
||||
Container mtusi-messenger-lab3-api-3 Started
|
||||
@@ -0,0 +1,4 @@
|
||||
Command: python3 tests/resilience.py --mode persistence --action-script scripts/restart.sh --base-url http://localhost:8080
|
||||
Console output:
|
||||
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
||||
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 60.0,
|
||||
"elapsed_seconds": 60.079,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 2881,
|
||||
"failed_requests": 2,
|
||||
"error_ratio": 0.000694,
|
||||
"successful_rps": 47.953,
|
||||
"successful_latency_ms": {
|
||||
"p50": 83.439,
|
||||
"p95": 198.871,
|
||||
"p99": 289.461
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 3,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 60.0,
|
||||
"elapsed_seconds": 60.079,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 2881,
|
||||
"failed_requests": 2,
|
||||
"error_ratio": 0.000694,
|
||||
"successful_rps": 47.953,
|
||||
"successful_latency_ms": {
|
||||
"p50": 83.439,
|
||||
"p95": 198.871,
|
||||
"p99": 289.461
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
Image mtusi-messenger-lab3-api:local Building
|
||||
Image mtusi-messenger-lab3-api:local Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.46kB done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 836B 0.0s done
|
||||
#2 DONE 0.1s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/python:3.12.6-slim-bookworm
|
||||
#3 DONE 0.9s
|
||||
|
||||
#4 [internal] load .dockerignore
|
||||
#4 transferring context: 216B 0.0s done
|
||||
#4 DONE 0.1s
|
||||
|
||||
#5 [internal] load build context
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [1/7] FROM docker.io/library/python:3.12.6-slim-bookworm@sha256:ad48727987b259854d52241fac3bc633574364867b8e20aec305e6e7f4028b26
|
||||
#6 resolve docker.io/library/python:3.12.6-slim-bookworm@sha256:ad48727987b259854d52241fac3bc633574364867b8e20aec305e6e7f4028b26 0.0s done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#5 [internal] load build context
|
||||
#5 transferring context: 1.16kB 0.2s done
|
||||
#5 DONE 0.2s
|
||||
|
||||
#7 [2/7] WORKDIR /app
|
||||
#7 CACHED
|
||||
|
||||
#8 [3/7] COPY requirements.txt ./
|
||||
#8 CACHED
|
||||
|
||||
#9 [4/7] RUN pip install --no-cache-dir --requirement requirements.txt
|
||||
#9 1.677 Collecting fastapi==0.115.0 (from -r requirements.txt (line 1))
|
||||
#9 2.013 Downloading fastapi-0.115.0-py3-none-any.whl.metadata (27 kB)
|
||||
#9 2.130 Collecting uvicorn==0.30.6 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 2.189 Downloading uvicorn-0.30.6-py3-none-any.whl.metadata (6.6 kB)
|
||||
#9 2.502 Collecting pydantic==2.9.2 (from -r requirements.txt (line 3))
|
||||
#9 2.563 Downloading pydantic-2.9.2-py3-none-any.whl.metadata (149 kB)
|
||||
#9 3.452 Collecting SQLAlchemy==2.0.36 (from -r requirements.txt (line 4))
|
||||
#9 3.514 Downloading SQLAlchemy-2.0.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.7 kB)
|
||||
#9 3.630 Collecting psycopg==3.2.3 (from psycopg[binary]==3.2.3->-r requirements.txt (line 5))
|
||||
#9 3.691 Downloading psycopg-3.2.3-py3-none-any.whl.metadata (4.3 kB)
|
||||
#9 3.804 Collecting redis==5.2.0 (from -r requirements.txt (line 6))
|
||||
#9 3.868 Downloading redis-5.2.0-py3-none-any.whl.metadata (9.1 kB)
|
||||
#9 3.957 Collecting argon2-cffi==23.1.0 (from -r requirements.txt (line 7))
|
||||
#9 4.023 Downloading argon2_cffi-23.1.0-py3-none-any.whl.metadata (5.2 kB)
|
||||
#9 4.126 Collecting starlette<0.39.0,>=0.37.2 (from fastapi==0.115.0->-r requirements.txt (line 1))
|
||||
#9 4.187 Downloading starlette-0.38.6-py3-none-any.whl.metadata (6.0 kB)
|
||||
#9 4.307 Collecting typing-extensions>=4.8.0 (from fastapi==0.115.0->-r requirements.txt (line 1))
|
||||
#9 4.371 Downloading typing_extensions-4.16.0-py3-none-any.whl.metadata (3.3 kB)
|
||||
#9 4.456 Collecting click>=7.0 (from uvicorn==0.30.6->uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 4.518 Downloading click-8.5.1-py3-none-any.whl.metadata (2.6 kB)
|
||||
#9 4.584 Collecting h11>=0.8 (from uvicorn==0.30.6->uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 4.649 Downloading h11-0.16.0-py3-none-any.whl.metadata (8.3 kB)
|
||||
#9 4.720 Collecting annotated-types>=0.6.0 (from pydantic==2.9.2->-r requirements.txt (line 3))
|
||||
#9 4.779 Downloading annotated_types-0.8.0-py3-none-any.whl.metadata (15 kB)
|
||||
#9 6.041 Collecting pydantic-core==2.23.4 (from pydantic==2.9.2->-r requirements.txt (line 3))
|
||||
#9 6.107 Downloading pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB)
|
||||
#9 6.482 Collecting greenlet!=0.4.17 (from SQLAlchemy==2.0.36->-r requirements.txt (line 4))
|
||||
#9 6.547 Downloading greenlet-3.5.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.metadata (3.8 kB)
|
||||
#9 6.625 Collecting argon2-cffi-bindings (from argon2-cffi==23.1.0->-r requirements.txt (line 7))
|
||||
#9 6.713 Downloading argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl.metadata (7.5 kB)
|
||||
#9 7.072 Collecting psycopg-binary==3.2.3 (from psycopg[binary]==3.2.3->-r requirements.txt (line 5))
|
||||
#9 7.161 Downloading psycopg_binary-3.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.8 kB)
|
||||
#9 7.289 Collecting httptools>=0.5.0 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 7.357 Downloading httptools-0.9.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (3.5 kB)
|
||||
#9 7.431 Collecting python-dotenv>=0.13 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 7.495 Downloading python_dotenv-1.2.4-py3-none-any.whl.metadata (29 kB)
|
||||
#9 7.632 Collecting pyyaml>=5.1 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 7.693 Downloading pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.4 kB)
|
||||
#9 7.809 Collecting uvloop!=0.15.0,!=0.15.1,>=0.14.0 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 7.872 Downloading uvloop-0.23.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (5.1 kB)
|
||||
#9 8.059 Collecting watchfiles>=0.13 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 8.156 Downloading watchfiles-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB)
|
||||
#9 8.480 Collecting websockets>=10.4 (from uvicorn[standard]==0.30.6->-r requirements.txt (line 2))
|
||||
#9 8.551 Downloading websockets-17.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.3 kB)
|
||||
#9 8.676 Collecting anyio<5,>=3.4.0 (from starlette<0.39.0,>=0.37.2->fastapi==0.115.0->-r requirements.txt (line 1))
|
||||
#9 8.737 Downloading anyio-4.16.0-py3-none-any.whl.metadata (4.7 kB)
|
||||
#9 9.039 Collecting cffi>=1.0.1 (from argon2-cffi-bindings->argon2-cffi==23.1.0->-r requirements.txt (line 7))
|
||||
#9 9.102 Downloading cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.5 kB)
|
||||
#9 9.182 Collecting idna>=2.8 (from anyio<5,>=3.4.0->starlette<0.39.0,>=0.37.2->fastapi==0.115.0->-r requirements.txt (line 1))
|
||||
#9 9.247 Downloading idna-3.20-py3-none-any.whl.metadata (7.2 kB)
|
||||
#9 9.328 Collecting pycparser (from cffi>=1.0.1->argon2-cffi-bindings->argon2-cffi==23.1.0->-r requirements.txt (line 7))
|
||||
#9 9.393 Downloading pycparser-3.12-py3-none-any.whl.metadata (9.7 kB)
|
||||
#9 9.471 Downloading fastapi-0.115.0-py3-none-any.whl (94 kB)
|
||||
#9 9.613 Downloading uvicorn-0.30.6-py3-none-any.whl (62 kB)
|
||||
#9 9.704 Downloading pydantic-2.9.2-py3-none-any.whl (434 kB)
|
||||
#9 9.996 Downloading SQLAlchemy-2.0.36-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.2 MB)
|
||||
#9 11.62 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 2.0 MB/s eta 0:00:00
|
||||
#9 11.68 Downloading psycopg-3.2.3-py3-none-any.whl (197 kB)
|
||||
#9 11.86 Downloading redis-5.2.0-py3-none-any.whl (261 kB)
|
||||
#9 12.08 Downloading argon2_cffi-23.1.0-py3-none-any.whl (15 kB)
|
||||
#9 12.15 Downloading psycopg_binary-3.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.2 MB)
|
||||
#9 14.42 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.2/4.2 MB 1.9 MB/s eta 0:00:00
|
||||
#9 14.48 Downloading pydantic_core-2.23.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB)
|
||||
#9 15.49 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.1 MB/s eta 0:00:00
|
||||
#9 15.60 Downloading annotated_types-0.8.0-py3-none-any.whl (13 kB)
|
||||
#9 15.69 Downloading click-8.5.1-py3-none-any.whl (126 kB)
|
||||
#9 15.80 Downloading greenlet-3.5.6-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (621 kB)
|
||||
#9 16.09 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 621.4/621.4 kB 2.4 MB/s eta 0:00:00
|
||||
#9 16.15 Downloading h11-0.16.0-py3-none-any.whl (37 kB)
|
||||
#9 16.24 Downloading httptools-0.9.0-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (552 kB)
|
||||
#9 16.50 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 552.8/552.8 kB 2.2 MB/s eta 0:00:00
|
||||
#9 16.56 Downloading python_dotenv-1.2.4-py3-none-any.whl (23 kB)
|
||||
#9 16.65 Downloading pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (807 kB)
|
||||
#9 17.07 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 807.9/807.9 kB 1.8 MB/s eta 0:00:00
|
||||
#9 17.13 Downloading starlette-0.38.6-py3-none-any.whl (71 kB)
|
||||
#9 17.22 Downloading typing_extensions-4.16.0-py3-none-any.whl (45 kB)
|
||||
#9 17.30 Downloading uvloop-0.23.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (4.5 MB)
|
||||
#9 19.53 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 2.1 MB/s eta 0:00:00
|
||||
#9 19.59 Downloading watchfiles-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (458 kB)
|
||||
#9 19.85 Downloading websockets-17.4-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (226 kB)
|
||||
#9 20.04 Downloading argon2_cffi_bindings-26.1.0-cp310-abi3-manylinux_2_26_x86_64.manylinux_2_28_x86_64.whl (26 kB)
|
||||
#9 20.11 Downloading anyio-4.16.0-py3-none-any.whl (134 kB)
|
||||
#9 20.28 Downloading cffi-2.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (221 kB)
|
||||
#9 20.46 Downloading idna-3.20-py3-none-any.whl (69 kB)
|
||||
#9 20.55 Downloading pycparser-3.12-py3-none-any.whl (62 kB)
|
||||
#9 20.67 Installing collected packages: websockets, uvloop, typing-extensions, redis, pyyaml, python-dotenv, pycparser, psycopg-binary, idna, httptools, h11, greenlet, click, annotated-types, uvicorn, SQLAlchemy, pydantic-core, psycopg, cffi, anyio, watchfiles, starlette, pydantic, argon2-cffi-bindings, fastapi, argon2-cffi
|
||||
#9 22.02 Successfully installed SQLAlchemy-2.0.36 annotated-types-0.8.0 anyio-4.16.0 argon2-cffi-23.1.0 argon2-cffi-bindings-26.1.0 cffi-2.1.1 click-8.5.1 fastapi-0.115.0 greenlet-3.5.6 h11-0.16.0 httptools-0.9.0 idna-3.20 psycopg-3.2.3 psycopg-binary-3.2.3 pycparser-3.12 pydantic-2.9.2 pydantic-core-2.23.4 python-dotenv-1.2.4 pyyaml-6.0.3 redis-5.2.0 starlette-0.38.6 typing-extensions-4.16.0 uvicorn-0.30.6 uvloop-0.23.0 watchfiles-1.3.0 websockets-17.4
|
||||
#9 22.02 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.
|
||||
#9 22.38
|
||||
#9 22.38 [notice] A new release of pip is available: 24.2 -> 26.3
|
||||
#9 22.38 [notice] To update, run: pip install --upgrade pip
|
||||
#9 DONE 23.3s
|
||||
|
||||
#10 [5/7] COPY src/ ./src/
|
||||
#10 DONE 0.1s
|
||||
|
||||
#11 [6/7] COPY migrations/ ./migrations/
|
||||
#11 DONE 0.1s
|
||||
|
||||
#12 [7/7] RUN useradd --create-home --uid 10001 appuser
|
||||
#12 DONE 0.4s
|
||||
|
||||
#13 exporting to image
|
||||
#13 exporting layers
|
||||
#13 exporting layers 3.3s done
|
||||
#13 exporting manifest sha256:9d09f8506e1eebad5711b7d16612dd66df9e6817ead50fead1b6f266cd41c9b6 0.0s done
|
||||
#13 exporting config sha256:d2aaee67d64791fe5cfa3dae9dfe389fa098804bb996770e56840782acc27498 0.0s done
|
||||
#13 exporting attestation manifest sha256:e2b74e3c3daef55ece1850952f42f20470ac087104e9d65a838c41424673190c
|
||||
#13 exporting attestation manifest sha256:e2b74e3c3daef55ece1850952f42f20470ac087104e9d65a838c41424673190c 0.1s done
|
||||
#13 exporting manifest list sha256:87c611efe8121200bbb1f8c6ba95a5d28d1f6901e190e7daff7da72efa052266 0.0s done
|
||||
#13 naming to docker.io/library/mtusi-messenger-lab3-api:local
|
||||
#13 naming to docker.io/library/mtusi-messenger-lab3-api:local done
|
||||
#13 unpacking to docker.io/library/mtusi-messenger-lab3-api:local
|
||||
#13 unpacking to docker.io/library/mtusi-messenger-lab3-api:local 0.8s done
|
||||
#13 DONE 4.4s
|
||||
|
||||
#14 resolving provenance for metadata file
|
||||
#14 DONE 0.0s
|
||||
Image mtusi-messenger-lab3-api:local Built
|
||||
Container mtusi-messenger-lab3-api-7 Running
|
||||
Container mtusi-messenger-lab3-api-9 Creating
|
||||
Container mtusi-messenger-lab3-api-9 Created
|
||||
Container mtusi-messenger-lab3-api-9 Starting
|
||||
Container mtusi-messenger-lab3-api-9 Started
|
||||
Container mtusi-messenger-lab3-api-8 Starting
|
||||
Container mtusi-messenger-lab3-api-8 Started
|
||||
Container mtusi-messenger-lab3-api-8 Running
|
||||
Container mtusi-messenger-lab3-api-9 Running
|
||||
Container mtusi-messenger-lab3-api-10 Creating
|
||||
Container mtusi-messenger-lab3-api-10 Created
|
||||
Container mtusi-messenger-lab3-api-10 Starting
|
||||
Container mtusi-messenger-lab3-api-10 Started
|
||||
Container mtusi-messenger-lab3-api-9 Running
|
||||
Container mtusi-messenger-lab3-api-10 Running
|
||||
Container mtusi-messenger-lab3-api-11 Creating
|
||||
Container mtusi-messenger-lab3-api-11 Created
|
||||
Container mtusi-messenger-lab3-api-11 Starting
|
||||
Container mtusi-messenger-lab3-api-11 Started
|
||||
Container mtusi-messenger-lab3-api-9 Running
|
||||
Container mtusi-messenger-lab3-api-10 Running
|
||||
Container mtusi-messenger-lab3-api-11 Stopping
|
||||
Container mtusi-messenger-lab3-api-11 Stopped
|
||||
Container mtusi-messenger-lab3-api-11 Removing
|
||||
Container mtusi-messenger-lab3-api-11 Removed
|
||||
PASS: old API containers were replaced one at a time; two new replicas are healthy. revision=roll-20261110095038
|
||||
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
|
||||
mtusi-messenger-lab3-api-10 mtusi-messenger-lab3-api:local "uvicorn src.app.mai…" api 15 seconds ago Up 14 seconds (healthy) 8080/tcp
|
||||
mtusi-messenger-lab3-api-9 mtusi-messenger-lab3-api:local "uvicorn src.app.mai…" api 24 seconds ago Up 24 seconds (healthy) 8080/tcp
|
||||
@@ -0,0 +1,5 @@
|
||||
Compose configuration and runtime service inspection:
|
||||
- Only lb publishes 127.0.0.1:8080 to container port 8080.
|
||||
- API replicas expose port 8080 internally and have no host port binding.
|
||||
- PostgreSQL and Redis have no host port binding.
|
||||
- CPU/RAM limits are configured for all five services in compose.yaml.
|
||||
@@ -0,0 +1,5 @@
|
||||
Final post-restart verification
|
||||
Command: docker compose --env-file .env ps
|
||||
Observed: api-3 healthy; api-4 healthy; db healthy; redis healthy; lb healthy and publishing 127.0.0.1:8080.
|
||||
Command: python3 tests/smoke.py --base-url http://localhost:8080
|
||||
Output: PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,8 @@
|
||||
2026-11-06T21:33:41Z 46c9e552d0a0
|
||||
2026-11-06T21:35:34Z 46c9e552d0a0
|
||||
2026-11-06T21:38:58Z 3375d99fba8b
|
||||
2026-11-06T22:28:26Z 74e4faa7a0f1
|
||||
2026-11-06T22:29:20Z 74e4faa7a0f1
|
||||
2026-11-10T09:30:12Z 2f298bdf21b0
|
||||
2026-11-10T09:50:23Z 3895110fa377
|
||||
2026-11-12T17:44:23Z 80747c6466aa
|
||||
Reference in New Issue
Block a user