Code runner
Русский | English
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.
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 fromapi/runner/.internal/isolationtest/,testdata/hostile/- A16 isolation tests.
make -C runner check
make -C deploy runner-dev-up
make -C deploy runner-dev-down
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.