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

Example#
    {
        "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

Example#
    {
        "MapFile": {
            "file": "config/",
            "to": "/etc/myapp/"
        }
    }

SetArgs#

Set process arguments for the GenVM environment. Type: Array of strings

Example#
    {
        "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)

Example#
    {
        "LinkWasm": "path/in/arch/to/module.wasm"
    }

StartWasm#

Start a specific WebAssembly file in GenVM. Type: String (path to Wasm file)

Example#
    {
        "StartWasm": "path/in/arch/to/module.wasm"
    }

Depends#

Specify a dependency on another runner by its ID and hash.

Example#
    {
        "Depends": "cpython:123"
    }

Seq#

Execute a sequence of initialization actions.

Example#
    {
        "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)

Example#
    {
        "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”.

Example#
    {
        "With": {
            "runner": "base-environment",
            "action": { "MapFile": {"file": "patched.foo", "to": "foo" } }
        }
    }