Skip to content

Load lifecycle

A load is a workload deployed to a node. Each load is declared in the loads section of the config with a target node and a load driver: container runs an OCI image through containerd, and process runs a native executable. See Container driver and Process driver.

Loads can depend on other loads with depends_on. Realm starts dependencies first and stops them last, and rejects dependency cycles. realm loads graph prints the dependency graph.

Provisioning a load on a ready node creates a deployment on that node’s agent, and the state of a load is the state of its deployment. realm start and realm update provision the loads of the planned state for you.

stateDiagram-v2
[*] --> Ready: Provision
Ready --> Running: Start
Ready --> [*]: Deprovision
Running --> Stopped: Stop / Kill
Stopped --> Running: Start
Stopped --> [*]: Deprovision
Error --> Stopped: Kill
Error --> [*]: Deprovision
State Meaning
ready Provisioned on the node but not started
running The container or process is running
stopped The load was stopped or killed, and can be started again
error The load failed; kill or deprovision it to recover

Check the state of the loads with realm loads state.

  • Provision: prepares the load on its node, for example by pulling the container image. The node must be ready.
  • Start: realm loads start starts a ready or stopped load. realm start starts every load in the cluster in dependency order.
  • Stop: realm loads stop stops the load gracefully, for example with the process driver’s stop_signal.
  • Kill: realm loads kill terminates a running or error load immediately.
  • Deprovision: removes the deployment from the node. Managed container volumes are kept.

Read a load’s output with realm loads stdout <load> and realm loads stderr <load>.