Install script

Spotlight serves a POSIX shell script at /api/install.sh on the Spotlight address. It needs no sign-in and reads no input. See Install a host. On a self-hosted Spotlight, use your deployment's address in place of app.usespotlight.ai.

curl -fsSL https://app.usespotlight.ai/api/install.sh | SPOTLIGHT_TOKEN=<pool token> sh
curl -fsSL https://app.usespotlight.ai/api/install.sh \
  | SPOTLIGHT_TRUST=<trust id> SPOTLIGHT_OIDC_TOKEN_FILE=<token file> sh

Variables

VariableDefaultDescription
SPOTLIGHT_TOKENnoneA pull pool's token. Without it, the value in the existing configuration file.
SPOTLIGHT_TRUSTnoneA runner trust's id. Without it, the value in the existing configuration file.
SPOTLIGHT_OIDC_TOKEN_FILEnoneThe path to the workload's OIDC token. Without it, the value in the existing configuration file.
SPOTLIGHT_CAPACITYnoneWritten to the configuration when set. Without it, the value in the existing configuration file.
SPOTLIGHT_URLnoneWritten to the configuration. Without it, the public address of the Spotlight that served the script, its SPOTLIGHT_PUBLIC_URL.
SPOTLIGHT_VERSIONnoneThe spotlight release to install. Without it, the release of the Spotlight that served the script, its SPOTLIGHT_RELEASE, else latest.
SPOTLIGHT_RUNNER_IMAGEghcr.io/usespotlightai/spotlight-runner:<version>The image pulled and written to the configuration.
SPOTLIGHT_REPOusespotlightai/spotlightThe GitHub repository releases are downloaded from.
SPOTLIGHT_DOWNLOAD_URLnoneA base URL to download the binary and checksum from, in place of GitHub releases.
SPOTLIGHT_BIN_DIR/usr/local/bin as root or when writable, else ~/.spotlight/binWhere spotlight is installed.
SPOTLIGHT_HOST_CONFIG/etc/spotlight/host.env as root, else ~/.spotlight/host.envThe configuration file written.
SPOTLIGHT_NO_SERVICEnone1 installs without starting a service.

The binary is downloaded from:

SPOTLIGHT_VERSIONURL
latesthttps://github.com/<repo>/releases/latest/download/spotlight-<os>-<arch>
any otherhttps://github.com/<repo>/releases/download/<version>/spotlight-<os>-<arch>

<os> is linux or darwin. <arch> is amd64 or arm64. The checksum is the same URL with .sha256 appended.

Steps

The script stops at the first failure. Each failure listed under Messages exits 1.

StepAction
1Finds curl or wget, and sha256sum or shasum.
2Reads the platform from uname -s and uname -m.
3Chooses and creates the binary directory.
4Chooses the configuration path.
5Reads the credentials: each variable from the environment, else from the existing configuration file.
6Finds a container runtime: the first of docker or podman whose info succeeds.
7Downloads spotlight and its checksum, checks the checksum, and installs the binary.
8Writes the configuration file.
9Pulls the runner image with the runtime found in step 6.
10With SPOTLIGHT_NO_SERVICE=1, stops here. Otherwise runs spotlight host install with SPOTLIGHT_HOST_CONFIG set to the configuration path.

See The spotlight command for the service spotlight host install writes.

Files

PathModeContents
<bin dir>/spotlightexecutableThe binary.
<config path>0600The host configuration.

The script writes the configuration file whole, replacing what was there. It holds only these keys:

KeyWritten
SPOTLIGHT_URLalways
SPOTLIGHT_TOKENwhen set
SPOTLIGHT_TRUSTwhen set
SPOTLIGHT_OIDC_TOKEN_FILEwhen set
SPOTLIGHT_CAPACITYwhen set
SPOTLIGHT_RUNNER_IMAGEalways

Running the script again drops any other key the file held. See Host settings for every key the host reads, and the separate sandbox.env and egress.env files beside it.

Messages

Every message goes to standard error, prefixed spotlight host: .

MessageWhen
downloading spotlight <version> (<os>-<arch>)Step 7 begins.
installed <bin dir>/spotlightThe binary is in place.
wrote <config path>The configuration is written.
pulling <image>Step 9 begins.
installed. Start it with: SPOTLIGHT_HOST_CONFIG=<config path> <bin dir>/spotlight hostSPOTLIGHT_NO_SERVICE=1.
serving <spotlight address>: this machine shows on the workspace's Runners page once it reportsThe service is installed.
MessageCause
need curl or wget to download spotlightNeither is on PATH.
need sha256sum or shasum to check what it downloadsNeither is on PATH.
unsupported operating system: <os>Not Linux or macOS.
unsupported architecture: <arch>Not x86-64 or ARM64.
set SPOTLIGHT_TOKEN to a pull pool's token, or SPOTLIGHT_TRUST and SPOTLIGHT_OIDC_TOKEN_FILE to claim through a runner trustNo token and no trust.
no container runtime answered: install and start Docker or Podman (on macOS, Docker Desktop, OrbStack or Colima), then run this againNo runtime answered info.
could not download spotlight from <url>The binary download failed.
could not download the checksum from <url>.sha256The checksum download failed.
spotlight failed its checksum: expected <sha256>, got <sha256>The download does not match its checksum.
could not pull <image>The image pull failed.

See The spotlight command for the failures of spotlight host install.

On this page