ЛР 5 — БВТ2301 — Иванов Данил — на 5 #30
@@ -18,3 +18,6 @@ __pycache__
|
||||
node_modules
|
||||
evidence
|
||||
.DS_Store
|
||||
build/
|
||||
.gradle/
|
||||
.idea/
|
||||
@@ -0,0 +1,16 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{java,py}]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
max_line_length = 100
|
||||
|
||||
[*.java]
|
||||
ij_java_class_count_to_use_import_on_demand = 999
|
||||
ij_java_names_count_to_use_import_on_demand = 999
|
||||
@@ -1,18 +1,10 @@
|
||||
## Лабораторная 5
|
||||
|
||||
Автор / группа: TODO
|
||||
Целевая оценка (3/4/5): TODO
|
||||
Трек 5, если заявлен: TODO
|
||||
Автор / группа: Иванов Данил, БВТ2301.
|
||||
Целевая оценка: 5, трек 2 — доказанная идемпотентность pipeline.
|
||||
|
||||
Что реализовано и что перенесено: TODO
|
||||
Команды запуска из чистого clone: TODO
|
||||
Результаты проверок и ссылка на REPORT.md: TODO
|
||||
Ограничения / известные ошибки: TODO
|
||||
Источники и использование ИИ: TODO
|
||||
Перенесена реализация lab4. Upload отвечает 202 queued после durable S3 staging и атомарного COMMIT Attachment/job/outbox. Отдельные Redis Streams broker, outbox dispatcher и worker публикуют оригинал, thumbnail, crop и WebP. Pipeline version, lease token, content-addressed ключи и транзакционная публикация manifest защищают от дублей и устаревших workers; explicit replay не повторяет READY. Две API-реплики сохранены.
|
||||
|
||||
- [ ] Весь обязательный минимум текущей и предыдущих работ сохранён с объявленными переходами.
|
||||
- [ ] Контракт и публичные тесты не ослаблены.
|
||||
- [ ] make check и make test выполнены; приложен реальный вывод.
|
||||
- [ ] Сценарии отказов/безопасности своего уровня воспроизведены.
|
||||
- [ ] Все секреты и приватные ключи находятся вне Git; отчёт не содержит tokens.
|
||||
- [ ] README задания сохранён, REPORT.md содержит инструкцию именно моего решения.
|
||||
Запуск, настройки, границы транзакций, методики, результаты и ограничения: [REPORT.md](../REPORT.md). Тесты: [tests/README.md](../tests/README.md). Доказательства: [evidence](../evidence/). Применена помощь Codex при переносе, разработке, проверках и отчёте.
|
||||
|
||||
Контракт и публичные тесты lab5 не менялись. Локальный override меняет только host port на 18085 из-за резервирования 8080 Windows; отдельный test override включает управляемые сбои. В обычной конфигурации fault injection выключен. Standalone HA БД/S3/LB не заявляется. Изменения и PR не опубликованы.
|
||||
|
||||
+104
-27
@@ -1,32 +1,109 @@
|
||||
# Local/private state
|
||||
### Git ###
|
||||
*.orig
|
||||
*.BACKUP.*
|
||||
*.BASE.*
|
||||
*.LOCAL.*
|
||||
*.REMOTE.*
|
||||
*_BACKUP_*.txt
|
||||
*_BASE_*.txt
|
||||
*_LOCAL_*.txt
|
||||
*_REMOTE_*.txt
|
||||
|
||||
### Java ###
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
.mtj.tmp/
|
||||
|
||||
# Package files
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# JVM crash logs
|
||||
hs_err_pid*
|
||||
replay_pid*
|
||||
|
||||
### Gradle ###
|
||||
.gradle/
|
||||
build/
|
||||
!gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
### Maven ###
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
dependency-reduced-pom.xml
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea/
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### Eclipse / STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings/
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Windows ###
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
[Dd]esktop.ini
|
||||
$RECYCLE.BIN/
|
||||
*.cab
|
||||
*.msi
|
||||
*.msix
|
||||
*.msm
|
||||
*.msp
|
||||
*.lnk
|
||||
|
||||
### macOS ###
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
### Miscellaneous ###
|
||||
*.sw?
|
||||
.#*
|
||||
*#
|
||||
*~
|
||||
bin/
|
||||
/scratch
|
||||
*.sublime-*
|
||||
|
||||
### Environment / Secrets ###
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
secrets/
|
||||
certs/private/
|
||||
*.key
|
||||
*.p12
|
||||
*.pfx
|
||||
*.jks
|
||||
*.pem
|
||||
*.tfstate*
|
||||
volumes/
|
||||
data/
|
||||
backups/
|
||||
# Runtime/build artifacts
|
||||
.venv/
|
||||
secrets/*.txt
|
||||
!secrets/.gitkeep
|
||||
|
||||
### Python / venv ###
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
node_modules/
|
||||
dist/
|
||||
build/
|
||||
target/
|
||||
bin/
|
||||
obj/
|
||||
coverage/
|
||||
*.log
|
||||
.DS_Store
|
||||
.idea/
|
||||
.vscode/
|
||||
# Keep small, sanitized evidence summaries in evidence/ under version control.
|
||||
# Inspect git diff --cached: ignore rules are not a secret scanner.
|
||||
*.pyc
|
||||
.venv/
|
||||
.venv
|
||||
venv/
|
||||
|
||||
### Lab evidence ###
|
||||
evidence/**/*.dump
|
||||
evidence/**/*.sql.gz
|
||||
evidence/**/raw/
|
||||
evidence/**/*.raw
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
FROM eclipse-temurin:21-jdk-jammy AS builder
|
||||
WORKDIR /build
|
||||
COPY gradle gradle
|
||||
COPY gradlew settings.gradle build.gradle ./
|
||||
RUN --mount=type=cache,target=/root/.gradle chmod +x gradlew && ./gradlew dependencies --no-daemon
|
||||
COPY contracts contracts
|
||||
COPY src src
|
||||
RUN --mount=type=cache,target=/root/.gradle ./gradlew bootJar -x test --no-daemon
|
||||
|
||||
FROM eclipse-temurin:21-jre-jammy AS runner
|
||||
WORKDIR /app
|
||||
RUN groupadd --system spring && useradd --system --gid spring --no-create-home spring
|
||||
COPY --from=builder /build/build/libs/*.jar app.jar
|
||||
RUN chown spring:spring app.jar
|
||||
USER spring
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1:8080/actuator/health/readiness | grep -q UP || exit 1
|
||||
ENV JAVA_OPTS="-XX:MaxRAMPercentage=75 -Xss512k"
|
||||
ENTRYPOINT ["sh", "-c", "exec java -Dfile.encoding=UTF-8 $JAVA_OPTS -jar app.jar"]
|
||||
@@ -1,37 +1,139 @@
|
||||
# Отчёт — лабораторная 5
|
||||
|
||||
- Автор, группа: TODO
|
||||
- Целевая оценка; выбранный трек 5, если нужен: TODO
|
||||
- Commit/PR: TODO после публикации
|
||||
- Использованные источники, библиотеки и помощь ИИ: TODO
|
||||
- Автор, группа: Иванов Данил, БВТ2301 (перенесено из отчёта lab4).
|
||||
- Целевая оценка: **5, трек 2 — доказанная идемпотентность pipeline**.
|
||||
- Форк: https://gitea.privcloud.tech/landcruiser200/mtusi2026lab5. Основа задания — `276dbdad8a34da4c5b57fbf1879ca169b581d75b`; реализация перенесена из lab4 `cc0ef71`. Результаты относятся к рабочему дереву, исходники зафиксированы SHA-256 в evidence. PR не опубликован.
|
||||
- Дата: 06.11.2026, Europe/Moscow. Использована помощь Codex: перенос, реализация, проверки, анализ и отчёт. Первичные материалы: [контракт](contracts/README.md), [состояния](contracts/attachment-states.md), [схема job](contracts/jobs.schema.json), [Redis Streams](https://redis.io/docs/latest/develop/data-types/streams/), [Pillow ImageOps](https://pillow.readthedocs.io/en/stable/reference/ImageOps.html).
|
||||
|
||||
## Запуск из чистого clone
|
||||
|
||||
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
|
||||
Требуются Docker Desktop с Linux containers, Docker Compose v2 с поддержкой `!override`, Python 3.9+ для публичных проверок. Для дополнительных image-тестов и style checks нужны Python 3.10+ и зависимости requirements-tools.txt. Для локальных Java-тестов — JDK 21; Docker собирает Java из исходников через Gradle Wrapper 9.3.0, скачанный вручную zip не требуется.
|
||||
|
||||
```powershell
|
||||
pwsh -File scripts/bootstrap.ps1
|
||||
docker compose config --quiet
|
||||
docker compose up -d --build
|
||||
# Дождаться двух healthy API и HTTP 200 /health/ready.
|
||||
$env:BASE_URL='http://127.0.0.1:8080'
|
||||
py tests/smoke.py
|
||||
```
|
||||
|
||||
На этом Windows-хосте 8080 попал в зарезервированный ОС диапазон. Поэтому для запуска и измерений использован отдельный override, меняющий только публикацию порта:
|
||||
|
||||
```powershell
|
||||
docker compose -f docker-compose.yml -f compose.local.yaml up -d --build
|
||||
$env:BASE_URL='http://127.0.0.1:18085'
|
||||
py tests/smoke.py
|
||||
py tests/resilience.py --mode persistence --action-script scripts/restart.cmd
|
||||
py tests/resilience.py --mode failover --action-script scripts/stop-one.cmd
|
||||
docker compose -f docker-compose.yml -f compose.local.yaml up -d api
|
||||
```
|
||||
|
||||
API по-прежнему **две реплики**. Параметры существующих PostgreSQL/Redis/MinIO/LB, сеть, volumes и лимиты API перенесены из lab4. Добавлены необходимые для lab5 broker, worker и dispatcher outbox. Репозиторий lab4 и его `.git` не изменялись; у lab5 собственная история и origin форка.
|
||||
|
||||
Bootstrap идемпотентно создаёт локальные secrets и `.env`, не перезаписывая имеющиеся значения. Пароли генерируются локально, не печатаются и исключены из Git. В исходниках ровно одна миграция [V1__init.sql](src/main/resources/db/migration/V1__init.sql): таблицы сразу создаются в конечном виде. На чистой БД Flyway применяет V1; две реплики координируются блокировками Flyway. Bucket bootstrap создаёт приватный bucket и отдельные ограниченные S3 credentials. MinIO console выключена, внутренние порты наружу не опубликованы.
|
||||
|
||||
По просьбе пользователя V2–V4 свёрнуты в V1. Проверка [check_migration.py](scripts/check_migration.py) применяет V1 к временной БД и сравнивает `pg_dump --schema-only` с существующим стендом, исключая только историю Flyway и случайные restriction tokens. Схемы совпали: [stdout](evidence/migration-check.txt), [SHA и результат](evidence/migration-check.json). Затем проверены настоящий Flyway migrate/validate и два конкурентных клиента инициализации на пустой БД: [fresh Flyway](evidence/migration-fresh-flyway.txt).
|
||||
|
||||
В существующем учебном volume данные сохранены. История V1–V4 предварительно сохранена локально в игнорируемом `.gradle/flyway-consolidation/history-before.json`; после доказанного равенства схем однократно выполнен Flyway repair. Для маркировки удалённых будущих V2–V4 использован пустой `ignoreMigrationPatterns`; эти версии получили DELETED, V1 — SUCCESS. Это операторское согласование уже применённой локальной истории, не автоматический repair при запуске приложения. [Журнал repair](evidence/migration-repair.txt), [сохранность количеств строк и история](evidence/migration-preservation.json), [перезапуск двух API](evidence/migration-final-validation.txt).
|
||||
|
||||
Полный основной прогон ниже выполнен до свёртки SQL; Java/Python-код приложения при свёртке не менялся. После неё повторены чистая Java-сборка, smoke, core pipeline и проверки межоперационных блокировок: [Java](evidence/migration-java-build.txt), [smoke](evidence/migration-smoke.txt), [core](evidence/migration-core.txt), [boundaries](evidence/migration-boundaries.txt). [Docker-сборка с единственной V1](evidence/migration-docker-build.txt). SHA исходников и environment пересняты после свёртки.
|
||||
|
||||
Остановка с сохранением данных: `docker compose down`. **Намеренное удаление учебных данных:** `docker compose down -v` — не часть проверок. Для Linux hooks `.sh` требуется `chmod +x`. Детальные команды экспериментов — [tests/README.md](tests/README.md).
|
||||
|
||||
## Архитектура и решения
|
||||
|
||||
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab4, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
|
||||
Клиент → nginx → Java API ×2 → PostgreSQL + приватный S3 staging. API атомарно фиксирует Attachment, ProcessingJob и Outbox в PostgreSQL после успешного S3 PUT. Только после COMMIT возвращается снимок `202 queued`. Ресайз API не выполняет; в очередь можно принимать работу при остановленном worker/broker, пока доступны БД, S3 и бюджет незавершённых jobs.
|
||||
|
||||
Dispatcher читает outbox с `FOR UPDATE SKIP LOCKED` и публикует ID/версию/попытку в отдельный Redis Streams broker. Broker использует AOF и `appendfsync always`; consumer group читает с COUNT=1, прежде новых сообщений обрабатываются собственные pending; активный consumer держит одну доставку. Незавершённая текущая попытка не ack-ается. Выдача XADD означает приём брокером, а XACK выполняется worker после устойчивого эффекта. Это разные границы. Неопределённый publish допускает redelivery. Lua атомарно связывает XADD с индексом (job_id, managed attempt): watchdog не размножает ожидающую работу при остановленном worker. ACK удаляет индекс только при совпадении stream ID, поэтому поздний ACK не удаляет публикацию следующей попытки. Outbox сохраняется в БД и повторно публикует текущую QUEUED работу, а также восстанавливает истёкшие leases. Поэтому рестарт broker или разрыв COMMIT/publish не требуют создавать новую job вручную.
|
||||
|
||||
Worker — отдельный Python-процесс, две реплики, каждая запускает не более одного дочернего image-процесса. Дочерний процесс проверяет исходный SHA-256/размер, MIME и пиксели, применяет EXIF orientation, сохраняет оригинал и три варианта. Parent ограничивает время процесса, Linux address space ограничен 768 MiB; container limit — 1 GiB. При превышении времени процесс уничтожается, сообщение остаётся без ack, lease восстанавливает работу. Prefetch и число процессов ограничивают RAM и неконтролируемый параллелизм.
|
||||
|
||||
Pipeline v1: thumbnail JPEG ≤256×256 без увеличения, crop JPEG 128×128 по центру, optimized WebP ≤1280×1280 без увеличения. Размеры рассчитываются целочисленно с округлением вниз. Filename ограничен Unicode code points; response header buffer LB 8k поддерживает Content-Disposition для допустимого имени из 255 четырёхбайтовых символов. Alpha компонуется на белый фон, EXIF/ICC не передаются в выходные изображения. Качество JPEG=85, WebP=80. В v2 JPEG=90 и WebP=85, геометрия сохраняется. Уменьшение каждого маленького файла не обещается. Обновление алгоритма/кодека требует новой pipeline_version.
|
||||
|
||||
Эффект идентифицируется `(attachment_id, pipeline_version, variant)`: уникальный ключ manifest в БД и content-addressed S3 keys с prefix версии. Повтор той же обработки пишет те же байты в те же ключи. Старая версия не пишет в prefix новой. Публикация manifest, READY и результата job выполняется одной транзакцией после проверки текущей версии, token lease и срока аренды под блокировкой строк. Истёкший или устаревший worker не может опубликовать READY/FAILED поверх нового результата. GET метаданных использует REPEATABLE READ. Content берёт shared cleanup fence до чтения метаданных и использует READ COMMITTED, чтобы ожидание блокировки не закрепило устаревший snapshot; выбранные immutable keys защищены до копирования bytes. Статус вложения при создании Message защищён FOR SHARE до COMMIT; queued/processing/failed content возвращает 409.
|
||||
|
||||
Retry: production-бюджет 5 попыток, экспоненциальный backoff до 30s с jitter 0–1s. Некорректное изображение — постоянная ошибка; сетевой/временный отказ повторяется, после исчерпания — FAILED с безопасным error_code. Реестр failed — PostgreSQL processing_jobs и API metadata. `python -m pipeline.operator replay UUID` доступен оператору через Docker exec: повторяет только FAILED, сохраняет job_id и монотонный attempt, добавляет новый бюджет и audit. Replay READY — no-op. `upgrade UUID --version 2` требует строго возрастающую версию и атомарно создаёт новый job/outbox.
|
||||
|
||||
Staging удаляется после безопасной публикации READY; dispatcher очищает остаток при crash до удаления/ack. FAILED staging хранится 24h для явного replay, затем очищается с `staging_expired`; replay после истечения retention отклоняется. Сверка orphan выполняется после того же grace. Активные upload/worker держат shared advisory lock 741204, cleanup — exclusive try-lock; используется повторная проверка ссылок БД. Активные/свежие и опубликованные объекты не удаляются по возрасту. Очистка старой попытки проверяет версию перед снятием staging-ссылки, поэтому не удаляет исходник новой версии.
|
||||
|
||||
Из lab4 сохранены Argon2, Bearer-сессии PostgreSQL, ACL, атомарная идемпотентность сообщений и keyset cursor. История упорядочена по `(created_at,id)`; snapshot между HTTP-запросами нет. При несинхронных часах конкурентная вставка раньше cursor может не попасть в текущий обход. Подтверждённые записи читаются из основной БД через любую API.
|
||||
|
||||
Настройки `.env.example` — логические роли: DATABASE_URL_FILE соответствует `postgres_*` Docker secrets; S3 credentials — файлам secrets; BROKER_URL_FILE — внутреннему broker:6379 без публичного порта. SESSION_STORE фактически PostgreSQL. WORKER_CONCURRENCY задаёт число worker-реплик, JOB_MAX_ATTEMPTS — бюджет новых jobs/replay, JOB_TIMEOUT_SECONDS=60, JOB_LEASE_SECONDS=75, STAGING_RETENTION_SECONDS=86400, MAX_PENDING_JOBS=100. Admission сериализуется advisory lock 741205: одновременные API не превышают бюджет. Readiness критичны PostgreSQL/S3, broker/worker восстанавливаются через outbox.
|
||||
|
||||
| Роль | Service / версия | Устойчивое состояние / проверка |
|
||||
| --- | --- | --- |
|
||||
| API ×2 | Java 21, Spring Boot 4.1.1; Dockerfile/Gradle Wrapper 9.3.0 | PostgreSQL/S3, собственных volumes нет; /health/ready |
|
||||
| Метаданные | db, postgres:16-alpine | pgdata; pg_isready |
|
||||
| Cache | redis, redis:7.4-alpine | redisdata; PING; сессии остаются в PostgreSQL |
|
||||
| Broker | broker, redis:7.4-alpine | brokerdata, AOF always; PING |
|
||||
| S3 | minio, pgsty/silo (MinIO technology), digest в Compose | minio-data; /minio/health/ready; app credentials ограничены bucket |
|
||||
| Worker ×2 | Python 3.12.12, Pillow 12.0.0 | Нет локальных оригиналов; terminal jobs/lease контролируются в БД |
|
||||
| Outbox | dispatcher, тот же Python image | processing_outbox в PostgreSQL, одна реплика; SKIP LOCKED поддерживает конкуренцию |
|
||||
| LB | lb, nginx:1.27-alpine | Только опубликованный loopback HTTP порт; upstream api:8080 |
|
||||
|
||||
У API лимиты CPU=1/RAM=512MiB/Xmx320m на реплику, у worker CPU=1/RAM=1GiB, у dispatcher CPU=0.5/RAM=256MiB. Docker VM: 8 CPU, около 7.65GiB RAM; точные значения и image IDs — environment.json. Secrets передаются файлами; административные S3 credentials доступны только bootstrap, не API/worker.
|
||||
|
||||
## Доказательства критериев
|
||||
|
||||
Правила хранения: [evidence/README.md](evidence/README.md). Методики: [tests/README.md](tests/README.md). Фактический stdout сохраняется без токенов, credentials и содержимого сообщений.
|
||||
|
||||
Полный повторный прогон выполняется [scripts/run_tests.ps1](scripts/run_tests.ps1): все исполняемые сценарии tests, оба режима resilience, 30-секундная нагрузка, Java-тесты и OpenAPI. Общий результат: [test-suite.txt](evidence/test-suite.txt). `client.py`, `image_probe.py`, `pipeline_support.py` используются как библиотеки сценариев.
|
||||
|
||||
Первый общий прогон остановился на предусловии failover: сразу после restart через LB наблюдалась одна API, поэтому остановка реплики ещё не выполнялась. [Исходный результат](evidence/failover-precondition-initial.txt), [журнал первого прогона](evidence/test-suite-initial.txt). Оркестратор исправлен: после persistence он ждёт две healthy API и ответы с двумя разными instance ID через LB. Публичный тест не менялся; результаты полного повторного прогона находятся в основном журнале.
|
||||
|
||||
Единый стиль собственной реализации проверяется [style.py](scripts/style.py): Java AOSP/google-java-format 1.28.0 и Python Black 25.9.0. Все шесть API-интерфейсов документированы Javadoc; HTTP-статусы и валидация находятся в интерфейсах. Контроллеры содержат одну final service-зависимость, `@RequiredArgsConstructor` и один вызов сервиса на операцию; дополнительные прокси-сервисы для переноса ResponseEntity не создавались. Для скачивания сервис формирует динамические заголовки. [Результат проверки](evidence/style.txt), [полная OpenAPI-валидация](evidence/openapi-validation.txt), [целостность публичного задания и отсутствие локальных паролей](evidence/final-checks.txt).
|
||||
|
||||
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
|
||||
| --- | --- | --- | --- |
|
||||
| Публичный smoke | make test | TODO | TODO |
|
||||
| Остальные пункты уровня 3 | TODO | TODO | TODO |
|
||||
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
|
||||
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
|
||||
|
||||
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
|
||||
| Сборка/модульные тесты | gradlew.bat test; docker compose build | Java и контейнеры собираются из исходников | [Java](evidence/java-build.txt), [Docker](evidence/docker-build.txt) |
|
||||
| Публичный smoke | py tests/smoke.py | 202 queued → ready; checksum original; реальный JPEG thumbnail 256×160 | [smoke](evidence/smoke.txt) |
|
||||
| ACL/MIME/filename/размер/повреждение | pipeline_core.py | Пользовательские ошибки 400/404/413/415, без ложного READY | [core](evidence/pipeline-core.txt) |
|
||||
| queued доступен сообщению, content=409 | pipeline_core.py | Worker остановлен, API не делает resize | [core](evidence/pipeline-core.txt) |
|
||||
| Crop/WebP, EXIF, alpha, без увеличения | pipeline_core.py | Геометрия, MIME, checksum и реальные байты вариантов | [core](evidence/pipeline-core.txt) |
|
||||
| Несколько API / конкурентные запросы | pipeline_core.py | 24 повтора через 2 instance ID, один Message | [core](evidence/pipeline-core.txt) |
|
||||
| Durable staging/outbox/broker | pipeline_faults.py | API/publisher/broker restart, те же принятые jobs становятся ready | [faults](evidence/pipeline-faults.txt) |
|
||||
| Дубль, reorder, crash до/после effects/COMMIT/ack | pipeline_faults.py | Один manifest и один набор S3 keys на версию | [faults](evidence/pipeline-faults.txt), [времена](evidence/pipeline-faults.json) |
|
||||
| Lease/timeout и stale worker | pipeline_faults.py | Работа восстановлена, устаревшая публикация отклонена | [faults](evidence/pipeline-faults.txt) |
|
||||
| Retry/DLQ/replay | pipeline_faults.py | 3 попытки в ускоренном профиле; FAILED; явный replay; READY replay no-op | [faults](evidence/pipeline-faults.txt) |
|
||||
| Версия 2 раньше старой job | pipeline_faults.py | Старый worker/доставка v1 не меняют manifest v2 | [faults](evidence/pipeline-faults.txt) |
|
||||
| Backpressure двух API и восстановление | pipeline_faults.py | Бюджет 6 в профиле: 6 принятых/4 отклонённых из 10, принятые обработаны | [backpressure](evidence/backpressure.json) |
|
||||
| Нет потери подтверждённых задач | pipeline_faults.py | Все принятые ID имеют текущую job/outbox и конечный статус | [ledger](evidence/accepted-jobs.json) |
|
||||
| Самостоятельный pixel guard worker, private bucket, retention | pipeline_retention.py | 49 млн пикселей → FAILED; anonymous S3 → 403; истёкший staging удалён, fresh/referenced сохранены | [retention](evidence/pipeline-retention.txt) |
|
||||
| Незавершённая доставка без dispatcher | pipeline_ack_guard.py | Истёкший worker не ack-ает текущую незавершённую попытку; pending/index сохранены; затем attempt 2 даёт один результат | [ACK guard](evidence/pipeline-ack-guard.txt), [инварианты](evidence/fenced-pending.json) |
|
||||
| Unicode filename на границе | pipeline_filename.py | 255 ASCII/emoji принимаются, 256 emoji отклоняются; content проходит через LB | [filename](evidence/pipeline-filename.txt) |
|
||||
| Межоперационные окна Message / content | pipeline_boundaries.py | FOR SHARE удерживает статус до COMMIT; download ждёт cleanup fence и освобождает его | [boundaries](evidence/pipeline-boundaries.txt) |
|
||||
| Последнее место истории между двумя API | pipeline_history_capacity.py | После seed limit−1 десять разных одновременных POST дают один 201 и девять 413; COUNT и INSERT защищены блокировкой строки Chat до COMMIT | [history capacity](evidence/pipeline-history-capacity.txt) |
|
||||
| Гибель API между S3 PUT и COMMIT | pipeline_upload_crash.py | SIGKILL API: незавершённая транзакция откатывается, 202 не подтверждён, staging остаётся unreferenced; прежняя сессия работает после восстановления | [upload crash](evidence/pipeline-upload-crash.txt) |
|
||||
| Нагрузка сообщений | load.py --duration 30 --concurrency 4 | Closed-loop успешные ответы, ошибки и квантили отдельно; не максимум производительности | [load](evidence/load.json), [stdout](evidence/load.txt) |
|
||||
| Сохранность всего стенда | resilience.py --mode persistence | Старая сессия, сообщения и original после restart всех stores | [persistence](evidence/persistence.txt), [до](evidence/restart-before.txt), [после](evidence/restart-after.txt) |
|
||||
| Failover API | resilience.py --mode failover | Обслужившая API действительно остановлена, другая читает original | [failover](evidence/failover.txt), [до](evidence/stop-one-before.txt), [после](evidence/stop-one-after.txt) |
|
||||
|
||||
## Эксперименты и отказы
|
||||
|
||||
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
|
||||
Гипотеза: versioned content-addressed объекты и fencing при атомарной публикации результата сохраняют один наблюдаемый эффект несмотря на at-least-once доставку и живого устаревшего worker. Инварианты: 202 имеет durable source/job/outbox; READY имеет original и ровно три варианта текущей версии; старый token/version не меняет новый manifest; повтор READY не тратит попытку; accepted ID не исчезает из реестра.
|
||||
|
||||
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
|
||||
Fault-injection управляется только оператором через БД и включается отдельным [compose.test.yaml](compose.test.yaml). На production по умолчанию отключён. В профиле: 3 попытки, lease=8s, timeout=25s, очередь=6; намеренно короткий lease позволяет доказать работу fencing при ещё живом старом процессе. В production lease=75s больше timeout=60s. Стенд и API остаются с двумя репликами.
|
||||
|
||||
Методика — последовательные сценарии [pipeline_faults.py](tests/pipeline_faults.py). Настоящие PostgreSQL, S3 и Redis, не моки. Publisher и worker аварийно завершаются в контрольных точках; broker перезапускается с volume. Для stale версии worker задерживается после S3 writes, оператор публикует v2, затем доставляются v1/v2 в обратном порядке. Ledger проверяет все 202. При upgrade старая job явно становится SUPERSEDED; исходник и подтверждённое вложение сохраняются, завершается текущая версия. Дополнительный burst — 10 одновременных upload PNG 800×600, ограничение 6; после снятия отказа принятые работы доходят до READY. Это closed-loop опыт, не измерение максимального throughput.
|
||||
|
||||
Hardware/версии/лимиты: [environment.json](evidence/environment.json); [SHA исходников](evidence/source-sha256.json); [schema jobs](evidence/job-schema.json); [ресурсы](evidence/resource-summary.json). RSS/CPU samples — docker stats. Дискретные samples могут пропустить краткий пик. Времена сценариев включают Docker CLI/startup и polling; это не чистая latency обработки. Polling завершений burst последовательно завышает ранние времена. Квантили наблюдаемых верхних оценок времени до ready для шести принятых jobs вычисляются из последнего прогона в [drain-summary](evidence/drain-summary.json). Они включают Docker startup и последовательный polling, не являются SLA. Максимальный throughput pipeline и полноценные p50/p95/p99 на длинном стационарном потоке не заявляются: выбран fault-injection трек, а не исследование очереди под перегрузкой.
|
||||
|
||||
| Воздействие | Ожидаем | Наблюдаем | Потеря данных / восстановление |
|
||||
| --- | --- | --- | --- |
|
||||
| TODO | TODO | TODO | TODO |
|
||||
| COMMIT до publish, publisher crash | outbox сохраняет намерение | Фактический stdout faults | Те же job_id, без ручного создания новой job |
|
||||
| Publish до отметки outbox | повторная доставка допустима | Один конечный эффект | ACK после устойчивого результата |
|
||||
| Worker crash до/после S3 | lease восстанавливает работу | Ограниченная новая попытка | S3 keys не размножаются |
|
||||
| COMMIT до ack | redelivery READY — no-op | Одна попытка публикации READY | Результат не откатывается |
|
||||
| Старый worker/версия | SQL fencing и разные version prefixes | Manifest v2 неизменен | Старые orphan bytes чистятся после grace |
|
||||
| Broker/API restart | volumes и outbox сохраняют задачи | Те же 202 становятся ready | Время — в JSON сценариев |
|
||||
|
||||
At-least-once плюс идемпотентный эффект **не означает exactly-once доставку**: сообщения и выполнение попыток повторяются; единственна атомарно опубликованная версия результата.
|
||||
|
||||
## Ограничения и следующие шаги
|
||||
|
||||
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
|
||||
Если соединение потеряно после COMMIT до HTTP-ответа, исход запроса для клиента неопределён: сохранённое вложение и job остаются устойчивыми. Upload не принимает Idempotency-Key и не обещает отсутствие второго вложения при повторной загрузке; идемпотентный эффект pipeline относится к одной job и её версии. Отдельный SIGKILL-тест фиксирует точку именно до COMMIT.
|
||||
|
||||
Стенд учебный и локальный, без HA PostgreSQL/MinIO/LB/host. Две worker-реплики не заменяют HA хранилищ. Произвольный внешний оператор может удалить bytes; система не восстанавливает удалённый источник. Replay после истечения retention не создаёт новый исходник. Версии увеличиваются только оператором, HTTP pipeline-management API не добавлялся. Старые опубликованные manifests сохраняются для аудита; их compaction потребует отдельной политики.
|
||||
|
||||
Доставка JSON содержит только служебные IDs, но broker доступен внутренним доверенным сервисам без TLS; для удалённого production нужна отдельная модель доступа. Файлы ≤10MiB читаются ограниченным буфером API; это ограниченная RAM, не constant-memory pipeline. API admission-lock может снижать throughput. Cleanup использует try-lock и может откладываться при постоянных передачах; retention задаёт минимальный grace, не точное время удаления. Первый функциональный fault-прогон прошёл, но сборщик RSS имел ошибку Go template; после исправления выполнен второй полный прогон с обязательной проверкой наличия samples. Эксперимент локальный и ограничен описанными точками, не доказывает отсутствие всех возможных отказов. Изменения не отправлены в remote и PR не создан.
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.springframework.boot' version '4.1.1'
|
||||
id 'io.spring.dependency-management' version '1.1.7'
|
||||
}
|
||||
|
||||
group = 'ru.mtusi'
|
||||
version = '0.0.1-SNAPSHOT'
|
||||
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion = JavaLanguageVersion.of(21)
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
|
||||
|
||||
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:3.1.0'
|
||||
implementation 'com.bucket4j:bucket4j-core:8.10.1'
|
||||
implementation 'org.mapstruct:mapstruct:1.6.3'
|
||||
implementation 'org.postgresql:postgresql:42.7.13'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-flyway'
|
||||
runtimeOnly 'org.flywaydb:flyway-database-postgresql'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa:4.1.1'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-data-redis:4.1.1'
|
||||
implementation 'org.springframework.security:spring-security-crypto'
|
||||
implementation 'org.bouncycastle:bcprov-jdk18on:1.78.1'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-oauth2-resource-server'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-cache'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-aspectj'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-jackson'
|
||||
implementation 'io.minio:minio:9.0.3'
|
||||
|
||||
|
||||
runtimeOnly 'io.netty:netty-transport-native-epoll::linux-x86_64'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test:4.1.1'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-restclient-test'
|
||||
testImplementation 'org.springframework.boot:spring-boot-resttestclient'
|
||||
|
||||
compileOnly 'org.projectlombok:lombok'
|
||||
annotationProcessor 'org.mapstruct:mapstruct-processor:1.6.3'
|
||||
annotationProcessor 'org.projectlombok:lombok-mapstruct-binding:0.2.0'
|
||||
annotationProcessor 'org.projectlombok:lombok'
|
||||
testCompileOnly 'org.projectlombok:lombok'
|
||||
testAnnotationProcessor 'org.projectlombok:lombok'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-actuator-test'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
|
||||
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile).configureEach {
|
||||
options.compilerArgs << '-parameters'
|
||||
}
|
||||
|
||||
tasks.named('test') {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
services:
|
||||
api:
|
||||
environment:
|
||||
JOB_MAX_ATTEMPTS: 3
|
||||
MAX_PENDING_JOBS: 6
|
||||
worker:
|
||||
environment:
|
||||
FAULT_INJECTION_ENABLED: "true"
|
||||
JOB_MAX_ATTEMPTS: 3
|
||||
JOB_LEASE_SECONDS: 8
|
||||
JOB_TIMEOUT_SECONDS: 25
|
||||
dispatcher:
|
||||
environment:
|
||||
FAULT_INJECTION_ENABLED: "true"
|
||||
JOB_MAX_ATTEMPTS: 3
|
||||
JOB_LEASE_SECONDS: 8
|
||||
JOB_TIMEOUT_SECONDS: 25
|
||||
@@ -0,0 +1,291 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB_FILE: /run/secrets/postgres_db
|
||||
POSTGRES_USER_FILE: /run/secrets/postgres_user
|
||||
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
networks:
|
||||
- messenger-net
|
||||
healthcheck:
|
||||
# Добавлена очистка от \n и \r для надежности на Windows
|
||||
test: ["CMD-SHELL", "pg_isready -U $$(cat /run/secrets/postgres_user | tr -d '\\n\\r') -d $$(cat /run/secrets/postgres_db | tr -d '\\n\\r')"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 1G
|
||||
|
||||
redis:
|
||||
image: redis:7.4-alpine
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes --appendfsync everysec --save ""
|
||||
volumes:
|
||||
- redisdata:/data
|
||||
networks:
|
||||
- messenger-net
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
broker:
|
||||
image: redis:7.4-alpine
|
||||
restart: unless-stopped
|
||||
command: redis-server --appendonly yes --appendfsync always --save ""
|
||||
volumes:
|
||||
- brokerdata:/data
|
||||
networks:
|
||||
- messenger-net
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
|
||||
worker: &pipeline-worker
|
||||
build:
|
||||
context: .
|
||||
dockerfile: worker/Dockerfile
|
||||
restart: unless-stopped
|
||||
environment: &pipeline-environment
|
||||
ROLE: worker
|
||||
DB_HOST: db
|
||||
BROKER_HOST: broker
|
||||
S3_ENDPOINT: http://minio:9000
|
||||
S3_BUCKET: messenger-attachments
|
||||
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
||||
JOB_TIMEOUT_SECONDS: ${JOB_TIMEOUT_SECONDS:-60}
|
||||
JOB_LEASE_SECONDS: ${JOB_LEASE_SECONDS:-75}
|
||||
STAGING_RETENTION_SECONDS: ${STAGING_RETENTION_SECONDS:-86400}
|
||||
FAULT_INJECTION_ENABLED: ${FAULT_INJECTION_ENABLED:-false}
|
||||
secrets:
|
||||
- postgres_db
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
networks:
|
||||
- messenger-net
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
broker:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
replicas: ${WORKER_CONCURRENCY:-2}
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 1G
|
||||
|
||||
dispatcher:
|
||||
<<: *pipeline-worker
|
||||
environment:
|
||||
<<: *pipeline-environment
|
||||
ROLE: dispatcher
|
||||
deploy:
|
||||
replicas: 1
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.5'
|
||||
memory: 256M
|
||||
|
||||
migrate:
|
||||
profiles: [migration]
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
entrypoint:
|
||||
- "sh"
|
||||
- "-c"
|
||||
- |
|
||||
export SPRING_DATASOURCE_USERNAME="$$(cat /run/secrets/postgres_user)";
|
||||
export SPRING_DATASOURCE_PASSWORD="$$(cat /run/secrets/postgres_password)";
|
||||
export S3_ACCESS_KEY_ID="$$(cat /run/secrets/s3_access_key_id)";
|
||||
export S3_SECRET_ACCESS_KEY="$$(cat /run/secrets/s3_secret_access_key)";
|
||||
exec java -Dfile.encoding=UTF-8 -Dspring.main.web-application-type=none -Dspring.main.keep-alive=false -jar app.jar
|
||||
environment:
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/messenger
|
||||
SPRING_FLYWAY_ENABLED: "true"
|
||||
RECONCILER_ENABLED: "false"
|
||||
SPRING_TASK_SCHEDULING_ENABLED: "false" # Отключает фоновые задачи, чтобы контейнер успешно завершился
|
||||
secrets:
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: "no"
|
||||
networks:
|
||||
- messenger-net
|
||||
healthcheck:
|
||||
disable: true
|
||||
|
||||
api:
|
||||
stop_grace_period: 40s
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
minio-init:
|
||||
condition: service_completed_successfully
|
||||
entrypoint:
|
||||
- "sh"
|
||||
- "-c"
|
||||
- |
|
||||
export INSTANCE_ID="$$(cat /etc/hostname)";
|
||||
export SPRING_DATASOURCE_USERNAME="$$(cat /run/secrets/postgres_user)";
|
||||
export SPRING_DATASOURCE_PASSWORD="$$(cat /run/secrets/postgres_password)";
|
||||
export S3_ACCESS_KEY_ID="$$(cat /run/secrets/s3_access_key_id)";
|
||||
export S3_SECRET_ACCESS_KEY="$$(cat /run/secrets/s3_secret_access_key)";
|
||||
exec java -Dfile.encoding=UTF-8 $$JAVA_OPTS -jar app.jar
|
||||
environment:
|
||||
RECONCILER_INTERVAL_MS: ${RECONCILER_INTERVAL_MS:-3600000}
|
||||
RECONCILER_DRY_RUN: ${RECONCILER_DRY_RUN:-false}
|
||||
RECONCILER_GRACE_PERIOD_MINUTES: ${RECONCILER_GRACE_PERIOD_MINUTES:-15}
|
||||
JAVA_OPTS: -Xmx320m -Xss512k
|
||||
JOB_MAX_ATTEMPTS: ${JOB_MAX_ATTEMPTS:-5}
|
||||
MAX_PENDING_JOBS: ${MAX_PENDING_JOBS:-100}
|
||||
RATE_PER_MINUTE: ${RATE_PER_MINUTE:-100000}
|
||||
SPRING_DATASOURCE_URL: jdbc:postgresql://db:5432/messenger
|
||||
SPRING_PROFILES_ACTIVE: ${APP_ENV:-lab}
|
||||
SPRING_FLYWAY_ENABLED: "true"
|
||||
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-400}
|
||||
SESSION_STORE: ${SESSION_STORE:-postgres}
|
||||
SPRING_DATA_REDIS_HOST: redis
|
||||
SPRING_DATA_REDIS_PORT: 6379
|
||||
MAX_MESSAGES_PER_CHAT: ${MAX_MESSAGES_PER_CHAT:-10000}
|
||||
S3_ENDPOINT: http://minio:9000
|
||||
S3_BUCKET: messenger-attachments
|
||||
S3_REGION: us-east-1
|
||||
secrets:
|
||||
- postgres_user
|
||||
- postgres_password
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
networks:
|
||||
- messenger-net
|
||||
deploy:
|
||||
replicas: 2
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 512M
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1:8080/health/ready | grep -q '\"status\":\"ok\"'"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 40s
|
||||
|
||||
lb:
|
||||
image: nginx:1.27-alpine
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "127.0.0.1:8080:80"
|
||||
volumes:
|
||||
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
depends_on:
|
||||
api:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- messenger-net
|
||||
|
||||
minio:
|
||||
image: pgsty/silo@sha256:7bb2aff6b89efe1cb1303c10fc21d579447434ed06649ac9ec05a5e2dbf30ad7
|
||||
command: server /data --console-address ":9001"
|
||||
environment:
|
||||
MINIO_ROOT_USER_FILE: /run/secrets/minio_root_user
|
||||
MINIO_ROOT_PASSWORD_FILE: /run/secrets/minio_root_password
|
||||
MINIO_BROWSER: "off"
|
||||
volumes:
|
||||
- minio-data:/data
|
||||
secrets:
|
||||
- minio_root_user
|
||||
- minio_root_password
|
||||
networks:
|
||||
- messenger-net
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -f http://localhost:9000/minio/health/ready || exit 1"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
|
||||
minio-init:
|
||||
image: pgsty/mc@sha256:ce62c9053c69ce12a527a322345b5ad9f44b5f8a7b8189f82e516f2e3f30f1d8
|
||||
depends_on:
|
||||
minio:
|
||||
condition: service_healthy
|
||||
entrypoint: >
|
||||
/bin/sh -ec "
|
||||
export MINIO_ROOT_USER=$$(cat /run/secrets/minio_root_user);
|
||||
export MINIO_ROOT_PASSWORD=$$(cat /run/secrets/minio_root_password);
|
||||
export S3_ACCESS_KEY_ID=$$(cat /run/secrets/s3_access_key_id);
|
||||
export S3_SECRET_ACCESS_KEY=$$(cat /run/secrets/s3_secret_access_key);
|
||||
until mc alias set local http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD; do
|
||||
echo 'Waiting for MinIO...' && sleep 2;
|
||||
done;
|
||||
mc mb --ignore-existing local/messenger-attachments;
|
||||
mc anonymous set none local/messenger-attachments;
|
||||
mc admin user add local $$S3_ACCESS_KEY_ID $$S3_SECRET_ACCESS_KEY;
|
||||
mc admin policy create local app-uploads-policy /tmp/policy.json;
|
||||
mc admin policy attach local app-uploads-policy --user $$S3_ACCESS_KEY_ID;
|
||||
echo 'MinIO initialization completed (bucket: messenger-attachments)';
|
||||
"
|
||||
volumes:
|
||||
- ./policy.json:/tmp/policy.json:ro
|
||||
secrets:
|
||||
- minio_root_user
|
||||
- minio_root_password
|
||||
- s3_access_key_id
|
||||
- s3_secret_access_key
|
||||
networks:
|
||||
- messenger-net
|
||||
restart: "no"
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
redisdata:
|
||||
minio-data:
|
||||
brokerdata:
|
||||
|
||||
networks:
|
||||
messenger-net:
|
||||
driver: bridge
|
||||
|
||||
secrets:
|
||||
postgres_db:
|
||||
file: ./secrets/postgres_db.txt
|
||||
postgres_user:
|
||||
file: ./secrets/postgres_user.txt
|
||||
postgres_password:
|
||||
file: ./secrets/postgres_password.txt
|
||||
minio_root_user:
|
||||
file: ./secrets/minio_root_user.txt
|
||||
minio_root_password:
|
||||
file: ./secrets/minio_root_password.txt
|
||||
s3_access_key_id:
|
||||
file: ./secrets/s3_access_key_id.txt
|
||||
s3_secret_access_key:
|
||||
file: ./secrets/s3_secret_access_key.txt
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"accepted_ids": [
|
||||
"c5a9f640-7632-4246-a410-3ba40b672def",
|
||||
"ee6f2a74-b2e9-4658-aa51-4fe4f70814df",
|
||||
"91df6d6c-4a55-4da8-a529-0f60983d821c",
|
||||
"057fa846-f8b1-4faa-b78f-4e81d35024f2",
|
||||
"a50446b5-db71-4ef9-97a8-13fc1ad7227d",
|
||||
"8a5fbf9a-d330-463c-8cf9-c1231acb3a5b",
|
||||
"30725ce2-b850-414d-9856-a32372a79159",
|
||||
"7a829a5f-4ab2-454f-88fd-c8e179d83e72",
|
||||
"e5e2f3a8-970d-43bf-a2c4-11076f28ea16",
|
||||
"2a350755-0d84-400a-bc29-0654c24bb5da",
|
||||
"880535a8-081c-4716-bde7-d0082c21a43f",
|
||||
"cd611fe9-9ff3-44dc-932e-c381359717da",
|
||||
"f984e44e-8bf6-4bfc-afa4-e43bea658ed7",
|
||||
"06554ea1-e5b4-4b56-ae2c-003f1b120f5a",
|
||||
"8e42e5b2-a422-4424-8cd0-cbfa0208b42a",
|
||||
"4b899c01-ea7a-4fef-a0cb-4ac726283928",
|
||||
"0e0933f0-c8f4-4240-b6d9-926f13d9843a",
|
||||
"0a2e438c-e236-4f28-b6c1-32f698552f52",
|
||||
"f04e593c-f8e2-4b24-bdc0-3de9d5d6f5de"
|
||||
],
|
||||
"count": 19,
|
||||
"missing_or_nonterminal": 0
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"accepted_ids": [
|
||||
"172b8f36-f573-49ea-b910-657b6b142213",
|
||||
"0a156803-e856-42e0-9a9a-a11bb610237e",
|
||||
"ab1d30b5-fa62-4195-ad1f-ce0c14864c86",
|
||||
"e5259e9c-1d69-41a2-aa6c-5293bcb2e039",
|
||||
"55c8afb0-1f84-4736-97e2-9e1e84c3c5d1",
|
||||
"3fd48f9d-0ec9-4349-9b89-4d5cc8fd6adc",
|
||||
"26b66752-66d3-4b07-9da4-80f9da8f49e4",
|
||||
"b26b4bd0-6530-4dc4-916f-352c3a907d8b",
|
||||
"87b659ad-8383-428d-884f-da1c52765d03",
|
||||
"3b805b9a-20c6-4d58-a6d8-90fcbe0c355b",
|
||||
"5d9cd993-cea3-4b22-af03-f2e31edecb62",
|
||||
"693fa219-1ef0-4827-bfe6-1c416ec2d917",
|
||||
"4cf648a0-986a-4612-9ec7-0367471ac206",
|
||||
"d6aee2d9-e1b7-49df-b76a-1c38a315bd9f",
|
||||
"d15e5d79-ef3f-46e4-9f68-83a106fc97f3",
|
||||
"0489f1c8-2412-4a2b-8de8-4f9b2822dd4c",
|
||||
"fdb6e9ea-cca9-4de3-a6c4-9db37e215c83",
|
||||
"9b749bff-124a-4343-8329-a552ccaae3c2",
|
||||
"a0fca671-a279-4d5e-bb33-4b5080a283f3"
|
||||
],
|
||||
"count": 19,
|
||||
"missing_or_nonterminal": 0
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"accepted": 6,
|
||||
"rejected": 4,
|
||||
"concurrency": 10,
|
||||
"image_bytes": 1442570,
|
||||
"seconds_to_observed_ready": [
|
||||
5.0,
|
||||
5.030999999999949,
|
||||
6.17200000000048,
|
||||
6.203000000000429,
|
||||
7.655999999999949,
|
||||
7.686999999999898
|
||||
],
|
||||
"stats_samples": [],
|
||||
"method": "closed loop; sequential polls overestimate early completions"
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"accepted": 6,
|
||||
"rejected": 4,
|
||||
"concurrency": 10,
|
||||
"image_bytes": 1442631,
|
||||
"seconds_to_observed_ready": [
|
||||
5.313000000000102,
|
||||
5.359999999998763,
|
||||
6.5,
|
||||
6.82799999999952,
|
||||
7.968999999999141,
|
||||
8.015999999999622
|
||||
],
|
||||
"stats_samples": [
|
||||
"mtusi2026lab5-work-api-1 388.2MiB / 512MiB 0.52%\nmtusi2026lab5-work-api-2 385.6MiB / 512MiB 0.57%\nmtusi2026lab5-work-lb-1 7.41MiB / 7.649GiB 0.03%\nmtusi2026lab5-work-db-1 48.61MiB / 1GiB 0.05%\nmtusi2026lab5-work-minio-1 342.5MiB / 7.649GiB 0.24%\nmtusi2026lab5-work-redis-1 3.27MiB / 7.649GiB 0.65%\nmtusi2026lab5-work-broker-1 4.004MiB / 7.649GiB 7.71%",
|
||||
"mtusi2026lab5-work-api-1 388.2MiB / 512MiB 1.90%\nmtusi2026lab5-work-api-2 385.9MiB / 512MiB 9.18%\nmtusi2026lab5-work-lb-1 7.41MiB / 7.649GiB 0.15%\nmtusi2026lab5-work-db-1 51.21MiB / 1GiB 18.49%\nmtusi2026lab5-work-minio-1 342.6MiB / 7.649GiB 7.46%\nmtusi2026lab5-work-redis-1 3.273MiB / 7.649GiB 3.45%\nmtusi2026lab5-work-broker-1 4.016MiB / 7.649GiB 0.67%\nmtusi2026lab5-work-dispatcher-1 52.36MiB / 256MiB 41.89%\nmtusi2026lab5-work-worker-2 83.13MiB / 1GiB 69.20%\nmtusi2026lab5-work-worker-1 100.7MiB / 1GiB 78.14%",
|
||||
"mtusi2026lab5-work-dispatcher-1 52.43MiB / 256MiB 2.37%\nmtusi2026lab5-work-worker-2 104.2MiB / 1GiB 72.25%\nmtusi2026lab5-work-worker-1 97.39MiB / 1GiB 72.54%\nmtusi2026lab5-work-api-1 388.8MiB / 512MiB 12.75%\nmtusi2026lab5-work-api-2 386.4MiB / 512MiB 6.68%\nmtusi2026lab5-work-lb-1 7.43MiB / 7.649GiB 0.36%\nmtusi2026lab5-work-db-1 50.76MiB / 1GiB 36.81%\nmtusi2026lab5-work-minio-1 346.3MiB / 7.649GiB 3.19%\nmtusi2026lab5-work-redis-1 3.273MiB / 7.649GiB 0.39%\nmtusi2026lab5-work-broker-1 4.016MiB / 7.649GiB 0.53%",
|
||||
"mtusi2026lab5-work-dispatcher-1 52.45MiB / 256MiB 3.28%\nmtusi2026lab5-work-worker-2 52.21MiB / 1GiB 0.18%\nmtusi2026lab5-work-worker-1 51.34MiB / 1GiB 0.18%\nmtusi2026lab5-work-api-1 389MiB / 512MiB 0.40%\nmtusi2026lab5-work-api-2 386.6MiB / 512MiB 0.36%\nmtusi2026lab5-work-lb-1 7.418MiB / 7.649GiB 0.00%\nmtusi2026lab5-work-db-1 49.6MiB / 1GiB 4.80%\nmtusi2026lab5-work-minio-1 347.1MiB / 7.649GiB 3.09%\nmtusi2026lab5-work-redis-1 3.27MiB / 7.649GiB 3.39%\nmtusi2026lab5-work-broker-1 4.016MiB / 7.649GiB 1.05%"
|
||||
],
|
||||
"method": "closed loop; sequential polls overestimate early completions"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
PASS environment, job schema, metrics, source hashes and report links
|
||||
@@ -0,0 +1 @@
|
||||
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
|
||||
@@ -0,0 +1,5 @@
|
||||
PASS queued snapshot, link before ready, 409 before worker; original + 3 variants
|
||||
PASS bytes/corruption/MIME/filename/ACL/cross-chat negatives
|
||||
PASS alpha white, no small-image enlargement, EXIF rotation, crop and WebP
|
||||
PASS 24 concurrent requests across 2 API replicas; single message effect
|
||||
PASS core pipeline contract
|
||||
@@ -0,0 +1,108 @@
|
||||
Image mtusi2026lab5-work-api Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 527B 0.0s done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 944B 0.0s done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/eclipse-temurin:21-jre-jammy
|
||||
#3 ...
|
||||
|
||||
#4 [auth] library/eclipse-temurin:pull token for registry-1.docker.io
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load metadata for docker.io/library/eclipse-temurin:21-jdk-jammy
|
||||
#5 DONE 2.8s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/eclipse-temurin:21-jre-jammy
|
||||
#3 DONE 2.9s
|
||||
|
||||
#6 [internal] load .dockerignore
|
||||
#6 transferring context: 240B done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [internal] load build context
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [runner 1/5] FROM docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269
|
||||
#8 resolve docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269
|
||||
#8 resolve docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269 0.2s done
|
||||
#8 DONE 0.2s
|
||||
|
||||
#9 [builder 1/8] FROM docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69
|
||||
#9 resolve docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69 0.2s done
|
||||
#9 DONE 0.3s
|
||||
|
||||
#7 [internal] load build context
|
||||
#7 transferring context: 464.95kB 0.1s done
|
||||
#7 DONE 0.1s
|
||||
|
||||
#10 [builder 2/8] WORKDIR /build
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 3/8] COPY gradle gradle
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 4/8] COPY gradlew settings.gradle build.gradle ./
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 5/8] RUN --mount=type=cache,target=/root/.gradle chmod +x gradlew && ./gradlew dependencies --no-daemon
|
||||
#13 CACHED
|
||||
|
||||
#14 [builder 6/8] COPY contracts contracts
|
||||
#14 CACHED
|
||||
|
||||
#15 [builder 7/8] COPY src src
|
||||
#15 DONE 0.3s
|
||||
|
||||
#16 [builder 8/8] RUN --mount=type=cache,target=/root/.gradle ./gradlew bootJar -x test --no-daemon
|
||||
#16 1.477 To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.3.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
#16 2.577 Daemon will be stopped at the end of the build
|
||||
#16 12.88
|
||||
#16 12.88 > Task :compileJava
|
||||
#16 12.88 Note: /build/src/main/java/ru/mtusi/messenger/controller/controllerAdvice/GlobalExceptionHandler.java uses or overrides a deprecated API.
|
||||
#16 12.88 Note: Recompile with -Xlint:deprecation for details.
|
||||
#16 13.48
|
||||
#16 13.48 > Task :processResources
|
||||
#16 13.48 > Task :classes
|
||||
#16 13.48 > Task :resolveMainClassName
|
||||
#16 15.86 > Task :bootJar
|
||||
#16 15.86
|
||||
#16 15.86 [Incubating] Problems report is available at: file:///build/build/reports/problems/problems-report.html
|
||||
#16 15.86
|
||||
#16 15.86 BUILD SUCCESSFUL in 15s
|
||||
#16 15.86 4 actionable tasks: 4 executed
|
||||
#16 15.86 Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.0/userguide/configuration_cache_enabling.html
|
||||
#16 DONE 18.8s
|
||||
|
||||
#17 [runner 2/5] WORKDIR /app
|
||||
#17 CACHED
|
||||
|
||||
#18 [runner 3/5] RUN groupadd --system spring && useradd --system --gid spring --no-create-home spring
|
||||
#18 CACHED
|
||||
|
||||
#19 [runner 4/5] COPY --from=builder /build/build/libs/*.jar app.jar
|
||||
#19 DONE 2.7s
|
||||
|
||||
#20 [runner 5/5] RUN chown spring:spring app.jar
|
||||
#20 DONE 2.1s
|
||||
|
||||
#21 exporting to image
|
||||
#21 exporting layers
|
||||
#21 exporting layers 5.4s done
|
||||
#21 exporting manifest sha256:8c0bc43a62b520c8c5ac26acf67aa669ee41f0ad1fb34890a14483716a03442f 0.0s done
|
||||
#21 exporting config sha256:4c65822f15bbcc32ab8522835829ae25f46f7ae7c17bc7c47bcabaa221453b8f 0.0s done
|
||||
#21 exporting attestation manifest sha256:1d788e6cc4ba91dc39ed7c9fdcd345b119c97710f886ebb6d6649a4847cb7dff
|
||||
#21 exporting attestation manifest sha256:1d788e6cc4ba91dc39ed7c9fdcd345b119c97710f886ebb6d6649a4847cb7dff 0.0s done
|
||||
#21 exporting manifest list sha256:31354e7482da40ad7007b99a41a46e86539eeaf0d0c88ccdbfbf2ddccb20aac4 0.1s done
|
||||
#21 naming to docker.io/library/mtusi2026lab5-work-api:latest
|
||||
#21 naming to docker.io/library/mtusi2026lab5-work-api:latest 0.0s done
|
||||
#21 unpacking to docker.io/library/mtusi2026lab5-work-api:latest
|
||||
#21 unpacking to docker.io/library/mtusi2026lab5-work-api:latest 1.0s done
|
||||
#21 DONE 6.7s
|
||||
|
||||
#22 resolving provenance for metadata file
|
||||
#22 DONE 0.1s
|
||||
Image mtusi2026lab5-work-api Built
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,81 @@
|
||||
Image mtusi2026lab5-work-dispatcher Building
|
||||
Image mtusi2026lab5-work-worker Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.45kB 0.0s done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [worker internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 312B done
|
||||
#2 DONE 0.0s
|
||||
|
||||
#3 [auth] library/python:pull token for registry-1.docker.io
|
||||
#3 DONE 0.0s
|
||||
|
||||
#4 [worker internal] load metadata for docker.io/library/python:3.12.12-slim
|
||||
#4 DONE 3.5s
|
||||
|
||||
#5 [worker internal] load .dockerignore
|
||||
#5 transferring context: 240B done
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [worker internal] load build context
|
||||
#6 transferring context: 4.17kB 0.0s done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [dispatcher 1/5] FROM docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c
|
||||
#7 resolve docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c
|
||||
#7 resolve docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c 0.1s done
|
||||
#7 DONE 0.1s
|
||||
|
||||
#6 [dispatcher internal] load build context
|
||||
#6 DONE 0.1s
|
||||
|
||||
#8 [worker 2/5] WORKDIR /app
|
||||
#8 CACHED
|
||||
|
||||
#9 [worker 3/5] COPY worker/requirements.txt ./
|
||||
#9 CACHED
|
||||
|
||||
#10 [dispatcher 4/5] RUN pip install --no-cache-dir -r requirements.txt && useradd --system --uid 10001 worker
|
||||
#10 CACHED
|
||||
|
||||
#11 [dispatcher 5/5] COPY worker/pipeline ./pipeline
|
||||
#11 DONE 0.1s
|
||||
|
||||
#11 [worker 5/5] COPY worker/pipeline ./pipeline
|
||||
#11 DONE 0.1s
|
||||
|
||||
#12 [worker] exporting to image
|
||||
#12 exporting layers
|
||||
#12 exporting layers 0.4s done
|
||||
#12 exporting manifest sha256:1d02fca0d5474664c54c8ecf8169769d3f6fdbb543608b8e8175fff0bf2dba60
|
||||
#12 exporting manifest sha256:1d02fca0d5474664c54c8ecf8169769d3f6fdbb543608b8e8175fff0bf2dba60 0.2s done
|
||||
#12 exporting config sha256:25beea4e4e3b851792959d1e3b57cceb3bb865f57671704efa213e623e04bc4b
|
||||
#12 exporting config sha256:25beea4e4e3b851792959d1e3b57cceb3bb865f57671704efa213e623e04bc4b 0.2s done
|
||||
#12 exporting attestation manifest sha256:f7cdd92e1dea891112f625dda3d4623a427db275791150a14cd0dc5cbb1ae130
|
||||
#12 exporting attestation manifest sha256:f7cdd92e1dea891112f625dda3d4623a427db275791150a14cd0dc5cbb1ae130 0.3s done
|
||||
#12 exporting manifest list sha256:7d613fe08cb7e1ee441469eeec13e297d5aa57beacdb9e2bbea8e08824dd17f4
|
||||
#12 exporting manifest list sha256:7d613fe08cb7e1ee441469eeec13e297d5aa57beacdb9e2bbea8e08824dd17f4 0.1s done
|
||||
#12 naming to docker.io/library/mtusi2026lab5-work-worker:latest
|
||||
#12 naming to docker.io/library/mtusi2026lab5-work-worker:latest 0.0s done
|
||||
#12 unpacking to docker.io/library/mtusi2026lab5-work-worker:latest
|
||||
#12 unpacking to docker.io/library/mtusi2026lab5-work-worker:latest 0.2s done
|
||||
#12 DONE 1.6s
|
||||
|
||||
#13 [dispatcher] exporting to image
|
||||
#13 exporting layers 0.4s done
|
||||
#13 exporting manifest sha256:ffaa3765389b0327eeadaa6e813ba8179e3a3aa0f269178971a2a9d19e9e28d3 0.2s done
|
||||
#13 exporting config sha256:a28981a93faca90699d81669ab23a35f206b268a26fe85f3fce33c836a272808 0.3s done
|
||||
#13 exporting attestation manifest sha256:84da190255cc9ba9184b1df648e343e796fd54829f328d1e82671547998a7715 0.3s done
|
||||
#13 exporting manifest list sha256:83facacff5b1f596996f5a8fbeaae801d6c6476bf245eff0d698ba8dd9dfdb64 0.2s done
|
||||
#13 naming to docker.io/library/mtusi2026lab5-work-dispatcher:latest 0.0s done
|
||||
#13 unpacking to docker.io/library/mtusi2026lab5-work-dispatcher:latest 0.2s done
|
||||
#13 DONE 1.7s
|
||||
|
||||
#14 [worker] resolving provenance for metadata file
|
||||
#14 DONE 0.0s
|
||||
|
||||
#15 [dispatcher] resolving provenance for metadata file
|
||||
#15 DONE 0.0s
|
||||
Image mtusi2026lab5-work-worker Built
|
||||
Image mtusi2026lab5-work-dispatcher Built
|
||||
@@ -0,0 +1,235 @@
|
||||
Image mtusi2026lab5-work-worker Building
|
||||
Image mtusi2026lab5-work-api Building
|
||||
Image mtusi2026lab5-work-dispatcher Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 1.46kB 0.0s done
|
||||
#1 DONE 0.0s
|
||||
|
||||
#2 [dispatcher internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 312B 0.0s done
|
||||
#2 DONE 0.1s
|
||||
|
||||
#3 [api internal] load build definition from Dockerfile
|
||||
#3 transferring dockerfile: 944B 0.0s done
|
||||
#3 DONE 0.1s
|
||||
|
||||
#4 [api internal] load metadata for docker.io/library/eclipse-temurin:21-jre-jammy
|
||||
#4 ...
|
||||
|
||||
#5 [auth] library/eclipse-temurin:pull token for registry-1.docker.io
|
||||
#5 DONE 0.0s
|
||||
|
||||
#6 [auth] library/python:pull token for registry-1.docker.io
|
||||
#6 DONE 0.0s
|
||||
|
||||
#7 [dispatcher internal] load metadata for docker.io/library/python:3.12.12-slim
|
||||
#7 DONE 2.8s
|
||||
|
||||
#4 [api internal] load metadata for docker.io/library/eclipse-temurin:21-jre-jammy
|
||||
#4 DONE 2.8s
|
||||
|
||||
#8 [api internal] load metadata for docker.io/library/eclipse-temurin:21-jdk-jammy
|
||||
#8 DONE 2.8s
|
||||
|
||||
#9 [api internal] load .dockerignore
|
||||
#9 transferring context: 240B done
|
||||
#9 DONE 0.0s
|
||||
|
||||
#10 [api internal] load build context
|
||||
#10 DONE 0.0s
|
||||
|
||||
#11 [worker internal] load build context
|
||||
#11 transferring context: 1.55kB done
|
||||
#11 DONE 0.1s
|
||||
|
||||
#12 [worker 1/5] FROM docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c
|
||||
#12 resolve docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c
|
||||
#12 resolve docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c 0.2s done
|
||||
#12 DONE 0.2s
|
||||
|
||||
#13 [api builder 1/8] FROM docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69
|
||||
#13 resolve docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69
|
||||
#13 resolve docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69 0.2s done
|
||||
#13 DONE 0.3s
|
||||
|
||||
#12 [dispatcher 1/5] FROM docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c
|
||||
#12 resolve docker.io/library/python:3.12.12-slim@sha256:f3fa41d74a768c2fce8016b98c191ae8c1bacd8f1152870a3f9f87d350920b7c 0.2s done
|
||||
#12 DONE 0.2s
|
||||
|
||||
#14 [api runner 1/5] FROM docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269
|
||||
#14 resolve docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269 0.2s done
|
||||
#14 DONE 0.3s
|
||||
|
||||
#15 [dispatcher 3/5] COPY worker/requirements.txt ./
|
||||
#15 CACHED
|
||||
|
||||
#16 [dispatcher 4/5] RUN pip install --no-cache-dir -r requirements.txt && useradd --system --uid 10001 worker
|
||||
#16 CACHED
|
||||
|
||||
#17 [dispatcher 2/5] WORKDIR /app
|
||||
#17 CACHED
|
||||
|
||||
#18 [dispatcher 5/5] COPY worker/pipeline ./pipeline
|
||||
#18 CACHED
|
||||
|
||||
#10 [api internal] load build context
|
||||
#10 transferring context: 264.94kB 0.1s done
|
||||
#10 DONE 0.1s
|
||||
|
||||
#19 [worker] exporting to image
|
||||
#19 exporting layers done
|
||||
#19 exporting manifest sha256:138666f0025df1701ac66e9f90ce9857bae488b52bc0b08afc001e6fe6e16c05 0.0s done
|
||||
#19 exporting config sha256:1f9be9434c34b1c3d7b406137948f162f70c572a8c489890063b8786ffaff319 0.0s done
|
||||
#19 ...
|
||||
|
||||
#20 [api builder 2/8] WORKDIR /build
|
||||
#20 CACHED
|
||||
|
||||
#21 [api builder 3/8] COPY gradle gradle
|
||||
#21 CACHED
|
||||
|
||||
#22 [api builder 4/8] COPY gradlew settings.gradle build.gradle ./
|
||||
#22 CACHED
|
||||
|
||||
#23 [api builder 5/8] RUN --mount=type=cache,target=/root/.gradle chmod +x gradlew && ./gradlew dependencies --no-daemon
|
||||
#23 CACHED
|
||||
|
||||
#24 [api builder 6/8] COPY contracts contracts
|
||||
#24 CACHED
|
||||
|
||||
#19 [worker] exporting to image
|
||||
#19 exporting attestation manifest sha256:d2990e33774581f6c36502c0eb69d2c88d2bf49811a56c4cb4e926ee5b10aaf2
|
||||
#19 exporting attestation manifest sha256:d2990e33774581f6c36502c0eb69d2c88d2bf49811a56c4cb4e926ee5b10aaf2 0.2s done
|
||||
#19 exporting manifest list sha256:01836fa7f74744ac827753533c3315f05af8c043492226bd028c3cc97fb77e22
|
||||
#19 ...
|
||||
|
||||
#25 [api builder 7/8] COPY src src
|
||||
#25 DONE 0.4s
|
||||
|
||||
#19 [worker] exporting to image
|
||||
#19 exporting manifest list sha256:01836fa7f74744ac827753533c3315f05af8c043492226bd028c3cc97fb77e22 0.2s done
|
||||
#19 naming to docker.io/library/mtusi2026lab5-work-worker:latest 0.0s done
|
||||
#19 unpacking to docker.io/library/mtusi2026lab5-work-worker:latest
|
||||
#19 unpacking to docker.io/library/mtusi2026lab5-work-worker:latest 0.1s done
|
||||
#19 DONE 0.8s
|
||||
|
||||
#26 [dispatcher] exporting to image
|
||||
#26 exporting layers done
|
||||
#26 exporting manifest sha256:4a7d3372c66bacaa5b04cdc5ab57efc1974eedbcc8ce8f38adf7680671bade6c 0.0s done
|
||||
#26 exporting config sha256:2616101d358f51625b00975e5ad22e867eed2b610ff944c1fbb842ad5a01cbb6 0.0s done
|
||||
#26 exporting attestation manifest sha256:12caea1fd66e57ed52d35dc1a33fdbfface71ded36d5b95b9dc9d51e2746cea2 0.2s done
|
||||
#26 exporting manifest list sha256:9ce9966165ed98ef6e0a988b9c615f2fb20f56cb7acadbdb93ba21ea1db4da0d 0.2s done
|
||||
#26 naming to docker.io/library/mtusi2026lab5-work-dispatcher:latest 0.1s done
|
||||
#26 unpacking to docker.io/library/mtusi2026lab5-work-dispatcher:latest 0.1s done
|
||||
#26 DONE 0.8s
|
||||
|
||||
#27 [api builder 8/8] RUN --mount=type=cache,target=/root/.gradle ./gradlew bootJar -x test --no-daemon
|
||||
#27 ...
|
||||
|
||||
#28 [dispatcher] resolving provenance for metadata file
|
||||
#28 DONE 0.1s
|
||||
|
||||
#29 [worker] resolving provenance for metadata file
|
||||
#29 DONE 0.0s
|
||||
|
||||
#27 [api builder 8/8] RUN --mount=type=cache,target=/root/.gradle ./gradlew bootJar -x test --no-daemon
|
||||
#27 1.718 To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.3.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
#27 2.817 Daemon will be stopped at the end of the build
|
||||
#27 13.92
|
||||
#27 13.92 > Task :compileJava
|
||||
#27 13.92 Note: /build/src/main/java/ru/mtusi/messenger/controller/controllerAdvice/GlobalExceptionHandler.java uses or overrides a deprecated API.
|
||||
#27 13.92 Note: Recompile with -Xlint:deprecation for details.
|
||||
#27 14.72
|
||||
#27 14.72 > Task :processResources
|
||||
#27 14.72 > Task :classes
|
||||
#27 14.72 > Task :resolveMainClassName
|
||||
#27 16.81 > Task :bootJar
|
||||
#27 16.87
|
||||
#27 16.87 [Incubating] Problems report is available at: file:///build/build/reports/problems/problems-report.html
|
||||
#27 16.87
|
||||
#27 16.87 BUILD SUCCESSFUL in 15s
|
||||
#27 16.87 4 actionable tasks: 4 executed
|
||||
#27 16.87 Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.0/userguide/configuration_cache_enabling.html
|
||||
#27 DONE 21.1s
|
||||
|
||||
#30 [api runner 2/5] WORKDIR /app
|
||||
#30 CACHED
|
||||
|
||||
#31 [api runner 3/5] RUN groupadd --system spring && useradd --system --gid spring --no-create-home spring
|
||||
#31 CACHED
|
||||
|
||||
#32 [api runner 4/5] COPY --from=builder /build/build/libs/*.jar app.jar
|
||||
#32 DONE 2.2s
|
||||
|
||||
#33 [api runner 5/5] RUN chown spring:spring app.jar
|
||||
#33 DONE 1.7s
|
||||
|
||||
#34 [api] exporting to image
|
||||
#34 exporting layers
|
||||
#34 exporting layers 6.2s done
|
||||
#34 exporting manifest sha256:392113d86ea8459b00ebb72e01254ba05b361a75287af442f6ecdbc5f4205bf2 0.1s done
|
||||
#34 exporting config sha256:cff6e70956e806bc88547ad285afa887ffc56613af74d7c4db971da575202c32 0.0s done
|
||||
#34 exporting attestation manifest sha256:d6c09dfd709d684913341728d2fbad12627cf0cef027cee9cfb5a489ce82c652 0.1s done
|
||||
#34 exporting manifest list sha256:415e5ba1591a45c2fe76ba8342a3a2582f7749548a5a550f99d84174f1aeff96
|
||||
#34 exporting manifest list sha256:415e5ba1591a45c2fe76ba8342a3a2582f7749548a5a550f99d84174f1aeff96 0.1s done
|
||||
#34 naming to docker.io/library/mtusi2026lab5-work-api:latest 0.0s done
|
||||
#34 unpacking to docker.io/library/mtusi2026lab5-work-api:latest
|
||||
#34 unpacking to docker.io/library/mtusi2026lab5-work-api:latest 1.1s done
|
||||
#34 DONE 7.6s
|
||||
|
||||
#35 [api] resolving provenance for metadata file
|
||||
#35 DONE 0.0s
|
||||
Image mtusi2026lab5-work-api Built
|
||||
Image mtusi2026lab5-work-dispatcher Built
|
||||
Image mtusi2026lab5-work-worker Built
|
||||
Container mtusi2026lab5-work-redis-1 Running
|
||||
Container mtusi2026lab5-work-db-1 Running
|
||||
Container mtusi2026lab5-work-minio-1 Running
|
||||
Container mtusi2026lab5-work-broker-1 Running
|
||||
Container mtusi2026lab5-work-lb-1 Running
|
||||
Container mtusi2026lab5-work-api-1 Recreate
|
||||
Container mtusi2026lab5-work-api-2 Recreate
|
||||
Container mtusi2026lab5-work-api-2 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreate
|
||||
Container mtusi2026lab5-work-worker-2 Recreate
|
||||
Container mtusi2026lab5-work-worker-1 Recreate
|
||||
Container mtusi2026lab5-work-api-1 Recreated
|
||||
Container mtusi2026lab5-work-worker-2 Recreated
|
||||
Container mtusi2026lab5-work-worker-1 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreated
|
||||
Container mtusi2026lab5-work-minio-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Starting
|
||||
Container mtusi2026lab5-work-minio-init-1 Started
|
||||
Container mtusi2026lab5-work-redis-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-init-1 Waiting
|
||||
Container mtusi2026lab5-work-db-1 Waiting
|
||||
Container mtusi2026lab5-work-redis-1 Healthy
|
||||
Container mtusi2026lab5-work-db-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Exited
|
||||
Container mtusi2026lab5-work-api-1 Starting
|
||||
Container mtusi2026lab5-work-api-1 Started
|
||||
Container mtusi2026lab5-work-api-2 Starting
|
||||
Container mtusi2026lab5-work-api-2 Started
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-dispatcher-1 Starting
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-worker-2 Starting
|
||||
Container mtusi2026lab5-work-dispatcher-1 Started
|
||||
Container mtusi2026lab5-work-worker-2 Started
|
||||
Container mtusi2026lab5-work-worker-1 Starting
|
||||
Container mtusi2026lab5-work-worker-1 Started
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"observed_ready_seconds": {
|
||||
"50": 6.5,
|
||||
"95": 8.015999999999622,
|
||||
"99": 8.015999999999622
|
||||
},
|
||||
"accepted": 6,
|
||||
"expected_unavailable": 4,
|
||||
"image_bytes": 1442631,
|
||||
"polling_and_startup_included": true,
|
||||
"interpretation": "upper bounds from sequential polls, n=6; not a steady-state latency SLA"
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
{
|
||||
"time_moscow": "2026-11-06T21:07:44.092814+03:00",
|
||||
"base_commit": "276dbdad8a34da4c5b57fbf1879ca169b581d75b",
|
||||
"source_lab4": "cc0ef71",
|
||||
"worktree": "modified; source hashes below",
|
||||
"docker": "29.9.2 CPU=8 RAM=8212664320",
|
||||
"containers": [
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-api-1",
|
||||
"image": "sha256:fb7d190c85600f12a430f16a21709e0027c3896447baa312995a434c1fa83aff",
|
||||
"started_at": "2026-11-06T18:06:37.723116808Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000,
|
||||
"profile": {
|
||||
"JOB_MAX_ATTEMPTS": "5",
|
||||
"MAX_PENDING_JOBS": "100"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-api-2",
|
||||
"image": "sha256:fb7d190c85600f12a430f16a21709e0027c3896447baa312995a434c1fa83aff",
|
||||
"started_at": "2026-11-06T18:06:38.324320365Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 536870912,
|
||||
"nano_cpus": 1000000000,
|
||||
"profile": {
|
||||
"JOB_MAX_ATTEMPTS": "5",
|
||||
"MAX_PENDING_JOBS": "100"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-broker-1",
|
||||
"image": "sha256:8da19c7399dca900c6822a1cf30f9d2285585e2c4b457ff4095b0f4500054d3f",
|
||||
"started_at": "2026-11-06T17:47:14.251335287Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mtusi2026lab5-work_brokerdata",
|
||||
"target": "/data"
|
||||
}
|
||||
],
|
||||
"memory_limit_bytes": 0,
|
||||
"nano_cpus": 0,
|
||||
"profile": {}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-db-1",
|
||||
"image": "sha256:0cefaabd882e42bcb2a2f3dc56d3ce4770560ba62fd7f197f1a2e008fd5731ab",
|
||||
"started_at": "2026-11-06T17:47:15.036216414Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mtusi2026lab5-work_pgdata",
|
||||
"target": "/var/lib/postgresql/data"
|
||||
}
|
||||
],
|
||||
"memory_limit_bytes": 1073741824,
|
||||
"nano_cpus": 1000000000,
|
||||
"profile": {}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-dispatcher-1",
|
||||
"image": "sha256:9ce9966165ed98ef6e0a988b9c615f2fb20f56cb7acadbdb93ba21ea1db4da0d",
|
||||
"started_at": "2026-11-06T18:07:35.39373003Z",
|
||||
"state": "running",
|
||||
"health": null,
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 268435456,
|
||||
"nano_cpus": 500000000,
|
||||
"profile": {
|
||||
"FAULT_INJECTION_ENABLED": "false",
|
||||
"ROLE": "dispatcher",
|
||||
"JOB_MAX_ATTEMPTS": "5",
|
||||
"JOB_TIMEOUT_SECONDS": "60",
|
||||
"JOB_LEASE_SECONDS": "75"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-lb-1",
|
||||
"image": "sha256:65645c7bb6a0661892a8b03b89d0743208a18dd2f3f17a54ef4b76fb8e2f2a10",
|
||||
"started_at": "2026-11-06T17:47:14.480124672Z",
|
||||
"state": "running",
|
||||
"health": null,
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 0,
|
||||
"nano_cpus": 0,
|
||||
"profile": {}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-minio-1",
|
||||
"image": "sha256:7bb2aff6b89efe1cb1303c10fc21d579447434ed06649ac9ec05a5e2dbf30ad7",
|
||||
"started_at": "2026-11-06T17:47:14.380498565Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mtusi2026lab5-work_minio-data",
|
||||
"target": "/data"
|
||||
}
|
||||
],
|
||||
"memory_limit_bytes": 0,
|
||||
"nano_cpus": 0,
|
||||
"profile": {}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-redis-1",
|
||||
"image": "sha256:8da19c7399dca900c6822a1cf30f9d2285585e2c4b457ff4095b0f4500054d3f",
|
||||
"started_at": "2026-11-06T17:47:14.652341111Z",
|
||||
"state": "running",
|
||||
"health": "healthy",
|
||||
"volumes": [
|
||||
{
|
||||
"name": "mtusi2026lab5-work_redisdata",
|
||||
"target": "/data"
|
||||
}
|
||||
],
|
||||
"memory_limit_bytes": 0,
|
||||
"nano_cpus": 0,
|
||||
"profile": {}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-worker-1",
|
||||
"image": "sha256:01836fa7f74744ac827753533c3315f05af8c043492226bd028c3cc97fb77e22",
|
||||
"started_at": "2026-11-06T18:07:36.312812141Z",
|
||||
"state": "running",
|
||||
"health": null,
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 1073741824,
|
||||
"nano_cpus": 1000000000,
|
||||
"profile": {
|
||||
"FAULT_INJECTION_ENABLED": "false",
|
||||
"ROLE": "worker",
|
||||
"JOB_TIMEOUT_SECONDS": "60",
|
||||
"JOB_LEASE_SECONDS": "75",
|
||||
"JOB_MAX_ATTEMPTS": "5"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "/mtusi2026lab5-work-worker-2",
|
||||
"image": "sha256:01836fa7f74744ac827753533c3315f05af8c043492226bd028c3cc97fb77e22",
|
||||
"started_at": "2026-11-06T18:07:35.872411493Z",
|
||||
"state": "running",
|
||||
"health": null,
|
||||
"volumes": [],
|
||||
"memory_limit_bytes": 1073741824,
|
||||
"nano_cpus": 1000000000,
|
||||
"profile": {
|
||||
"JOB_TIMEOUT_SECONDS": "60",
|
||||
"ROLE": "worker",
|
||||
"JOB_MAX_ATTEMPTS": "5",
|
||||
"FAULT_INJECTION_ENABLED": "false",
|
||||
"JOB_LEASE_SECONDS": "75"
|
||||
}
|
||||
}
|
||||
],
|
||||
"job_states": "FAILED|4\nREADY|150\nSUPERSEDED|5",
|
||||
"redis_durability": "appendonly\nyes\nappendfsync\nalways",
|
||||
"broker_stream_entries": "0",
|
||||
"broker_publication_index_entries": "0"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
FAIL: less than two API instances observed before failure; verify LB/session affinity
|
||||
@@ -0,0 +1,3 @@
|
||||
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
|
||||
{"observed_instances_before": 2, "successful_writes": 88, "failed_attempts": 0, "first_recovery_seconds": 2.765}
|
||||
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"attachment_id": "81764d24-8572-4f8f-b8a8-31005e2b17b9",
|
||||
"unfinished_delivery_retained": true,
|
||||
"recovered_attempt": 2,
|
||||
"one_manifest": true,
|
||||
"s3_objects": 4
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
PASS public lab5 assignment, contract and executable tests unchanged
|
||||
PASS no local credential values in Git-visible files; secrets and .env ignored
|
||||
PASS git diff --check
|
||||
Controller DI, single service call, API Javadoc and formatting: evidence/style.txt
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
> Task :compileJava
|
||||
Note: D:\Лабы\mtusi2026lab5-work\src\main\java\ru\mtusi\messenger\controller\controllerAdvice\GlobalExceptionHandler.java uses or overrides a deprecated API.
|
||||
Note: Recompile with -Xlint:deprecation for details.
|
||||
|
||||
> Task :processResources
|
||||
> Task :classes
|
||||
> Task :compileTestJava
|
||||
> Task :processTestResources NO-SOURCE
|
||||
> Task :testClasses
|
||||
> Task :test
|
||||
|
||||
[Incubating] Problems report is available at: file:///D:/%D0%9B%D0%B0%D0%B1%D1%8B/mtusi2026lab5-work/build/reports/problems/problems-report.html
|
||||
|
||||
BUILD SUCCESSFUL in 13s
|
||||
4 actionable tasks: 4 executed
|
||||
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.0/userguide/configuration_cache_enabling.html
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"validated_outbox_templates": 159,
|
||||
"valid": true
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 5,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 30.0,
|
||||
"elapsed_seconds": 30.109,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1648,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 54.734,
|
||||
"successful_latency_ms": {
|
||||
"p50": 47.0,
|
||||
"p95": 188.0,
|
||||
"p99": 281.0
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"lab": 5,
|
||||
"workload": "closed-loop POST messages; no automatic retries",
|
||||
"requested_duration_seconds": 30.0,
|
||||
"elapsed_seconds": 30.109,
|
||||
"concurrency": 4,
|
||||
"successful_requests": 1648,
|
||||
"failed_requests": 0,
|
||||
"error_ratio": 0.0,
|
||||
"successful_rps": 54.734,
|
||||
"successful_latency_ms": {
|
||||
"p50": 47.0,
|
||||
"p95": 188.0,
|
||||
"p99": 281.0
|
||||
},
|
||||
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS message eligibility: status UPDATE blocked until Message COMMIT; subsequent FAILED attachment rejected with 409
|
||||
PASS download/cleanup barrier: content waits for exclusive cleanup, returns identical bytes, releases shared fence
|
||||
@@ -0,0 +1 @@
|
||||
PASS environment, job schema, metrics, source hashes and report links
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"migration": "V1__init.sql",
|
||||
"migration_sha256": "b4a40c651fc3e8fb10c588f7374164dbe716bef508a3c7609e24a9284aaad894",
|
||||
"schema_sha256": "473dc9e3e10eadf1075c82952d856d45b3b32aa82110ecb7a2f6388d269580db",
|
||||
"equivalent_to_existing_schema": true,
|
||||
"excludes": "Flyway history and pg_dump random restriction tokens",
|
||||
"temporary_database_removed": true
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
PASS one V1__init.sql; fresh PostgreSQL schema equals existing V1-V4 schema; temporary DB removed
|
||||
@@ -0,0 +1,5 @@
|
||||
PASS queued snapshot, link before ready, 409 before worker; original + 3 variants
|
||||
PASS bytes/corruption/MIME/filename/ACL/cross-chat negatives
|
||||
PASS alpha white, no small-image enlargement, EXIF rotation, crop and WebP
|
||||
PASS 24 concurrent requests across 2 API replicas; single message effect
|
||||
PASS core pipeline contract
|
||||
@@ -0,0 +1,110 @@
|
||||
Image mtusi2026lab5-work-api Building
|
||||
#1 [internal] load local bake definitions
|
||||
#1 reading from stdin 527B 0.1s done
|
||||
#1 DONE 0.1s
|
||||
|
||||
#2 [internal] load build definition from Dockerfile
|
||||
#2 transferring dockerfile: 944B 0.0s done
|
||||
#2 DONE 0.1s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/eclipse-temurin:21-jdk-jammy
|
||||
#3 ...
|
||||
|
||||
#4 [auth] library/eclipse-temurin:pull token for registry-1.docker.io
|
||||
#4 DONE 0.0s
|
||||
|
||||
#5 [internal] load metadata for docker.io/library/eclipse-temurin:21-jre-jammy
|
||||
#5 DONE 4.8s
|
||||
|
||||
#3 [internal] load metadata for docker.io/library/eclipse-temurin:21-jdk-jammy
|
||||
#3 DONE 4.8s
|
||||
|
||||
#6 [internal] load .dockerignore
|
||||
#6 transferring context: 240B done
|
||||
#6 DONE 0.1s
|
||||
|
||||
#7 [internal] load build context
|
||||
#7 DONE 0.0s
|
||||
|
||||
#8 [runner 1/5] FROM docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269
|
||||
#8 resolve docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269
|
||||
#8 resolve docker.io/library/eclipse-temurin:21-jre-jammy@sha256:1eac8b8fee11ca7d6725a48bc5d41992ed1561504ebae25490d2d062847e8269 0.3s done
|
||||
#8 DONE 0.3s
|
||||
|
||||
#9 [builder 1/8] FROM docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69
|
||||
#9 resolve docker.io/library/eclipse-temurin:21-jdk-jammy@sha256:4b1a74fbffbe6b4e7b6f0171a472478282fb463790a51edf10e465d578f22b69 0.3s done
|
||||
#9 DONE 0.3s
|
||||
|
||||
#7 [internal] load build context
|
||||
#7 transferring context: 492.46kB 0.1s done
|
||||
#7 DONE 0.2s
|
||||
|
||||
#10 [builder 2/8] WORKDIR /build
|
||||
#10 CACHED
|
||||
|
||||
#11 [builder 3/8] COPY gradle gradle
|
||||
#11 CACHED
|
||||
|
||||
#12 [builder 4/8] COPY gradlew settings.gradle build.gradle ./
|
||||
#12 CACHED
|
||||
|
||||
#13 [builder 5/8] RUN --mount=type=cache,target=/root/.gradle chmod +x gradlew && ./gradlew dependencies --no-daemon
|
||||
#13 CACHED
|
||||
|
||||
#14 [builder 6/8] COPY contracts contracts
|
||||
#14 CACHED
|
||||
|
||||
#15 [builder 7/8] COPY src src
|
||||
#15 DONE 0.4s
|
||||
|
||||
#16 [builder 8/8] RUN --mount=type=cache,target=/root/.gradle ./gradlew bootJar -x test --no-daemon
|
||||
#16 4.224 To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.3.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
#16 7.423 Daemon will be stopped at the end of the build
|
||||
#16 24.82
|
||||
#16 24.82 > Task :compileJava
|
||||
#16 24.82 Note: /build/src/main/java/ru/mtusi/messenger/controller/controllerAdvice/GlobalExceptionHandler.java uses or overrides a deprecated API.
|
||||
#16 24.82 Note: Recompile with -Xlint:deprecation for details.
|
||||
#16 26.52
|
||||
#16 26.52 > Task :processResources
|
||||
#16 26.52 > Task :classes
|
||||
#16 26.52 > Task :resolveMainClassName
|
||||
#16 33.52 > Task :bootJar
|
||||
#16 33.52
|
||||
#16 33.52 [Incubating] Problems report is available at: file:///build/build/reports/problems/problems-report.html
|
||||
#16 33.52
|
||||
#16 33.52 BUILD SUCCESSFUL in 31s
|
||||
#16 33.52 4 actionable tasks: 4 executed
|
||||
#16 33.52 Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.0/userguide/configuration_cache_enabling.html
|
||||
#16 DONE 42.0s
|
||||
|
||||
#17 [runner 2/5] WORKDIR /app
|
||||
#17 CACHED
|
||||
|
||||
#18 [runner 3/5] RUN groupadd --system spring && useradd --system --gid spring --no-create-home spring
|
||||
#18 CACHED
|
||||
|
||||
#19 [runner 4/5] COPY --from=builder /build/build/libs/*.jar app.jar
|
||||
#19 DONE 5.9s
|
||||
|
||||
#20 [runner 5/5] RUN chown spring:spring app.jar
|
||||
#20 DONE 5.8s
|
||||
|
||||
#21 exporting to image
|
||||
#21 exporting layers
|
||||
#21 exporting layers 10.7s done
|
||||
#21 exporting manifest sha256:160a056dd9d8248824c73c179ba07ff3533ac42727e191b8226708df56874dbb
|
||||
#21 exporting manifest sha256:160a056dd9d8248824c73c179ba07ff3533ac42727e191b8226708df56874dbb 0.2s done
|
||||
#21 exporting config sha256:e9eecfd086e056e85d7a9dfb056f69860cf5404f04152fd961e4b48a266b4eeb
|
||||
#21 exporting config sha256:e9eecfd086e056e85d7a9dfb056f69860cf5404f04152fd961e4b48a266b4eeb 0.1s done
|
||||
#21 exporting attestation manifest sha256:0ac4b6c52ce16f2184ee4a646872bf79bb129a15b86b49fbb9a1f4f39862cb35
|
||||
#21 exporting attestation manifest sha256:0ac4b6c52ce16f2184ee4a646872bf79bb129a15b86b49fbb9a1f4f39862cb35 0.2s done
|
||||
#21 exporting manifest list sha256:fb7d190c85600f12a430f16a21709e0027c3896447baa312995a434c1fa83aff
|
||||
#21 exporting manifest list sha256:fb7d190c85600f12a430f16a21709e0027c3896447baa312995a434c1fa83aff 0.1s done
|
||||
#21 naming to docker.io/library/mtusi2026lab5-work-api:latest 0.0s done
|
||||
#21 unpacking to docker.io/library/mtusi2026lab5-work-api:latest
|
||||
#21 unpacking to docker.io/library/mtusi2026lab5-work-api:latest 9.9s done
|
||||
#21 DONE 21.4s
|
||||
|
||||
#22 resolving provenance for metadata file
|
||||
#22 DONE 0.2s
|
||||
Image mtusi2026lab5-work-api Built
|
||||
@@ -0,0 +1,3 @@
|
||||
PASS removed V2-V4 marked DELETED by Flyway repair; V1 validates
|
||||
PASS concurrent clean V1 initialization
|
||||
PASS API x2 healthy after restart with consolidated history
|
||||
@@ -0,0 +1,34 @@
|
||||
18:01:07.508 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1 (PostgreSQL 16.15)
|
||||
18:01:07.714 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Schema history table "public"."flyway_schema_history" does not exist yet
|
||||
18:01:07.720 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.046s)
|
||||
18:01:07.752 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Creating Schema History table "public"."flyway_schema_history" ...
|
||||
18:01:07.985 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Current version of schema "public": << Empty Schema >>
|
||||
18:01:08.168 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Migrating schema "public" to version "1 - init"
|
||||
18:01:09.202 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Successfully applied 1 migration to schema "public", now at version v1 (execution time 00:00.987s)
|
||||
18:01:09.232 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1 (PostgreSQL 16.15)
|
||||
18:01:09.292 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.013s)
|
||||
18:01:09.425 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1 (PostgreSQL 16.15)
|
||||
MIGRATION 1 SUCCESS
|
||||
PASS fresh database migrated and validated with exactly V1
|
||||
18:05:23.318 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
18:05:23.644 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Schema history table "public"."flyway_schema_history" does not exist yet
|
||||
18:05:23.652 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.081s)
|
||||
18:05:23.681 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Creating Schema History table "public"."flyway_schema_history" ...
|
||||
18:05:23.952 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Current version of schema "public": << Empty Schema >>
|
||||
18:05:24.331 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Migrating schema "public" to version "1 - init"
|
||||
18:05:25.613 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Successfully applied 1 migration to schema "public", now at version v1 (execution time 00:01.178s)
|
||||
18:05:25.707 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
18:05:25.750 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.010s)
|
||||
18:05:25.814 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
MIGRATION 1 SUCCESS
|
||||
|
||||
18:05:23.480 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
18:05:23.778 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Schema history table "public"."flyway_schema_history" does not exist yet
|
||||
18:05:23.783 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.073s)
|
||||
18:05:25.887 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Current version of schema "public": 1
|
||||
18:05:25.891 [main] INFO org.flywaydb.core.internal.command.DbMigrate -- Schema "public" is up to date. No migration necessary.
|
||||
18:05:25.922 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
18:05:26.018 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 1 migration (execution time 00:00.012s)
|
||||
18:05:26.095 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/proof_flyway_v1_parallel (PostgreSQL 16.15)
|
||||
MIGRATION 1 SUCCESS
|
||||
PASS two concurrent Flyway clients initialized one V1 safely
|
||||
@@ -0,0 +1,20 @@
|
||||
To honour the JVM settings for this build a single-use Daemon process will be forked. For more on this, please refer to https://docs.gradle.org/9.3.0/userguide/gradle_daemon.html#sec:disabling_the_daemon in the Gradle documentation.
|
||||
Daemon will be stopped at the end of the build
|
||||
> Task :clean
|
||||
|
||||
> Task :compileJava
|
||||
Note: D:\Лабы\mtusi2026lab5-work\src\main\java\ru\mtusi\messenger\controller\controllerAdvice\GlobalExceptionHandler.java uses or overrides a deprecated API.
|
||||
Note: Recompile with -Xlint:deprecation for details.
|
||||
|
||||
> Task :processResources
|
||||
> Task :classes
|
||||
> Task :compileTestJava
|
||||
> Task :processTestResources NO-SOURCE
|
||||
> Task :testClasses
|
||||
> Task :test
|
||||
|
||||
[Incubating] Problems report is available at: file:///D:/%D0%9B%D0%B0%D0%B1%D1%8B/mtusi2026lab5-work/build/reports/problems/problems-report.html
|
||||
|
||||
BUILD SUCCESSFUL in 45s
|
||||
5 actionable tasks: 5 executed
|
||||
Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.3.0/userguide/configuration_cache_enabling.html
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS Flyway repair + validate; all application table counts preserved
|
||||
PASS rebuilt API x2 healthy after history reconciliation
|
||||
@@ -0,0 +1,67 @@
|
||||
{
|
||||
"time_moscow": "2026-11-06T21:02:45.302644+03:00",
|
||||
"data_counts_preserved": true,
|
||||
"counts": {
|
||||
"users": 138,
|
||||
"chats": 51,
|
||||
"chat_members": 97,
|
||||
"messages": 14377,
|
||||
"sessions": 138,
|
||||
"idempotency_keys": 4378,
|
||||
"attachments": 149,
|
||||
"message_attachments": 32,
|
||||
"processing_jobs": 154,
|
||||
"processing_outbox": 154,
|
||||
"attachment_variants": 435,
|
||||
"pipeline_events": 634,
|
||||
"pipeline_faults": 58
|
||||
},
|
||||
"history_after": [
|
||||
{
|
||||
"version": "1",
|
||||
"script": "V1__init.sql",
|
||||
"type": "SQL",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "2",
|
||||
"script": "V2__attachment_integrity.sql",
|
||||
"type": "SQL",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "3",
|
||||
"script": "V3__processing_pipeline.sql",
|
||||
"type": "SQL",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "4",
|
||||
"script": "V4__staging_lookup.sql",
|
||||
"type": "SQL",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "2",
|
||||
"script": "V2__attachment_integrity.sql",
|
||||
"type": "DELETE",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "3",
|
||||
"script": "V3__processing_pipeline.sql",
|
||||
"type": "DELETE",
|
||||
"success": true
|
||||
},
|
||||
{
|
||||
"version": "4",
|
||||
"script": "V4__staging_lookup.sql",
|
||||
"type": "DELETE",
|
||||
"success": true
|
||||
}
|
||||
],
|
||||
"history_backup": "ignored .gradle/flyway-consolidation/history-before.json",
|
||||
"active_resolved_migrations": [
|
||||
"1 SUCCESS"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
Container mtusi2026lab5-work-lb-1 Running
|
||||
Container mtusi2026lab5-work-broker-1 Running
|
||||
Container mtusi2026lab5-work-db-1 Running
|
||||
Container mtusi2026lab5-work-minio-1 Running
|
||||
Container mtusi2026lab5-work-redis-1 Running
|
||||
Container mtusi2026lab5-work-api-1 Recreate
|
||||
Container mtusi2026lab5-work-api-2 Recreate
|
||||
Container mtusi2026lab5-work-api-1 Recreated
|
||||
Container mtusi2026lab5-work-api-2 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreate
|
||||
Container mtusi2026lab5-work-worker-2 Recreate
|
||||
Container mtusi2026lab5-work-worker-1 Recreate
|
||||
Container mtusi2026lab5-work-worker-1 Recreated
|
||||
Container mtusi2026lab5-work-worker-2 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreated
|
||||
Container mtusi2026lab5-work-minio-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Starting
|
||||
Container mtusi2026lab5-work-minio-init-1 Started
|
||||
Container mtusi2026lab5-work-db-1 Waiting
|
||||
Container mtusi2026lab5-work-redis-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-init-1 Waiting
|
||||
Container mtusi2026lab5-work-redis-1 Healthy
|
||||
Container mtusi2026lab5-work-db-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Exited
|
||||
Container mtusi2026lab5-work-api-1 Starting
|
||||
Container mtusi2026lab5-work-api-1 Started
|
||||
Container mtusi2026lab5-work-api-2 Starting
|
||||
Container mtusi2026lab5-work-api-2 Started
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-dispatcher-1 Starting
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-worker-2 Starting
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-dispatcher-1 Started
|
||||
Container mtusi2026lab5-work-worker-2 Started
|
||||
Container mtusi2026lab5-work-worker-1 Starting
|
||||
Container mtusi2026lab5-work-worker-1 Started
|
||||
@@ -0,0 +1,27 @@
|
||||
18:02:35.333 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
18:02:35.733 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repair of failed migration in Schema History table "public"."flyway_schema_history" not necessary. No failed migration detected.
|
||||
18:02:35.836 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repairing Schema History table for version 1 (Description: init, Type: SQL, Checksum: -1112597962) ...
|
||||
18:02:35.860 [main] INFO org.flywaydb.core.internal.command.DbRepair -- Successfully repaired schema history table "public"."flyway_schema_history" (execution time 00:00.231s).
|
||||
18:02:36.164 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
18:02:36.372 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 4 migrations (execution time 00:00.038s)
|
||||
18:02:36.540 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
MIGRATION 1 SUCCESS
|
||||
MIGRATION 2 FUTURE_SUCCESS
|
||||
MIGRATION 3 FUTURE_SUCCESS
|
||||
MIGRATION 4 FUTURE_SUCCESS
|
||||
|
||||
Explicit empty ignoreMigrationPatterns for removed future versions:
|
||||
18:05:14.813 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
18:05:15.230 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repair of failed migration in Schema History table "public"."flyway_schema_history" not necessary. No failed migration detected.
|
||||
18:05:15.296 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repairing Schema History table for version "2" (Marking as DELETED) ...
|
||||
18:05:15.307 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repairing Schema History table for version "3" (Marking as DELETED) ...
|
||||
18:05:15.314 [main] INFO org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory -- Repairing Schema History table for version "4" (Marking as DELETED) ...
|
||||
18:05:15.376 [main] INFO org.flywaydb.core.internal.command.DbRepair -- Successfully repaired schema history table "public"."flyway_schema_history" (execution time 00:00.187s).
|
||||
18:05:15.376 [main] INFO org.flywaydb.core.internal.command.DbRepair -- Please ensure the previous contents of the deleted migrations are removed from the database, or moved into an existing migration.
|
||||
18:05:15.679 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
18:05:15.824 [main] INFO org.flywaydb.core.internal.command.DbValidate -- Successfully validated 4 migrations (execution time 00:00.030s)
|
||||
18:05:15.992 [main] INFO org.flywaydb.core.FlywayExecutor -- Database: jdbc:postgresql://db:5432/messenger (PostgreSQL 16.15)
|
||||
MIGRATION 1 SUCCESS
|
||||
MIGRATION 2 DELETED
|
||||
MIGRATION 3 DELETED
|
||||
MIGRATION 4 DELETED
|
||||
@@ -0,0 +1 @@
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1 @@
|
||||
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
|
||||
@@ -0,0 +1,2 @@
|
||||
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 @@
|
||||
PASS expired worker without dispatcher: no premature ACK; pending/index retained; recovery publishes exactly one result on attempt 2
|
||||
@@ -0,0 +1,2 @@
|
||||
PASS message eligibility: status UPDATE blocked until Message COMMIT; subsequent FAILED attachment rejected with 409
|
||||
PASS download/cleanup barrier: content waits for exclusive cleanup, returns identical bytes, releases shared fence
|
||||
@@ -0,0 +1,5 @@
|
||||
PASS queued snapshot, link before ready, 409 before worker; original + 3 variants
|
||||
PASS bytes/corruption/MIME/filename/ACL/cross-chat negatives
|
||||
PASS alpha white, no small-image enlargement, EXIF rotation, crop and WebP
|
||||
PASS 24 concurrent requests across 2 API replicas; single message effect
|
||||
PASS core pipeline contract
|
||||
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"scenario": "commit_publish_api_broker_restart",
|
||||
"result": "PASS",
|
||||
"seconds": 63.828
|
||||
},
|
||||
{
|
||||
"scenario": "publish_confirm_db_mark_crash",
|
||||
"result": "PASS",
|
||||
"seconds": 17.25
|
||||
},
|
||||
{
|
||||
"scenario": "24_concurrent_duplicate_deliveries",
|
||||
"result": "PASS",
|
||||
"seconds": 14.875
|
||||
},
|
||||
{
|
||||
"scenario": "crash_before_effects",
|
||||
"result": "PASS",
|
||||
"seconds": 22.343
|
||||
},
|
||||
{
|
||||
"scenario": "crash_after_effects",
|
||||
"result": "PASS",
|
||||
"seconds": 22.297
|
||||
},
|
||||
{
|
||||
"scenario": "crash_after_commit",
|
||||
"result": "PASS",
|
||||
"seconds": 19.594
|
||||
},
|
||||
{
|
||||
"scenario": "crash_before_ack",
|
||||
"result": "PASS",
|
||||
"seconds": 19.0
|
||||
},
|
||||
{
|
||||
"scenario": "expired_lease_fences_old_worker",
|
||||
"result": "PASS",
|
||||
"seconds": 23.047
|
||||
},
|
||||
{
|
||||
"scenario": "hard_process_timeout_recovery",
|
||||
"result": "PASS",
|
||||
"seconds": 35.203
|
||||
},
|
||||
{
|
||||
"scenario": "new_version_then_stale_reordered_jobs",
|
||||
"result": "PASS",
|
||||
"seconds": 27.859
|
||||
},
|
||||
{
|
||||
"scenario": "permanent_failure_explicit_replay",
|
||||
"result": "PASS",
|
||||
"seconds": 15.532
|
||||
},
|
||||
{
|
||||
"scenario": "bounded_retry_explicit_replay",
|
||||
"result": "PASS",
|
||||
"seconds": 25.234
|
||||
},
|
||||
{
|
||||
"scenario": "two_replica_atomic_backpressure_recovery",
|
||||
"result": "PASS",
|
||||
"seconds": 12.922
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,29 @@
|
||||
durability: 202 -> outbox COMMIT without publisher; API restart; publish; broker restart while worker stopped; same jobs ready
|
||||
{"scenario": "commit_publish_api_broker_restart", "result": "PASS", "seconds": 63.828}
|
||||
{"scenario": "publish_confirm_db_mark_crash", "result": "PASS", "seconds": 17.25}
|
||||
{"scenario": "24_concurrent_duplicate_deliveries", "result": "PASS", "seconds": 14.875}
|
||||
{"scenario": "crash_before_effects", "result": "PASS", "seconds": 22.343}
|
||||
{"scenario": "crash_after_effects", "result": "PASS", "seconds": 22.297}
|
||||
{"scenario": "crash_after_commit", "result": "PASS", "seconds": 19.594}
|
||||
{"scenario": "crash_before_ack", "result": "PASS", "seconds": 19.0}
|
||||
{"scenario": "expired_lease_fences_old_worker", "result": "PASS", "seconds": 23.047}
|
||||
{"scenario": "hard_process_timeout_recovery", "result": "PASS", "seconds": 35.203}
|
||||
{"scenario": "new_version_then_stale_reordered_jobs", "result": "PASS", "seconds": 27.859}
|
||||
{"scenario": "permanent_failure_explicit_replay", "result": "PASS", "seconds": 15.532}
|
||||
{"scenario": "bounded_retry_explicit_replay", "result": "PASS", "seconds": 25.234}
|
||||
Exception in thread Thread-609 (sample):
|
||||
Traceback (most recent call last):
|
||||
File "C:\Users\skotd\AppData\Local\Programs\Python\Python310\lib\threading.py", line 1016, in _bootstrap_inner
|
||||
self.run()
|
||||
File "C:\Users\skotd\AppData\Local\Programs\Python\Python310\lib\threading.py", line 953, in run
|
||||
self._target(*self._args, **self._kwargs)
|
||||
File "D:\Лабы\mtusi2026lab5-work\tests\pipeline_faults.py", line 154, in sample
|
||||
samples.append(compose('stats','--no-stream','--format','{{.Name}} {{.MemUsage}} {{.CPUPerc}}'))
|
||||
File "D:\Лабы\mtusi2026lab5-work\tests\pipeline_support.py", line 11, in compose
|
||||
check(result.returncode == 0, 'Compose operator action failed: '+args[0])
|
||||
File "D:\Лабы\mtusi2026lab5-work\tests\client.py", line 24, in check
|
||||
raise Failure(message)
|
||||
client.Failure: Compose operator action failed: stats
|
||||
backpressure: 6 accepted, 4 rejected with 503, accepted jobs drained after recovery
|
||||
{"scenario": "two_replica_atomic_backpressure_recovery", "result": "PASS", "seconds": 12.922}
|
||||
PASS staging cleaned after safe result publication; no confirmed job lost; all pipeline fault invariants
|
||||
@@ -0,0 +1,67 @@
|
||||
[
|
||||
{
|
||||
"scenario": "commit_publish_api_broker_restart",
|
||||
"result": "PASS",
|
||||
"seconds": 82.968
|
||||
},
|
||||
{
|
||||
"scenario": "publish_confirm_db_mark_crash",
|
||||
"result": "PASS",
|
||||
"seconds": 16.953
|
||||
},
|
||||
{
|
||||
"scenario": "24_concurrent_duplicate_deliveries",
|
||||
"result": "PASS",
|
||||
"seconds": 15.985
|
||||
},
|
||||
{
|
||||
"scenario": "crash_before_effects",
|
||||
"result": "PASS",
|
||||
"seconds": 22.922
|
||||
},
|
||||
{
|
||||
"scenario": "crash_after_effects",
|
||||
"result": "PASS",
|
||||
"seconds": 21.687
|
||||
},
|
||||
{
|
||||
"scenario": "crash_after_commit",
|
||||
"result": "PASS",
|
||||
"seconds": 11.891
|
||||
},
|
||||
{
|
||||
"scenario": "crash_before_ack",
|
||||
"result": "PASS",
|
||||
"seconds": 18.938
|
||||
},
|
||||
{
|
||||
"scenario": "expired_lease_fences_old_worker",
|
||||
"result": "PASS",
|
||||
"seconds": 23.031
|
||||
},
|
||||
{
|
||||
"scenario": "hard_process_timeout_recovery",
|
||||
"result": "PASS",
|
||||
"seconds": 35.0
|
||||
},
|
||||
{
|
||||
"scenario": "new_version_then_stale_reordered_jobs",
|
||||
"result": "PASS",
|
||||
"seconds": 26.484
|
||||
},
|
||||
{
|
||||
"scenario": "permanent_failure_explicit_replay",
|
||||
"result": "PASS",
|
||||
"seconds": 15.031
|
||||
},
|
||||
{
|
||||
"scenario": "bounded_retry_explicit_replay",
|
||||
"result": "PASS",
|
||||
"seconds": 24.11
|
||||
},
|
||||
{
|
||||
"scenario": "two_replica_atomic_backpressure_recovery",
|
||||
"result": "PASS",
|
||||
"seconds": 14.75
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,16 @@
|
||||
durability: 202 -> outbox COMMIT without publisher; API restart; publish; broker restart while worker stopped; same jobs ready
|
||||
{"scenario": "commit_publish_api_broker_restart", "result": "PASS", "seconds": 82.968}
|
||||
{"scenario": "publish_confirm_db_mark_crash", "result": "PASS", "seconds": 16.953}
|
||||
{"scenario": "24_concurrent_duplicate_deliveries", "result": "PASS", "seconds": 15.985}
|
||||
{"scenario": "crash_before_effects", "result": "PASS", "seconds": 22.922}
|
||||
{"scenario": "crash_after_effects", "result": "PASS", "seconds": 21.687}
|
||||
{"scenario": "crash_after_commit", "result": "PASS", "seconds": 11.891}
|
||||
{"scenario": "crash_before_ack", "result": "PASS", "seconds": 18.938}
|
||||
{"scenario": "expired_lease_fences_old_worker", "result": "PASS", "seconds": 23.031}
|
||||
{"scenario": "hard_process_timeout_recovery", "result": "PASS", "seconds": 35.0}
|
||||
{"scenario": "new_version_then_stale_reordered_jobs", "result": "PASS", "seconds": 26.484}
|
||||
{"scenario": "permanent_failure_explicit_replay", "result": "PASS", "seconds": 15.031}
|
||||
{"scenario": "bounded_retry_explicit_replay", "result": "PASS", "seconds": 24.11}
|
||||
backpressure: 6 accepted, 4 rejected with 503, accepted jobs drained after recovery
|
||||
{"scenario": "two_replica_atomic_backpressure_recovery", "result": "PASS", "seconds": 14.75}
|
||||
PASS staging cleaned after safe result publication; no confirmed job lost; all pipeline fault invariants
|
||||
@@ -0,0 +1 @@
|
||||
PASS filename code-point limits: 255 ASCII and 255 emoji -> 202 and download 200; 256 emoji -> 400; long Content-Disposition accepted by LB
|
||||
@@ -0,0 +1 @@
|
||||
PASS history last-slot race: 10 simultaneous unique POSTs, exactly 1 committed and 9 rejected with 413; DB count equals configured limit
|
||||
@@ -0,0 +1,5 @@
|
||||
PASS anonymous direct S3 GET of existing original returns 403
|
||||
injected 49-million-pixel complete PNG into trusted staging with matching metadata
|
||||
PASS worker independently rejects >40 million pixels before full decode; FAILED on first attempt
|
||||
fresh orphan retained by grace
|
||||
PASS expired failed staging cleaned; unsafe replay refused; referenced ready bytes retained
|
||||
@@ -0,0 +1 @@
|
||||
PASS SIGKILL after S3 PUT before DB COMMIT: no confirmed response, DB rolled back, staged orphan unreferenced; same session uploads after recovery
|
||||
@@ -0,0 +1,51 @@
|
||||
Container mtusi2026lab5-work-db-1 Running
|
||||
Container mtusi2026lab5-work-redis-1 Running
|
||||
Container mtusi2026lab5-work-broker-1 Running
|
||||
Container mtusi2026lab5-work-minio-1 Running
|
||||
Container mtusi2026lab5-work-lb-1 Running
|
||||
Container mtusi2026lab5-work-api-1 Recreate
|
||||
Container mtusi2026lab5-work-api-2 Recreate
|
||||
Container mtusi2026lab5-work-api-2 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreate
|
||||
Container mtusi2026lab5-work-worker-1 Recreate
|
||||
Container mtusi2026lab5-work-worker-2 Recreate
|
||||
Container mtusi2026lab5-work-api-1 Recreated
|
||||
Container mtusi2026lab5-work-worker-1 Recreated
|
||||
Container mtusi2026lab5-work-dispatcher-1 Recreated
|
||||
Container mtusi2026lab5-work-worker-2 Recreated
|
||||
Container mtusi2026lab5-work-minio-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Starting
|
||||
Container mtusi2026lab5-work-minio-init-1 Started
|
||||
Container mtusi2026lab5-work-redis-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-init-1 Waiting
|
||||
Container mtusi2026lab5-work-db-1 Waiting
|
||||
Container mtusi2026lab5-work-db-1 Healthy
|
||||
Container mtusi2026lab5-work-redis-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Exited
|
||||
Container mtusi2026lab5-work-api-1 Starting
|
||||
Container mtusi2026lab5-work-api-1 Started
|
||||
Container mtusi2026lab5-work-api-2 Starting
|
||||
Container mtusi2026lab5-work-api-2 Started
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Waiting
|
||||
Container mtusi2026lab5-work-api-2 Waiting
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-broker-1 Healthy
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-worker-2 Starting
|
||||
Container mtusi2026lab5-work-api-1 Healthy
|
||||
Container mtusi2026lab5-work-api-2 Healthy
|
||||
Container mtusi2026lab5-work-dispatcher-1 Starting
|
||||
Container mtusi2026lab5-work-worker-2 Started
|
||||
Container mtusi2026lab5-work-worker-1 Starting
|
||||
Container mtusi2026lab5-work-dispatcher-1 Started
|
||||
Container mtusi2026lab5-work-worker-1 Started
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"profile": "6 accepted / 4 unavailable; 10 clients; 800x600 PNG",
|
||||
"limits": "API 512MiB, worker 1GiB, dispatcher 256MiB",
|
||||
"samples": 4,
|
||||
"peaks": {
|
||||
"mtusi2026lab5-work-api-1": {
|
||||
"sampled_peak_MiB": 389.0,
|
||||
"sampled_peak_CPU_percent": 12.75
|
||||
},
|
||||
"mtusi2026lab5-work-api-2": {
|
||||
"sampled_peak_MiB": 386.6,
|
||||
"sampled_peak_CPU_percent": 9.18
|
||||
},
|
||||
"mtusi2026lab5-work-lb-1": {
|
||||
"sampled_peak_MiB": 7.43,
|
||||
"sampled_peak_CPU_percent": 0.36
|
||||
},
|
||||
"mtusi2026lab5-work-db-1": {
|
||||
"sampled_peak_MiB": 51.21,
|
||||
"sampled_peak_CPU_percent": 36.81
|
||||
},
|
||||
"mtusi2026lab5-work-minio-1": {
|
||||
"sampled_peak_MiB": 347.1,
|
||||
"sampled_peak_CPU_percent": 7.46
|
||||
},
|
||||
"mtusi2026lab5-work-redis-1": {
|
||||
"sampled_peak_MiB": 3.273,
|
||||
"sampled_peak_CPU_percent": 3.45
|
||||
},
|
||||
"mtusi2026lab5-work-broker-1": {
|
||||
"sampled_peak_MiB": 4.016,
|
||||
"sampled_peak_CPU_percent": 7.71
|
||||
},
|
||||
"mtusi2026lab5-work-dispatcher-1": {
|
||||
"sampled_peak_MiB": 52.45,
|
||||
"sampled_peak_CPU_percent": 41.89
|
||||
},
|
||||
"mtusi2026lab5-work-worker-2": {
|
||||
"sampled_peak_MiB": 104.2,
|
||||
"sampled_peak_CPU_percent": 72.25
|
||||
},
|
||||
"mtusi2026lab5-work-worker-1": {
|
||||
"sampled_peak_MiB": 100.7,
|
||||
"sampled_peak_CPU_percent": 78.14
|
||||
}
|
||||
},
|
||||
"limitations": "discrete RSS/CPU samples, not true maximum or steady-state throughput"
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
/mtusi2026lab5-work-api-1 2026-11-06T17:47:15.389698037Z
|
||||
/mtusi2026lab5-work-api-2 2026-11-06T17:47:15.157720279Z
|
||||
/mtusi2026lab5-work-broker-1 2026-11-06T17:47:14.251335287Z
|
||||
/mtusi2026lab5-work-db-1 2026-11-06T17:47:15.036216414Z
|
||||
/mtusi2026lab5-work-dispatcher-1 2026-11-06T17:47:16.963493889Z
|
||||
/mtusi2026lab5-work-lb-1 2026-11-06T17:47:14.480124672Z
|
||||
/mtusi2026lab5-work-minio-1 2026-11-06T17:47:14.380498565Z
|
||||
/mtusi2026lab5-work-redis-1 2026-11-06T17:47:14.652341111Z
|
||||
/mtusi2026lab5-work-worker-1 2026-11-06T17:47:17.11010028Z
|
||||
/mtusi2026lab5-work-worker-2 2026-11-06T17:47:17.029609274Z
|
||||
@@ -0,0 +1,10 @@
|
||||
/mtusi2026lab5-work-api-1 2026-11-06T17:45:42.055001418Z
|
||||
/mtusi2026lab5-work-api-2 2026-11-06T17:45:42.343371976Z
|
||||
/mtusi2026lab5-work-broker-1 2026-11-06T17:38:02.613394188Z
|
||||
/mtusi2026lab5-work-db-1 2026-11-06T17:32:52.170574291Z
|
||||
/mtusi2026lab5-work-dispatcher-1 2026-11-06T17:46:33.939195709Z
|
||||
/mtusi2026lab5-work-lb-1 2026-11-06T17:32:52.242220543Z
|
||||
/mtusi2026lab5-work-minio-1 2026-11-06T17:32:52.070932492Z
|
||||
/mtusi2026lab5-work-redis-1 2026-11-06T17:32:51.719945618Z
|
||||
/mtusi2026lab5-work-worker-1 2026-11-06T17:46:34.217967009Z
|
||||
/mtusi2026lab5-work-worker-2 2026-11-06T17:46:33.645732539Z
|
||||
@@ -0,0 +1,16 @@
|
||||
Container mtusi2026lab5-work-api-1 Running
|
||||
Container mtusi2026lab5-work-db-1 Running
|
||||
Container mtusi2026lab5-work-minio-1 Running
|
||||
Container mtusi2026lab5-work-redis-1 Running
|
||||
Container mtusi2026lab5-work-minio-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Starting
|
||||
Container mtusi2026lab5-work-minio-init-1 Started
|
||||
Container mtusi2026lab5-work-redis-1 Waiting
|
||||
Container mtusi2026lab5-work-minio-init-1 Waiting
|
||||
Container mtusi2026lab5-work-db-1 Waiting
|
||||
Container mtusi2026lab5-work-db-1 Healthy
|
||||
Container mtusi2026lab5-work-redis-1 Healthy
|
||||
Container mtusi2026lab5-work-minio-init-1 Exited
|
||||
Container mtusi2026lab5-work-api-2 Starting
|
||||
Container mtusi2026lab5-work-api-2 Started
|
||||
@@ -0,0 +1 @@
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1 @@
|
||||
PASS: lab5 public API scenario; infrastructure and grading evidence remain separate.
|
||||
@@ -0,0 +1,159 @@
|
||||
{
|
||||
"src/main/java/ru/mtusi/messenger/MessengerLab1Application.java": "88c6dc51a1541bfb60067a346460ce03c54b38fbd2a948991800fed3cace3c36",
|
||||
"src/main/java/ru/mtusi/messenger/cache/CacheHealthTracker.java": "3f061f664b84ea0492e2bb61e154a595e7b3c6d18cc673fa95da6d69944ef737",
|
||||
"src/main/java/ru/mtusi/messenger/config/JacksonConfig.java": "39b987cd4529a9d34744bf55efc825b6cfb2bae93d77cc4330b73ed3475cc993",
|
||||
"src/main/java/ru/mtusi/messenger/config/MinioConfig.java": "f83fa7eb639d3bb3a69a25396b5956a7ae7fd14086dce095d1555523fa4f82af",
|
||||
"src/main/java/ru/mtusi/messenger/config/OpenApiConfig.java": "2abe3c50fcb7405743f7f75dde186961d8c6641f3afbfb5a5167f89245dc6155",
|
||||
"src/main/java/ru/mtusi/messenger/config/RateLimitConfig.java": "61c0979d9198e02ae93e1d88b220f36fb9e40cb6014047dc01c6a4808143057e",
|
||||
"src/main/java/ru/mtusi/messenger/config/RedisConfig.java": "38e4ab26af31cad16ad4c4d989948f2e7a4e4aff6774abe0d2659f407d129c88",
|
||||
"src/main/java/ru/mtusi/messenger/config/SecurityConfig.java": "868ed2cc13b62468a4163eaa0a7ef4edaff61de047ac4ec7184f0fca27091895",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/AppProperties.java": "351ecfb59fb0c88fec25deaa0abd82c772b1496eb70d03f54e55c254b3b6816c",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/IdempotencyProperties.java": "065ed8206d932c43a32568d60c6ba3f210073d27aa50322c3230a0f149cdd822",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/InstanceProperties.java": "0ec19bb2d242f6831ca113d25b0183aac98b6dad67b7a535226f3a54053ba65d",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/RateLimitProperties.java": "7fec3f5cf685f8381a7787b49f998a0c406f1aa83d15312607a115f8d98cba47",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/RedisProperties.java": "a9e0b2c81b83f490935d40c81c0b48b8de044deb6ef1c7a35d08b665f88ada4a",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/S3Properties.java": "9c53f5235bb5faad050a3e46b5ea3bbc3022b3ee644dd72816fe449aeb686df5",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/SessionProperties.java": "fcd1a5d72655ad35dcd24101a6b68a49e1ea60b14498cd34a5090e2893141d90",
|
||||
"src/main/java/ru/mtusi/messenger/config/properties/UploadProperties.java": "0af77902ba3345e8eb60dbbf3ee8e81b90e996647ed8ebff1d1102e04026eaba",
|
||||
"src/main/java/ru/mtusi/messenger/controller/AttachmentController.java": "19705b6da3010c26e423e8cc100c522ad9c8c01bc1b07a494a0cd710086db404",
|
||||
"src/main/java/ru/mtusi/messenger/controller/AttachmentsApi.java": "64bf2fc9c25bb161e28d900ba76e4b6d91c257ede01259ead9d63346ac26b80f",
|
||||
"src/main/java/ru/mtusi/messenger/controller/AuthApi.java": "45acd2b55d8c289f0daf9f70c0fc38477a633d92ccac6bf5735b533a7115e1b9",
|
||||
"src/main/java/ru/mtusi/messenger/controller/AuthController.java": "a5db3355b44a9f4cfe71d181b62668b9c7dcad2888b9ef33932034d23ba99873",
|
||||
"src/main/java/ru/mtusi/messenger/controller/ChatController.java": "49ef6e0e2135dfcd35a61cec7849835d6f2c75cc41e9d01c0b08e823c70034ba",
|
||||
"src/main/java/ru/mtusi/messenger/controller/ChatsApi.java": "dc4f021487ba1950094b0d53b3764c09252f1e3053b6930171093fa890cb8541",
|
||||
"src/main/java/ru/mtusi/messenger/controller/HealthApi.java": "f5f3645ea4ecb7043bc721aa6f245f3e1a9e1dbeab3de1af24a2c3db30ef686e",
|
||||
"src/main/java/ru/mtusi/messenger/controller/HealthController.java": "ca929dc4f5db7c3a380aa5a16e31755c5f98570a70a9c60f76e7a8b91096911e",
|
||||
"src/main/java/ru/mtusi/messenger/controller/MessageController.java": "c1c42e223bd3cd945fd27f911edad74a14a87502f0efbc9b43565f52576baf3e",
|
||||
"src/main/java/ru/mtusi/messenger/controller/MessagesApi.java": "8a085fabcef8a811bef855301304478f38b983c9fa2668c01db03259e433141f",
|
||||
"src/main/java/ru/mtusi/messenger/controller/UserController.java": "52082cf75de23b57eef6b211207e1a8508e5e22e4ae3ffefc010d5fe3f6d21a0",
|
||||
"src/main/java/ru/mtusi/messenger/controller/UsersApi.java": "2f95871d9334ae832c05b4a0a2b9b5faeddc44a036a2101fd8a64da033b56a21",
|
||||
"src/main/java/ru/mtusi/messenger/controller/controllerAdvice/GlobalExceptionHandler.java": "154bc885ee66e06899a9479a507122289e67dca84f992b7fd79eec558fa3e6cb",
|
||||
"src/main/java/ru/mtusi/messenger/dto/AttachmentDTO.java": "8a5ecfa0018bce8bb3be52cc9031613b23b0c4ca129a8dbca2898459c334f343",
|
||||
"src/main/java/ru/mtusi/messenger/dto/ChatDTO.java": "b9dbd4a8f043c5e1287c53d20c1b7d0aa9d713888cbd592c06fdd56a61e8bdd8",
|
||||
"src/main/java/ru/mtusi/messenger/dto/ChatPageDTO.java": "83306e7e8dd52eccb540302c5b96f49aee4d65200b984b19edd00ec03559ba85",
|
||||
"src/main/java/ru/mtusi/messenger/dto/CreateChatDTO.java": "170cba1f52075043d61ca81077ad2e67fb85cbfb15599ec8dfbc85d341e76604",
|
||||
"src/main/java/ru/mtusi/messenger/dto/CreateMessageDTO.java": "b76748a82ec6f1a88eca19e54034a65e152fb986262e37120ea9af45a2912ada",
|
||||
"src/main/java/ru/mtusi/messenger/dto/CreateUserDTO.java": "f8903c32dc8eca5dd306f579b2ee2a8c7c4ae0aa512f4534a477a412bb41f7c6",
|
||||
"src/main/java/ru/mtusi/messenger/dto/ErrorDTO.java": "29d73ad94c71db058faa3d915f32acaa939573687702c5a7153a6714061f00fe",
|
||||
"src/main/java/ru/mtusi/messenger/dto/ErrorErrorDTO.java": "87e0e171ac72c43f7435e5b219d3fe6380a8c940e7bb87958e2df7f70625ccf3",
|
||||
"src/main/java/ru/mtusi/messenger/dto/HealthDTO.java": "02306d373316c6f96278d97f7bd9fed76299b5eb79cffb5636f328d2d1de70d3",
|
||||
"src/main/java/ru/mtusi/messenger/dto/MessageDTO.java": "7d8d0cddaa326323099120b29da74bd8d62dda97d1641c6f7ba687bd3b2e84bf",
|
||||
"src/main/java/ru/mtusi/messenger/dto/MessagePageDTO.java": "4b4fd18119cfa542a5120142e6a03e310385525dd6e656fdcdde8d55a92382c2",
|
||||
"src/main/java/ru/mtusi/messenger/dto/SessionDTO.java": "90827f5fd5fef55ae3e183369a4f239e109c02fcd8ccffa2e8e1846553b4739a",
|
||||
"src/main/java/ru/mtusi/messenger/dto/UserDTO.java": "3629a3e031e9bcf84a602ac11bc95ae6a7870b25a0452543c24ae940d96a4cfb",
|
||||
"src/main/java/ru/mtusi/messenger/dto/VariantDTO.java": "7d7bb208f49ba07386e97c6e02e3bda912034c921a6b3b22c4f534951c6483c5",
|
||||
"src/main/java/ru/mtusi/messenger/exception/ApiErrorFactory.java": "62373a2a9e11fed20ae2a15b92446f3e3c6d4cea461e274bc5ff5a15fcb34f08",
|
||||
"src/main/java/ru/mtusi/messenger/exception/ConflictException.java": "80b1b6602b9fb74ed763b07905cd5d084d76a53b46e8e1d31734e29ccf9c6e6d",
|
||||
"src/main/java/ru/mtusi/messenger/exception/InvalidRequestException.java": "15c4970028f71a8ad6c8cbf317158754445e8f8b4b7414c88d9d56e59b803680",
|
||||
"src/main/java/ru/mtusi/messenger/exception/NotFoundException.java": "0be747b28a29ed79c032a4256f1e2ac92365d0282219dcd8e0608fa3e45dfbdb",
|
||||
"src/main/java/ru/mtusi/messenger/exception/PayloadTooLargeException.java": "14104310e0bed9c878c822d3269ec239dbbd9aa21916eb1b3df9ffe0a008bcfb",
|
||||
"src/main/java/ru/mtusi/messenger/exception/RateLimitedException.java": "cce2f144983ba1540e359d34bd4169746ea1eb7869ba6ae5dd59e41acca19166",
|
||||
"src/main/java/ru/mtusi/messenger/exception/ServiceUnavailableException.java": "79debd21b15f38917fa83340a44dd13543ee44317b17c2dbb706a3a4c44bc650",
|
||||
"src/main/java/ru/mtusi/messenger/exception/StaleAttachmentException.java": "5288d953312f8f8bb6f9a98ff4150fa64271827b0934dd9b354c2fd7ff8f11d4",
|
||||
"src/main/java/ru/mtusi/messenger/exception/StorageUnavailableException.java": "cdc2fe016cef32b0c93c8f51fb4b85b18cd8ed74051ff1fd4877882e469b23d9",
|
||||
"src/main/java/ru/mtusi/messenger/exception/UnauthorizedException.java": "251dc2ee2419729e44410d62c97a98eff08698c801f519c76e1fc0a62e55c8a3",
|
||||
"src/main/java/ru/mtusi/messenger/exception/UnsupportedMediaTypeException.java": "6a0573dba993ef765bc58ff0a4ce1aae0a1d7722cfecb8dc3858a7efc8245cad",
|
||||
"src/main/java/ru/mtusi/messenger/filter/InstanceIdFilter.java": "3e0112a9f90b79c433a6fbdf77afc20b1bf0387e693496d5c428c9c595f409f2",
|
||||
"src/main/java/ru/mtusi/messenger/filter/RateLimitFilter.java": "3d1e0ec75c63345acd42762a7c5b3e965acf3f254f92dc20a3b4667f2f56e089",
|
||||
"src/main/java/ru/mtusi/messenger/filter/RequestIdFilter.java": "217c4f3ae7288ac92d56fda6f61fcae9d01876c0dc6b085e27758e5ad23e7397",
|
||||
"src/main/java/ru/mtusi/messenger/mapper/AttachmentMapper.java": "75c549f7d843843ec502aeb0cff96f2b1cc841df8b8b66da1684dd0fc59c1128",
|
||||
"src/main/java/ru/mtusi/messenger/mapper/ChatMapper.java": "761f6fa8d28c16a4b798f609671e82273a17452821e3bf971f131afe3d00f35f",
|
||||
"src/main/java/ru/mtusi/messenger/mapper/MessageMapper.java": "099149f2060e90fdae382fa28fd3bfd3ec621b740a98a7a9bc8888f6ed649ed1",
|
||||
"src/main/java/ru/mtusi/messenger/mapper/SessionMapper.java": "daebe3300899220c98d26d29728d14c3801c1ba5a061411a7265fd321c6ac0e7",
|
||||
"src/main/java/ru/mtusi/messenger/mapper/UserMapper.java": "c05e950c85dcfedfed21ef5813b62bbdb8f642f2e172d5d4baea68ddaf294241",
|
||||
"src/main/java/ru/mtusi/messenger/model/Attachment.java": "c0076e1b7ff8b401d340d686ecab9446cddbc4c04e55277f31da7ef866d8aab1",
|
||||
"src/main/java/ru/mtusi/messenger/model/AttachmentStatus.java": "6aaa777b2b9042618c7bd25aa44a7c04e1983053d7272167bae16783a7072e79",
|
||||
"src/main/java/ru/mtusi/messenger/model/Chat.java": "997e6acb77cd3f34cfe5745015fefb3356521fec1a53a633e2d81af4b1a5d8ea",
|
||||
"src/main/java/ru/mtusi/messenger/model/IdempotencyKey.java": "d74360e291e3601afad564c463b85a9e89fef90351fa32d6cdd02a4fce4d9ffb",
|
||||
"src/main/java/ru/mtusi/messenger/model/Message.java": "c58fc53563602ee75bec4b492783261bf5fad5b1f3803333a5f7e2a7ce62fd98",
|
||||
"src/main/java/ru/mtusi/messenger/model/Session.java": "039980fd45fc2551f875958f34a40d6a155f9d10414dbe20875b25beaf16f96e",
|
||||
"src/main/java/ru/mtusi/messenger/model/User.java": "01ab578d2ecfedb739e03fc0107f097e3c98a2c7e3c267d351837902723b79c8",
|
||||
"src/main/java/ru/mtusi/messenger/repository/AttachmentRepository.java": "002f8318f97cb797068cc14b1826ece7dab096349e429b269c6395ba23f7f033",
|
||||
"src/main/java/ru/mtusi/messenger/repository/ChatRepository.java": "2336e381b0271ea744a1d58ab10ce97644a1d242c8ec180bbb79f072c79b8d70",
|
||||
"src/main/java/ru/mtusi/messenger/repository/IdempotencyRepository.java": "9e6fdb7b1c9ff7b32b182d223f06a2df5cbac851f875f285740cd7b71a78124b",
|
||||
"src/main/java/ru/mtusi/messenger/repository/MessageRepository.java": "21b00bd89a161206826cfa681b20019ba3140adc841f60d0c4b51b63603bca04",
|
||||
"src/main/java/ru/mtusi/messenger/repository/SessionRepository.java": "071c7d9c30dcc75356eb87324f309fc698aea72166545d0b06ac6052f8aa39ec",
|
||||
"src/main/java/ru/mtusi/messenger/repository/UserRepository.java": "f7bcc2b1dd0cc1a3ae35297cca1daa23579bdad56f8c5c491a4e61bc60a7ddff",
|
||||
"src/main/java/ru/mtusi/messenger/security/ApiAuthenticationEntryPoint.java": "ea207873b9717735bb28b2d41356e9a2104ad262c9fe33db0436f4a47fe98775",
|
||||
"src/main/java/ru/mtusi/messenger/security/BasicCredentials.java": "0f381c0e02d881d8463ca91ccdfbcc20c74bc21125bf7983e5b326e7f96e2e69",
|
||||
"src/main/java/ru/mtusi/messenger/security/SessionAuthenticationFilter.java": "645f6e3d6e04cc15611262602dbf0604be486f8b3c70ad3f9548b7df7ba5060b",
|
||||
"src/main/java/ru/mtusi/messenger/security/SessionAuthenticationProvider.java": "6e6bfc710105c45e25e46f84e454eec7f7fc578cc80dd693b739d5f6833edccc",
|
||||
"src/main/java/ru/mtusi/messenger/security/SessionAuthenticationToken.java": "231317a83df87a7dcd23114ce3ca42859f91c739f645f7b43209819797b2fe0d",
|
||||
"src/main/java/ru/mtusi/messenger/security/SessionPrincipal.java": "fff3d1d27cf7079947315a5a7e2e960f5f7e245a96a98157430cad474e4ab9f6",
|
||||
"src/main/java/ru/mtusi/messenger/service/AttachmentService.java": "d342caf93e51d5d9fbd4014f6d04c948826c2b374f137c398597a61318a49f66",
|
||||
"src/main/java/ru/mtusi/messenger/service/AttachmentVariantService.java": "015880d98f570597109f7eca26aedb3f6f24667c4b28ae62a9309420443793b1",
|
||||
"src/main/java/ru/mtusi/messenger/service/AuthService.java": "8d93d2f458fabef523ed6af97d2f8ed11ecd2b9b01a4eba4533fc31e22c148e4",
|
||||
"src/main/java/ru/mtusi/messenger/service/ChatService.java": "76f0e94e6ce6c6d3c9b8dfdda363d1b7a2f5017901e9cdeafc3a00f120f4a473",
|
||||
"src/main/java/ru/mtusi/messenger/service/HealthService.java": "ad7a32cbeed901b4913865e1a66e48d45cc35d0eb0f945e1e2eed27c4029d9fa",
|
||||
"src/main/java/ru/mtusi/messenger/service/IdempotencyService.java": "968b1d1f5037b19707a84d45cb8f3173b818c229dc3e3492ae9cb2eb53f21218",
|
||||
"src/main/java/ru/mtusi/messenger/service/MessageService.java": "5a11b2dac973d6b428c54c02605cc8e331f487135355cbef025c46195494c2b6",
|
||||
"src/main/java/ru/mtusi/messenger/service/ProcessingJobService.java": "47985c5fc559a1e675a6a15421146b697bf32c5d8ac551cab6fb9e9f6f524dc5",
|
||||
"src/main/java/ru/mtusi/messenger/service/SessionCacheService.java": "93aa66af0c14b8db8f07a38fdebbb367f79272324ec1db9ebdbe506c6da6000d",
|
||||
"src/main/java/ru/mtusi/messenger/service/SessionService.java": "6f9b61ae0ea28e74d32930f5ac079967c406f439cecda5d287713aa4de8ac421",
|
||||
"src/main/java/ru/mtusi/messenger/service/UserService.java": "cf9b9b2eeacba63314d2d883a0a0d59278c7a7a2897fca457b26eabf4e03c5e5",
|
||||
"src/main/java/ru/mtusi/messenger/util/CursorCodec.java": "f218c8f1380a9d15a49a2c790a614a967ac31ebc5a353cd4949b5edc4ec338ba",
|
||||
"src/main/java/ru/mtusi/messenger/util/TokenGenerator.java": "a8de6b5f2253b581f2cf1f9a2c04655ca5893ec1cc4b5e71058f2a2ae0617305",
|
||||
"src/main/java/ru/mtusi/messenger/util/TokenHasher.java": "86d2579f53463d2a180e9de12144c656643399ca57d681582347b4a8f794484d",
|
||||
"src/main/java/ru/mtusi/messenger/util/converter/IdempotencyPayloadConverter.java": "3fde1a9dd714ca64da80bc666a8d0bd8486c301e550cd0f55ac9327acba800ad",
|
||||
"src/main/java/ru/mtusi/messenger/validation/AttachmentValidator.java": "91e529f3eac82500341b25ea5c109b671aec7af150386e18d20cd3e9ffee5072",
|
||||
"src/main/java/ru/mtusi/messenger/validation/ChatValidator.java": "8fd4ba91aaa4e21dd2b372f17fdfd126d62a4039efacf1686f3e2b3143a5bd54",
|
||||
"src/main/java/ru/mtusi/messenger/validation/IdempotencyValidator.java": "99fe04376e875a2e63b5c884e7128dcddceaa200622033a5c8e7f9b411291683",
|
||||
"src/test/java/ru/mtusi/messenger/AttachmentIntegrationTest.java": "8d4498036d995cd2a60c071e66dfb1d9d0a075580935c2456dd313a924a21044",
|
||||
"src/test/java/ru/mtusi/messenger/MessengerLab1ApplicationTests.java": "d0e7aeee3b3c3c151b241a14e1c41c683401513bdd168e9d5b58fea4905f0132",
|
||||
"src/main/resources/db/migration/V1__init.sql": "b4a40c651fc3e8fb10c588f7374164dbe716bef508a3c7609e24a9284aaad894",
|
||||
"worker/pipeline/broker.py": "2d35ede652cc5068399c54f11c249216ba507cd44e7dd473c2fcfb9de680c630",
|
||||
"worker/pipeline/cleanup.py": "900f923625b362f0c8983b91ba9c10aee5cfe72f991990ef026f1da0f00708fd",
|
||||
"worker/pipeline/config.py": "bba3c1b90b751c0c91c872864178c8339f4b9ee7dc8da92edb9102c0c7ec98c0",
|
||||
"worker/pipeline/faults.py": "af5e7096351605a7e9353a409eb1ccc179281ee893bdc98f4d51240297a05bb0",
|
||||
"worker/pipeline/images.py": "c56c7cdc4ddaf271d1f66bbad88ae2e25a34dc8416e74dddc23abbc135bc7177",
|
||||
"worker/pipeline/main.py": "f5aca97d6ee4d3b262fe49eb052e3ae3501a38ab5d43c8843b56d63866da203e",
|
||||
"worker/pipeline/operator.py": "8ac54e1a8c69d3ebbb43e68df75d4417a673525d9a40efd1729d6fea33d9937c",
|
||||
"worker/pipeline/outbox.py": "bda994876088cdb9773646f08c09206cb20e76475b194ef5abf6e9032f793a74",
|
||||
"worker/pipeline/process.py": "990f82e04843f8cbf50a53271cae63b7729d1682ab2f1aa5c8a98d40dde8487e",
|
||||
"worker/pipeline/repository.py": "e67740be9db4102d3e1ae744089ba6f91e65d952a2f336fe87d4ea543cad3f51",
|
||||
"worker/pipeline/storage.py": "89d5675f9354c6692fb0f8c646dc09a6bc76ea1055eaa53d768cf3e8d4d1e004",
|
||||
"worker/pipeline/__init__.py": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
||||
"tests/client.py": "b318084e2a4c380db91a55d082190bf33979fa556a4c4ca87e01f46ae275775c",
|
||||
"tests/image_probe.py": "ef48d8882ab138b9699a173e7419e5814c22a10b01b6b0ddbb50ea49481a5baa",
|
||||
"tests/load.py": "9a9aff05e109630e243c3b092d7bd564344e4872b29e38b6618647a08460a72e",
|
||||
"tests/pipeline_ack_guard.py": "0477930ec4058f412c36f06427218d4786fb9d250b502d69fce658a74aa3dd44",
|
||||
"tests/pipeline_boundaries.py": "051277b8fea2026403a64e951c48d67abfed4aa4bfc06862b01749a4c3ca463f",
|
||||
"tests/pipeline_core.py": "2bbb8d77f0286fc551ea4b08a38268a027653d473bbe8bb13b53c8a11941aa98",
|
||||
"tests/pipeline_faults.py": "90ecd9babe860e9d556cee0c416a96f71617d8c627620796b832be15289969a7",
|
||||
"tests/pipeline_filename.py": "aaaa67ecd54e296181f490fb43a284dd51602b35b09ce7759ab42fbbccf57d9d",
|
||||
"tests/pipeline_history_capacity.py": "eaf6fd80c0c09d9fda2da5ae4aff6111d9f49b4726893081a24e29c1dd23041e",
|
||||
"tests/pipeline_retention.py": "2a2ddb427366b75b547934201d19135fb5fa3ffe4f2747375bd7269993e6e157",
|
||||
"tests/pipeline_support.py": "1530715f9b77f40f4a65f577fe9e9b714206b992d75f4d0de9a5c6d621cc16c0",
|
||||
"tests/pipeline_upload_crash.py": "a97912a371b17ca21c00c784cb93182a8ba876c7fa80eb4584128e1eef2b74dd",
|
||||
"tests/resilience.py": "4ba30b9c81a0664127ddab2b0bea5e76aa2087be8bb25aa13cd5a8e69be23fdd",
|
||||
"tests/smoke.py": "354e168e1e644145c3ff50bbbe189fd217cce5659aa125f588098025ffab0fdf",
|
||||
"scripts/bootstrap.ps1": "219760fe8b02c0cbdcb740da306cf1c47247b5b0455fd6912dd335f3ef65426c",
|
||||
"scripts/capture_evidence.py": "3ee3c2ccfc9fe119354680190581df163f14141e3bf98e293b5fe6896c7cc88f",
|
||||
"scripts/check_contract.py": "61e300fe5c1074360418e24b4653b12f96808247a2beaf2a64859aa360f81493",
|
||||
"scripts/check_migration.py": "3b971cb4cf9da7c9f557e2411e60bdc60cf1f86b8a419af99f040ec61ca49da2",
|
||||
"scripts/restart.cmd": "a8b170bd67efd9fd2cbd0db837984f826cf0f09c9b73754798b79ff481b1d589",
|
||||
"scripts/restart.example.sh": "7cbfc7f518b975ee3ca37a645359ff734ab0686789b795a9ac845789eb46fbd9",
|
||||
"scripts/restart.ps1": "2fcab11d9ed03fb89ba94717623a944e3a33e554ca8544578d3108e81422178d",
|
||||
"scripts/restart.sh": "82973884fc66475d630f1d2b91f2d0ccb1758370625a970d576a55c88848eebd",
|
||||
"scripts/run_tests.ps1": "7b1871d52bf2438635e43db0c0618c17dd366c29b54a0a2ddf6a132739bd3fca",
|
||||
"scripts/stop-one.cmd": "b636287c36f4c8f52e7840513506565bab0a1d480bb9187fdb40d1c0101616fa",
|
||||
"scripts/stop-one.example.sh": "6467c6e1515dee72982f85bced3f3862601ae0dbfafd4fd4818ef420f1dea040",
|
||||
"scripts/stop-one.ps1": "c60f70430dbea3916c68011ad5ccbaf329a44a43f1e2d55f33597e4a495cc0b6",
|
||||
"scripts/stop-one.sh": "fec1a774f4387676b8b6adf2398a41e7b0108a0bc745103a3079b23acfe6f668",
|
||||
"scripts/style.py": "aad155a2ea25a385289ce920049a6ecaa1f91cd5366d1cb80a2f3165a0750fd4",
|
||||
"scripts/validate_openapi.py": "cd7a33221b1860c5d2330e52afa6cb222d375db671ae9ab379ba51a0d3a77946",
|
||||
"build.gradle": "aa16867c650e97a151e19bfcd7c6e66397542390c54dda1de2bab12d20d67c3a",
|
||||
"settings.gradle": "565869e78610c6cd4d55f73a5c486ebd783b0eec8f607f7a7c85f3e282fde456",
|
||||
".editorconfig": "e1f0d4738f5eb17f62588ed013a0de9b6be25d623f0abb1f02ed44a6fb8131e5",
|
||||
"pyproject.toml": "3a54c899a2fe6161e250aab62f9fa45ec6715846c18b03d7fb2ab22fa38b3490",
|
||||
"requirements-tools.txt": "511c29a1ec610b3e6af95481c42f26971b6c2ba787a4e05d3c9e1219b0924571",
|
||||
"gradle/wrapper/gradle-wrapper.properties": "f855a38f15e05a8375ddb6ea469f2be1c1daec015ce8cc2ad23800e5dc7259e5",
|
||||
"Dockerfile": "2fbfdcc303f7c6c6cdd69ce810ae87606eb2230b4ec0556875560017379b107e",
|
||||
"worker/Dockerfile": "a74e733543ace54c6b4984f4cac72cc940ddf494a0379b999e9beed941a30a0d",
|
||||
"worker/requirements.txt": "750c639863396d20746f3730704cf8dc9432a78ec8757876124afbfe2a005ecd",
|
||||
"docker-compose.yml": "46ee52c03980587c3f8c773619920ab667e26ba0983b23ff542cf3d2735ead1f",
|
||||
"compose.test.yaml": "6682c8f1f6fe539cea111cf0c3b0dce08a167144137f01a342a15c2d8b2c7cab",
|
||||
"compose.local.yaml": "ac71af616f79b7143146519c17f38f75ecd96d16fadf842824dd3e9141180632",
|
||||
"nginx.conf": "fa52e0f797114d88b0eb3bbf0d2e7c574663d09a29f78a42c9a0715c0a0d0e8e",
|
||||
"policy.json": "df8ef175cfca7a4d20d835fd605db8c7de1e96eea2a1b1fa4b8eb8b091ef2f66"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
/mtusi2026lab5-work-api-2 47ab05827b25 exited
|
||||
@@ -0,0 +1 @@
|
||||
/mtusi2026lab5-work-api-2 47ab05827b25 running
|
||||
@@ -0,0 +1,4 @@
|
||||
All done! ✨ 🍰 ✨
|
||||
23 files left unchanged.
|
||||
PASS 14 controller operations: one service call, constructor DI, API Javadoc
|
||||
PASS Java AOSP / Python Black style
|
||||
@@ -0,0 +1,4 @@
|
||||
All done! ✨ 🍰 ✨
|
||||
24 files would be left unchanged.
|
||||
PASS 14 controller operations: one service call, constructor DI, API Javadoc
|
||||
PASS Java AOSP / Python Black style
|
||||
@@ -0,0 +1,18 @@
|
||||
Started: 2026-11-06T20:19:37.7882627+03:00
|
||||
style exit=0 at 2026-11-06T20:19:41.3540542+03:00
|
||||
contract-check exit=0 at 2026-11-06T20:19:41.5720023+03:00
|
||||
openapi-validation exit=0 at 2026-11-06T20:19:43.4033666+03:00
|
||||
java-build exit=0 at 2026-11-06T20:19:56.9025216+03:00
|
||||
docker-build exit=0 at 2026-11-06T20:22:03.1048119+03:00
|
||||
smoke exit=0 at 2026-11-06T20:22:13.5546723+03:00
|
||||
pipeline-core exit=0 at 2026-11-06T20:22:28.3452619+03:00
|
||||
pipeline-faults exit=0 at 2026-11-06T20:28:20.6413608+03:00
|
||||
pipeline-retention exit=0 at 2026-11-06T20:28:43.1203968+03:00
|
||||
pipeline-boundaries exit=0 at 2026-11-06T20:29:07.3341301+03:00
|
||||
pipeline-ack-guard exit=0 at 2026-11-06T20:29:45.5193303+03:00
|
||||
pipeline-filename exit=0 at 2026-11-06T20:29:49.1817412+03:00
|
||||
pipeline-upload-crash exit=0 at 2026-11-06T20:31:20.5502923+03:00
|
||||
production-restore exit=0 at 2026-11-06T20:32:11.7886071+03:00
|
||||
load exit=0 at 2026-11-06T20:32:46.1632974+03:00
|
||||
persistence exit=0 at 2026-11-06T20:33:26.1894727+03:00
|
||||
failover exit=1 at 2026-11-06T20:33:30.8789358+03:00
|
||||
@@ -0,0 +1,23 @@
|
||||
Started: 2026-11-06T20:34:11.5034866+03:00
|
||||
style exit=0 at 2026-11-06T20:34:15.0425754+03:00
|
||||
contract-check exit=0 at 2026-11-06T20:34:15.3198638+03:00
|
||||
openapi-validation exit=0 at 2026-11-06T20:34:17.1914904+03:00
|
||||
java-build exit=0 at 2026-11-06T20:34:30.8501324+03:00
|
||||
docker-build exit=0 at 2026-11-06T20:36:19.9337260+03:00
|
||||
smoke exit=0 at 2026-11-06T20:36:32.2110764+03:00
|
||||
pipeline-core exit=0 at 2026-11-06T20:36:47.2794544+03:00
|
||||
pipeline-faults exit=0 at 2026-11-06T20:42:20.2554765+03:00
|
||||
pipeline-retention exit=0 at 2026-11-06T20:42:40.8460316+03:00
|
||||
pipeline-boundaries exit=0 at 2026-11-06T20:43:03.9474931+03:00
|
||||
pipeline-ack-guard exit=0 at 2026-11-06T20:43:43.9068820+03:00
|
||||
pipeline-filename exit=0 at 2026-11-06T20:43:47.2571637+03:00
|
||||
pipeline-upload-crash exit=0 at 2026-11-06T20:45:27.3689423+03:00
|
||||
pipeline-history-capacity exit=0 at 2026-11-06T20:45:34.2556420+03:00
|
||||
production-restore exit=0 at 2026-11-06T20:46:34.6430758+03:00
|
||||
load exit=0 at 2026-11-06T20:47:09.3453898+03:00
|
||||
persistence exit=0 at 2026-11-06T20:47:47.6874649+03:00
|
||||
failover exit=0 at 2026-11-06T20:48:09.2515497+03:00
|
||||
restore-api exit=0 at 2026-11-06T20:48:11.6757144+03:00
|
||||
smoke exit=0 at 2026-11-06T20:48:17.2700600+03:00
|
||||
capture exit=0 at 2026-11-06T20:48:54.5343891+03:00
|
||||
PASS all executable lab5 tests, validation and style checks
|
||||
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"name": "ru.mtusi.messenger.AttachmentIntegrationTest",
|
||||
"tests": "3",
|
||||
"skipped": "0",
|
||||
"failures": "0",
|
||||
"errors": "0",
|
||||
"timestamp": "2026-11-06T18:03:20.341Z",
|
||||
"time": "6.171"
|
||||
},
|
||||
{
|
||||
"name": "ru.mtusi.messenger.MessengerLab1ApplicationTests",
|
||||
"tests": "1",
|
||||
"skipped": "0",
|
||||
"failures": "0",
|
||||
"errors": "0",
|
||||
"timestamp": "2026-11-06T18:03:26.516Z",
|
||||
"time": "0.248"
|
||||
}
|
||||
]
|
||||
Vendored
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+93
@@ -0,0 +1,93 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
access_log /tmp/access.log;
|
||||
error_log /tmp/error.log warn;
|
||||
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
resolver_timeout 5s;
|
||||
|
||||
upstream api_backend {
|
||||
zone api_backend 64k;
|
||||
server api:8080 resolve max_fails=1 fail_timeout=5s;
|
||||
keepalive 32;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
client_max_body_size 0;
|
||||
client_body_timeout 15s;
|
||||
|
||||
location / {
|
||||
proxy_pass http://api_backend;
|
||||
proxy_http_version 1.1;
|
||||
proxy_request_buffering off;
|
||||
proxy_buffer_size 8k;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
|
||||
proxy_next_upstream error timeout http_502 http_504;
|
||||
proxy_next_upstream_tries 3;
|
||||
|
||||
proxy_connect_timeout 1s;
|
||||
proxy_send_timeout 10s;
|
||||
proxy_read_timeout 10s;
|
||||
}
|
||||
}
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"s3:GetObject",
|
||||
"s3:PutObject",
|
||||
"s3:DeleteObject",
|
||||
"s3:ListBucket",
|
||||
"s3:GetBucketLocation",
|
||||
"s3:AbortMultipartUpload",
|
||||
"s3:ListMultipartUploadParts"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:s3:::messenger-attachments",
|
||||
"arn:aws:s3:::messenger-attachments/*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
[tool.black]
|
||||
line-length = 100
|
||||
target-version = ['py39']
|
||||
@@ -0,0 +1,4 @@
|
||||
-r requirements-dev.txt
|
||||
black==25.9.0
|
||||
Pillow==12.0.0
|
||||
jsonschema==4.26.0
|
||||
@@ -0,0 +1,12 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
New-Item -ItemType Directory -Force secrets | Out-Null
|
||||
$values = @{postgres_db='messenger'; postgres_user='messenger'; postgres_password=''; minio_root_user='labadmin'; minio_root_password=''; s3_access_key_id='labapi'; s3_secret_access_key=''}
|
||||
foreach ($name in $values.Keys) {
|
||||
$path = Join-Path secrets ($name + '.txt')
|
||||
if (!(Test-Path -LiteralPath $path)) {
|
||||
$value = $values[$name]
|
||||
if (!$value) { $value = [Convert]::ToBase64String([System.Security.Cryptography.RandomNumberGenerator]::GetBytes(32)) }
|
||||
[System.IO.File]::WriteAllText((Join-Path (Get-Location) $path), $value)
|
||||
}
|
||||
}
|
||||
if (!(Test-Path .env)) { Copy-Item .env.example .env }
|
||||
@@ -0,0 +1,211 @@
|
||||
import hashlib
|
||||
import json
|
||||
import math
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from datetime import datetime, timezone, timedelta
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
from pipeline_support import compose, sql, broker, ready_api
|
||||
|
||||
|
||||
def main():
|
||||
ready_api()
|
||||
stamp = datetime.now(timezone(timedelta(hours=3))).isoformat()
|
||||
ids = compose("ps", "-q").splitlines()
|
||||
inspection = json.loads(subprocess.check_output(["docker", "inspect", *ids], text=True))
|
||||
allowed = {
|
||||
"ROLE",
|
||||
"JOB_MAX_ATTEMPTS",
|
||||
"JOB_TIMEOUT_SECONDS",
|
||||
"JOB_LEASE_SECONDS",
|
||||
"MAX_PENDING_JOBS",
|
||||
"FAULT_INJECTION_ENABLED",
|
||||
}
|
||||
containers = []
|
||||
for item in inspection:
|
||||
environment = {
|
||||
v.split("=", 1)[0]: v.split("=", 1)[1]
|
||||
for v in item["Config"]["Env"]
|
||||
if v.split("=", 1)[0] in allowed
|
||||
}
|
||||
containers.append(
|
||||
{
|
||||
"name": item["Name"],
|
||||
"image": item["Image"],
|
||||
"started_at": item["State"]["StartedAt"],
|
||||
"state": item["State"]["Status"],
|
||||
"health": item["State"].get("Health", {}).get("Status"),
|
||||
"volumes": [
|
||||
{"name": m["Name"], "target": m["Destination"]}
|
||||
for m in item["Mounts"]
|
||||
if m["Type"] == "volume"
|
||||
],
|
||||
"memory_limit_bytes": item["HostConfig"]["Memory"],
|
||||
"nano_cpus": item["HostConfig"]["NanoCpus"],
|
||||
"profile": environment,
|
||||
}
|
||||
)
|
||||
info = {
|
||||
"time_moscow": stamp,
|
||||
"base_commit": subprocess.check_output(["git", "rev-parse", "HEAD"], text=True).strip(),
|
||||
"source_lab4": "cc0ef71",
|
||||
"worktree": "modified; source hashes below",
|
||||
"docker": subprocess.check_output(
|
||||
["docker", "info", "--format", "{{.ServerVersion}} CPU={{.NCPU}} RAM={{.MemTotal}}"],
|
||||
text=True,
|
||||
).strip(),
|
||||
"containers": containers,
|
||||
"job_states": sql(
|
||||
"select status,count(*) from processing_jobs group by status order by status;"
|
||||
),
|
||||
"redis_durability": broker("CONFIG", "GET", "appendonly", "appendfsync"),
|
||||
"broker_stream_entries": broker("XLEN", "attachment-jobs"),
|
||||
"broker_publication_index_entries": broker("HLEN", "job-publications"),
|
||||
}
|
||||
(ROOT / "evidence/environment.json").write_text(json.dumps(info, ensure_ascii=False, indent=2))
|
||||
capture_schema()
|
||||
capture_metrics()
|
||||
capture_final_checks()
|
||||
files = list((ROOT / "src").rglob("*.java")) + list(
|
||||
(ROOT / "src/main/resources").rglob("*.sql")
|
||||
)
|
||||
files += (
|
||||
list((ROOT / "worker").rglob("*.py"))
|
||||
+ list((ROOT / "tests").glob("*.py"))
|
||||
+ list((ROOT / "scripts").glob("*"))
|
||||
)
|
||||
files += [
|
||||
ROOT / p
|
||||
for p in [
|
||||
"build.gradle",
|
||||
"settings.gradle",
|
||||
".editorconfig",
|
||||
"pyproject.toml",
|
||||
"requirements-tools.txt",
|
||||
"gradle/wrapper/gradle-wrapper.properties",
|
||||
"Dockerfile",
|
||||
"worker/Dockerfile",
|
||||
"worker/requirements.txt",
|
||||
"docker-compose.yml",
|
||||
"compose.test.yaml",
|
||||
"compose.local.yaml",
|
||||
"nginx.conf",
|
||||
"policy.json",
|
||||
]
|
||||
]
|
||||
manifest = {
|
||||
p.relative_to(ROOT).as_posix(): hashlib.sha256(p.read_bytes()).hexdigest()
|
||||
for p in files
|
||||
if p.is_file()
|
||||
}
|
||||
(ROOT / "evidence/source-sha256.json").write_text(json.dumps(manifest, indent=2))
|
||||
summary = [
|
||||
{k: v for k, v in ET.parse(p).getroot().attrib.items() if k != "hostname"}
|
||||
for p in (ROOT / "build/test-results/test").glob("TEST-*.xml")
|
||||
]
|
||||
(ROOT / "evidence/unit-summary.json").write_text(json.dumps(summary, indent=2))
|
||||
targets = re.findall(r"\]\(([^)]+)\)", (ROOT / "REPORT.md").read_text())
|
||||
missing = [t for t in targets if not t.startswith(("http", "#")) and not (ROOT / t).exists()]
|
||||
if missing:
|
||||
raise AssertionError("Missing report links: " + str(missing))
|
||||
print("PASS environment, job schema, metrics, source hashes and report links")
|
||||
|
||||
|
||||
def capture_schema():
|
||||
from jsonschema import Draft202012Validator, FormatChecker
|
||||
|
||||
schema = json.loads((ROOT / "contracts/jobs.schema.json").read_text())
|
||||
validator = Draft202012Validator(schema, format_checker=FormatChecker())
|
||||
payloads = json.loads(
|
||||
sql("select coalesce(json_agg(payload),'[]'::json) from processing_outbox;")
|
||||
)
|
||||
for payload in payloads:
|
||||
validator.validate(payload)
|
||||
(ROOT / "evidence/job-schema.json").write_text(
|
||||
json.dumps({"validated_outbox_templates": len(payloads), "valid": True}, indent=2)
|
||||
)
|
||||
|
||||
|
||||
def capture_final_checks():
|
||||
public = [
|
||||
"README.md",
|
||||
"lab.json",
|
||||
"contracts",
|
||||
"tests/client.py",
|
||||
"tests/smoke.py",
|
||||
"tests/resilience.py",
|
||||
"tests/load.py",
|
||||
"tests/image_probe.py",
|
||||
]
|
||||
subprocess.run(["git", "diff", "--exit-code", "--", *public], cwd=ROOT, check=True)
|
||||
subprocess.run(["git", "diff", "--check"], cwd=ROOT, check=True)
|
||||
names = (
|
||||
subprocess.check_output(
|
||||
["git", "ls-files", "--cached", "--others", "--exclude-standard", "-z"], cwd=ROOT
|
||||
)
|
||||
.decode("utf-8")
|
||||
.split("\0")
|
||||
)
|
||||
credentials = [
|
||||
path.read_bytes().strip()
|
||||
for path in (ROOT / "secrets").glob("*.txt")
|
||||
if "password" in path.stem or "secret" in path.stem
|
||||
]
|
||||
for name in filter(None, names):
|
||||
path = ROOT / name
|
||||
if path.is_file() and any(value and value in path.read_bytes() for value in credentials):
|
||||
raise AssertionError("Local credential value found in a Git-visible file")
|
||||
subprocess.run(["git", "check-ignore", "--quiet", ".env"], cwd=ROOT, check=True)
|
||||
for path in (ROOT / "secrets").glob("*.txt"):
|
||||
subprocess.run(["git", "check-ignore", "--quiet", str(path)], cwd=ROOT, check=True)
|
||||
(ROOT / "evidence/final-checks.txt").write_text(
|
||||
"PASS public lab5 assignment, contract and executable tests unchanged\n"
|
||||
"PASS no local credential values in Git-visible files; secrets and .env ignored\n"
|
||||
"PASS git diff --check\n"
|
||||
"Controller DI, single service call, API Javadoc and formatting: evidence/style.txt\n"
|
||||
)
|
||||
|
||||
|
||||
def capture_metrics():
|
||||
raw = json.loads((ROOT / "evidence/backpressure.json").read_text())
|
||||
peaks = {}
|
||||
for sample in raw["stats_samples"]:
|
||||
for name, value, unit, cpu in re.findall(
|
||||
r"(\S+) ([\d.]+)(KiB|MiB|GiB) / \S+ ([\d.]+)%", sample
|
||||
):
|
||||
value = float(value) * {"KiB": 1 / 1024, "MiB": 1, "GiB": 1024}[unit]
|
||||
current = peaks.setdefault(name, {"sampled_peak_MiB": 0, "sampled_peak_CPU_percent": 0})
|
||||
current["sampled_peak_MiB"] = max(current["sampled_peak_MiB"], value)
|
||||
current["sampled_peak_CPU_percent"] = max(
|
||||
current["sampled_peak_CPU_percent"], float(cpu)
|
||||
)
|
||||
result = {
|
||||
"profile": "6 accepted / 4 unavailable; 10 clients; 800x600 PNG",
|
||||
"limits": "API 512MiB, worker 1GiB, dispatcher 256MiB",
|
||||
"samples": len(raw["stats_samples"]),
|
||||
"peaks": peaks,
|
||||
"limitations": "discrete RSS/CPU samples, not true maximum or steady-state throughput",
|
||||
}
|
||||
(ROOT / "evidence/resource-summary.json").write_text(json.dumps(result, indent=2))
|
||||
observations = sorted(raw["seconds_to_observed_ready"])
|
||||
drain = {
|
||||
"observed_ready_seconds": {
|
||||
str(p): observations[max(0, math.ceil(p / 100 * len(observations)) - 1)]
|
||||
for p in (50, 95, 99)
|
||||
},
|
||||
"accepted": raw["accepted"],
|
||||
"expected_unavailable": raw["rejected"],
|
||||
"image_bytes": raw["image_bytes"],
|
||||
"polling_and_startup_included": True,
|
||||
"interpretation": "upper bounds from sequential polls, n=6; not a steady-state latency SLA",
|
||||
}
|
||||
(ROOT / "evidence/drain-summary.json").write_text(json.dumps(drain, indent=2))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,62 @@
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
sys.path.insert(0, str(ROOT / "tests"))
|
||||
from pipeline_support import compose, sql
|
||||
|
||||
|
||||
def database_command(program, database, *arguments, data=None):
|
||||
command = program + ' -U "$(cat /run/secrets/postgres_user)" "$@"'
|
||||
return compose("exec", "-T", "db", "sh", "-c", command, "sh", *arguments, database, data=data)
|
||||
|
||||
|
||||
def schema(database):
|
||||
dump = database_command(
|
||||
"pg_dump",
|
||||
database,
|
||||
"--schema-only",
|
||||
"--no-owner",
|
||||
"--no-privileges",
|
||||
"--exclude-table=public.flyway_schema_history",
|
||||
)
|
||||
return "\n".join(
|
||||
line
|
||||
for line in dump.splitlines()
|
||||
if not line.startswith(("\\restrict ", "\\unrestrict ", "-- Dumped "))
|
||||
)
|
||||
|
||||
|
||||
def main():
|
||||
files = sorted((ROOT / "src/main/resources/db/migration").glob("*.sql"))
|
||||
if [path.name for path in files] != ["V1__init.sql"]:
|
||||
raise AssertionError("Expected exactly V1__init.sql")
|
||||
database = "proof_v1_" + uuid.uuid4().hex
|
||||
current = sql("select current_database();")
|
||||
sql('create database "' + database + '";')
|
||||
try:
|
||||
database_command("psql", database, "-v", "ON_ERROR_STOP=1", data=files[0].read_text())
|
||||
actual, expected = schema(database), schema(current)
|
||||
if actual != expected:
|
||||
raise AssertionError("Fresh V1 schema differs from existing migrated schema")
|
||||
result = {
|
||||
"migration": files[0].name,
|
||||
"migration_sha256": hashlib.sha256(files[0].read_bytes()).hexdigest(),
|
||||
"schema_sha256": hashlib.sha256(actual.encode()).hexdigest(),
|
||||
"equivalent_to_existing_schema": True,
|
||||
"excludes": "Flyway history and pg_dump random restriction tokens",
|
||||
"temporary_database_removed": True,
|
||||
}
|
||||
finally:
|
||||
sql('drop database "' + database + '" with (force);')
|
||||
(ROOT / "evidence/migration-check.json").write_text(json.dumps(result, indent=2))
|
||||
print(
|
||||
"PASS one V1__init.sql; fresh PostgreSQL schema equals existing V1-V4 schema; temporary DB removed"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1 @@
|
||||
@powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0restart.ps1"
|
||||
@@ -0,0 +1,9 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ids = docker compose ps -q
|
||||
$before = docker inspect --format '{{.Name}} {{.State.StartedAt}}' $ids
|
||||
$before | Set-Content evidence/restart-before.txt
|
||||
docker compose restart db redis minio broker api worker dispatcher lb
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
$ids = docker compose ps -q
|
||||
$after = docker inspect --format '{{.Name}} {{.State.StartedAt}}' $ids
|
||||
$after | Set-Content evidence/restart-after.txt
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
docker compose restart db redis minio broker api worker dispatcher lb
|
||||
@@ -0,0 +1,47 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Set-Location (Split-Path $PSScriptRoot -Parent)
|
||||
$env:BASE_URL = 'http://127.0.0.1:18085'
|
||||
$production = @('compose', '-f', 'docker-compose.yml', '-f', 'compose.local.yaml')
|
||||
$testing = $production + @('-f', 'compose.test.yaml')
|
||||
$summary = 'evidence/test-suite.txt'
|
||||
"Started: $([DateTimeOffset]::Now.ToString('o'))" | Set-Content $summary
|
||||
|
||||
function Invoke-Check {
|
||||
param([string]$Name, [string]$Executable, [string[]]$Arguments)
|
||||
Write-Host "Running $Name"
|
||||
& $Executable @Arguments *> "evidence/$Name.txt"
|
||||
$result = $LASTEXITCODE
|
||||
"$Name exit=$result at $([DateTimeOffset]::Now.ToString('o'))" | Add-Content $summary
|
||||
if ($result -ne 0) {
|
||||
Get-Content "evidence/$Name.txt" -Tail 30
|
||||
throw "$Name failed ($result)"
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
Invoke-Check 'style' 'py' @('scripts/style.py')
|
||||
Invoke-Check 'contract-check' 'py' @('scripts/check_contract.py')
|
||||
Invoke-Check 'openapi-validation' 'py' @('scripts/validate_openapi.py')
|
||||
Invoke-Check 'java-build' '.\gradlew.bat' @('test', '--rerun-tasks')
|
||||
Invoke-Check 'docker-build' 'docker' ($testing + @('up', '-d', '--build'))
|
||||
& py -c "import sys;sys.path.insert(0,'tests');from pipeline_support import ready_api;ready_api()"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'API not ready' }
|
||||
foreach ($name in @('smoke', 'pipeline_core', 'pipeline_faults', 'pipeline_retention', 'pipeline_boundaries', 'pipeline_ack_guard', 'pipeline_filename', 'pipeline_upload_crash', 'pipeline_history_capacity')) {
|
||||
Invoke-Check ($name.Replace('_', '-')) 'py' @("tests/$name.py")
|
||||
}
|
||||
Invoke-Check 'production-restore' 'docker' ($production + @('up', '-d'))
|
||||
& py -c "import sys;sys.path.insert(0,'tests');from pipeline_support import ready_api;ready_api()"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'production API not ready' }
|
||||
Invoke-Check 'load' 'py' @('tests/load.py', '--duration', '30', '--concurrency', '4', '--output', 'evidence/load.json')
|
||||
Invoke-Check 'persistence' 'py' @('tests/resilience.py', '--mode', 'persistence', '--action-script', 'scripts/restart.cmd')
|
||||
& py -c "import sys;sys.path.insert(0,'tests');from pipeline_support import ready_api;ready_api()"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Two routable API replicas required before failover' }
|
||||
Invoke-Check 'failover' 'py' @('tests/resilience.py', '--mode', 'failover', '--action-script', 'scripts/stop-one.cmd')
|
||||
Invoke-Check 'restore-api' 'docker' ($production + @('up', '-d', 'api'))
|
||||
Invoke-Check 'smoke' 'py' @('tests/smoke.py')
|
||||
Invoke-Check 'capture' 'py' @('scripts/capture_evidence.py')
|
||||
'PASS all executable lab5 tests, validation and style checks' | Add-Content $summary
|
||||
} finally {
|
||||
& docker @production up -d
|
||||
if ($LASTEXITCODE -ne 0) { throw 'Failed to restore production profile' }
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
@powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0stop-one.ps1"
|
||||
@@ -0,0 +1,13 @@
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$replicas = docker compose ps -q api
|
||||
foreach ($replica in $replicas) {
|
||||
$alias = docker inspect --format '{{.Config.Hostname}}' $replica
|
||||
if ($alias -eq $env:TARGET_INSTANCE_ID) {
|
||||
docker inspect --format "{{.Name}} {{.Config.Hostname}} {{.State.Status}}" $replica | Set-Content evidence/stop-one-before.txt
|
||||
docker stop --time 2 $replica
|
||||
$result = $LASTEXITCODE
|
||||
docker inspect --format "{{.Name}} {{.Config.Hostname}} {{.State.Status}}" $replica | Set-Content evidence/stop-one-after.txt
|
||||
exit $result
|
||||
}
|
||||
}
|
||||
exit 1
|
||||
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
for id in $(docker compose ps -q api); do
|
||||
if [ "$(docker inspect --format '{{.Config.Hostname}}' "$id")" = "$TARGET_INSTANCE_ID" ]; then
|
||||
docker stop -t 2 "$id"
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
exit 1
|
||||
@@ -0,0 +1,88 @@
|
||||
import argparse
|
||||
import hashlib
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import urllib.request
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
VERSION = "1.28.0"
|
||||
SHA256 = "32342e7c1b4600f80df3471da46aee8012d3e1445d5ea1be1fb71289b07cc735"
|
||||
|
||||
|
||||
def formatter():
|
||||
jar = Path(tempfile.gettempdir()) / f"google-java-format-{VERSION}-all-deps.jar"
|
||||
if not jar.exists():
|
||||
url = (
|
||||
"https://repo.maven.apache.org/maven2/com/google/googlejavaformat/"
|
||||
f"google-java-format/{VERSION}/{jar.name}"
|
||||
)
|
||||
with urllib.request.urlopen(url, timeout=60) as response:
|
||||
jar.write_bytes(response.read())
|
||||
if hashlib.sha256(jar.read_bytes()).hexdigest() != SHA256:
|
||||
raise RuntimeError("Java formatter checksum mismatch")
|
||||
return jar
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--apply", action="store_true")
|
||||
args = parser.parse_args()
|
||||
java_home = os.environ.get("JAVA_HOME")
|
||||
java = str(Path(java_home) / "bin" / "java") if java_home else "java"
|
||||
files = sorted(str(p.relative_to(ROOT)) for p in (ROOT / "src").rglob("*.java"))
|
||||
mode = ["--replace"] if args.apply else ["--dry-run", "--set-exit-if-changed"]
|
||||
subprocess.run([java, "-jar", str(formatter()), "--aosp", *mode, *files], cwd=ROOT, check=True)
|
||||
python = [
|
||||
"worker/pipeline",
|
||||
"scripts/style.py",
|
||||
"scripts/capture_evidence.py",
|
||||
"scripts/check_migration.py",
|
||||
]
|
||||
python += sorted(str(p.relative_to(ROOT)) for p in (ROOT / "tests").glob("pipeline_*.py"))
|
||||
subprocess.run(
|
||||
[sys.executable, "-m", "black", *([] if args.apply else ["--check"]), *python],
|
||||
cwd=ROOT,
|
||||
check=True,
|
||||
)
|
||||
check_controllers()
|
||||
print("PASS Java AOSP / Python Black style")
|
||||
|
||||
|
||||
def check_controllers():
|
||||
directory = ROOT / "src/main/java/ru/mtusi/messenger/controller"
|
||||
operations = 0
|
||||
for path in directory.glob("*Controller.java"):
|
||||
source = path.read_text(encoding="utf-8")
|
||||
fields = re.findall(r"private final (\w+Service) (\w+);", source)
|
||||
if "@RequiredArgsConstructor" not in source or len(fields) != 1:
|
||||
raise AssertionError(f"Controller DI contract: {path.name}")
|
||||
bodies = re.findall(r"@Override\s+public [^{}]+\{([^{}]*)\}", source)
|
||||
if not bodies:
|
||||
raise AssertionError(f"Controller has no operations: {path.name}")
|
||||
service = fields[0][1]
|
||||
for body in bodies:
|
||||
if body.count(";") != 1 or len(re.findall(rf"\b{service}\.\w+\(", body)) != 1:
|
||||
raise AssertionError(f"Controller must call one service: {path.name}")
|
||||
if not re.fullmatch(rf"\s*(?:return )?{service}\.\w+\([^;]*\);\s*", body):
|
||||
raise AssertionError(f"Controller contains extra logic: {path.name}")
|
||||
operations += len(bodies)
|
||||
for path in directory.glob("*Api.java"):
|
||||
source = path.read_text(encoding="utf-8")
|
||||
if source.count("/**") != source.count("@Operation(") + 1:
|
||||
raise AssertionError(f"Missing API documentation: {path.name}")
|
||||
for path in (ROOT / "src/main/java").rglob("*.java"):
|
||||
source = path.read_text(encoding="utf-8")
|
||||
if "@Autowired" in source:
|
||||
raise AssertionError(f"Use constructor injection: {path.name}")
|
||||
if re.search(r"^import .*\*;", source, re.MULTILINE):
|
||||
raise AssertionError(f"Use explicit imports: {path.name}")
|
||||
print(f"PASS {operations} controller operations: one service call, constructor DI, API Javadoc")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1 @@
|
||||
rootProject.name = 'messenger-lab5'
|
||||
@@ -0,0 +1,17 @@
|
||||
package ru.mtusi.messenger;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.context.properties.ConfigurationPropertiesScan;
|
||||
import org.springframework.boot.security.autoconfigure.UserDetailsServiceAutoConfiguration;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@ConfigurationPropertiesScan
|
||||
@SpringBootApplication(exclude = UserDetailsServiceAutoConfiguration.class)
|
||||
@EnableScheduling
|
||||
public class MessengerLab1Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(MessengerLab1Application.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package ru.mtusi.messenger.cache;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
@Component
|
||||
public class CacheHealthTracker {
|
||||
|
||||
private final AtomicBoolean stale = new AtomicBoolean(false);
|
||||
|
||||
public void markStale() {
|
||||
stale.set(true);
|
||||
}
|
||||
|
||||
public boolean consumeStale() {
|
||||
return stale.getAndSet(false);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.boot.jackson.autoconfigure.JsonMapperBuilderCustomizer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import tools.jackson.databind.DeserializationFeature;
|
||||
import tools.jackson.databind.cfg.CoercionAction;
|
||||
import tools.jackson.databind.cfg.CoercionInputShape;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class JacksonConfig {
|
||||
|
||||
@Bean
|
||||
public JsonMapperBuilderCustomizer strictJacksonCustomizer() {
|
||||
log.warn(">>> Strict JsonMapper customizer applied");
|
||||
return builder ->
|
||||
builder.enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
|
||||
.withCoercionConfigDefaults(
|
||||
config -> {
|
||||
config.setCoercion(
|
||||
CoercionInputShape.Boolean, CoercionAction.Fail);
|
||||
config.setCoercion(
|
||||
CoercionInputShape.Integer, CoercionAction.Fail);
|
||||
config.setCoercion(
|
||||
CoercionInputShape.Float, CoercionAction.Fail);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import io.minio.MinioClient;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import ru.mtusi.messenger.config.properties.S3Properties;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class MinioConfig {
|
||||
private final S3Properties props;
|
||||
|
||||
@Bean
|
||||
public MinioClient minioClient() {
|
||||
return MinioClient.builder()
|
||||
.endpoint(props.endpoint())
|
||||
.httpClient(
|
||||
new okhttp3.OkHttpClient.Builder()
|
||||
.connectTimeout(java.time.Duration.ofSeconds(2))
|
||||
.readTimeout(java.time.Duration.ofSeconds(10))
|
||||
.writeTimeout(java.time.Duration.ofSeconds(10))
|
||||
.callTimeout(java.time.Duration.ofSeconds(20))
|
||||
.build())
|
||||
.region(props.region())
|
||||
.credentials(props.resolvedAccessKey(), props.resolvedSecretKey())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
@SecurityScheme(name = "basicAuth", type = SecuritySchemeType.HTTP, scheme = "basic")
|
||||
@SecurityScheme(
|
||||
name = "bearerAuth",
|
||||
type = SecuritySchemeType.HTTP,
|
||||
scheme = "bearer",
|
||||
bearerFormat = "opaque session token")
|
||||
public class OpenApiConfig {}
|
||||
@@ -0,0 +1,29 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import io.github.bucket4j.Bandwidth;
|
||||
import io.github.bucket4j.Bucket;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import ru.mtusi.messenger.config.properties.RateLimitProperties;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
@Configuration
|
||||
@RequiredArgsConstructor
|
||||
public class RateLimitConfig {
|
||||
private final RateLimitProperties props;
|
||||
|
||||
@Bean
|
||||
public Bucket rateLimitBucket() {
|
||||
Bandwidth limit =
|
||||
Bandwidth.builder()
|
||||
.capacity(props.ratePerMinute())
|
||||
.refillGreedy(props.ratePerMinute(), Duration.ofMinutes(1))
|
||||
.build();
|
||||
return Bucket.builder().addLimit(limit).build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import io.lettuce.core.ClientOptions;
|
||||
import io.lettuce.core.SocketOptions;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.annotation.CachingConfigurer;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.interceptor.CacheErrorHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.cache.RedisCacheManager;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.connection.RedisStandaloneConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration;
|
||||
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.JacksonJsonRedisSerializer;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
|
||||
import ru.mtusi.messenger.cache.CacheHealthTracker;
|
||||
import ru.mtusi.messenger.config.properties.RedisProperties;
|
||||
import ru.mtusi.messenger.config.properties.SessionProperties;
|
||||
import ru.mtusi.messenger.service.SessionService;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
@EnableConfigurationProperties(RedisProperties.class)
|
||||
@RequiredArgsConstructor
|
||||
public class RedisConfig implements CachingConfigurer {
|
||||
private final SessionProperties sessionProperties;
|
||||
private final RedisProperties redisProperties;
|
||||
private final CacheHealthTracker cacheHealthTracker;
|
||||
|
||||
@Bean
|
||||
public RedisConnectionFactory redisConnectionFactory() {
|
||||
RedisStandaloneConfiguration server =
|
||||
new RedisStandaloneConfiguration(redisProperties.host(), redisProperties.port());
|
||||
|
||||
SocketOptions socketOptions =
|
||||
SocketOptions.builder()
|
||||
.connectTimeout(redisProperties.connectTimeout())
|
||||
.keepAlive(
|
||||
SocketOptions.KeepAliveOptions.builder()
|
||||
.enable()
|
||||
.idle(redisProperties.keepAliveIdle())
|
||||
.interval(redisProperties.keepAliveInterval())
|
||||
.count(3)
|
||||
.build())
|
||||
.tcpUserTimeout(
|
||||
SocketOptions.TcpUserTimeoutOptions.builder()
|
||||
.tcpUserTimeout(redisProperties.tcpUserTimeout())
|
||||
.enable()
|
||||
.build())
|
||||
.build();
|
||||
|
||||
ClientOptions clientOptions =
|
||||
ClientOptions.builder().socketOptions(socketOptions).autoReconnect(true).build();
|
||||
|
||||
LettuceClientConfiguration client =
|
||||
LettuceClientConfiguration.builder()
|
||||
.commandTimeout(redisProperties.commandTimeout())
|
||||
.shutdownTimeout(redisProperties.shutdownTimeout())
|
||||
.clientOptions(clientOptions)
|
||||
.build();
|
||||
|
||||
return new LettuceConnectionFactory(server, client);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public RedisCacheManager cacheManager(RedisConnectionFactory cf) {
|
||||
RedisCacheConfiguration cfg =
|
||||
RedisCacheConfiguration.defaultCacheConfig()
|
||||
.entryTtl(sessionProperties.ttl())
|
||||
.disableCachingNullValues()
|
||||
.serializeValuesWith(
|
||||
RedisSerializationContext.SerializationPair.fromSerializer(
|
||||
new JacksonJsonRedisSerializer<>(
|
||||
SessionService.SessionRecord.class)));
|
||||
return RedisCacheManager.builder(cf).cacheDefaults(cfg).build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CacheErrorHandler errorHandler() {
|
||||
return new CacheErrorHandler() {
|
||||
@Override
|
||||
public void handleCacheGetError(RuntimeException e, Cache cache, Object key) {
|
||||
cacheHealthTracker.markStale();
|
||||
log.warn("Cache GET failed ({}): {}", cache.getName(), e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCachePutError(
|
||||
RuntimeException e, Cache cache, Object key, Object value) {
|
||||
cacheHealthTracker.markStale();
|
||||
log.warn("Cache PUT failed ({}): {}", cache.getName(), e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCacheEvictError(RuntimeException e, Cache cache, Object key) {
|
||||
cacheHealthTracker.markStale();
|
||||
log.warn("Cache EVICT failed ({}): {}", cache.getName(), e.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleCacheClearError(RuntimeException e, Cache cache) {
|
||||
cacheHealthTracker.markStale();
|
||||
log.warn("Cache CLEAR failed ({}): {}", cache.getName(), e.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package ru.mtusi.messenger.config;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.authentication.ProviderManager;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||
import org.springframework.security.crypto.argon2.Argon2PasswordEncoder;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.security.oauth2.server.resource.web.BearerTokenResolver;
|
||||
import org.springframework.security.oauth2.server.resource.web.DefaultBearerTokenResolver;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||
|
||||
import ru.mtusi.messenger.security.ApiAuthenticationEntryPoint;
|
||||
import ru.mtusi.messenger.security.SessionAuthenticationFilter;
|
||||
import ru.mtusi.messenger.security.SessionAuthenticationProvider;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
@RequiredArgsConstructor
|
||||
public class SecurityConfig {
|
||||
private final SessionAuthenticationProvider sessionAuthenticationProvider;
|
||||
private final ApiAuthenticationEntryPoint entryPoint;
|
||||
|
||||
@Bean
|
||||
public PasswordEncoder passwordEncoder() {
|
||||
return Argon2PasswordEncoder.defaultsForSpringSecurity_v5_8();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManager() {
|
||||
return new ProviderManager(sessionAuthenticationProvider);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain filterChain(
|
||||
HttpSecurity http,
|
||||
AuthenticationManager authenticationManager,
|
||||
BearerTokenResolver bearerTokenResolver)
|
||||
throws Exception {
|
||||
SessionAuthenticationFilter sessionFilter =
|
||||
new SessionAuthenticationFilter(bearerTokenResolver, authenticationManager);
|
||||
|
||||
http.csrf(AbstractHttpConfigurer::disable)
|
||||
.httpBasic(AbstractHttpConfigurer::disable)
|
||||
.formLogin(AbstractHttpConfigurer::disable)
|
||||
.logout(AbstractHttpConfigurer::disable)
|
||||
.sessionManagement(sm -> sm.sessionCreationPolicy(SessionCreationPolicy.STATELESS))
|
||||
.authorizeHttpRequests(
|
||||
auth ->
|
||||
auth.requestMatchers("/health/**")
|
||||
.permitAll()
|
||||
.requestMatchers(
|
||||
"/swagger-ui.html",
|
||||
"/swagger-ui/**",
|
||||
"/v3/api-docs",
|
||||
"/v3/api-docs/**")
|
||||
.permitAll()
|
||||
.requestMatchers(HttpMethod.POST, "/api/v1/users")
|
||||
.permitAll()
|
||||
.requestMatchers(HttpMethod.POST, "/api/v1/auth/sessions")
|
||||
.permitAll()
|
||||
.requestMatchers("/actuator/health", "/actuator/health/**")
|
||||
.permitAll()
|
||||
.anyRequest()
|
||||
.authenticated())
|
||||
.addFilterBefore(sessionFilter, UsernamePasswordAuthenticationFilter.class)
|
||||
.exceptionHandling(eh -> eh.authenticationEntryPoint(entryPoint));
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BearerTokenResolver bearerTokenResolver() {
|
||||
return new DefaultBearerTokenResolver();
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user