forked from mtusi2026/mtusi2026lab4
153 lines
8.7 KiB
Plaintext
153 lines
8.7 KiB
Plaintext
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
make check
|
|
python3 scripts/check_contract.py
|
|
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
docker compose --env-file .env config --quiet
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
make validate
|
|
python3 scripts/validate_openapi.py
|
|
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
docker compose --env-file .env up --build --scale api=2
|
|
[+] Running 13/13
|
|
✔ s3_init Pulled 29.1s
|
|
✔ s3 Pulled 29.1s
|
|
[+] Building 54.6s (29/34) docker:default
|
|
=> [migrate internal] load build definition from Dockerfile 0.2s
|
|
=> => transferring dockerfile: 567B 0.1s
|
|
=> [api internal] load metadata for docker.io/library/python:3.12.11-slim-bookworm 4.7s
|
|
=> [migrate internal] load .dockerignore 0.1s
|
|
=> => transferring context: 216B
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ curl -i http://localhost:8080/health/ready
|
|
HTTP/1.1 200 OK
|
|
date: Sat, 31 Oct 2026 17:06:30 GMT
|
|
server: uvicorn
|
|
content-length: 15
|
|
content-type: application/json
|
|
x-request-id: 241b13832e55470c83632d148975e85a
|
|
x-instance-id: 464805954a42
|
|
|
|
{"status":"ok"}thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make test
|
|
python3 tests/smoke.py --base-url "http://localhost:8080"
|
|
PASS: lab4 public API scenario; infrastructure and grading evidence remain separate.
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
(проверки 3ей лабы)
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make test-lab3
|
|
python3 student-tests/lab3_idempotency_checks.py --base-url "http://localhost:8080"
|
|
{"distinct_instances": ["464805954a42", "e269ce4a6969"], "parallel_requests": 12, "distinct_message_ids": 1, "changed_body_status": 409, "missing_key_status": 400, "invalid_key_status": 400}
|
|
PASS: concurrent cross-replica idempotency, key validation, and instance visibility
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make test-level4
|
|
python3 student-tests/level4_checks.py --base-url "http://localhost:8080"
|
|
statuses seen: [201, 400, 404, 413, 415]
|
|
PASS: level-4 attachment checks (no 5xx for user errors)
|
|
python3 -m unittest discover -s student-tests -p "test_*.py"
|
|
INFO:httpx:HTTP Request: POST http://testserver/api/v1/chats/68da9b78-1806-4f38-bffa-f73b9499a1ef/attachments?filename=a.png "HTTP/1.1 415 Unsupported Media Type"
|
|
.WARNING:messenger:Database operation failed request_id=7dce87b3b62643cc890fe3e40a8c15dd
|
|
INFO:httpx:HTTP Request: POST http://testserver/api/v1/chats/9c8e1f04-5772-4854-8297-08482a1bef15/attachments?filename=a.png "HTTP/1.1 503 Service Unavailable"
|
|
.WARNING:messenger:Object storage failure request_id=eb68ec5f6e774fab8463cada45862daa type=BotoCoreError
|
|
INFO:httpx:HTTP Request: POST http://testserver/api/v1/chats/97cd6e8a-3e68-4c94-add5-5e0aac4e0e4f/attachments?filename=a.png "HTTP/1.1 503 Service Unavailable"
|
|
.
|
|
----------------------------------------------------------------------
|
|
Ran 3 tests in 0.071s
|
|
|
|
OK
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make check-s3
|
|
sh scripts/check_s3_exposure.sh
|
|
s3 publishers: []
|
|
PASS: S3 and console unreachable from host; run 'make check-s3' for in-network checks
|
|
docker compose run --rm --no-deps --entrypoint python api scripts/check_s3_private.py
|
|
PASS anonymous GET object -> 403
|
|
PASS anonymous HEAD object -> 403
|
|
PASS anonymous list bucket -> 403
|
|
PASS anonymous PUT -> 403
|
|
PASS app creds: ListBuckets denied
|
|
PASS app creds: CreateBucket denied
|
|
PASS app creds: DeleteBucket denied
|
|
PASS app creds: PutBucketPolicy denied
|
|
PASS app creds: PutObject outside attachments/ denied
|
|
PASS admin console port 9001 closed
|
|
PASS admin console port 9090 closed
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ python3 student-tests/orphan_sweep_check.py
|
|
PASS: grace period, dry-run, orphan removal, referenced object preserved, idempotent re-run
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make memory
|
|
python3 student-tests/memory_experiment.py --base-url "http://localhost:8080" --concurrency 10
|
|
{
|
|
"profile": "big-bytes",
|
|
"concurrency": 10,
|
|
"payload_bytes": 10050123,
|
|
"wall_seconds": 2.39,
|
|
"latency_s": {
|
|
"min": 1.05,
|
|
"max": 1.87
|
|
},
|
|
"before": {
|
|
"c6a05147ec62": {
|
|
"VmRSS_MiB": 91,
|
|
"VmHWM_MiB": 91
|
|
},
|
|
"f76cf025a087": {
|
|
"VmRSS_MiB": 94,
|
|
"VmHWM_MiB": 94
|
|
}
|
|
},
|
|
"after_peak": {
|
|
"c6a05147ec62": {
|
|
"VmRSS_MiB": 126,
|
|
"VmHWM_MiB": 126
|
|
},
|
|
"f76cf025a087": {
|
|
"VmRSS_MiB": 116,
|
|
"VmHWM_MiB": 116
|
|
}
|
|
},
|
|
"naive_estimate_MiB": 192
|
|
}
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$
|
|
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make test-persistence ACTION_SCRIPT=scripts/restart.sh
|
|
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:8080"
|
|
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
|
|
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ make test-failover ACTION_SCRIPT=scripts/stop-one.sh
|
|
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "http://localhost:8080"
|
|
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
|
{"observed_instances_before": 2, "successful_writes": 108, "failed_attempts": 1, "first_recovery_seconds": 2.727}
|
|
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
|
|
|
(восстановление реплики после стоп ван сш)
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ docker compose up -d --scale api=2 api
|
|
[+] Running 7/7
|
|
✔ Container mtusi-lab4-s3-1 Running 0.0s
|
|
✔ Container mtusi-lab4-postgres-1 Healthy 0.6s
|
|
✔ Container mtusi-lab4-migrate-1 Exited 3.5s
|
|
✔ Container mtusi-lab4-redis-1 Healthy 1.6s
|
|
✔ Container mtusi-lab4-s3_init-1 Exited 2.5s
|
|
✔ Container mtusi-lab4-api-1 Running 0.0s
|
|
✔ Container mtusi-lab4-api-2 Started 3.7s
|
|
thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab4/mtusi2026lab4-fork$ |