docs: simplify project guides and add GPLv3

This commit is contained in:
TakuyaYagam1 committed 2026-10-11 22:25:10 +03:00
1 parent e4de6d0f9a
commit 76d32bb79f
59 files changed
+2267 -8843

No files matched your search

+21 -14
View File
@@ -2,21 +2,28 @@
[Русский](README.md) | English
Configuration for running the application with Docker Compose and Nginx.
Docker Compose, Nginx, and startup tools. Dockerfiles live in service directories; the shared `.env.example` is at the repository root.
- `docker/docker-compose.yml` starts the core stack with PostgreSQL, Redis, SeaweedFS, and Kafka.
- `docker/docker-compose.ml.yml` and `docker/docker-compose.monitoring.yml` run ML and monitoring as separate projects.
- `nginx/` configures frontend serving and API proxying.
- `docker/docker-compose.e2e.yml` is an overlay used only by the browser suite: it removes the frontend host port and adds the Playwright runner.
- `docker/docker-compose.release.yml`, `docker/docker-compose.demo.release.yml`, and `docker/docker-compose.ml.release.yml` are overlays that name the release images `lincodex.invalid/<service>:<tag>` (the demo seed image included) and never pull them from a registry.
- `docker/docker-compose.demo.yml` and `demo/` belong to the isolated demo stand with synthetic data: `make -C deploy demo-seed DEMO_MODE=isolated` starts and seeds it, `demo-reset` rebuilds it only when it holds no ordinary account, and `demo-down` stops it; see the [isolated demo stand](../docs/en/DEPLOY.md#isolated-demo-stand).
- `scripts/` contains the isolated stack smoke check, the browser E2E runner, and `release_manifest.py`, which builds, describes, and checks release images.
- `edge/` holds the public edge proxy: nginx and tunnel templates, certbot renewal hook, systemd drop-ins, and the scripts that render and check them. `make -C deploy edge-config` renders the nginx configuration and runs `nginx -t` in a container; see the [edge proxy runbook](../docs/en/DEPLOY.md#edge-proxy-https-and-tunnel).
- `labs/` holds the LXD layout of the app host for the isolated runner and the labs (`lxd-preseed.yaml`, `acls.sh`) and `runner-vm.sh`, which builds, updates, and checks the production runner VM: `make -C deploy runner-vm-up`, `runner-vm-a16`, and `runner-vm-check` on the app host, and `check-runner-vm` anywhere; see [the runner VM](../docs/en/DEPLOY.md#production-the-runner-vm).
- `make -C deploy check-perimeter` checks the published ports, denied paths, limits, and the trusted peer of Nginx from the files; `make -C deploy perimeter-test` checks the same over HTTP on throwaway Nginx containers; see [Public perimeter and client address](../docs/en/DEPLOY.md#public-perimeter-and-client-address).
| Directory | Purpose |
| --- | --- |
| `docker/` | Core stack and separate Compose files for ML, monitoring, demo, E2E, and the dev runner |
| `nginx/` | SPA serving and API proxy to Go |
| `edge/` | Public HTTPS proxy and private tunnel templates |
| `labs/` | LXD networks, code runner VM, and labd systemd configuration |
| `ml-gpu/` | ML on a GPU host through systemd |
| `demo/`, `scripts/` | Synthetic data, checks, and release tooling |
| `release/` | Local release manifests, excluded from Git |
Dockerfiles live in service directories and `.env.example` at the repository root. From the root, `make -C deploy config` checks Compose and `make -C deploy up` starts the core stack after `.env` is prepared. Start monitoring separately with `make -C deploy monitoring-up`. `make -C deploy test-e2e` runs the Playwright suite against a throwaway stack under a unique project name and removes it afterwards; `make -C deploy test-e2e-registration` enables a local Resend-compatible inbox only for registration browser tests. See [TESTING.md](../docs/en/TESTING.md#browser-e2e-suite) for details.
From the repository root:
`make -C deploy release-build`, `release-smoke`, `release-e2e`, and `release-manifest` build the release images with pinned base image digests, check them, and publish an immutable manifest to `deploy/release/<release-id>/`, which Git ignores; a new `RELEASE_ID` gives the next stage its own manifest. `make -C deploy release-manifest-check` scans the manifest for secrets and machine data, `release-manifest-verify` compares running containers with it, `release-up` restores the core stack and `demo-seed DEMO_MODE=isolated RELEASE_ID=<id>` the demo stand from its exact images, and `release-clean` removes release images that no manifest retains. See the [release manifest](../docs/en/DEPLOY.md#release-manifest).
```sh
make -C deploy help
make -C deploy config
make -C deploy up
```
See the [deployment guide](../docs/en/DEPLOY.md).
`config` validates examples; `up` requires a prepared `.env` and starts core only. ML and monitoring start separately; monitoring and local ML need the existing core network. `down` preserves volumes.
For a demonstration: `make -C deploy demo-seed DEMO_MODE=isolated`. For checks: `make -C deploy check`, `smoke`, or `test-e2e`. The latter two create and remove their own stands.
Secrets, HTTPS, runner, and release instructions: [DEPLOYMENT.md](../docs/en/DEPLOYMENT.md). Test scenarios: [TESTING.md](../docs/en/TESTING.md).
+21 -14
View File
@@ -2,21 +2,28 @@
Русский | [English](README.en.md)
Конфигурация запуска через Docker Compose и Nginx.
Docker Compose, Nginx и инструменты запуска. Dockerfile лежат в каталогах сервисов, общий пример настроек - в `.env.example` в корне.
- `docker/docker-compose.yml` поднимает основной стек с PostgreSQL, Redis, SeaweedFS и Kafka.
- `docker/docker-compose.ml.yml` и `docker/docker-compose.monitoring.yml` запускают ML и мониторинг отдельными проектами.
- `nginx/` содержит конфигурацию раздачи frontend и проксирования API.
- `docker/docker-compose.e2e.yml` - overlay только для браузерного набора: убирает host-порт frontend и добавляет запуск Playwright.
- `docker/docker-compose.release.yml`, `docker/docker-compose.demo.release.yml` и `docker/docker-compose.ml.release.yml` - overlay с именами образов выпуска `lincodex.invalid/<service>:<tag>` (включая образ demo seed) без скачивания из registry.
- `docker/docker-compose.demo.yml` и `demo/` относятся к изолированному демонстрационному стенду с синтетическими данными: `make -C deploy demo-seed DEMO_MODE=isolated` запускает и заполняет его, `demo-reset` пересоздает его, только если в нем нет обычных аккаунтов, а `demo-down` останавливает; см. [изолированный демонстрационный стенд](../docs/ru/DEPLOY.md#изолированный-демонстрационный-стенд).
- `scripts/` содержит smoke-проверку изолированного стека, запуск браузерных E2E и `release_manifest.py` для сборки, описания и сверки образов выпуска.
- `edge/` содержит публичный edge proxy: шаблоны nginx и туннеля, hook продления certbot, drop-in systemd и скрипты, которые их отрисовывают и проверяют. `make -C deploy edge-config` отрисовывает конфигурацию nginx и выполняет `nginx -t` в контейнере; см. [runbook edge proxy](../docs/ru/DEPLOY.md#edge-proxy-https-и-туннель).
- `labs/` содержит раскладку LXD хоста приложения для изолированного исполнителя и лабораторий (`lxd-preseed.yaml`, `acls.sh`) и `runner-vm.sh`, который собирает, обновляет и проверяет production VM исполнителя: `make -C deploy runner-vm-up`, `runner-vm-a16` и `runner-vm-check` на хосте приложения и `check-runner-vm` где угодно; см. [VM исполнителя](../docs/ru/DEPLOY.md#production-vm-исполнителя).
- `make -C deploy check-perimeter` проверяет по файлам опубликованные порты, запрещенные пути, лимиты и доверенного пира Nginx; `make -C deploy perimeter-test` проверяет то же по HTTP на одноразовых контейнерах Nginx; см. [Публичный периметр и адрес клиента](../docs/ru/DEPLOY.md#публичный-периметр-и-адрес-клиента).
| Каталог | Назначение |
| --- | --- |
| `docker/` | Основной стек и отдельные Compose для ML, мониторинга, demo, E2E и dev-runner |
| `nginx/` | Раздача SPA и проксирование API в Go |
| `edge/` | Шаблоны публичного HTTPS-прокси и приватного туннеля |
| `labs/` | LXD-сети, VM исполнителя кода и systemd-конфигурация labd |
| `ml-gpu/` | Запуск ML на GPU-хосте через systemd |
| `demo/`, `scripts/` | Синтетические данные, проверки и сборка выпуска |
| `release/` | Локальные манифесты выпуска, вне Git |
Dockerfile лежат в каталогах сервисов, `.env.example` - в корне репозитория. Из корня: `make -C deploy config` проверяет Compose, `make -C deploy up` запускает основной стек после подготовки `.env`. Мониторинг включается отдельно через `make -C deploy monitoring-up`. `make -C deploy test-e2e` запускает набор Playwright на одноразовом стеке с уникальным именем проекта и удаляет его после прогона; `make -C deploy test-e2e-registration` включает локальный Resend-compatible inbox только для браузерных тестов регистрации. Подробности см. в [TESTING.md](../docs/ru/TESTING.md#браузерный-e2e-набор).
Из корня репозитория:
`make -C deploy release-build`, `release-smoke`, `release-e2e` и `release-manifest` собирают образы выпуска с закрепленными digest базовых образов, проверяют их и публикуют неизменяемый манифест в `deploy/release/<release-id>/` (игнорируется Git); новый `RELEASE_ID` дает следующему этапу собственный манифест. `make -C deploy release-manifest-check` ищет в манифесте секреты и данные машины, `release-manifest-verify` сверяет с ним запущенные контейнеры, `release-up` восстанавливает основной стек, а `demo-seed DEMO_MODE=isolated RELEASE_ID=<id>` - демонстрационный стенд из точных образов, и `release-clean` удаляет образы выпуска, которые не удерживает ни один манифест. См. [манифест выпуска](../docs/ru/DEPLOY.md#манифест-выпуска).
```sh
make -C deploy help
make -C deploy config
make -C deploy up
```
Подробнее: [развертывание](../docs/ru/DEPLOY.md).
`config` проверяет примеры, `up` требует подготовленный `.env` и запускает только core. ML и мониторинг включаются отдельно; мониторинг и локальный ML требуют уже созданной сети core. `down` сохраняет тома.
Для демонстрации: `make -C deploy demo-seed DEMO_MODE=isolated`. Для проверок: `make -C deploy check`, `smoke` или `test-e2e`. Последние две цели создают и удаляют свои стенды.
Инструкции по секретам, HTTPS, runner и выпуску: [DEPLOYMENT.md](../docs/ru/DEPLOYMENT.md). Сценарии проверок: [TESTING.md](../docs/ru/TESTING.md).
+1 -1
View File
@@ -5,7 +5,7 @@
# writable cgroup v2 tree inside the Docker Desktop VM, and it serves plain
# HTTP on loopback. A privileged container on the core application host is
# forbidden; production runs the runner image only inside its dedicated VM
# with TLS and without these switches (see docs/en/DEPLOY.md).
# with TLS and without these switches (see docs/en/DEPLOYMENT.md).
#
# Use it through make -C deploy runner-dev-up, which creates the local token
# file named by RUNNER_DEV_TOKEN_FILE.
+4 -4
View File
@@ -242,7 +242,7 @@ services:
IDENTITY_SESSION_IDLE_TIMEOUT: ${IDENTITY_SESSION_IDLE_TIMEOUT:-24h}
IDENTITY_SESSION_ABSOLUTE_LIFETIME: ${IDENTITY_SESSION_ABSOLUTE_LIFETIME:-168h}
ASSESSMENT_DEMO_CATEGORIES_ENABLED: ${ASSESSMENT_DEMO_CATEGORIES_ENABLED:-false}
# Semantic matching (see docs/en/DEPLOY.md#semantic-matching). Off by
# Semantic matching (see docs/en/DEPLOYMENT.md#semantic-matching). Off by
# default: searches then use the neutral Sem. When on, vector jobs call
# the separate ML project, which joins this network as "ml".
SEMANTIC_MATCHING_ENABLED: ${SEMANTIC_MATCHING_ENABLED:-false}
@@ -259,7 +259,7 @@ services:
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
GITHUB_TIMEOUT: ${GITHUB_TIMEOUT:-10s}
REPOSITORY_CHECK_INTERVAL: ${REPOSITORY_CHECK_INTERVAL:-10m}
# Own code runner (see docs/en/DEPLOY.md#code-runner-client). Off while
# Own code runner (see docs/en/DEPLOYMENT.md#code-runner-client). Off while
# CODE_RUNNER_URL is empty: practice then reports the runner as
# unavailable and runs nothing. The token and the run key are secrets;
# pass the CA inline (CODE_RUNNER_CA_PEM) or mount a file and set its
@@ -294,7 +294,7 @@ services:
expose:
- "8080"
- "9090"
# Shutdown budget with the defaults (see docs/en/DEPLOY.md):
# Shutdown budget with the defaults (see docs/en/DEPLOYMENT.md):
# - in parallel: the HTTP shutdown (SHUTDOWN_TIMEOUT, 10s), the relay
# pass (10s plus a 5s rollback), and each event consumer
# (CONSUMER_SHUTDOWN_GRACE 5s, a 5s rollback, CONSUMER_COMMIT_TIMEOUT
@@ -328,7 +328,7 @@ services:
ipv4_address: ${APP_FRONTEND_IP:-172.29.79.10}
ports:
# Loopback by default. On the app host behind the edge proxy,
# APP_HTTP_BIND is the tunnel address (see docs/en/DEPLOY.md); never
# APP_HTTP_BIND is the tunnel address (see docs/en/DEPLOYMENT.md); never
# set it to 0.0.0.0, because Docker publishing bypasses ufw.
- "${APP_HTTP_BIND:-127.0.0.1}:${APP_HTTP_PORT:-8080}:8080"
healthcheck:
+1 -1
View File
@@ -2,7 +2,7 @@
# /etc/systemd/system/awg-quick@awg-lincodex.service.d/userspace.conf.
#
# The kernel module is not used: awg-quick falls back to the userspace
# daemon, which is installed from a pinned build (see docs/en/DEPLOY.md).
# daemon, which is installed from a pinned build (see docs/en/DEPLOYMENT.md).
# The daemon is one process per interface and is not restarted by systemd
# on its own; check the handshake with `awg show` after incidents.
[Service]
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# Creates the network ACLs referenced by lxd-preseed.yaml (TASK-592).
# Creates the network ACLs referenced by lxd-preseed.yaml.
# Run before the preseed. Rules are stateful: replies to allowed traffic pass.
set -euo pipefail
+1 -1
View File
@@ -1,4 +1,4 @@
# LXD host layout for the isolated runner and the practical labs (TASK-592).
# LXD host layout for the isolated runner and the practical labs.
# Applied once on the app host with: lxd init --preseed < lxd-preseed.yaml
# It only adds objects; it does not touch Docker, wg0 or the awg-lincodex tunnel.
storage_pools:
+1 -1
View File
@@ -1,7 +1,7 @@
# systemd user unit of the ML service on a GPU host without Docker. Install it
# as ~/.config/systemd/user/lincodex-ml.service of the service user (with
# lingering enabled) and keep the settings and the token in the environment
# file, mode 600; see docs/en/DEPLOY.md#ml-service-on-a-gpu-host.
# file, mode 600; see docs/en/DEPLOYMENT.md#ml-service-on-a-gpu-host.
#
# %h is the home directory of the user: the layout below is
# %h/lincodex-ml/app/ml the ml/ directory of the release
+1 -1
View File
@@ -6,7 +6,7 @@
ML_EMBEDDER=giga,qwen3
ML_DEVICE=cuda
# float16 fits both models in about 2.4 GiB of VRAM; see the precision note in
# docs/en/DEPLOY.md#ml-service-on-a-gpu-host before changing it.
# docs/en/DEPLOYMENT.md#ml-service-on-a-gpu-host before changing it.
ML_DTYPE=float16
# Allocator cap of the process; the CUDA context adds about 130 MiB.
ML_CUDA_MEMORY_LIMIT_MB=2300