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,
"diffId": 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>",
"egress": {
"url": "<egress URL>",
"credential": "<run proxy credential>",
"traffic": "all"
}
},
"spotlightUrl": "https://app.usespotlight.ai",
"claimBy": "<ISO 8601 time>"
}
}| Field | Description |
|---|---|
kind | run, check or diff. A diff reads the diff of a push. |
runId | The run. Null for the check of a stack made from a push, and for a diff. |
stackId | For a check, the change stack; otherwise null. |
diffId | For a diff, the push to diff; otherwise null. |
taskId | The task, or null. |
pool | The pool's key. |
labels | The placement the work requires. |
image | The image the line names, or null. |
runner.id, runner.token | The runner to start and its one-run token. |
runner.egress | The egress the runner sends its traffic through, or null when the pool names no egress. See Egress. |
runner.egress.url | The egress's URL: the url of the spotlight_egress the pool names, or the platform egress's URL. |
runner.egress.credential | The run proxy credential: made for this runner alone. |
runner.egress.traffic | all or bound: the pool's provision.egressTraffic. |
spotlightUrl | The address the runner connects to. |
claimBy | The runner must claim the work by this time, 5 minutes after the work was reserved for it. |
Delivery
| Item | Value |
|---|---|
| Timeout | 10 seconds. |
| Redirects | Not followed. |
| Accepted | Any 2xx response. |
| Hosts | Hosts that the deployment allows, at addresses that Spotlight calls. See Calls out of Spotlight. |
Egress
When the pool names an egress in provision.egress:
- Spotlight also offers the pool runs whose secrets egress injects, or that use Spotlight's API, such as the runs of a setup chat.
- Each call, for a run or a check, carries
runner.egress. The runner readsurlfromSPOTLIGHT_EGRESS_URL,credentialfromSPOTLIGHT_EGRESS_PROXY_CREDENTIALandtrafficfromSPOTLIGHT_EGRESS_TRAFFIC. See The spotlight command.
When it names none, runner.egress is null, and a run whose secrets egress injects,
or that uses Spotlight's API, is never offered to the 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:
| Code | Cause | Retried |
|---|---|---|
unreachable | The call could not be made. | yes |
http-error | The response was not 2xx. | yes |
expired | The pool accepted the work, but no runner claimed it by claimBy. | yes |
not-allowed | The URL's host is not allowed: This deployment’s outbound allow-list doesn’t include <host>., or This workspace’s outbound allow-list doesn’t include <host>. for the workspace's list. The host is at a blocked address: <host>: The address is ... or <host>: The host resolves to <address>, ..., with the reason the blocked-address messages give. The URL is not https where https is required. The egress URL is not https where https is required: Egress URL must be https. Runners send their proxy credential to it. | no |
unusable | The pool's provision secret cannot be opened. The pool names the platform egress and the deployment has none, or names an egress that does not exist in its workspace. The work needs egress, and the pool no longer names one: The pool names no egress now. A run whose secrets egress injects, or that uses the Spotlight API, needs one. | no |
harness-missing | The 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.