feat(runner): compile Go and check answers per test group
This commit is contained in:
1 parent
e95c681165
commit
afee564bf4
61 files changed
+2592
-143
No files matched your search
@@ -740,9 +740,13 @@ Isolation layers of one run (implemented):
|
||||
|
||||
The service bounds concurrent runs (1 by default) and answers 503 `runner_busy` when no slot is free; the backend keeps the queue. The contract and the configuration bound the request body, the source, the inputs, and the output. Logs carry only the method, operation, status, duration, run ID, language, group and test counts, and outcome; the source, test data, program output, and token never reach a log. Runs live only in memory and are forgotten after their TTL; the backend resubmits a run lost in a restart.
|
||||
|
||||
Outcomes distinguish `accepted`, `wrong_answer`, `compile_error` (for Python, a syntax check with `compile()` before the tests), `time_limit_exceeded`, `memory_limit_exceeded`, `output_limit_exceeded`, `runtime_error` (including the process limit), and `infrastructure_failure`. Test time is the CPU time of every process of the test, including interpreter startup; memory is the cgroup peak of the test, including nsjail and file cache charged to the test.
|
||||
Languages. Python 3 runs on the image's interpreter in isolated mode after a syntax check with `compile()`. Go is compiled in a separate phase with its own limits (20 s CPU, 768 MiB, files up to 64 MiB): `go tool compile` and `go tool link` run in separate jails and read a standard library prebuilt into the image through an importcfg, so they need no build cache, modules, cgo, or network, and only the standard library can be imported. A run directory consists of the source (`/box`, read-only) and the build output (`/out`): only compile steps write it, and tests see it read-only. A compile or link error is `compile_error` with the compiler message, and no test runs.
|
||||
|
||||
Planned and not implemented: deployment of the runner VM with TLS, firewall, and monitoring; Go (compile and run); a float tolerance checker and custom checkers; calls from the backend and the run queue; service metrics; the full A16 isolation suite built on `runner/testdata/hostile/`.
|
||||
A checker is set per group: `exact`, `tokens`, `numbers` (numeric tokens are equal within an absolute or relative tolerance), and `custom`. A custom checker is a task family program in Python or Go; it is built once per run and runs in nsjail with the same isolation as the solution and limits of its own (5 s CPU, 256 MiB). It receives the input, the expected output, and the actual output as read-only files in `/check` and answers with its exit status: 0 accepts, 1 rejects, and anything else is a checker failure, that is, `infrastructure_failure`. Its output is discarded. The result is returned per group; hidden test content, program output, and hidden test diagnostics never reach the response.
|
||||
|
||||
Outcomes distinguish `accepted`, `wrong_answer`, `compile_error` (for Python, a syntax check with `compile()` before the tests; for Go, compile and link), `time_limit_exceeded`, `memory_limit_exceeded`, `output_limit_exceeded`, `runtime_error` (including the process limit), and `infrastructure_failure`. Test time is the CPU time of every process of the test, including interpreter startup; memory is the cgroup peak of the test, including nsjail and file cache charged to the test.
|
||||
|
||||
Planned and not implemented: deployment of the runner VM with TLS, firewall, and monitoring; calls from the backend and the run queue; service metrics; the full A16 isolation suite built on `runner/testdata/hostile/`.
|
||||
|
||||
## Matching and explanations
|
||||
|
||||
|
||||
Reference in new issue
Block a user