ServicesWorker Pools

Turn on managed Workers

Run Tasks on Spiral-managed compute that scales with demand.

In development

Run Tasks without any infrastructure of your own. Turn on a Spiral-managed provider for the Project, and Spiral starts Workers when Tasks are waiting and stops them when no work remains.

Prerequisites

  • You have the Project admin role. Turning on a provider creates a workload and grants it a role, and only an admin can grant roles.

Turn on a provider in Studio

  1. Open the Project.
  2. Open Tasks.
  3. Turn on a provider in the Spiral-managed Workers section.

Turn on a provider over HTTP

List the providers and their state in the Project:

curl https://api.spiraldb.dev/api/workers/projects/demo/managed-workers \
  -H "Authorization: Bearer $SPIRAL_TOKEN"

Each provider has an id, a displayName, and enabled, plus the workerPoolIds of its pools and how many Workers are active and busy (activeWorkers, busyWorkers). Its phase summarizes what it is doing: disabled, idle, provisioning, scaling_up, active, scaling_down, or degraded. The response also contains the workloadId that managed Workers sign in as.

Turn on one provider by its id:

curl -X PUT https://api.spiraldb.dev/api/workers/projects/demo/managed-workers/$PROVIDER_ID \
  -H "Authorization: Bearer $SPIRAL_TOKEN"

What turning on a provider creates

The first time you turn on a provider, Spiral creates one workload in the Project with the editor role, and managed Workers sign in as it. Spiral also creates one Worker Pool for each resource profile the provider supports. See Spiral-managed capacity.

Verify capacity

Submit a Task, then read the provider again. While the Task runs, busyWorkers is at least 1. In Studio, the Task page shows Auto worker in the Capacity field. See Inspect Tasks and Workers.

Pause one managed pool

To stop new Workers for one resource profile only, pause its pool. The other profiles keep running:

curl -X POST https://api.spiraldb.dev/api/tasks/projects/demo/worker-pools/$WORKER_POOL_ID/pause \
  -H "Authorization: Bearer $SPIRAL_TOKEN"

Use POST .../activate to start it again. Each managed pool starts with a limit of 1000 concurrent Workers, and turning on a provider again keeps the limit an existing pool already has.

Turn off a provider

curl -X DELETE https://api.spiraldb.dev/api/workers/projects/demo/managed-workers/$PROVIDER_ID \
  -H "Authorization: Bearer $SPIRAL_TOKEN"

Spiral pauses the provider's pools and releases their waiting Tasks to any other Worker that can run them. Workers already running an Attempt finish it. Spiral keeps the Project workload, so turning on this or another provider later reuses it.

After a profile change

If a Spiral release adds or removes a provider's resource profiles, the list of pools under workerPoolIds no longer matches the profiles in Spiral-managed capacity. Turn on the provider again: this creates the missing pools and pauses the ones that are no longer used. Running Workers keep their resources until they exit.

Where next: run your own Workers when you need GPUs or compute next to your data.

Found a problem? Edit this page or report an issue.

On this page