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
| API | compute.etorm.com/v1alpha1 |
| Resource | programs (cluster-scoped inside its cluster) |
| Short names | prog |
| Available in | the platform and project clusters |
| Status | written by a controller through /status |
Minimal example
apiVersion: compute.etorm.com/v1alpha1
kind: Program
metadata:
name: example
spec: {}
Spec
| Field | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
moduleRef | object | Platform 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.project | string | yes | length 1 to 63 | The platform project that owns the bucket. | |
moduleRef.bucket | string | yes | length 1 to 63 | The platform bucket that holds the module. | |
moduleRef.key | string | yes | length 1 to 1024 | The object's key. | |
moduleRef.digest | string | yes | pattern ^sha256:[0-9a-f]{64}$ | sha256 of the binary, which names the program: nodes check it after fetching. | |
moduleRef.size | integer | yes | 1 to 33554432 | Size of the binary in bytes. | |
moduleRef.facts | object | yes | What validating the module found, written by the tool that registers it (nodes validate again before running it). | ||
moduleRef.facts.imports | list of string | Host functions the program uses. | |||
moduleRef.facts.handlers | list of string | yes | Handler functions it implements. | ||
moduleRef.facts.memoryPages | integer | yes | 0 to 4096 | Declared maximum memory in 64 KiB pages. | |
moduleRef.facts.memoryMinPages | integer | yes | 0 to 4096 | Memory it needs when it starts, in 64 KiB pages. | |
module | string | length 1 to 349600 | The 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. | ||
description | string | up to 1000 characters | What the program does, for people. |
Status
| Field | Type | Required | Default | Allowed | Description |
|---|---|---|---|---|---|
phase | string | Ready when the module passed validation; Failed with the reason in conditions otherwise. | |||
digest | string | sha256 of the binary. Two programs with the same digest share one compiled form. | |||
size | integer | Size of the binary in bytes. | |||
world | string | The interface version the module implements. | |||
imports | list of string | Host functions the program uses. | |||
handlers | list of string | Handler functions the program implements: start, frames, timer, scheduled, stop. | |||
memoryPages | integer | Declared maximum memory in 64 KiB pages. | |||
memoryMinPages | integer | Memory the program needs when it starts, in 64 KiB pages: a process must be allowed at least this much. | |||
conditions | list of object | Detailed state, one entry per aspect; Ready says whether the program can be run. | |||
conditions[].type | string | Aspect. | |||
conditions[].status | string | True or False. | |||
conditions[].reason | string | Machine-readable reason. | |||
conditions[].message | string | Human-readable detail. |
Columns in listings
| Column | From |
|---|---|
| Digest | .status.digest |
| Size | .status.size |
| Phase | .status.phase |