64 lines
4.9 KiB
Markdown
64 lines
4.9 KiB
Markdown
# Executed commands and isolation
|
|
|
|
All host commands were run from C:/dev/mtusi/lab2 (PowerShell). Ordinary sandbox
|
|
launch failed with setup-refresh error; the approved escalated shell was used.
|
|
No external repository mutation or Git-index mutation was performed.
|
|
|
|
```powershell
|
|
# Initial read-only checks
|
|
git status --short --branch
|
|
git log -1 --format=fuller
|
|
git diff -- REPORT.md
|
|
git show 65003b6:REPORT.md
|
|
docker ps --format '{{.Names}} {{.Image}} {{.Status}}'
|
|
# Source snapshot before changing application
|
|
py -3.14 evidence/grade5/snapshot.py baseline
|
|
$env:G5_API_IMAGE='lab2-g5-20261025:baseline'
|
|
$env:COMPOSE_PROJECT_NAME='lab2-g5-20261025-baseline'
|
|
# research.yaml copied from evidence/grade5/compose.research.yaml into snapshot
|
|
# (-f file at measurement time did not yet contain optional api-peer service)
|
|
docker compose --project-directory .grade5-work/baseline -f .grade5-work/baseline/research.yaml build api tools
|
|
docker compose --project-directory .grade5-work/baseline -f .grade5-work/baseline/research.yaml up -d --wait api
|
|
# Pilot: same driver with --pilot and separate raw directory; original pilot used bind output.
|
|
# Completed main series (retained one-off container):
|
|
docker compose --project-directory .grade5-work/baseline -f .grade5-work/baseline/research.yaml run --name lab2-g5-baseline-measure --no-deps -v C:/dev/mtusi/lab2:/workspace:ro -w /workspace --entrypoint python api student-tests/grade5/benchmark.py --label baseline --out /tmp/g5raw
|
|
docker cp lab2-g5-baseline-measure:/tmp/g5raw evidence/grade5/raw/baseline
|
|
# Stop only baseline dependencies before candidate series
|
|
docker compose --project-directory .grade5-work/baseline -f .grade5-work/baseline/research.yaml stop api postgres valkey
|
|
# After application change; initial candidate also measured and retained separately.
|
|
py -3.14 evidence/grade5/snapshot.py final
|
|
$env:G5_API_IMAGE='lab2-g5-20261025:final'
|
|
$env:COMPOSE_PROJECT_NAME='lab2-g5-20261025-final'
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml build api
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml up -d --wait api
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml run --name lab2-g5-final-measure --no-deps -v C:/dev/mtusi/lab2:/workspace:ro -w /workspace --entrypoint python api student-tests/grade5/benchmark.py --label candidate --out /tmp/g5raw
|
|
docker cp lab2-g5-final-measure:/tmp/g5raw evidence/grade5/raw/candidate
|
|
py -3.14 evidence/grade5/aggregate.py
|
|
# Peer/short-TTL processes started only AFTER measurement
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml up -d --wait api-peer api-expiry
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml run --rm tools sh student-tests/grade5/run-public.sh
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml run --rm --no-deps -v C:/dev/mtusi/lab2:/workspace:ro -w /workspace --entrypoint python api student-tests/grade5/test_singleflight.py
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml run --rm --no-deps -v C:/dev/mtusi/lab2:/workspace:ro -w /workspace --entrypoint python api student-tests/grade5/integration.py
|
|
docker compose --project-directory .grade5-work/final -f .grade5-work/final/research.yaml run --rm tools python student-tests/grade5/faults.py
|
|
# Clean export with original compose.yaml, unique images, no published ports
|
|
py -3.14 evidence/grade5/snapshot.py clean
|
|
$env:COMPOSE_PROJECT_NAME='lab2-g5-20261025-clean'
|
|
# Copy compose.clean-override.yaml to .grade5-work/clean/override.yaml.
|
|
# For each following command use these arguments as $argsClean:
|
|
# --project-directory .grade5-work/clean -f .grade5-work/clean/compose.yaml -f .grade5-work/clean/override.yaml --profile test
|
|
docker compose @argsClean config --quiet
|
|
docker compose @argsClean run --rm --no-deps tools sh -c 'sh scripts/init-env.sh && sh scripts/init-env.sh'
|
|
docker compose @argsClean build --no-cache api
|
|
docker compose @argsClean up -d --wait api api-expiry
|
|
docker compose @argsClean exec -T postgres psql -U messenger -d messenger -Atc 'select count(*) from users; select count(*) from chats; select count(*) from messages; select version from schema_migrations;'
|
|
docker compose @argsClean run --rm tools sh student-tests/grade5/run-public.sh
|
|
```
|
|
|
|
Output redirection goes to NEW evidence/grade5 only. Inside snapshots the Linux
|
|
scripts write their own evidence/grade5/checks, then host copies those to the main
|
|
new evidence directory. Original evidence/ and evidence/release are not overwritten.
|
|
The snapshots exclude .git/.env/secrets/cache/volumes/evidence and generate new secrets.
|
|
The clean override changes only image names, host-port publication, resource swap
|
|
budget and tools project env. API source, Dockerfile, original compose, migration,
|
|
mandatory contract and public tests are unchanged by that override.
|