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>"
  }
}
FieldDescription
kindrun, check or diff. A diff reads the diff of a push.
runIdThe run. Null for the check of a stack made from a push, and for a diff.
stackIdFor a check, the change stack; otherwise null.
diffIdFor a diff, the push to diff; otherwise null.
taskIdThe task, or null.
poolThe pool's key.
labelsThe placement the work requires.
imageThe image the line names, or null.
runner.id, runner.tokenThe runner to start and its one-run token.
runner.egressThe egress the runner sends its traffic through, or null when the pool names no egress. See Egress.
runner.egress.urlThe egress's URL: the url of the spotlight_egress the pool names, or the platform egress's URL.
runner.egress.credentialThe run proxy credential: made for this runner alone.
runner.egress.trafficall or bound: the pool's provision.egressTraffic.
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.
HostsHosts 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 reads url from SPOTLIGHT_EGRESS_URL, credential from SPOTLIGHT_EGRESS_PROXY_CREDENTIAL and traffic from SPOTLIGHT_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:

CodeCauseRetried
unreachableThe call could not be made.yes
http-errorThe response was not 2xx.yes
expiredThe pool accepted the work, but no runner claimed it by claimBy.yes
not-allowedThe 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
unusableThe 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-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