Runners#
It is concept that is similar to libraries
Each runner is identified by <human-readable-id>:<hash> and is a set of files, with a single mandatory one: runner.json
Runner json has a recursive structure and supports following actions
AddEnv#
Add an environment variable to the GenVM environment. It supports variable interpolation using ${} syntax to access existing environment variables
{
"AddEnv": {
"name": "DEBUG",
"val": "true"
}
}
MapFile#
Map a file or directory from an archive to a specific path in the GenVM filesystem. Properties:
file (string): Path within an archive
If the path ends with /, it recursively maps all files in that directory
to (string): Absolute destination path in the GenVM filesystem
{
"MapFile": {
"file": "config/",
"to": "/etc/myapp/"
}
}
SetArgs#
Set process arguments for the GenVM environment. Type: Array of strings
{
"SetArgs": ["exe-name", "--verbose", "--config", "/path/to/config"]
}
LinkWasm#
Link a WebAssembly file to make it available in GenVM. Type: String (path to Wasm file)
{
"LinkWasm": "path/in/arch/to/module.wasm"
}
StartWasm#
Start a specific WebAssembly file in GenVM. Type: String (path to Wasm file)
{
"StartWasm": "path/in/arch/to/module.wasm"
}
Depends#
Specify a dependency on another runner by its ID and hash.
{
"Depends": "cpython:123"
}
Seq#
Execute a sequence of initialization actions.
{
"Seq": [
{ "SetArgs": ["exe-name", "--verbose", "--config", "/path/to/config"] },
{ "StartWasm": "path/in/arch/to/module.wasm" }
]
}
When#
Conditionally executes an action based on Wasm mode.
cond property is a WebAssembly mode, either “det” (deterministic) or “nondet” (non-deterministic)
{
"When": {
"cond": "det",
"action": { "AddEnv": {"name": "MODE", "val": "deterministic"} }
}
}
With#
Set a runner as current without executing its action, useful for reusing files or creating runner “locks”.
{
"With": {
"runner": "base-environment",
"action": { "MapFile": {"file": "patched.foo", "to": "foo" } }
}
}