Provision call

For each run or check a push pool is to serve, Spotlight calls the pool's provision.url to start a runner. The pool, its URL and its secret are set on spotlight_runner_pool.

Request

POST <provision.url>
content-type: application/json
webhook-id: <runner id>
webhook-timestamp: <Unix seconds>
webhook-signature: v1,<signature>

The signature is made as for a hook's HMAC signing, with provision.secret as the secret.

Body

{
  "type": "work.provision",
  "timestamp": "<ISO 8601 time>",
  "data": {
    "kind": "run",
    "runId": "<run id>",
    "stackId": null,
    "taskId": "<task id>",
    "workspaceId": "<workspace id>",
    "pool": "<pool key>",
    "labels": ["<label>"],
    "image": "<image reference or null>",
    "runner": { "id": "<runner id>", "token": "<one-run token>" },
    "spotlightUrl": "https://app.usespotlight.ai",
    "claimBy": "<ISO 8601 time>"
  }
}
FieldDescription
kindrun or check.
runIdThe run.
stackIdThe change stack, for a check; otherwise null.
taskIdThe task, or null.
poolThe pool's key.
labelsThe placement the work asks for.
imageThe image the line names, or null.
runner.id, runner.tokenThe runner to start and its one-run token.
spotlightUrlThe address the runner connects to.
claimByThe runner must claim the work by this time, 5 minutes after the work was reserved for it.

Delivery

ItemValue
Timeout10 seconds.
RedirectsNot followed.
AcceptedAny 2xx response.
HostsOnly hosts on the deployment's outbound allow-list.

A run that uses secrets is never provisioned by a push pool.

Failures

When several push pools fit the work, a failed call tries the next pool. When the last pool fails, the work's provisioning fails:

CodeCauseRetried
unreachableThe call could not be made.yes
refusedThe response was not 2xx.yes
lapsedThe pool accepted the work, but no runner claimed it by claimBy.yes
not-allowedThe URL's host is not allowed, or the URL is not https where that is refused.no
unusableThe pool's provision secret cannot be opened.no
harness-missingThe runner the pool started does not have the work's harness installed.no

A retried failure gets up to 5 attempts in all, 5, 10, 20 and 40 seconds apart.

On this page