$ git clone --local /Users/ssmayorova/Documents/ChatGPT/Высоконагруженные приложения/mtusi2026lab2 /Users/ssmayorova/Documents/ChatGPT/Высоконагруженные приложения/clean-clone-o_gf7ofj/mtusi2026lab2
Cloning into '/Users/ssmayorova/Documents/ChatGPT/Высоконагруженные приложения/clean-clone-o_gf7ofj/mtusi2026lab2'...
done.
$ python3 scripts/bootstrap.py
Local configuration ready; secrets were not printed.
$ docker compose up -d --build --wait
 Image mtusi-clean-144e2e11-api Building
#1 [internal] load local bake definitions
#1 reading from stdin 718B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 739B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
#3 DONE 0.0s

#4 [internal] load .dockerignore
#4 transferring context: 132B done
#4 DONE 0.0s

#5 [internal] load build context
#5 transferring context: 24.62kB 0.0s done
#5 DONE 0.0s

#6 [1/7] FROM docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0
#6 resolve docker.io/library/python:3.12.8-slim-bookworm@sha256:2199a62885a12290dc9c5be3ca0681d367576ab7bf037da120e564723292a2f0 0.1s done
#6 DONE 0.1s

#7 [4/7] COPY requirements.txt ./
#7 CACHED

#8 [5/7] RUN pip install --no-cache-dir -r requirements.txt
#8 CACHED

#9 [2/7] WORKDIR /app
#9 CACHED

#10 [6/7] COPY src/ ./src/
#10 CACHED

#11 [3/7] RUN groupadd --gid 10001 app && useradd --uid 10001 --gid app --no-create-home app
#11 CACHED

#12 [7/7] COPY migrations/ ./migrations/
#12 CACHED

#13 exporting to image
#13 exporting layers done
#13 exporting manifest sha256:17e1aa1e1ab70d739372aac14340c7082aa2b9d516783f5bb8416e85ac608009 0.0s done
#13 exporting config sha256:08162a60f623a2176f3cf1137372f23710c41dd7f958d7212129d15d5829c02b
#13 exporting config sha256:08162a60f623a2176f3cf1137372f23710c41dd7f958d7212129d15d5829c02b 0.0s done
#13 exporting attestation manifest sha256:ed2d5c62a3502802fd1706fca353486999cc539bd9b0d7f4171309a19a8fabe3 0.0s done
#13 exporting manifest list sha256:f866af8b5e84486fa48b2a6264eb645a81e4e41773a66380f849fb3628f59f49 0.0s done
#13 naming to docker.io/library/mtusi-clean-144e2e11-api:latest done
#13 unpacking to docker.io/library/mtusi-clean-144e2e11-api:latest 0.0s done
#13 DONE 0.2s

#14 resolving provenance for metadata file
#14 DONE 0.0s
 Image mtusi-clean-144e2e11-api Built
 Network mtusi-clean-144e2e11_default Creating
 Network mtusi-clean-144e2e11_default Created
 Volume mtusi-clean-144e2e11_postgres_data Creating
 Volume mtusi-clean-144e2e11_postgres_data Created
 Container mtusi-clean-144e2e11-redis-1 Creating
 Container mtusi-clean-144e2e11-postgres-1 Creating
 Container mtusi-clean-144e2e11-postgres-1 Created
 Container mtusi-clean-144e2e11-redis-1 Created
 Container mtusi-clean-144e2e11-api-1 Creating
 Container mtusi-clean-144e2e11-api-1 Created
 Container mtusi-clean-144e2e11-redis-1 Starting
 Container mtusi-clean-144e2e11-postgres-1 Starting
 Container mtusi-clean-144e2e11-redis-1 Started
 Container mtusi-clean-144e2e11-postgres-1 Started
 Container mtusi-clean-144e2e11-postgres-1 Waiting
 Container mtusi-clean-144e2e11-redis-1 Waiting
 Container mtusi-clean-144e2e11-redis-1 Healthy
 Container mtusi-clean-144e2e11-postgres-1 Healthy
 Container mtusi-clean-144e2e11-api-1 Starting
 Container mtusi-clean-144e2e11-api-1 Started
 Container mtusi-clean-144e2e11-redis-1 Waiting
 Container mtusi-clean-144e2e11-api-1 Waiting
 Container mtusi-clean-144e2e11-postgres-1 Waiting
 Container mtusi-clean-144e2e11-redis-1 Healthy
 Container mtusi-clean-144e2e11-postgres-1 Healthy
 Container mtusi-clean-144e2e11-api-1 Healthy
$ make check test test-student BASE_URL=http://localhost:18086
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
python3 tests/smoke.py --base-url "http://localhost:18086"
PASS: lab2 public API scenario; infrastructure and grading evidence remain separate.
BASE_URL="http://localhost:18086" python3 -m unittest discover -s student-tests -p test_api.py -v
test_concurrent_messages_and_pagination (test_api.APIContract) ... ok
test_cursor_scope_and_validation (test_api.APIContract) ... ok
test_foreign_chat (test_api.APIContract) ... ok
test_invalid_chat_creation (test_api.APIContract) ... ok
test_malformed_json_and_extra_fields (test_api.APIContract) ... ok
test_registration_race (test_api.APIContract) ... ok
test_unicode_limits (test_api.APIContract) ... ok
test_unicode_password_basic_and_logout (test_api.APIContract) ... ok

----------------------------------------------------------------------
Ran 8 tests in 11.843s

OK
$ make test-persistence ACTION_SCRIPT=scripts/restart.sh BASE_URL=http://localhost:18086
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "http://localhost:18086"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
$ docker compose exec -T postgres psql -U messenger -d messenger -Atc SELECT count(*) FROM schema_migrations;
1
 Container mtusi-clean-144e2e11-api-1 Stopping
 Container mtusi-clean-144e2e11-api-1 Stopped
 Container mtusi-clean-144e2e11-api-1 Removing
 Container mtusi-clean-144e2e11-api-1 Removed
 Container mtusi-clean-144e2e11-postgres-1 Stopping
 Container mtusi-clean-144e2e11-redis-1 Stopping
 Container mtusi-clean-144e2e11-redis-1 Stopped
 Container mtusi-clean-144e2e11-redis-1 Removing
 Container mtusi-clean-144e2e11-postgres-1 Stopped
 Container mtusi-clean-144e2e11-postgres-1 Removing
 Container mtusi-clean-144e2e11-redis-1 Removed
 Container mtusi-clean-144e2e11-postgres-1 Removed
 Volume mtusi-clean-144e2e11_postgres_data Removing
 Network mtusi-clean-144e2e11_default Removing
 Volume mtusi-clean-144e2e11_postgres_data Removed
 Network mtusi-clean-144e2e11_default Removed
PASS: clean local clone, fresh image and all requested acceptance tests.
