Files
mtusi2026lab3/evidence/tests/clean-clone.md
T
ricoromaandClaude Opus 5.5 c5840bfaa8 docs: add idempotency and X-Instance-Id evidence to the report
- evidence for replay, conflict, replay through a new API process and
  after restarting API and storages, keys table, key race,
  X-Instance-Id in responses and logs, explicit and invalid
  instance_id and key TTL, test runs
- stand evidence: make wipe_data leaves the lab 2 volume intact, build
  from a fresh git clone passes smoke, bench restore stage sends with
  Idempotency-Key
- REPORT.md: X-Instance-Id, idempotency design, IDEMPOTENCY_TTL_SECONDS
  mapping, limitations and evidence rows
- tasks.md: mark the change tasks done, add follow-ups from verify

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 17:08:47 +03:00

79 lines
3.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Сборка и запуск из чистого clone
| | |
|---|---|
| Спеки | `container-image` «Сборка из чистого clone» — «Свежий clone» |
| Change | `instance-id-idempotency`, доработка по `/opsx:verify` (тег образа сменился на `:lab3`) |
| Дата | 2026-10-10 13:59–14:02 UTC |
| Commit | `af4bca0` |
| Стенд | рабочий `make run_docker`: проект `mtusi-lab3`, один контейнер api, `127.0.0.1:8080`, без балансировщика |
| Хост | Docker Desktop 29.8.1, macOS arm64; ВМ Docker: 12 CPU, 7,7 GiB RAM |
Настоящий `git clone` ветки во временный каталог, без копирования
рабочего дерева. Clone содержит только закоммиченное: `.env`,
`config.toml` и `.venv` в нём нет.
## `docker build` до любых подготовительных шагов (14:01 UTC)
```text
$ git clone --branch solution/bvt2301-safronov <репозиторий> clone2 && cd clone2
$ git log -1 --format=%h
af4bca0
$ ls .env config.toml
ls: .env: No such file or directory
ls: config.toml: No such file or directory
$ docker build -q -t mtusi-messenger:lab3 .
sha256:755c074cc63c5eb08503f9bc31f76d51932c688948f4878da0db1ffe4e75a013
exit=0
```
Базовый образ — `python:3.12.14-slim-trixie@sha256:f77ac9e4…` (digest
индекса, `Dockerfile`), зависимости — `uv sync --locked`.
## Шаги оператора и сборка compose (первый clone, 13:59–14:00 UTC)
Первый clone того же commit — шаги оператора и сборка compose без
кэша:
```text
$ make env_setup
env ready: .env, config.toml
$ docker compose --env-file .env config --quiet && echo "compose config: ok"
compose config: ok
$ docker compose config --format json | python3 -c '...; print("project:", c["name"], "| api image:", c["services"]["api"]["image"])'
project: mtusi-lab3 | api image: mtusi-messenger:lab3
$ DOCKER_BUILDKIT=1 docker compose build --no-cache api
Image mtusi-messenger:lab3 Built
$ docker run --rm --entrypoint sh mtusi-messenger:lab3 -c 'ls -A /app; ls /app/.env /app/config.toml; id'
.venv
alembic.ini
migrations
src
ls: cannot access '/app/.env': No such file or directory
ls: cannot access '/app/config.toml': No such file or directory
uid=10001(app) gid=10001(app) groups=10001(app)
```
В образе только `.venv`, код, миграции и `alembic.ini`; конфигурации и
секретов нет, процесс работает от `app` (UID 10001).
## Smoke на образе из clone
Рабочий стенд переключён на собранный образ без пересборки
(`docker compose up -d --no-build`, volumes прежние), затем публичный
smoke. Оба образа — из `docker compose build` и из `docker build` —
прошли:
```text
api container: 4a75b36ce43d image: sha256:c23f2dff0a8f health: healthy
$ make test
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
api container: 2614801f4e3a image: sha256:755c074cc63c
$ make test
PASS: lab3 public API scenario; infrastructure and grading evidence remain separate.
```
ID образов различаются: `docker compose build` добавляет к образу
метки проекта compose, код и слои те же.