Skip to main content
The jobs store keeps:
  • Each session’s background jobs, the ones cmd & starts, and each job’s output.
  • The processes each instance of the workspace runs, which ps lists.
  • When each instance was last seen, so the others can tell it is gone.
The group key is store.jobs. A job’s output is a stream other processes follow, so disk is refused here, and a disk store keeps its jobs in memory.

On Redis

Here the rest of the state stays on the machine’s disk, and every process on the machine that builds the workspace sees the same jobs.

Run several instances of one workspace

Every process that builds the workspace under the same id on one Redis is an instance of it, on one machine or several, behind a load balancer or as replicas of one agent.
workspace.yaml
On the servers, workspace.json holds {"id": "agent", "config": {...}} with the same config on each. The instances then share:
  • Each session’s background jobs: jobs, wait, kill %N and fg %N work on any instance, whichever started the job.
  • Processes: ps lists the other instances’ as owner:pid, and kill owner:pid stops one.
  • Cleanup: an instance counts as gone 30 seconds after it was last seen, and the next one to start stops the programs it left running.
  • Sessions, history and symlinks, since the whole store is on Redis.
A session sees only its own processes, on every instance; a profile with processes: workspace widens that to every session’s. Shell describes the details.