Resources / Program

Program

A registered program: a small WebAssembly module that handles Ethernet frames, timers and schedules. Immutable; to change a program register a new one under a new name. Programs the platform registers itself (larger, kept in platform storage) are available to every project.

Overview

APIcompute.etorm.com/v1alpha1
Resourceprograms (cluster-scoped inside its cluster)
Short namesprog
Available inthe platform and project clusters
Statuswritten by a controller through /status

Minimal example

apiVersion: compute.etorm.com/v1alpha1
kind: Program
metadata:
  name: example
spec: {}

Spec

FieldTypeRequiredDefaultAllowedDescription
moduleRefobjectPlatform programs only: the module is a stored object instead of inline text, so it may be much larger (up to 32 MiB). Exactly one of module and moduleRef is set.
moduleRef.projectstringyeslength 1 to 63The platform project that owns the bucket.
moduleRef.bucketstringyeslength 1 to 63The platform bucket that holds the module.
moduleRef.keystringyeslength 1 to 1024The object's key.
moduleRef.digeststringyespattern ^sha256:[0-9a-f]{64}$sha256 of the binary, which names the program: nodes check it after fetching.
moduleRef.sizeintegeryes1 to 33554432Size of the binary in bytes.
moduleRef.factsobjectyesWhat validating the module found, written by the tool that registers it (nodes validate again before running it).
moduleRef.facts.importslist of stringHost functions the program uses.
moduleRef.facts.handlerslist of stringyesHandler functions it implements.
moduleRef.facts.memoryPagesintegeryes0 to 4096Declared maximum memory in 64 KiB pages.
moduleRef.facts.memoryMinPagesintegeryes0 to 4096Memory it needs when it starts, in 64 KiB pages.
modulestringlength 1 to 349600The program: a WebAssembly module of at most 256 KiB that implements the process interface. Through the API it is base64 text; the console takes the file.
descriptionstringup to 1000 charactersWhat the program does, for people.

Status

FieldTypeRequiredDefaultAllowedDescription
phasestringReady when the module passed validation; Failed with the reason in conditions otherwise.
digeststringsha256 of the binary. Two programs with the same digest share one compiled form.
sizeintegerSize of the binary in bytes.
worldstringThe interface version the module implements.
importslist of stringHost functions the program uses.
handlerslist of stringHandler functions the program implements: start, frames, timer, scheduled, stop.
memoryPagesintegerDeclared maximum memory in 64 KiB pages.
memoryMinPagesintegerMemory the program needs when it starts, in 64 KiB pages: a process must be allowed at least this much.
conditionslist of objectDetailed state, one entry per aspect; Ready says whether the program can be run.
conditions[].typestringAspect.
conditions[].statusstringTrue or False.
conditions[].reasonstringMachine-readable reason.
conditions[].messagestringHuman-readable detail.

Columns in listings

ColumnFrom
Digest.status.digest
Size.status.size
Phase.status.phase

Related guides

All resources