Skip to main content

ComputeSpec

Struct ComputeSpec 

Source
pub struct ComputeSpec {
Show 16 fields pub version: u32, pub root: RootSource, pub kernel: String, pub kernel_cmdline: Option<String>, pub vcpus: u32, pub mem_mib: u32, pub entrypoint: Vec<String>, pub env: BTreeMap<String, String>, pub port: u16, pub restart: RestartPolicy, pub scale_to_zero: bool, pub volumes: Vec<VolumeRef>, pub writable_root: bool, pub isolation: IsolationRequirement, pub prefer_backend: Option<String>, pub bindings: Vec<ComputeBinding>,
}
Expand description

An immutable, content-addressed compute workload version (the analogue of a deployment manifest). Stored at computever/<hash>; the rootfs + kernel are blob hashes in the shared blob store (deduped, cached forever).

Fields§

§version: u32

Pinned schema discriminant (v1).

§root: RootSource

The source of the workload’s root filesystem: an OCI image reference, a tar rootfs archive, or a rootfs filesystem image, per the target substrate (see RootSource).

§kernel: String

Blob hash of the vmlinux kernel (shared across workloads). Applies only to the micro-VM substrate (a RootSource::Rootfs source); ignored otherwise, so an image/tar workload omits it (empty ⇒ absent from the wire + the content hash).

§kernel_cmdline: Option<String>

Kernel boot cmdline override; None uses the executor default.

§vcpus: u32

Virtual CPUs.

§mem_mib: u32

Guest memory in MiB.

§entrypoint: Vec<String>

The in-guest entrypoint (argv) the init execs.

§env: BTreeMap<String, String>

Environment variables for the entrypoint.

§port: u16

The TCP port the app listens on inside the guest (the gateway targets it).

§restart: RestartPolicy

Restart policy for the guest process.

§scale_to_zero: bool

Snapshot + stop when idle; restore on the next request (cold start).

§volumes: Vec<VolumeRef>

Persistent volumes (opt-in).

§writable_root: bool

Allow a writable root filesystem instead of the hardened read-only-root default. Opt-in and honored only under the single-tenant isolation posture (a backend forces read-only root under the multi-tenant guard). The idiomatic path for app writes remains a VolumeRef; this is for images that write outside a declared volume. Default off; omitted from the wire + the content hash when false (back-compat).

§isolation: IsolationRequirement

Isolation the workload requires; selects which backends are eligible. Default Trusted; omitted from the serialized spec when default, so existing specs keep their content hash.

§prefer_backend: Option<String>

Optional preferred backend id (vmm/container/cloudflare/docker); the scheduler honors it when the backend is eligible, else falls back.

§bindings: Vec<ComputeBinding>

Managed resources this workload depends on — the opaque-process analogue of a handler’s imports. boatramp resolves each to a tenant-scoped endpoint + credential at launch and injects the address into the guest env, so a workload reaches the managed sql (and, later, kv/blob/messaging) without a hand-glued URL. Empty ⇒ omitted from the wire + the content hash (back-compat).

Implementations§

Source§

impl ComputeSpec

Source

pub fn id(&self) -> String

The content hash of this spec — its computever/<hash> id. Computed over the canonical JSON so identical specs dedupe (like a deployment id).

Trait Implementations§

Source§

impl Clone for ComputeSpec

Source§

fn clone(&self) -> ComputeSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ComputeSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ComputeSpec

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<ComputeSpec, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ComputeSpec

Source§

impl PartialEq for ComputeSpec

Source§

fn eq(&self, other: &ComputeSpec) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ComputeSpec

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ComputeSpec

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.