75 lines
2.8 KiB
YAML
75 lines
2.8 KiB
YAML
parameters:
|
|
- name: run_id
|
|
in: path
|
|
required: true
|
|
description: >-
|
|
Random UUID chosen by the backend for one logical run. It is the
|
|
idempotency key of SubmitRun and must not encode a candidate, attempt,
|
|
or task identifier.
|
|
schema:
|
|
type: string
|
|
format: uuid
|
|
put:
|
|
operationId: SubmitRun
|
|
summary: Start a sandboxed run of one source against its test groups.
|
|
description: |-
|
|
Idempotent by `run_id`:
|
|
|
|
- a new ID with a free sandbox slot starts the run and answers 202 with `state: running`;
|
|
- the same ID with the same payload answers 200 with the current state of that run, including the finished result, without running it again;
|
|
- the same ID with a different payload answers 422 `idempotency_key_reused` and changes nothing;
|
|
- a new ID while every slot is busy, or while the runner is draining, answers 503 `runner_busy` with Retry-After; nothing is stored, so the caller retries with the same ID.
|
|
|
|
Payloads are compared by a SHA-256 fingerprint of the decoded request.
|
|
The runner keeps runs only in memory for a bounded time after they
|
|
finish; an ID that was forgotten or lost in a restart starts a new run.
|
|
Requests above the configured body limit (8 MiB by default) answer 413
|
|
`payload_too_large`. Semantic rules that the schema cannot express answer
|
|
400 `validation_failed`: group IDs are unique in a run, test IDs are
|
|
unique in a group, the number of tests multiplied by
|
|
`limits.time_limit_ms` does not exceed 300000, a `numbers` checker has a
|
|
positive tolerance, a `custom` checker has a program, and no other kind
|
|
carries tolerances or a program.
|
|
tags:
|
|
- runs
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/RunRequest
|
|
responses:
|
|
"200":
|
|
description: A run with this ID and the same payload already exists.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/RunStatus
|
|
"202":
|
|
description: The run was accepted and started.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/RunStatus
|
|
"503":
|
|
$ref: ../components/responses.yml#/RunnerBusy
|
|
default:
|
|
$ref: ../components/responses.yml#/Problem
|
|
get:
|
|
operationId: GetRun
|
|
summary: Read the state and, when finished, the per-group result of a run.
|
|
description: >-
|
|
Answers 404 `not_found` for an ID the runner does not hold, including a
|
|
run forgotten after its retention time or lost in a restart.
|
|
tags:
|
|
- runs
|
|
responses:
|
|
"200":
|
|
description: The current state of the run.
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: ../components/schemas.yml#/RunStatus
|
|
default:
|
|
$ref: ../components/responses.yml#/Problem
|