feat(deploy): add release manifest with pinned base image digests
This commit is contained in:
1 parent
ea0982a762
commit
a0551a34b8
18 files changed
+2316
-21
No files matched your search
+66
-1
@@ -311,7 +311,7 @@ For remote ML scraping, set ML_METRICS_TARGET to hostname:port or IPv4:port and
|
||||
|
||||
## Services and images
|
||||
|
||||
Container images use moving `latest` or `alpine` tags where the upstream publishes them. Check the current Compose references when updating the stack. These tags can move; resolve and record actual image digests and an SBOM for a release. Application dependency lockfiles remain checked in separately.
|
||||
Container images use moving `latest` or `alpine` tags where the upstream publishes them. Check the current Compose references when updating the stack. These tags can move; the [release manifest](#release-manifest) records the actual image digests of a release. An SBOM is not produced yet. Application dependency lockfiles remain checked in separately.
|
||||
|
||||
| Component | Current image source | Principal upstream license |
|
||||
| --- | --- | --- |
|
||||
@@ -333,6 +333,71 @@ These entries name the principal upstream project's license; they are not a comp
|
||||
|
||||
The backend builds with Go 1.26.8; its runtime image is selected in backend/Dockerfile. Frontend and ML base images are selected in their Dockerfiles. Upstream sources include [Docker Official Images](https://github.com/docker-library), [Distroless](https://github.com/GoogleContainerTools/distroless), and [NGINX unprivileged images](https://github.com/nginxinc/docker-nginx-unprivileged); inspect exact tags and layers before distribution.
|
||||
|
||||
## Release manifest
|
||||
|
||||
A release manifest records what a verified local release consists of: the commit, the toolchain versions, the lockfile hashes, the image of every service with its actual digest, and which components a check really ran. Moving `latest` and `alpine` tags stay in Compose and in the Dockerfiles by agreement; the manifest pins what they resolved to at release time. The interface is `make -C deploy release-manifest`; the other `release-*` targets prepare its inputs and check its result:
|
||||
|
||||
make -C deploy release-build
|
||||
make -C deploy release-smoke
|
||||
make -C deploy release-e2e
|
||||
make -C deploy release-manifest
|
||||
make -C deploy release-manifest-check
|
||||
|
||||
- `release-build` builds `backend`, `frontend`, and `ml` from their Dockerfiles and lockfiles through Compose and tags them `lincodex.invalid/<service>:<tag>`. The `.invalid` domain never resolves, and the release overlays set `pull_policy: never`, so a missing release image is never pulled from a registry. Each Dockerfile takes its base images as `*_IMAGE` build arguments whose defaults are the agreed tags; the target resolves each base to its repository digest in the local image store and builds with `<tag>@<digest>`. A base image used through `COPY --from` or `RUN --mount=from` that is not an earlier stage is refused, because it could not be pinned. Base and core service images are pulled only when missing locally; `RELEASE_PULL=always` refreshes every tag first. The target reads the source state again after the build and writes `build.json` (build arguments, base digests, image IDs) only if the commit and the working tree did not change during the build.
|
||||
- `release-smoke` and `release-e2e` run `deploy/scripts/smoke.sh` and `deploy/scripts/e2e.sh` with `LINCODEX_RELEASE_TAG`, which only these targets set: the stack starts from the release images with `--no-build --pull never`, and only after every check passes does the script write `evidence-smoke.json` or `evidence-e2e.json` with the release tag, commit, working tree fingerprint, and the image IDs of the running containers. A failed run writes nothing. Evidence written after the checks passed stays even if the stack cleanup fails afterwards; the script still exits with an error then.
|
||||
- `release-manifest` reads only local images, the build record, and the evidence; it pulls nothing. A missing image is listed as not present. Evidence or a build record that is malformed or was recorded for another tag, commit, or working tree state is not used; the manifest lists the rejected evidence under `rejected_checks`.
|
||||
- `release-manifest-check` checks the structure of the manifest and scans it for secrets and machine data.
|
||||
- `release-up` and `release-down` run the core stack from the release images with `ENV_FILE` and `APP_PROJECT`, without building or pulling. `make -C deploy release-manifest-verify RELEASE_VERIFY_PROJECT=<project>` compares every running container of that Compose project with the manifest of the current tag, or with `RELEASE_MANIFEST=<path>`, by image ID. It prints the release status and exits with status 1 on a different digest, a missing service, or a service the manifest does not list.
|
||||
- `release-clean` removes the local `lincodex.invalid/*` images and keeps the files in `deploy/release/`.
|
||||
|
||||
The release tag is the first 12 characters of the commit, with `-dirty` when the working tree differs from it. The working tree fingerprint is the Git tree ID written from a temporary index (seeded from HEAD, then `git add -A`), with line ending, file mode, symlink, and fsmonitor settings pinned. It covers modified, deleted, and untracked files, does not depend on diff settings, and leaves the real index untouched. All files go to `deploy/release/<tag>/`, which Git and the root `.dockerignore` ignore. Manifests are not committed: built image IDs depend on the machine, platform, and build time, and the manifest describes what this machine built and checked. Attach the manifest to the release instead.
|
||||
|
||||
### Format
|
||||
|
||||
The manifest is JSON with sorted keys and schema `lincodex.release-manifest/v1`:
|
||||
|
||||
| Key | Content |
|
||||
| --- | --- |
|
||||
| `schema`, `generated_at` | Schema version and UTC generation time |
|
||||
| `release` | `tag`, `status` (`verified` or `unverified`), `scope` (`core`), `required_checks` (`smoke`, `e2e`), and the `reasons` that keep it unverified |
|
||||
| `source` | `commit`, `dirty`, the working tree `fingerprint` (`git-tree:<id>`, or null for a clean tree), and `build_matches_source` |
|
||||
| `toolchains` | Go from go.mod, its `toolchain` directive, the `GO_IMAGE` default, `GOTOOLCHAIN=local`, the base image version, and the version recorded in the backend binary; Node and pnpm from `.node-version`, `packageManager`, the Dockerfile, and the base image; Python and uv from `.python-version`, `requires-python`, the Dockerfile, and the base image; `matches_version_file` for Node and Python; the Playwright package version |
|
||||
| `lockfiles` | SHA-256 of `backend/go.mod`, `backend/go.sum`, `frontend/package.json`, `frontend/pnpm-lock.yaml`, `ml/pyproject.toml`, and `ml/uv.lock` |
|
||||
| `checks`, `rejected_checks` | Accepted evidence with its scope, finish time, commit, fingerprint, and tool image, such as the Playwright image; rejected evidence with the reason |
|
||||
| `components` | Each Compose service of core, ML, and monitoring and each missing component: `group`, `kind` (`built`, `pulled`, `absent`), the image (`reference`, `present`, `image_id`, `repo_digest` for the tag's repository, all `repo_digests`, `platform`, and allowlisted `versions`), for built images the Dockerfile, its hash, build arguments, and base images, and `verification` |
|
||||
|
||||
`verification.status` is one of:
|
||||
|
||||
- `verified`: at least one accepted smoke or E2E run recorded this exact image ID for the service. `verification.checks` lists which. Only core services can be verified.
|
||||
- `not_verified`: the image is absent, was not in an accepted passing run, or belongs to a group no release check starts. ML is built but no check starts it and it has no model; monitoring images are recorded only when present locally.
|
||||
- `missing`: the component is planned but has no service or image in this repository: GPU inference, Judge0, and Qdrant.
|
||||
|
||||
The release is `verified` only when all of the following hold; otherwise `release.reasons` names each failed condition:
|
||||
|
||||
- the working tree is clean and the build record is well formed and matches the current source;
|
||||
- every core image was built by `release-build`, and every core pulled image has a registry digest;
|
||||
- both smoke and E2E evidence for the current source passed on the current image ID of every core component;
|
||||
- every lockfile and every service Dockerfile exists;
|
||||
- the Go pin is consistent and the backend binary reports the go.mod Go version;
|
||||
- Node in the frontend build image equals `frontend/.node-version`.
|
||||
|
||||
A Python version that differs from `ml/.python-version` is reported in `matches_version_file` but does not block the release, because ML is outside the verified scope. A moving `node:alpine` tag can therefore make a release unverified until `.node-version` is updated. A dirty tree is not refused: the manifest is written with `unverified` and the reason, so a local candidate can be checked before the commit.
|
||||
|
||||
Generating the manifest again for the same source, images, and evidence gives the same document apart from `generated_at`; the target says whether anything else changed since the previous manifest of the tag. Version fields are copied only from an allowlist of image variables and OCI labels. The manifest never contains environment values, `.env` content, container labels, mounts, local paths, user or host names; every file is scanned for those, for values of variables whose names suggest secrets (also as substrings and in base64), and for secret patterns before it is written, and `release-manifest-check` repeats the scan.
|
||||
|
||||
### Go pin
|
||||
|
||||
go.mod declares `go 1.26.8` without a separate `toolchain` line, the default `GO_IMAGE` is `golang:1.26.8-alpine`, and the build stage sets `GOTOOLCHAIN=local`, so a go.mod that asks for a newer Go fails the build instead of downloading another toolchain. `make -C deploy check` fails when these pins disagree or when a Dockerfile uses a base image that is not a pinnable build argument. The manifest also records the version read from the build information of the backend binary; to read it, the generator creates a container from the image without starting it, copies the binary out, and removes the container.
|
||||
|
||||
### Not covered
|
||||
|
||||
- The manifest is not an SBOM, a license inventory, a signature, or a provenance attestation, and it is not pushed to a registry.
|
||||
- The files in `deploy/release/` are local and not tamper-proof; evidence is not signed and proves only what this machine recorded.
|
||||
- Git-ignored files are not part of the fingerprint. A build context still receives such files unless `.dockerignore` excludes them.
|
||||
- Images are built for the local platform only. Versions without an image variable or label, such as Kafka, are identified only by digest.
|
||||
- `verified` means the image passed the recorded technical checks. Kafka publication, product workflows, ML, monitoring, backups, and production hosts are not checked.
|
||||
- CI runs `check-release` as part of `make -C deploy check`, but not the release build, the release runs, or the manifest targets.
|
||||
|
||||
## Observability configuration
|
||||
|
||||
Prometheus scrapes backend /metrics on port 9090, PostgreSQL exporter, Redis exporter on port 9121, SeaweedFS on port 9327, node exporter, itself, and the optional ML target. Loki uses a single-binary filesystem store with 168-hour retention. Grafana provisions Prometheus and Loki datasources from observability/grafana/provisioning/.
|
||||
|
||||
+15
-1
@@ -25,7 +25,7 @@ Useful focused commands:
|
||||
| make -C ml check | Ruff, mypy, pytest, and wheel build |
|
||||
| make -C ml check-generated | Pydantic models match the ML bundle without rewriting files |
|
||||
| make -C deploy config | Render Compose configurations without starting them |
|
||||
| make -C deploy check | Render Compose configurations and run `check-workflows`, which fails when a workflow `aggregate` job does not need every other job or lacks `if: always()` |
|
||||
| make -C deploy check | Render Compose configurations and run `check-workflows`, which fails when a workflow `aggregate` job does not need every other job or lacks `if: always()`, and `check-release`; see [Release manifest tests](#release-manifest-tests) |
|
||||
| make -C deploy smoke | Isolated technical smoke of service health routes |
|
||||
| make -C deploy test-e2e | Playwright browser suite against an isolated throwaway stack |
|
||||
| make -C observability check | Validate Prometheus, Loki, Alloy, and dashboard JSON |
|
||||
@@ -60,6 +60,20 @@ The current suite (`frontend/e2e/smoke.spec.ts`) checks that the SPA serves `/`
|
||||
|
||||
The suite does not cover candidate or employer workflows, sign-in, mail delivery, dependency failures (deployment smoke covers those), browsers other than desktop Chromium, layout, or accessibility. CI runs the suite in the `e2e` job after `backend`, `frontend`, and `infrastructure` pass: `make -C frontend install`, then `make -C deploy test-e2e`. The job needs no repository secrets or root `.env`; each run uses its own generated env file and fresh stand. On failure CI uploads the `e2e-diagnostics-attempt-<n>` artifact with `report/`, `results/` (traces and screenshots), and `stand.log` for 14 days. Hidden files and the env file are not uploaded. The `e2e` result is part of the required aggregate.
|
||||
|
||||
## Release manifest tests
|
||||
|
||||
`make -C deploy check-release` runs `deploy/scripts/test_release_manifest.py` with the Python standard library and without Docker. It fails when go.mod, the `GO_IMAGE` default, and `GOTOOLCHAIN=local` in backend/Dockerfile stop pinning Go 1.26.8, or when a service Dockerfile uses a base image that is not a pinnable `*_IMAGE` build argument, including an external image in `COPY --from` or `RUN --mount=from`. On fake image, Compose, and container data it checks that:
|
||||
|
||||
- the manifest copies no environment values, labels, or local paths, and two generations differ only in `generated_at`;
|
||||
- evidence counts only for the same tag, commit, and working tree fingerprint, and malformed evidence or build records are not used;
|
||||
- a component is `verified` only with evidence for its exact image ID, ML, monitoring, and missing components are never verified, and the release stays unverified without both smoke and E2E on the current images, on a dirty tree, with a core pulled image without a registry digest, a missing lockfile or Dockerfile, another Go version in the binary, or another Node version in the build image;
|
||||
- `release-build` refuses to write the build record when the commit or the working tree changes during the build;
|
||||
- the working tree fingerprint of a temporary Git repository ignores diff and line ending settings, covers untracked files, skips ignored ones, and leaves the real index unchanged;
|
||||
- the secret scan finds key blocks, tokens, credentials in URLs, local paths, user and host names, and values of secret-like variables, also as substrings and in base64, without echoing them;
|
||||
- the running-container comparison reports a different digest, a missing service, and an unknown service.
|
||||
|
||||
The test does not build images or start containers. The end-to-end path is `release-build`, `release-smoke` and `release-e2e`, `release-manifest`, `release-up`, `release-manifest-verify`, and `release-manifest-check`; see [DEPLOY.md](DEPLOY.md#release-manifest).
|
||||
|
||||
## Integration test bootstrap
|
||||
|
||||
The shared helper lives in `backend/integration_test/bootstrap_test.go`. Calling `env := bootstrap(t)` starts PostgreSQL, Redis, and SeaweedFS, waits for adapter readiness, and returns an environment with configuration and clients. To test one adapter, use `bootstrap(t, postgresService)`, `bootstrap(t, redisService)`, or `bootstrap(t, seaweedfsService)`. Multiple services can be selected.
|
||||
|
||||
+66
-1
@@ -313,7 +313,7 @@ Frontend телеметрия пока не подключена в React-при
|
||||
|
||||
## Сервисы и образы
|
||||
|
||||
Для контейнерных образов выбраны moving tags `latest` или `alpine`, если upstream публикует такой вариант. При обновлении Compose сверяйте актуальные ссылки на образы. Теги `latest` и `alpine` могут перемещаться; для выпуска фиксируйте фактические image digests и SBOM. Lockfiles прикладных зависимостей сохраняются отдельно.
|
||||
Для контейнерных образов выбраны moving tags `latest` или `alpine`, если upstream публикует такой вариант. При обновлении Compose сверяйте актуальные ссылки на образы. Теги `latest` и `alpine` могут перемещаться; фактические image digests выпуска фиксирует [манифест выпуска](#манифест-выпуска). SBOM пока не формируется. Lockfiles прикладных зависимостей сохраняются отдельно.
|
||||
|
||||
| Компонент | Текущий источник образа | Основной upstream license |
|
||||
| --- | --- | --- |
|
||||
@@ -335,6 +335,71 @@ Frontend телеметрия пока не подключена в React-при
|
||||
|
||||
Backend строится с Go 1.26.8; образ runtime выбран в backend/Dockerfile. Базовые образы frontend и ML описаны в соответствующих Dockerfiles. Исходники: [Docker Official Images](https://github.com/docker-library), [Distroless](https://github.com/GoogleContainerTools/distroless) и [NGINX unprivileged images](https://github.com/nginxinc/docker-nginx-unprivileged); перед распространением проверьте точные tags и слои.
|
||||
|
||||
## Манифест выпуска
|
||||
|
||||
Манифест выпуска фиксирует, из чего состоит проверенный локальный выпуск: коммит, версии toolchain, хеши lockfiles, образ каждого сервиса с фактическим digest и компоненты, на которых проверка действительно выполнялась. Плавающие теги `latest` и `alpine` по договоренности остаются в Compose и Dockerfile; манифест закрепляет, во что они разрешились в момент выпуска. Интерфейс - `make -C deploy release-manifest`; остальные цели `release-*` готовят его входные данные и проверяют результат:
|
||||
|
||||
make -C deploy release-build
|
||||
make -C deploy release-smoke
|
||||
make -C deploy release-e2e
|
||||
make -C deploy release-manifest
|
||||
make -C deploy release-manifest-check
|
||||
|
||||
- `release-build` собирает `backend`, `frontend` и `ml` через Compose из их Dockerfile и lockfiles и помечает образы `lincodex.invalid/<service>:<tag>`. Домен `.invalid` никогда не разрешается, а release-overlay задает `pull_policy: never`, поэтому отсутствующий образ выпуска не скачивается из registry. Каждый Dockerfile принимает базовые образы как build-аргументы `*_IMAGE`, по умолчанию равные согласованным тегам; цель разрешает каждый базовый образ в его repository digest из локального хранилища образов и собирает с `<tag>@<digest>`. Образ в `COPY --from` или `RUN --mount=from`, который не является предыдущим этапом, отклоняется, потому что его нельзя закрепить. Базовые образы и образы core-сервисов скачиваются, только если их нет локально; `RELEASE_PULL=always` сначала обновляет все теги. После сборки цель снова читает состояние исходников и пишет `build.json` (build-аргументы, digest базовых образов, image ID), только если коммит и рабочее дерево за время сборки не изменились.
|
||||
- `release-smoke` и `release-e2e` запускают `deploy/scripts/smoke.sh` и `deploy/scripts/e2e.sh` с `LINCODEX_RELEASE_TAG`, который задают только эти цели: стек поднимается из образов выпуска с `--no-build --pull never`, и только после прохождения всех проверок скрипт пишет `evidence-smoke.json` или `evidence-e2e.json` с тегом выпуска, коммитом, отпечатком рабочего дерева и image ID запущенных контейнеров. Неуспешный прогон ничего не пишет. Evidence, записанный после успешных проверок, остается, даже если затем не удалась очистка стека; скрипт при этом все равно завершается ошибкой.
|
||||
- `release-manifest` читает только локальные образы, запись сборки и evidence; ничего не скачивает. Отсутствующий образ указывается как отсутствующий. Evidence или запись сборки с неверной структурой или записанные для другого тега, коммита или состояния рабочего дерева не используются; отклоненный evidence перечисляется в `rejected_checks`.
|
||||
- `release-manifest-check` проверяет структуру манифеста и ищет в нем секреты и данные машины.
|
||||
- `release-up` и `release-down` запускают core-стек из образов выпуска с `ENV_FILE` и `APP_PROJECT` без сборки и скачивания. `make -C deploy release-manifest-verify RELEASE_VERIFY_PROJECT=<project>` сравнивает каждый запущенный контейнер этого Compose-проекта по image ID с манифестом текущего тега или с `RELEASE_MANIFEST=<path>`. Цель печатает статус выпуска и завершается со статусом 1 при другом digest, незапущенном сервисе или сервисе, которого нет в манифесте.
|
||||
- `release-clean` удаляет локальные образы `lincodex.invalid/*` и оставляет файлы в `deploy/release/`.
|
||||
|
||||
Тег выпуска - первые 12 символов коммита, с суффиксом `-dirty`, если рабочее дерево отличается от коммита. Отпечаток рабочего дерева - Git tree ID, записанный из временного индекса (заполняется из HEAD, затем `git add -A`) с закрепленными настройками переводов строк, режима файлов, symlink и fsmonitor. Он учитывает измененные, удаленные и неотслеживаемые файлы, не зависит от настроек diff и не меняет настоящий индекс. Все файлы пишутся в `deploy/release/<tag>/`, который игнорируют Git и корневой `.dockerignore`. Манифесты не коммитятся: image ID собранных образов зависят от машины, платформы и времени сборки, а манифест описывает то, что собрала и проверила эта машина. Прикладывайте манифест к выпуску.
|
||||
|
||||
### Формат
|
||||
|
||||
Манифест - JSON с отсортированными ключами и схемой `lincodex.release-manifest/v1`:
|
||||
|
||||
| Ключ | Содержимое |
|
||||
| --- | --- |
|
||||
| `schema`, `generated_at` | Версия схемы и время генерации в UTC |
|
||||
| `release` | `tag`, `status` (`verified` или `unverified`), `scope` (`core`), `required_checks` (`smoke`, `e2e`) и `reasons`, по которым выпуск не проверен |
|
||||
| `source` | `commit`, `dirty`, отпечаток рабочего дерева `fingerprint` (`git-tree:<id>` или null для чистого дерева) и `build_matches_source` |
|
||||
| `toolchains` | Go из go.mod, его директива `toolchain`, значение `GO_IMAGE` по умолчанию, `GOTOOLCHAIN=local`, версия базового образа и версия, записанная в бинарнике backend; Node и pnpm из `.node-version`, `packageManager`, Dockerfile и базового образа; Python и uv из `.python-version`, `requires-python`, Dockerfile и базового образа; `matches_version_file` для Node и Python; версия пакета Playwright |
|
||||
| `lockfiles` | SHA-256 `backend/go.mod`, `backend/go.sum`, `frontend/package.json`, `frontend/pnpm-lock.yaml`, `ml/pyproject.toml` и `ml/uv.lock` |
|
||||
| `checks`, `rejected_checks` | Принятый evidence с охватом, временем завершения, коммитом, отпечатком и образом инструмента, например Playwright; отклоненный evidence с причиной |
|
||||
| `components` | Каждый Compose-сервис core, ML и monitoring и каждый отсутствующий компонент: `group`, `kind` (`built`, `pulled`, `absent`), образ (`reference`, `present`, `image_id`, `repo_digest` для репозитория тега, все `repo_digests`, `platform` и разрешенные `versions`), для собранных образов - Dockerfile, его хеш, build-аргументы и базовые образы, а также `verification` |
|
||||
|
||||
`verification.status` принимает значения:
|
||||
|
||||
- `verified`: хотя бы один принятый smoke или E2E записал именно этот image ID сервиса. Какие именно, перечисляет `verification.checks`. Проверенными могут быть только core-сервисы.
|
||||
- `not_verified`: образа нет локально, он не участвовал в принятом успешном прогоне или относится к группе, которую не запускает ни одна проверка выпуска. ML собирается, но проверки его не запускают, и модели у него нет; образы monitoring записываются, только если есть локально.
|
||||
- `missing`: компонент запланирован, но в репозитории нет его сервиса или образа: GPU inference, Judge0 и Qdrant.
|
||||
|
||||
Выпуск получает `verified`, только если выполнены все условия ниже; иначе `release.reasons` называет каждое невыполненное:
|
||||
|
||||
- рабочее дерево чистое, запись сборки корректна и соответствует текущим исходникам;
|
||||
- каждый core-образ собран `release-build`, у каждого скачанного core-образа есть registry digest;
|
||||
- evidence и smoke, и E2E для текущих исходников прошел на текущем image ID каждого core-компонента;
|
||||
- все lockfiles и Dockerfile сервисов существуют;
|
||||
- Go pin согласован, и бинарник backend сообщает версию Go из go.mod;
|
||||
- Node в образе сборки frontend совпадает с `frontend/.node-version`.
|
||||
|
||||
Версия Python, отличная от `ml/.python-version`, отражается в `matches_version_file`, но не блокирует выпуск: ML вне проверяемого охвата. Поэтому плавающий тег `node:alpine` может сделать выпуск непроверенным, пока не обновлен `.node-version`. Грязное дерево не отклоняется: манифест пишется со статусом `unverified` и причиной, чтобы локального кандидата можно было проверить до коммита.
|
||||
|
||||
Повторная генерация для тех же исходников, образов и evidence дает тот же документ, кроме `generated_at`; цель сообщает, изменилось ли что-то еще по сравнению с предыдущим манифестом тега. Поля версий копируются только из разрешенного списка переменных образа и OCI labels. Манифест никогда не содержит значений окружения, содержимого `.env`, labels контейнеров, mounts, локальных путей, имен пользователя или хоста; перед записью каждый файл проверяется на них, на значения переменных с именами, похожими на секреты (в том числе как подстроки и в base64), и на шаблоны секретов, а `release-manifest-check` повторяет проверку.
|
||||
|
||||
### Go pin
|
||||
|
||||
go.mod объявляет `go 1.26.8` без отдельной строки `toolchain`, `GO_IMAGE` по умолчанию - `golang:1.26.8-alpine`, а этап сборки задает `GOTOOLCHAIN=local`, поэтому go.mod с требованием более новой Go роняет сборку вместо скачивания другого toolchain. `make -C deploy check` падает, если эти значения расходятся или Dockerfile использует базовый образ не через закрепляемый build-аргумент. Манифест также записывает версию из build information бинарника backend; для этого генератор создает контейнер из образа без запуска, копирует бинарник и удаляет контейнер.
|
||||
|
||||
### Что не покрыто
|
||||
|
||||
- Манифест не является SBOM, перечнем лицензий, подписью или provenance attestation и не публикуется в registry.
|
||||
- Файлы в `deploy/release/` локальны и не защищены от подмены; evidence не подписан и подтверждает только то, что записала эта машина.
|
||||
- Файлы, которые игнорирует Git, не входят в отпечаток. В контекст сборки они все равно попадают, если их не исключает `.dockerignore`.
|
||||
- Образы собираются только для локальной платформы. Версии без переменной образа или label, например Kafka, определяются только digest.
|
||||
- `verified` означает, что образ прошел записанные технические проверки. Публикация в Kafka, продуктовые сценарии, ML, мониторинг, резервное копирование и production-хосты не проверяются.
|
||||
- CI запускает `check-release` в составе `make -C deploy check`, но не сборку выпуска, прогоны на образах выпуска и цели манифеста.
|
||||
|
||||
## Observability configuration
|
||||
|
||||
Prometheus опрашивает backend /metrics на порту 9090, PostgreSQL exporter, Redis exporter на порту 9121, SeaweedFS на порту 9327, node exporter, себя и необязательный ML target. Loki использует файловое хранилище в single-binary режиме с хранением 168 часов. Grafana загружает datasource Prometheus и Loki из observability/grafana/provisioning/.
|
||||
|
||||
+15
-1
@@ -25,7 +25,7 @@ make test запускает backend, frontend и ML тесты. make check та
|
||||
| make -C ml check | Ruff, mypy, pytest и сборку wheel |
|
||||
| make -C ml check-generated | Соответствие Pydantic-моделей ML bundle без перезаписи файлов |
|
||||
| make -C deploy config | Рендер Compose конфигураций без запуска |
|
||||
| make -C deploy check | Рендер Compose конфигураций и `check-workflows`, который падает, если job `aggregate` в workflow не зависит от всех остальных jobs или не имеет `if: always()` |
|
||||
| make -C deploy check | Рендер Compose конфигураций, `check-workflows`, который падает, если job `aggregate` в workflow не зависит от всех остальных jobs или не имеет `if: always()`, и `check-release`; см. [Тесты манифеста выпуска](#тесты-манифеста-выпуска) |
|
||||
| make -C deploy smoke | Изолированный технический smoke по service health routes |
|
||||
| make -C deploy test-e2e | Браузерный набор Playwright на изолированном одноразовом стеке |
|
||||
| make -C observability check | Проверку Prometheus, Loki, Alloy и dashboard JSON |
|
||||
@@ -60,6 +60,20 @@ Deployment smoke проверяет инфраструктурные маршр
|
||||
|
||||
Набор не проверяет сценарии кандидата и работодателя, вход, доставку почты, отказы зависимостей (их проверяет deployment smoke), браузеры кроме desktop Chromium, верстку и доступность. CI запускает набор в job `e2e` после успешных `backend`, `frontend` и `infrastructure`: `make -C frontend install`, затем `make -C deploy test-e2e`. Секреты репозитория и корневой `.env` не нужны; каждый прогон использует свой сгенерированный env-файл и свежий стенд. При ошибке CI загружает артефакт `e2e-diagnostics-attempt-<n>` с `report/`, `results/` (трассы и снимки экрана) и `stand.log` на 14 дней. Скрытые файлы и env-файл не загружаются. Результат `e2e` входит в обязательный aggregate.
|
||||
|
||||
## Тесты манифеста выпуска
|
||||
|
||||
`make -C deploy check-release` запускает `deploy/scripts/test_release_manifest.py` на стандартной библиотеке Python и без Docker. Тест падает, если go.mod, значение `GO_IMAGE` по умолчанию и `GOTOOLCHAIN=local` в backend/Dockerfile перестают закреплять Go 1.26.8 или если Dockerfile сервиса использует базовый образ не через закрепляемый build-аргумент `*_IMAGE`, в том числе внешний образ в `COPY --from` или `RUN --mount=from`. На подставных данных образов, Compose и контейнеров он проверяет, что:
|
||||
|
||||
- манифест не копирует значения окружения, labels и локальные пути, а две генерации различаются только `generated_at`;
|
||||
- evidence засчитывается только для того же тега, коммита и отпечатка рабочего дерева, а evidence и записи сборки с неверной структурой не используются;
|
||||
- компонент получает `verified` только при evidence для его точного image ID, ML, monitoring и отсутствующие компоненты никогда не проверены, а выпуск остается непроверенным без smoke и E2E на текущих образах, на грязном дереве, при скачанном core-образе без registry digest, отсутствующем lockfile или Dockerfile, другой версии Go в бинарнике или другой версии Node в образе сборки;
|
||||
- `release-build` не пишет запись сборки, если коммит или рабочее дерево изменились во время сборки;
|
||||
- отпечаток рабочего дерева временного Git-репозитория не зависит от настроек diff и переводов строк, учитывает неотслеживаемые файлы, пропускает игнорируемые и не меняет настоящий индекс;
|
||||
- поиск секретов находит блоки ключей, токены, учетные данные в URL, локальные пути, имена пользователя и хоста и значения переменных, похожих на секреты, в том числе как подстроки и в base64, не печатая их;
|
||||
- сравнение с запущенными контейнерами сообщает о другом digest, незапущенном и неизвестном сервисе.
|
||||
|
||||
Тест не собирает образы и не запускает контейнеры. Полный путь: `release-build`, `release-smoke` и `release-e2e`, `release-manifest`, `release-up`, `release-manifest-verify` и `release-manifest-check`; см. [DEPLOY.md](DEPLOY.md#манифест-выпуска).
|
||||
|
||||
## Bootstrap интеграционных тестов
|
||||
|
||||
Общий helper находится в `backend/integration_test/bootstrap_test.go`. Вызов `env := bootstrap(t)` поднимает PostgreSQL, Redis и SeaweedFS, дожидается готовности адаптеров и возвращает окружение с конфигурацией и клиентами. Для проверки одного адаптера используйте `bootstrap(t, postgresService)`, `bootstrap(t, redisService)` или `bootstrap(t, seaweedfsService)`. Можно передать несколько сервисов.
|
||||
|
||||
Reference in new issue
Block a user