Kibotos

Core concepts

Templates, Workspaces, and Volumes are the objects you work with every time you use Kibotos. This page introduces them and the other objects, the states of a Workspace, and the two access paths: the control plane and the data plane.

Objects

flowchart LR
  T["Template<br/>revision"] -->|fixed at creation| W[Workspace]
  W ---|binds 0 or 1| V[Volume]
  W -.->|referenced by network policy| E[Egress]
  W -.->|referenced by network policy| R[Resolver]
  X[Exposure] -->|exposes one port| W
  W -->|export| TR[Transfer]
  TR -->|restore as new| W2[Workspace]

Templates and revisions

A Template is the system image used to create Workspaces, such as a minimal system, a programming toolchain, or a desktop environment.

  • Every publish produces an immutable revision. The deployer selects a default revision for each Template.
  • When you create a Workspace, you can name only the Template and let the system pick the current default revision, or you can name a specific revision.
  • Once chosen, the revision never changes. If the deployer later publishes a new version or changes the default revision, existing Workspaces keep the revision they have.

Workspaces

A Workspace is the environment an Agent works in. Each Workspace runs in its own MicroVM.

  • Its ID never changes after creation.
  • Every successful start is a new run, called a generation, numbered from 1 upward. After a stop, all credentials, processes, and connections of that run become invalid, and you need to request new credentials after the next start.
  • Its attributes are CPU, memory, writable layer size, expiration time, network policy, labels, and annotations. The writable layer is the writable part of the root file system. For its retention rules, see Guarantees and limits.
  • Volumes and writable layers are stored in the deployer's storage pools. At every start, the system picks a host that can reach these storage pools to run the Workspace. It may not be the same host as last time.

Volumes

A Volume is a persistent volume that exists independently of any Workspace.

  • By default, creating a Workspace also creates a dedicated Volume mounted at /data. You can instead bind an existing Volume, or have no Volume at all.
  • A Workspace binds at most one Volume, and a Volume belongs to only one Workspace at a time. After a Workspace stops, you can rebind or unbind its Volume. The change takes effect at the next start.
  • A Volume created by default is deleted together with its Workspace, and a bound existing Volume is kept by default. You can change either behavior when you bind the Volume. For when data is kept, see Guarantees and limits.

Other objects

ObjectWhat it isDetails
ExposureTurns an HTTP port in a Workspace into a public https:// addressPublic URLs
EgressAn outbound proxy provided by the caller. When the network policy references it, outbound connections go through it. Requires v0.3.0 or laterEgress
ResolverA DNS server provided by the caller. When the network policy references it, DNS queries go through it. Requires v0.3.0 or laterResolvers chosen by the caller
TransferExports the Volume of a stopped Workspace to an archive, which you can then import as a new Volume and restore as a new Workspace with a different IDExport, import, and restore
labels and annotationsKey-value pairs attached to objects such as Workspaces and Volumes. You can filter lists by labels; annotations are only storedLabels and annotations

Workspace states

stateDiagram-v2
  CREATING --> AVAILABLE
  AVAILABLE --> STOPPING: stop / expire
  STOPPING --> STOPPED
  STOPPED --> STARTING: start
  STARTING --> AVAILABLE
  AVAILABLE --> FAILED: error
  FAILED --> STOPPED: force stop
  STOPPED --> DELETING: delete
  DELETING --> DELETED
StateMeaning
CREATINGChoosing a host, preparing the Template, and starting the MicroVM
AVAILABLERunning; files and processes are accessible
STOPPINGStopping
STOPPEDStopped; uses no CPU or memory
STARTINGStarting
FAILEDSomething went wrong during creation, start, or while running
UNKNOWNThe result of an operation cannot be confirmed for the moment
DELETINGDeleting
DELETEDDeleted; still queryable by ID

The diagram shows only the main paths:

  • You can delete a Workspace directly from any state except DELETING and DELETED.
  • Errors during creation and start also lead to FAILED.
  • Whether the guest is responding (RESPONDING or UNRESPONSIVE) is reported separately and does not change the state.

For the operations allowed in each state and how to recover from FAILED, see Operations by state and Recovering from FAILED.

Control plane and data plane

There are two paths into Kibotos:

Control planeData plane
What it doesCreate, query, stop, and delete Workspaces; manage objects such as Volumes and ExposuresRead and write files, run processes, open terminals and desktops
Where requests goctrlThe host that runs the Workspace
How you authenticateAn Operator identity issued by the deployer, with mutual TLSA short-lived session credential requested from ctrl first

File and process traffic does not pass through ctrl, so large files and long-running output are unaffected by load on the control plane. The cost is one extra step to request a credential, and another request after each Workspace restart. Both kibo and the E2B gateway do this for you. For how requests flow, see Architecture.

Write operation conventions

ConventionWhat to do
Command IDEvery write request carries a command ID generated by the caller. Resending with the same command ID does not run the operation twice; if the result is already available, you get it directly
Expected revisionWhen you modify an existing object, include the revision you read. If someone else modified it first, the request is rejected instead of silently overwriting their change
Unknown resultWhen a request times out or the connection drops, resend it with the original command ID, or query the result of that command. A different command ID makes it a new operation

For the exact fields and error codes, see Write operation conventions on the native API page.

On this page