runner.json JSON Schema#

{
    "$id": "https://raw.githubusercontent.com/yeagerai/genvm/refs/heads/main/doc/schemas/runner.json",
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "GenVM runner.json",

    "oneOf": [
      { "$ref": "#/definitions/InitAction" }
    ],

    "definitions": {
      "WasmMode": {
        "enum": ["det", "nondet"]
      },
      "InitAction": {
        "description": "A single rule for loading.",
        "type": "object",
        "allOf": [
          {
            "type": "object",
            "properties": {
              "$schema": { "type": "string" }
            }
          },
          {
            "oneOf": [
              {
                "required": [
                  "AddEnv"
                ]
              },
              {
                "required": [
                  "MapFile"
                ]
              },
              {
                "required": [
                  "SetArgs"
                ]
              },
              {
                "required": [
                  "LinkWasm"
                ]
              },
              {
                "required": [
                  "StartWasm"
                ]
              },
              {
                "required": [
                  "Depends"
                ]
              },
              {
                "required": [
                  "Seq"
                ]
              },
              {
                "required": [
                  "When"
                ]
              },
              {
                "required": [
                  "With"
                ]
              }
            ]
          }
        ],
        "properties": {
          "AddEnv": {
            "description": "Adds environment variable",
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "description": "variable name"
              },
              "val": {
                "type": "string",
                "description": "variable value, can use ${} to access currently set env variables"
              }
            }
          },
          "MapFile": {
            "description": "Makes file available at specified path in genvm",
            "type": "object",
            "properties": {
              "file": {
                "type": "string",
                "description": "path within an archive, if it ends with `/`, it will map all files in that directory recursively"
              },
              "to": {
                "type": "string",
                "description": "absolute path in genvm fs"
              }
            }
          },
          "SetArgs": {
            "description": "sets process arguments for genvm",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "LinkWasm": {
            "description": "Link wasm file to be available from genvm",
            "type": "string"
          },
          "StartWasm": {
            "description": "Start wasm file in genvm",
            "type": "string"
          },
          "Depends": {
            "description": "Depend on other runner by id:hash",
            "type": "string"
          },
          "Seq": {
            "description": "Execute sequence",
            "type": "array",
            "items": {
              "$ref": "#/definitions/InitAction"
            }
          },
          "When": {
            "description": "Conditionally execute action",
            "type": "object",
            "properties": {
              "cond": { "$ref": "#/definitions/WasmMode" },
              "action": { "$ref": "#/definitions/InitAction" }
            }
          },
          "With": {
            "description": "Makes given runner current without executing it's action. It means that MapFile will fork with files from this archive. Useful for creating lock files",
            "type": "object",
            "properties": {
              "runner": { "type": "string" },
              "action": { "$ref": "#/definitions/InitAction" }
            }
          }
        },
        "additionalProperties": false
      }
    }
  }