Compute is in preview, and the
v1alpha API can change.Compare runtime classes
The following table compares the two classes:When to use each class
Choosegeneral-purpose in the following cases:
- You want to run an existing container image without repackaging it.
- Your app needs
envFrom, extra Linux capabilities, setuid binaries, or a large filesystem.
unikernel in the following cases:
- Startup time and per-Instance overhead matter, such as for bursty or short-lived services.
- Your app is a self-contained binary, such as a Go or Rust program, or a small interpreted app whose runtime and libraries fit in memory.
Select a runtime class
If you don’t set a runtime class, Datum usesunikernel. To run a standard container image, set the class to general-purpose explicitly.
To select a class with datumctl, pass the --runtime-class flag when you create the workload:
WORKLOAD_NAME: a name for your workload.IMAGE: the full image reference, including the registry host, such asghcr.io/example/app:1.0.LOCATION: the location to run in, such asus-central-1.RUNTIME_CLASS:general-purposeorunikernel.
spec.template.spec.runtime.class:
general-purpose workload returns an error that says disk-backed volumes aren’t supported by the general-purpose runtime class.
View the runtime class catalog
The classes are read-only resources in your project. To list them, run the following command:Change a workload’s runtime class
A workload keeps its runtime class for its whole life. If you try to change the class,datumctl compute deploy and the API reject the change.
To move a workload to another class, follow these steps:
- Deploy a new workload with a different name and the class that you want.
- To confirm that the new workload is available, run
datumctl compute workloadsand check that itsHEALTHisAvailable. - Delete the old workload with
datumctl compute destroy OLD_WORKLOAD_NAME. ReplaceOLD_WORKLOAD_NAMEwith the name of the workload that you’re replacing.
Where each class runs
Today,us-central-1, us-east-1, and us-west-1 serve both classes. If you place a workload in a location that doesn’t serve its class, Datum creates no Instances there and the workload reports the reason RuntimeClassNotServed. To fix it, choose another location or deploy a new workload with a class that the location serves. For the classes that each location serves, see Locations.
What’s next
- To run a standard container image, see Run a container image.
- To package your own app as a unikernel, see Build and deploy a unikernel.