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

+1 -1
View File
@@ -1,5 +1,5 @@
# Production image of the code runner. It runs only on the dedicated runner
# host or VM, never on the core application host; see docs/en/DEPLOY.md.
# host or VM, never on the core application host; see docs/en/DEPLOYMENT.md.
#
# Base images are build arguments so that a release build can pin each one to
# the digest it resolved; the defaults keep the agreed tags.
+16 -11
View File
@@ -2,17 +2,22 @@
[Русский](README.md) | English
A separate Go service that runs untrusted candidate code in nsjail and checks it against public and hidden tests. It supports Python 3 and Go (a separate compile phase with a prebuilt standard library) and the `exact`, `tokens`, `numbers`, and `custom` (a family program in nsjail) checkers. The backend calls it through the internal `api/runner/` contract over TLS with a bearer token; no backend use case calls it yet.
Go service that executes candidate Python and Go code in nsjail. It checks public and hidden tests with `exact`, `tokens`, `numbers`, or a custom checker. The backend uses it through the `CodeRunner` port and practice queue; the connection is disabled by default.
- `cmd/runner/` is the entry point and the container `healthcheck`.
- `internal/sandbox/` holds nsjail, cgroup v2, seccomp, run directories, and stopping on limits.
- `internal/judge/` holds languages, the syntax check step, and test and group outcomes.
- `internal/checker/` holds the checker interface and the `exact`, `tokens`, and `numbers` comparisons; the custom checker lives in `internal/judge/`.
- `internal/judgetest/` and `testdata/judge/` are reference Python and Go solutions with their expected group results.
- `internal/jobs/` keeps runs in memory, makes them idempotent by run ID, and bounds concurrent runs.
- `internal/server/` is the HTTP API on the generated ogen server (`internal/api/`, from `codegen/ogen.yml`).
- `internal/isolationtest/`, `testdata/hostile/`, and `scripts/run-a16.sh` are the A16 hostile-program suite in Python and Go, its report, and its run on the runner host.
- `internal/sandbox/` - namespaces, cgroup v2, seccomp, and limits.
- `internal/judge/`, `internal/checker/` - execution and result checking.
- `internal/jobs/` - in-memory runs and concurrency limits.
- `internal/server/`, `internal/api/` - HTTP API and ogen code from `api/runner/`.
- `internal/isolationtest/`, `testdata/hostile/` - A16 isolation tests.
From the repository root, `make -C runner check` runs formatting, build, unit tests, the generated code check, and lint; `make -C runner test-sandbox` builds the image and runs the reference solutions and the A16 suite in a privileged dev container; `make -C runner test-a16` runs only the A16 suite with a report, and `make -C runner a16-bundle` builds it for the runner host. Local start: `make -C deploy runner-dev-up` (development only).
```sh
make -C runner check
make -C deploy runner-dev-up
make -C deploy runner-dev-down
```
Production: the service runs only in the dedicated runner VM, never on the core host. More: [deployment](../docs/en/DEPLOY.md#code-runner), [architecture](../docs/en/ARCHITECTURE.md#code-runner), and [checks](../docs/en/TESTING.md#code-runner-tests).
The development container is privileged, serves HTTP only on loopback, and must not run on the core host. Production requires a dedicated VM with its own kernel, no application secrets or outgoing connections, TLS 1.3, and a service token. The backend cannot connect directly to development HTTP.
`make -C runner test-sandbox` checks solutions and A16 in a privileged development container. `test-a16` saves an isolation report; `a16-bundle` builds the checks for the target VM. Unit tests do not establish isolation of a real VM.
Settings and activation steps: [DEPLOYMENT.md](../docs/en/DEPLOYMENT.md#code-runner).
+16 -11
View File
@@ -2,17 +2,22 @@
Русский | [English](README.en.md)
Отдельный Go-сервис, который запускает недоверенный код кандидата в nsjail и проверяет его на публичных и скрытых тестах. Поддерживаются Python 3 и Go (отдельная фаза компиляции с заранее собранной стандартной библиотекой); checker `exact`, `tokens`, `numbers` и `custom` (программа семейства в nsjail). Backend вызывает его по внутреннему контракту `api/runner/` с TLS и bearer-токеном; ни один usecase backend пока не использует его.
Go-сервис для запуска кода кандидата на Python и Go в nsjail. Проверяет публичные и скрытые тесты через `exact`, `tokens`, `numbers` или custom checker. Backend использует его через порт `CodeRunner` и очередь практики; по умолчанию подключение выключено.
- `cmd/runner/` - точка входа и `healthcheck` для контейнера.
- `internal/sandbox/` - nsjail, cgroup v2, seccomp, рабочие каталоги и остановка по лимитам.
- `internal/judge/` - языки, шаг проверки синтаксиса, исходы тестов и групп.
- `internal/checker/` - интерфейс checker и сравнения `exact`, `tokens` и `numbers`; custom checker находится в `internal/judge/`.
- `internal/judgetest/` и `testdata/judge/` - эталонные решения на Python и Go с ожидаемыми результатами групп.
- `internal/jobs/` - прогоны в памяти, идемпотентность по run ID и лимит параллельных прогонов.
- `internal/server/` - HTTP API на сгенерированном ogen-сервере (`internal/api/`, из `codegen/ogen.yml`).
- `internal/isolationtest/`, `testdata/hostile/` и `scripts/run-a16.sh` - набор враждебных программ A16 на Python и Go, его отчет и запуск на хосте исполнителя.
- `internal/sandbox/` - namespaces, cgroup v2, seccomp и лимиты.
- `internal/judge/`, `internal/checker/` - запуск и проверка результатов.
- `internal/jobs/` - прогоны в памяти и ограничение параллелизма.
- `internal/server/`, `internal/api/` - HTTP API и ogen-код из `api/runner/`.
- `internal/isolationtest/`, `testdata/hostile/` - проверка изоляции A16.
Из корня: `make -C runner check` запускает форматирование, сборку, unit-тесты, проверку generated-кода и lint; `make -C runner test-sandbox` собирает образ и запускает эталонные решения и набор A16 в привилегированном dev-контейнере; `make -C runner test-a16` запускает только набор A16 с отчетом, а `make -C runner a16-bundle` собирает его для хоста исполнителя. Локальный запуск: `make -C deploy runner-dev-up` (только для разработки).
```sh
make -C runner check
make -C deploy runner-dev-up
make -C deploy runner-dev-down
```
Production: сервис работает только в отдельной VM исполнителя, никогда на core-хосте. Подробнее: [развертывание](../docs/ru/DEPLOY.md#исполнитель-кода), [архитектура](../docs/ru/ARCHITECTURE.md#исполнитель-кода) и [проверки](../docs/ru/TESTING.md#тесты-исполнителя-кода).
Dev-контейнер привилегированный, обслуживает HTTP только на loopback и не подходит для core-хоста. Production требует отдельную VM с собственным ядром, без секретов приложения и исходящих соединений, с TLS 1.3 и сервисным токеном. Backend не подключается напрямую к dev HTTP.
`make -C runner test-sandbox` проверяет решения и A16 в привилегированном dev-контейнере. `test-a16` сохраняет отчет только по изоляции; `a16-bundle` собирает пакет проверки для целевой VM. Unit-тесты не подтверждают изоляцию реальной VM.
Настройки и порядок включения: [DEPLOYMENT.md](../docs/ru/DEPLOYMENT.md#исполнитель-кода).