API Reference

Contents

API Reference#

Auto-generated API documentation from the Python source code.

App Specification#

pydantic model bfabric_app_runner.specs.app.app_spec.AppSpec#

Parsed app versions from the app spec file.

Show JSON schema
{
   "title": "AppSpec",
   "description": "Parsed app versions from the app spec file.",
   "type": "object",
   "properties": {
      "bfabric": {
         "$ref": "#/$defs/BfabricAppSpec"
      },
      "versions": {
         "items": {
            "$ref": "#/$defs/AppVersion"
         },
         "title": "Versions",
         "type": "array"
      }
   },
   "$defs": {
      "AppVersion": {
         "description": "A concrete app version specification.\n\nFor a better separation of concerns, the submitter will not be resolved automatically.",
         "properties": {
            "version": {
               "default": "latest",
               "title": "Version",
               "type": "string"
            },
            "commands": {
               "$ref": "#/$defs/CommandsSpec"
            },
            "reuse_default_resource": {
               "default": true,
               "title": "Reuse Default Resource",
               "type": "boolean"
            }
         },
         "required": [
            "commands"
         ],
         "title": "AppVersion",
         "type": "object"
      },
      "BfabricAppSpec": {
         "description": "Contains the app specification information that is relevant to bfabric, and not exactly the app itself.",
         "properties": {
            "app_runner": {
               "title": "App Runner",
               "type": "string"
            },
            "workflow_template_step_id": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workflow Template Step Id"
            }
         },
         "required": [
            "app_runner"
         ],
         "title": "BfabricAppSpec",
         "type": "object"
      },
      "CommandDocker": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "docker",
               "default": "docker",
               "title": "Type",
               "type": "string"
            },
            "image": {
               "title": "Image",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "entrypoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Entrypoint"
            },
            "engine": {
               "default": "docker",
               "enum": [
                  "docker",
                  "podman"
               ],
               "title": "Engine",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mac Address"
            },
            "mounts": {
               "$ref": "#/$defs/MountOptions",
               "default": {
                  "work_dir_target": null,
                  "read_only": [],
                  "writeable": [],
                  "share_bfabric_config": true
               }
            },
            "hostname": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Hostname"
            },
            "custom_args": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Custom Args",
               "type": "array"
            }
         },
         "required": [
            "image",
            "command"
         ],
         "title": "CommandDocker",
         "type": "object"
      },
      "CommandExec": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "exec",
               "default": "exec",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandExec",
         "type": "object"
      },
      "CommandPythonEnv": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "python_env",
               "default": "python_env",
               "title": "Type",
               "type": "string"
            },
            "pylock": {
               "format": "path",
               "title": "Pylock",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "python_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Python Version"
            },
            "local_extra_deps": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Local Extra Deps",
               "type": "array"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            },
            "refresh": {
               "default": false,
               "title": "Refresh",
               "type": "boolean"
            }
         },
         "required": [
            "pylock",
            "command"
         ],
         "title": "CommandPythonEnv",
         "type": "object"
      },
      "CommandShell": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "shell",
               "default": "shell",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandShell",
         "type": "object"
      },
      "CommandsSpec": {
         "additionalProperties": false,
         "description": "Defines the commands that are required to execute an app.",
         "properties": {
            "dispatch": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Dispatch"
            },
            "process": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Process"
            },
            "collect": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "docker": "#/$defs/CommandDocker",
                           "exec": "#/$defs/CommandExec",
                           "python_env": "#/$defs/CommandPythonEnv",
                           "shell": "#/$defs/CommandShell"
                        },
                        "propertyName": "type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/CommandShell"
                        },
                        {
                           "$ref": "#/$defs/CommandExec"
                        },
                        {
                           "$ref": "#/$defs/CommandDocker"
                        },
                        {
                           "$ref": "#/$defs/CommandPythonEnv"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Collect"
            }
         },
         "required": [
            "dispatch",
            "process"
         ],
         "title": "CommandsSpec",
         "type": "object"
      },
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "required": [
      "bfabric",
      "versions"
   ]
}

Fields:
Validators:
field bfabric: BfabricAppSpec [Required]#
field versions: list[AppVersion] [Required]#
Validated by:
validator no_duplicate_versions  »  versions#

Validates that there are no duplicate versions in the app spec.

pydantic model bfabric_app_runner.specs.app.app_spec.BfabricAppSpec#

Contains the app specification information that is relevant to bfabric, and not exactly the app itself.

Show JSON schema
{
   "title": "BfabricAppSpec",
   "description": "Contains the app specification information that is relevant to bfabric, and not exactly the app itself.",
   "type": "object",
   "properties": {
      "app_runner": {
         "title": "App Runner",
         "type": "string"
      },
      "workflow_template_step_id": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Workflow Template Step Id"
      }
   },
   "required": [
      "app_runner"
   ]
}

Fields:
field app_runner: str [Required]#

Specifies the app runner version to use for the app.

We support both a PyPI version (e.g. 0.0.17) as well as a git reference, which is a string in the format git+https://github.com/fgcz/bfabricPy@main#subdirectory=bfabric_app_runner where you can specify any git reference instead of main as needed.

field workflow_template_step_id: int | None = None#

If specified, this indicates that a workflow step should be created for the workunit.

pydantic model bfabric_app_runner.specs.app.app_spec.AppSpecTemplate#

This model defines the app_spec definition in a file.

As the name suggests, this is a template that can be expanded to a concrete AppSpec instance. The main difference is that this may contain usages of Variables. TODO

Show JSON schema
{
   "title": "AppSpecTemplate",
   "description": "This model defines the app_spec definition in a file.\n\nAs the name suggests, this is a template that can be expanded to a concrete ``AppSpec`` instance.\nThe main difference is that this may contain usages of `Variables`. TODO",
   "type": "object",
   "properties": {
      "bfabric": {
         "$ref": "#/$defs/BfabricAppSpec"
      },
      "versions": {
         "items": {
            "$ref": "#/$defs/AppVersionMultiTemplate"
         },
         "title": "Versions",
         "type": "array"
      }
   },
   "$defs": {
      "AppVersionMultiTemplate": {
         "properties": {
            "version": {
               "items": {
                  "type": "string"
               },
               "title": "Version",
               "type": "array"
            },
            "commands": {
               "$ref": "#/$defs/CommandsSpec"
            },
            "reuse_default_resource": {
               "default": true,
               "title": "Reuse Default Resource",
               "type": "boolean"
            }
         },
         "required": [
            "version",
            "commands"
         ],
         "title": "AppVersionMultiTemplate",
         "type": "object"
      },
      "BfabricAppSpec": {
         "description": "Contains the app specification information that is relevant to bfabric, and not exactly the app itself.",
         "properties": {
            "app_runner": {
               "title": "App Runner",
               "type": "string"
            },
            "workflow_template_step_id": {
               "anyOf": [
                  {
                     "type": "integer"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Workflow Template Step Id"
            }
         },
         "required": [
            "app_runner"
         ],
         "title": "BfabricAppSpec",
         "type": "object"
      },
      "CommandDocker": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "docker",
               "default": "docker",
               "title": "Type",
               "type": "string"
            },
            "image": {
               "title": "Image",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "entrypoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Entrypoint"
            },
            "engine": {
               "default": "docker",
               "enum": [
                  "docker",
                  "podman"
               ],
               "title": "Engine",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mac Address"
            },
            "mounts": {
               "$ref": "#/$defs/MountOptions",
               "default": {
                  "work_dir_target": null,
                  "read_only": [],
                  "writeable": [],
                  "share_bfabric_config": true
               }
            },
            "hostname": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Hostname"
            },
            "custom_args": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Custom Args",
               "type": "array"
            }
         },
         "required": [
            "image",
            "command"
         ],
         "title": "CommandDocker",
         "type": "object"
      },
      "CommandExec": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "exec",
               "default": "exec",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandExec",
         "type": "object"
      },
      "CommandPythonEnv": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "python_env",
               "default": "python_env",
               "title": "Type",
               "type": "string"
            },
            "pylock": {
               "format": "path",
               "title": "Pylock",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "python_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Python Version"
            },
            "local_extra_deps": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Local Extra Deps",
               "type": "array"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            },
            "refresh": {
               "default": false,
               "title": "Refresh",
               "type": "boolean"
            }
         },
         "required": [
            "pylock",
            "command"
         ],
         "title": "CommandPythonEnv",
         "type": "object"
      },
      "CommandShell": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "shell",
               "default": "shell",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandShell",
         "type": "object"
      },
      "CommandsSpec": {
         "additionalProperties": false,
         "description": "Defines the commands that are required to execute an app.",
         "properties": {
            "dispatch": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Dispatch"
            },
            "process": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Process"
            },
            "collect": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "docker": "#/$defs/CommandDocker",
                           "exec": "#/$defs/CommandExec",
                           "python_env": "#/$defs/CommandPythonEnv",
                           "shell": "#/$defs/CommandShell"
                        },
                        "propertyName": "type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/CommandShell"
                        },
                        {
                           "$ref": "#/$defs/CommandExec"
                        },
                        {
                           "$ref": "#/$defs/CommandDocker"
                        },
                        {
                           "$ref": "#/$defs/CommandPythonEnv"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Collect"
            }
         },
         "required": [
            "dispatch",
            "process"
         ],
         "title": "CommandsSpec",
         "type": "object"
      },
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "required": [
      "bfabric",
      "versions"
   ]
}

Fields:
field bfabric: BfabricAppSpec [Required]#
field versions: list[AppVersionMultiTemplate] [Required]#

App Versions#

pydantic model bfabric_app_runner.specs.app.app_version.AppVersion#

A concrete app version specification.

For a better separation of concerns, the submitter will not be resolved automatically.

Show JSON schema
{
   "title": "AppVersion",
   "description": "A concrete app version specification.\n\nFor a better separation of concerns, the submitter will not be resolved automatically.",
   "type": "object",
   "properties": {
      "version": {
         "default": "latest",
         "title": "Version",
         "type": "string"
      },
      "commands": {
         "$ref": "#/$defs/CommandsSpec"
      },
      "reuse_default_resource": {
         "default": true,
         "title": "Reuse Default Resource",
         "type": "boolean"
      }
   },
   "$defs": {
      "CommandDocker": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "docker",
               "default": "docker",
               "title": "Type",
               "type": "string"
            },
            "image": {
               "title": "Image",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "entrypoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Entrypoint"
            },
            "engine": {
               "default": "docker",
               "enum": [
                  "docker",
                  "podman"
               ],
               "title": "Engine",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mac Address"
            },
            "mounts": {
               "$ref": "#/$defs/MountOptions",
               "default": {
                  "work_dir_target": null,
                  "read_only": [],
                  "writeable": [],
                  "share_bfabric_config": true
               }
            },
            "hostname": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Hostname"
            },
            "custom_args": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Custom Args",
               "type": "array"
            }
         },
         "required": [
            "image",
            "command"
         ],
         "title": "CommandDocker",
         "type": "object"
      },
      "CommandExec": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "exec",
               "default": "exec",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandExec",
         "type": "object"
      },
      "CommandPythonEnv": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "python_env",
               "default": "python_env",
               "title": "Type",
               "type": "string"
            },
            "pylock": {
               "format": "path",
               "title": "Pylock",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "python_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Python Version"
            },
            "local_extra_deps": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Local Extra Deps",
               "type": "array"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            },
            "refresh": {
               "default": false,
               "title": "Refresh",
               "type": "boolean"
            }
         },
         "required": [
            "pylock",
            "command"
         ],
         "title": "CommandPythonEnv",
         "type": "object"
      },
      "CommandShell": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "shell",
               "default": "shell",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandShell",
         "type": "object"
      },
      "CommandsSpec": {
         "additionalProperties": false,
         "description": "Defines the commands that are required to execute an app.",
         "properties": {
            "dispatch": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Dispatch"
            },
            "process": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Process"
            },
            "collect": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "docker": "#/$defs/CommandDocker",
                           "exec": "#/$defs/CommandExec",
                           "python_env": "#/$defs/CommandPythonEnv",
                           "shell": "#/$defs/CommandShell"
                        },
                        "propertyName": "type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/CommandShell"
                        },
                        {
                           "$ref": "#/$defs/CommandExec"
                        },
                        {
                           "$ref": "#/$defs/CommandDocker"
                        },
                        {
                           "$ref": "#/$defs/CommandPythonEnv"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Collect"
            }
         },
         "required": [
            "dispatch",
            "process"
         ],
         "title": "CommandsSpec",
         "type": "object"
      },
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "required": [
      "commands"
   ]
}

Fields:
field commands: CommandsSpec [Required]#
field reuse_default_resource: bool = True#
field version: str = 'latest'#
pydantic model bfabric_app_runner.specs.app.app_version.AppVersionMultiTemplate#

Show JSON schema
{
   "title": "AppVersionMultiTemplate",
   "type": "object",
   "properties": {
      "version": {
         "items": {
            "type": "string"
         },
         "title": "Version",
         "type": "array"
      },
      "commands": {
         "$ref": "#/$defs/CommandsSpec"
      },
      "reuse_default_resource": {
         "default": true,
         "title": "Reuse Default Resource",
         "type": "boolean"
      }
   },
   "$defs": {
      "CommandDocker": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "docker",
               "default": "docker",
               "title": "Type",
               "type": "string"
            },
            "image": {
               "title": "Image",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "entrypoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Entrypoint"
            },
            "engine": {
               "default": "docker",
               "enum": [
                  "docker",
                  "podman"
               ],
               "title": "Engine",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mac Address"
            },
            "mounts": {
               "$ref": "#/$defs/MountOptions",
               "default": {
                  "work_dir_target": null,
                  "read_only": [],
                  "writeable": [],
                  "share_bfabric_config": true
               }
            },
            "hostname": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Hostname"
            },
            "custom_args": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Custom Args",
               "type": "array"
            }
         },
         "required": [
            "image",
            "command"
         ],
         "title": "CommandDocker",
         "type": "object"
      },
      "CommandExec": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "exec",
               "default": "exec",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandExec",
         "type": "object"
      },
      "CommandPythonEnv": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "python_env",
               "default": "python_env",
               "title": "Type",
               "type": "string"
            },
            "pylock": {
               "format": "path",
               "title": "Pylock",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "python_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Python Version"
            },
            "local_extra_deps": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Local Extra Deps",
               "type": "array"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            },
            "refresh": {
               "default": false,
               "title": "Refresh",
               "type": "boolean"
            }
         },
         "required": [
            "pylock",
            "command"
         ],
         "title": "CommandPythonEnv",
         "type": "object"
      },
      "CommandShell": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "shell",
               "default": "shell",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandShell",
         "type": "object"
      },
      "CommandsSpec": {
         "additionalProperties": false,
         "description": "Defines the commands that are required to execute an app.",
         "properties": {
            "dispatch": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Dispatch"
            },
            "process": {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ],
               "title": "Process"
            },
            "collect": {
               "anyOf": [
                  {
                     "discriminator": {
                        "mapping": {
                           "docker": "#/$defs/CommandDocker",
                           "exec": "#/$defs/CommandExec",
                           "python_env": "#/$defs/CommandPythonEnv",
                           "shell": "#/$defs/CommandShell"
                        },
                        "propertyName": "type"
                     },
                     "oneOf": [
                        {
                           "$ref": "#/$defs/CommandShell"
                        },
                        {
                           "$ref": "#/$defs/CommandExec"
                        },
                        {
                           "$ref": "#/$defs/CommandDocker"
                        },
                        {
                           "$ref": "#/$defs/CommandPythonEnv"
                        }
                     ]
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Collect"
            }
         },
         "required": [
            "dispatch",
            "process"
         ],
         "title": "CommandsSpec",
         "type": "object"
      },
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "required": [
      "version",
      "commands"
   ]
}

Fields:
Validators:
field commands: CommandsSpec [Required]#
field reuse_default_resource: bool = True#
field version: list[str] [Required]#
Validated by:
  • _version_ensure_list

Commands#

pydantic model bfabric_app_runner.specs.app.commands_spec.CommandsSpec#

Defines the commands that are required to execute an app.

Show JSON schema
{
   "title": "CommandsSpec",
   "description": "Defines the commands that are required to execute an app.",
   "type": "object",
   "properties": {
      "dispatch": {
         "discriminator": {
            "mapping": {
               "docker": "#/$defs/CommandDocker",
               "exec": "#/$defs/CommandExec",
               "python_env": "#/$defs/CommandPythonEnv",
               "shell": "#/$defs/CommandShell"
            },
            "propertyName": "type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/CommandShell"
            },
            {
               "$ref": "#/$defs/CommandExec"
            },
            {
               "$ref": "#/$defs/CommandDocker"
            },
            {
               "$ref": "#/$defs/CommandPythonEnv"
            }
         ],
         "title": "Dispatch"
      },
      "process": {
         "discriminator": {
            "mapping": {
               "docker": "#/$defs/CommandDocker",
               "exec": "#/$defs/CommandExec",
               "python_env": "#/$defs/CommandPythonEnv",
               "shell": "#/$defs/CommandShell"
            },
            "propertyName": "type"
         },
         "oneOf": [
            {
               "$ref": "#/$defs/CommandShell"
            },
            {
               "$ref": "#/$defs/CommandExec"
            },
            {
               "$ref": "#/$defs/CommandDocker"
            },
            {
               "$ref": "#/$defs/CommandPythonEnv"
            }
         ],
         "title": "Process"
      },
      "collect": {
         "anyOf": [
            {
               "discriminator": {
                  "mapping": {
                     "docker": "#/$defs/CommandDocker",
                     "exec": "#/$defs/CommandExec",
                     "python_env": "#/$defs/CommandPythonEnv",
                     "shell": "#/$defs/CommandShell"
                  },
                  "propertyName": "type"
               },
               "oneOf": [
                  {
                     "$ref": "#/$defs/CommandShell"
                  },
                  {
                     "$ref": "#/$defs/CommandExec"
                  },
                  {
                     "$ref": "#/$defs/CommandDocker"
                  },
                  {
                     "$ref": "#/$defs/CommandPythonEnv"
                  }
               ]
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Collect"
      }
   },
   "$defs": {
      "CommandDocker": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "docker",
               "default": "docker",
               "title": "Type",
               "type": "string"
            },
            "image": {
               "title": "Image",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "entrypoint": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Entrypoint"
            },
            "engine": {
               "default": "docker",
               "enum": [
                  "docker",
                  "podman"
               ],
               "title": "Engine",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "mac_address": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Mac Address"
            },
            "mounts": {
               "$ref": "#/$defs/MountOptions",
               "default": {
                  "work_dir_target": null,
                  "read_only": [],
                  "writeable": [],
                  "share_bfabric_config": true
               }
            },
            "hostname": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Hostname"
            },
            "custom_args": {
               "default": [],
               "items": {
                  "type": "string"
               },
               "title": "Custom Args",
               "type": "array"
            }
         },
         "required": [
            "image",
            "command"
         ],
         "title": "CommandDocker",
         "type": "object"
      },
      "CommandExec": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "exec",
               "default": "exec",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandExec",
         "type": "object"
      },
      "CommandPythonEnv": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "python_env",
               "default": "python_env",
               "title": "Type",
               "type": "string"
            },
            "pylock": {
               "format": "path",
               "title": "Pylock",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            },
            "python_version": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Python Version"
            },
            "local_extra_deps": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Local Extra Deps",
               "type": "array"
            },
            "env": {
               "additionalProperties": {
                  "type": "string"
               },
               "default": {},
               "title": "Env",
               "type": "object"
            },
            "prepend_paths": {
               "default": [],
               "items": {
                  "format": "path",
                  "type": "string"
               },
               "title": "Prepend Paths",
               "type": "array"
            },
            "refresh": {
               "default": false,
               "title": "Refresh",
               "type": "boolean"
            }
         },
         "required": [
            "pylock",
            "command"
         ],
         "title": "CommandPythonEnv",
         "type": "object"
      },
      "CommandShell": {
         "additionalProperties": false,
         "properties": {
            "type": {
               "const": "shell",
               "default": "shell",
               "title": "Type",
               "type": "string"
            },
            "command": {
               "title": "Command",
               "type": "string"
            }
         },
         "required": [
            "command"
         ],
         "title": "CommandShell",
         "type": "object"
      },
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "dispatch",
      "process"
   ]
}

Config:
  • extra: str = forbid

  • populate_by_name: bool = True

  • validate_by_alias: bool = True

  • validate_by_name: bool = True

Fields:
field collect: Annotated[CommandShell | CommandExec | CommandDocker | CommandPythonEnv, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] | None = None#

The app collect command, can be omitted if your process command already creates an outputs.yml file.

It will be called with arguments: $workunit_ref $chunk_dir.

field dispatch: Annotated[CommandShell | CommandExec | CommandDocker | CommandPythonEnv, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] [Required]#

The app dispatch command.

It will be called with arguments: $workunit_ref $work_dir.

Constraints:
  • discriminator = type

field process: Annotated[CommandShell | CommandExec | CommandDocker | CommandPythonEnv, Discriminator(discriminator=type, custom_error_type=None, custom_error_message=None, custom_error_context=None)] [Required]#

The app process command.

It will be called with arguments: $chunk_dir.

Constraints:
  • discriminator = type

pydantic model bfabric_app_runner.specs.app.commands_spec.CommandShell#

Show JSON schema
{
   "title": "CommandShell",
   "type": "object",
   "properties": {
      "type": {
         "const": "shell",
         "default": "shell",
         "title": "Type",
         "type": "string"
      },
      "command": {
         "title": "Command",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "command"
   ]
}

Config:
  • extra: str = forbid

Fields:
field command: str [Required]#

The command to run, will be split by spaces and is not an actual shell script.

field type: Literal['shell'] = 'shell'#

Identifies the command type.

pydantic model bfabric_app_runner.specs.app.commands_spec.CommandExec#

Show JSON schema
{
   "title": "CommandExec",
   "type": "object",
   "properties": {
      "type": {
         "const": "exec",
         "default": "exec",
         "title": "Type",
         "type": "string"
      },
      "command": {
         "title": "Command",
         "type": "string"
      },
      "env": {
         "additionalProperties": {
            "type": "string"
         },
         "default": {},
         "title": "Env",
         "type": "object"
      },
      "prepend_paths": {
         "default": [],
         "items": {
            "format": "path",
            "type": "string"
         },
         "title": "Prepend Paths",
         "type": "array"
      }
   },
   "additionalProperties": false,
   "required": [
      "command"
   ]
}

Config:
  • extra: str = forbid

Fields:
field command: str [Required]#

The command to run, will be split by shlex.split and is not an actual shell script.

field env: dict[str, str] = {}#

Environment variables to set before executing the command.

field prepend_paths: list[Path] = []#

A list of paths to prepend to the PATH variable before executing the command.

If multiple paths are specified, the first one will be the first in PATH, etc.

field type: Literal['exec'] = 'exec'#

Identifies the command type.

pydantic model bfabric_app_runner.specs.app.commands_spec.CommandDocker#

Show JSON schema
{
   "title": "CommandDocker",
   "type": "object",
   "properties": {
      "type": {
         "const": "docker",
         "default": "docker",
         "title": "Type",
         "type": "string"
      },
      "image": {
         "title": "Image",
         "type": "string"
      },
      "command": {
         "title": "Command",
         "type": "string"
      },
      "entrypoint": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Entrypoint"
      },
      "engine": {
         "default": "docker",
         "enum": [
            "docker",
            "podman"
         ],
         "title": "Engine",
         "type": "string"
      },
      "env": {
         "additionalProperties": {
            "type": "string"
         },
         "default": {},
         "title": "Env",
         "type": "object"
      },
      "mac_address": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Mac Address"
      },
      "mounts": {
         "$ref": "#/$defs/MountOptions",
         "default": {
            "work_dir_target": null,
            "read_only": [],
            "writeable": [],
            "share_bfabric_config": true
         }
      },
      "hostname": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Hostname"
      },
      "custom_args": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Custom Args",
         "type": "array"
      }
   },
   "$defs": {
      "MountOptions": {
         "additionalProperties": false,
         "properties": {
            "work_dir_target": {
               "anyOf": [
                  {
                     "format": "path",
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "title": "Work Dir Target"
            },
            "read_only": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Read Only",
               "type": "array"
            },
            "writeable": {
               "default": [],
               "items": {
                  "maxItems": 2,
                  "minItems": 2,
                  "prefixItems": [
                     {
                        "format": "path",
                        "type": "string"
                     },
                     {
                        "format": "path",
                        "type": "string"
                     }
                  ],
                  "type": "array"
               },
               "title": "Writeable",
               "type": "array"
            },
            "share_bfabric_config": {
               "default": true,
               "title": "Share Bfabric Config",
               "type": "boolean"
            }
         },
         "title": "MountOptions",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "image",
      "command"
   ]
}

Config:
  • extra: str = forbid

Fields:
field command: str [Required]#

The command to execute in the container.

field custom_args: list[str] = []#

Any custom CLI arguments to pass to the container engine.

field engine: Literal['docker', 'podman'] = 'docker'#

The container engine to use.

field entrypoint: str | None = None#

The entrypoint to use for the container (instead of the image’s default).

field env: dict[str, str] = {}#

Environment variables to set in the container.

field hostname: str | None = None#

The hostname to use for the container (instead of Docker’s default assignment).

field image: str [Required]#

The container image to run.

field mac_address: str | None = None#

The MAC address to use for the container (instead of Docker’s default assignment).

field mounts: MountOptions = MountOptions(work_dir_target=None, read_only=[], writeable=[], share_bfabric_config=True)#

Mount options for the container.

field type: Literal['docker'] = 'docker'#

Identifies the command type.

pydantic model bfabric_app_runner.specs.app.commands_spec.CommandPythonEnv#

Show JSON schema
{
   "title": "CommandPythonEnv",
   "type": "object",
   "properties": {
      "type": {
         "const": "python_env",
         "default": "python_env",
         "title": "Type",
         "type": "string"
      },
      "pylock": {
         "format": "path",
         "title": "Pylock",
         "type": "string"
      },
      "command": {
         "title": "Command",
         "type": "string"
      },
      "python_version": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Python Version"
      },
      "local_extra_deps": {
         "default": [],
         "items": {
            "format": "path",
            "type": "string"
         },
         "title": "Local Extra Deps",
         "type": "array"
      },
      "env": {
         "additionalProperties": {
            "type": "string"
         },
         "default": {},
         "title": "Env",
         "type": "object"
      },
      "prepend_paths": {
         "default": [],
         "items": {
            "format": "path",
            "type": "string"
         },
         "title": "Prepend Paths",
         "type": "array"
      },
      "refresh": {
         "default": false,
         "title": "Refresh",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "pylock",
      "command"
   ]
}

Config:
  • extra: str = forbid

Fields:
field command: str [Required]#

The command to run, will be split by shlex.split and is not an actual shell script.

field env: dict[str, str] = {}#

Environment variables to set before executing the command.

field local_extra_deps: list[Path] = []#

Additional dependencies to install into the environment.

Each entry should be a path to a wheel, sdist, or local package directory. These will be installed into the environment with uv pip install –no-deps after the main requirements. No dependency resolution will be performed for these, so their dependencies should already be present in the environment (typically specified in the pylock file).

field prepend_paths: list[Path] = []#

A list of paths to prepend to the PATH variable before executing the command.

If multiple paths are specified, the first one will be the first in PATH, etc.

field pylock: Path [Required]#

Path to the Pylock file that specifies the environment to use.

field python_version: str | None = None#

The Python version to use.

field refresh: bool = False#

When True, forces provisioning of an ephemeral environment that doesn’t affect the cache.

This creates a temporary environment for the single execution and doesn’t modify or reuse the cached environment. This ensures that refresh operations always start from a clean state and don’t leave broken environments in the cache if provisioning fails.

field type: Literal['python_env'] = 'python_env'#
pydantic model bfabric_app_runner.specs.app.commands_spec.MountOptions#

Show JSON schema
{
   "title": "MountOptions",
   "type": "object",
   "properties": {
      "work_dir_target": {
         "anyOf": [
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Work Dir Target"
      },
      "read_only": {
         "default": [],
         "items": {
            "maxItems": 2,
            "minItems": 2,
            "prefixItems": [
               {
                  "format": "path",
                  "type": "string"
               },
               {
                  "format": "path",
                  "type": "string"
               }
            ],
            "type": "array"
         },
         "title": "Read Only",
         "type": "array"
      },
      "writeable": {
         "default": [],
         "items": {
            "maxItems": 2,
            "minItems": 2,
            "prefixItems": [
               {
                  "format": "path",
                  "type": "string"
               },
               {
                  "format": "path",
                  "type": "string"
               }
            ],
            "type": "array"
         },
         "title": "Writeable",
         "type": "array"
      },
      "share_bfabric_config": {
         "default": true,
         "title": "Share Bfabric Config",
         "type": "boolean"
      }
   },
   "additionalProperties": false
}

Config:
  • extra: str = forbid

Fields:
field read_only: list[tuple[Path, Path]] = []#
field share_bfabric_config: bool = True#
field work_dir_target: Path | None = None#
field writeable: list[tuple[Path, Path]] = []#

Input Specifications#

Input Types#

pydantic model bfabric_app_runner.specs.inputs.bfabric_resource_spec.BfabricResourceSpec#

Show JSON schema
{
   "title": "BfabricResourceSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_resource",
         "default": "bfabric_resource",
         "title": "Type",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "filename": {
         "anyOf": [
            {
               "pattern": "^[^/][^:]*$",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Filename"
      },
      "check_checksum": {
         "default": true,
         "title": "Check Checksum",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "id"
   ]
}

Config:
  • extra: str = forbid

Fields:
field check_checksum: bool = True#

Whether to check the checksum of the file, after downloading

field filename: RelativeFilePath | None = None#

Target filename to save to

field id: int [Required]#

B-Fabric resource ID

field type: Literal['bfabric_resource'] = 'bfabric_resource'#
pydantic model bfabric_app_runner.specs.inputs.bfabric_dataset_spec.BfabricDatasetSpec#

Show JSON schema
{
   "title": "BfabricDatasetSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_dataset",
         "default": "bfabric_dataset",
         "title": "Type",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "filename": {
         "pattern": "^[^/][^:]*$",
         "title": "Filename",
         "type": "string"
      },
      "separator": {
         "default": ",",
         "enum": [
            ",",
            "\t"
         ],
         "title": "Separator",
         "type": "string"
      },
      "format": {
         "default": "csv",
         "enum": [
            "csv",
            "parquet"
         ],
         "title": "Format",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "filename"
   ]
}

Config:
  • extra: str = forbid

Fields:
field filename: RelativeFilePath [Required]#

Target filename to save to

Constraints:
  • pattern = ^[^/][^:]*$

field format: Literal['csv', 'parquet'] = 'csv'#
field id: int [Required]#

B-Fabric dataset ID

field separator: Literal[',', '\t'] = ','#

Separator for the CSV file (not relevant for Parquet)

field type: Literal['bfabric_dataset'] = 'bfabric_dataset'#
pydantic model bfabric_app_runner.specs.inputs.bfabric_resource_archive_spec.BfabricResourceArchiveSpec#

Show JSON schema
{
   "title": "BfabricResourceArchiveSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_resource_archive",
         "default": "bfabric_resource_archive",
         "title": "Type",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "filename": {
         "pattern": "^[^/][^:]*$",
         "title": "Filename",
         "type": "string"
      },
      "extract": {
         "const": "zip",
         "default": "zip",
         "title": "Extract",
         "type": "string"
      },
      "include_patterns": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Include Patterns",
         "type": "array"
      },
      "exclude_patterns": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Exclude Patterns",
         "type": "array"
      },
      "strip_root": {
         "default": false,
         "title": "Strip Root",
         "type": "boolean"
      },
      "check_checksum": {
         "default": true,
         "title": "Check Checksum",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "filename"
   ]
}

Config:
  • extra: str = forbid

Fields:
field check_checksum: bool = True#

Whether to check the checksum of the archive file, after downloading.

field exclude_patterns: list[str] = []#

Globs of files to exclude from the archive extraction (by default no files are excluded)

field extract: Literal['zip'] = 'zip'#

Extraction to perform, currently only ‘zip’ is supported

field filename: RelativeFilePath [Required]#

Target directory to save to

Constraints:
  • pattern = ^[^/][^:]*$

field id: int [Required]#

B-Fabric resource ID

field include_patterns: list[str] = []#

Globs of files to include in the archive extraction (by default all files are included)

field strip_root: bool = False#

If True, the root directory (if present) of the archive will be stripped during extraction.

field type: Literal['bfabric_resource_archive'] = 'bfabric_resource_archive'#
pydantic model bfabric_app_runner.specs.inputs.bfabric_resource_dataset.BfabricResourceDatasetSpec#

Spec to download all resources listed in a B-Fabric dataset to a folder.

This requires a column (“Resource” by default) referring to the resource IDs in B-Fabric.

The output will be saved to a folder (specified by filename), containing the selected files, as well as a parquet file (by default dataset.parquet) which contains the original dataset and an additional column (by default “File”) which contains the file names to identify the files.

Show JSON schema
{
   "title": "BfabricResourceDatasetSpec",
   "description": "Spec to download all resources listed in a B-Fabric dataset to a folder.\n\nThis requires a column (\"Resource\" by default) referring to the resource IDs in B-Fabric.\n\nThe output will be saved to a folder (specified by `filename`), containing the selected files, as well as a\nparquet file (by default `dataset.parquet`) which contains the original dataset and an additional column\n(by default \"File\") which contains the file names to identify the files.",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_resource_dataset",
         "default": "bfabric_resource_dataset",
         "title": "Type",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "column": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "string"
            }
         ],
         "default": "Resource",
         "title": "Column"
      },
      "filename": {
         "pattern": "^[^/][^:]*$",
         "title": "Filename",
         "type": "string"
      },
      "include_patterns": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Include Patterns",
         "type": "array"
      },
      "exclude_patterns": {
         "default": [],
         "items": {
            "type": "string"
         },
         "title": "Exclude Patterns",
         "type": "array"
      },
      "check_checksum": {
         "default": true,
         "title": "Check Checksum",
         "type": "boolean"
      },
      "output_dataset_filename": {
         "default": "dataset.parquet",
         "title": "Output Dataset Filename",
         "type": "string"
      },
      "output_dataset_file_column": {
         "default": "File",
         "title": "Output Dataset File Column",
         "type": "string"
      },
      "output_dataset_only": {
         "default": false,
         "title": "Output Dataset Only",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "filename"
   ]
}

Config:
  • extra: str = forbid

Fields:
field check_checksum: bool = True#

Whether to check the checksum of each resource file, after downloading.

field column: int | str = 'Resource'#

Column name or index containing the resource IDs. (case insensitive if string)

field exclude_patterns: list[str] = []#

Globs of files to exclude from the archive extraction (by default no files are excluded)

field filename: RelativeFilePath [Required]#

Target directory to save to.

Constraints:
  • pattern = ^[^/][^:]*$

field id: int [Required]#

B-Fabric dataset ID.

field include_patterns: list[str] = []#

Globs of files to include in the archive extraction (by default all files are included)

field output_dataset_file_column: str = 'File'#

Output name containing the file names (i.e. relative to the directory where the files get stored).

field output_dataset_filename: str = 'dataset.parquet'#

Filename to store the dataset metadata as a parquet file.

field output_dataset_only: bool = False#

Special flag which can be set to true for cases, where you only want the dataset but not the actual files.

field type: Literal['bfabric_resource_dataset'] = 'bfabric_resource_dataset'#
pydantic model bfabric_app_runner.specs.inputs.bfabric_order_fasta_spec.BfabricOrderFastaSpec#

Show JSON schema
{
   "title": "BfabricOrderFastaSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_order_fasta",
         "default": "bfabric_order_fasta",
         "title": "Type",
         "type": "string"
      },
      "id": {
         "title": "Id",
         "type": "integer"
      },
      "entity": {
         "enum": [
            "workunit",
            "order"
         ],
         "title": "Entity",
         "type": "string"
      },
      "filename": {
         "pattern": "^[^/][^:]*$",
         "title": "Filename",
         "type": "string"
      },
      "required": {
         "default": false,
         "title": "Required",
         "type": "boolean"
      }
   },
   "additionalProperties": false,
   "required": [
      "id",
      "entity",
      "filename"
   ]
}

Config:
  • extra: str = forbid

Fields:
field entity: Literal['workunit', 'order'] [Required]#
field filename: RelativeFilePath [Required]#
Constraints:
  • pattern = ^[^/][^:]*$

field id: int [Required]#
field required: bool = False#
field type: Literal['bfabric_order_fasta'] = 'bfabric_order_fasta'#
bfabric_app_runner.specs.inputs.bfabric_annotation_spec.BfabricAnnotationSpec#

alias of BfabricAnnotationResourceSampleSpec

pydantic model bfabric_app_runner.specs.inputs.file_spec.FileSpec#

Show JSON schema
{
   "title": "FileSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "file",
         "default": "file",
         "title": "Type",
         "type": "string"
      },
      "source": {
         "anyOf": [
            {
               "$ref": "#/$defs/FileSourceSsh"
            },
            {
               "$ref": "#/$defs/FileSourceLocal"
            }
         ],
         "title": "Source"
      },
      "filename": {
         "anyOf": [
            {
               "pattern": "^[^/][^:]*$",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Filename"
      },
      "link": {
         "default": false,
         "title": "Link",
         "type": "boolean"
      },
      "checksum": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Checksum"
      }
   },
   "$defs": {
      "FileSourceLocal": {
         "properties": {
            "local": {
               "pattern": "^/[^:]*$",
               "title": "Local",
               "type": "string"
            }
         },
         "required": [
            "local"
         ],
         "title": "FileSourceLocal",
         "type": "object"
      },
      "FileSourceSsh": {
         "properties": {
            "ssh": {
               "$ref": "#/$defs/FileSourceSshValue"
            }
         },
         "required": [
            "ssh"
         ],
         "title": "FileSourceSsh",
         "type": "object"
      },
      "FileSourceSshValue": {
         "properties": {
            "host": {
               "title": "Host",
               "type": "string"
            },
            "path": {
               "pattern": "^/[^:]*$",
               "title": "Path",
               "type": "string"
            }
         },
         "required": [
            "host",
            "path"
         ],
         "title": "FileSourceSshValue",
         "type": "object"
      }
   },
   "required": [
      "source"
   ]
}

Fields:
Validators:
field checksum: str | None = None#
Validated by:
field filename: RelativeFilePath | None = None#
Validated by:
Validated by:
field source: FileSourceSsh | FileSourceLocal [Required]#
Validated by:
field type: Literal['file'] = 'file'#
Validated by:
pydantic model bfabric_app_runner.specs.inputs.static_file_spec.StaticFileSpec#

Show JSON schema
{
   "title": "StaticFileSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "static_file",
         "default": "static_file",
         "title": "Type",
         "type": "string"
      },
      "content": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "format": "binary",
               "type": "string"
            }
         ],
         "title": "Content"
      },
      "filename": {
         "title": "Filename",
         "type": "string"
      }
   },
   "required": [
      "content",
      "filename"
   ]
}

Fields:
field content: str | bytes [Required]#

The text or binary content to write.

field filename: str [Required]#

The target filename to write to.

field type: Literal['static_file'] = 'static_file'#
pydantic model bfabric_app_runner.specs.inputs.static_yaml_spec.StaticYamlSpec#

Show JSON schema
{
   "title": "StaticYamlSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "static_yaml",
         "default": "static_yaml",
         "title": "Type",
         "type": "string"
      },
      "data": {
         "anyOf": [
            {
               "additionalProperties": true,
               "type": "object"
            },
            {
               "items": {},
               "type": "array"
            }
         ],
         "title": "Data"
      },
      "filename": {
         "title": "Filename",
         "type": "string"
      }
   },
   "required": [
      "data",
      "filename"
   ]
}

Fields:
field data: dict | list [Required]#

The YAML document content to write.

field filename: str [Required]#

The target filename to write to.

field type: Literal['static_yaml'] = 'static_yaml'#

Output Specifications#

pydantic model bfabric_app_runner.specs.outputs_spec.CopyResourceSpec#

Show JSON schema
{
   "title": "CopyResourceSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_copy_resource",
         "default": "bfabric_copy_resource",
         "title": "Type",
         "type": "string"
      },
      "local_path": {
         "format": "path",
         "title": "Local Path",
         "type": "string"
      },
      "store_entry_path": {
         "format": "path",
         "title": "Store Entry Path",
         "type": "string"
      },
      "store_folder_path": {
         "anyOf": [
            {
               "format": "path",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Store Folder Path"
      },
      "update_existing": {
         "$ref": "#/$defs/UpdateExisting",
         "default": "if_exists"
      },
      "protocol": {
         "const": "scp",
         "default": "scp",
         "title": "Protocol",
         "type": "string"
      }
   },
   "$defs": {
      "UpdateExisting": {
         "enum": [
            "no",
            "if_exists",
            "required"
         ],
         "title": "UpdateExisting",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "local_path",
      "store_entry_path"
   ]
}

Config:
  • extra: str = forbid

Fields:
field local_path: Path [Required]#

The local path to the file to be copied.

field protocol: Literal['scp'] = 'scp'#
field store_entry_path: Path [Required]#

The path to the storage entry in the storage folder.

field store_folder_path: Path | None = None#

The storage folder will be determined by the default rule, but can be specified if needed.

field type: Literal['bfabric_copy_resource'] = 'bfabric_copy_resource'#
field update_existing: UpdateExisting = UpdateExisting.IF_EXISTS#
pydantic model bfabric_app_runner.specs.outputs_spec.SaveDatasetSpec#

Show JSON schema
{
   "title": "SaveDatasetSpec",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_dataset",
         "default": "bfabric_dataset",
         "title": "Type",
         "type": "string"
      },
      "local_path": {
         "format": "path",
         "title": "Local Path",
         "type": "string"
      },
      "separator": {
         "title": "Separator",
         "type": "string"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "has_header": {
         "default": true,
         "title": "Has Header",
         "type": "boolean"
      },
      "invalid_characters": {
         "default": "",
         "title": "Invalid Characters",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "local_path",
      "separator"
   ]
}

Config:
  • extra: str = forbid

Fields:
field has_header: bool = True#
field invalid_characters: str = ''#
field local_path: Path [Required]#
field name: str | None = None#
field separator: str [Required]#
field type: Literal['bfabric_dataset'] = 'bfabric_dataset'#
pydantic model bfabric_app_runner.specs.outputs_spec.SaveLinkSpec#

Saves a link to the workunit, or, if desired to an arbitrary entity of type entity_type with id entity_id.

Show JSON schema
{
   "title": "SaveLinkSpec",
   "description": "Saves a link to the workunit, or, if desired to an arbitrary entity of type entity_type with id entity_id.",
   "type": "object",
   "properties": {
      "type": {
         "const": "bfabric_link",
         "default": "bfabric_link",
         "title": "Type",
         "type": "string"
      },
      "name": {
         "title": "Name",
         "type": "string"
      },
      "url": {
         "title": "Url",
         "type": "string"
      },
      "entity_type": {
         "default": "Workunit",
         "title": "Entity Type",
         "type": "string"
      },
      "entity_id": {
         "anyOf": [
            {
               "type": "integer"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Entity Id"
      },
      "update_existing": {
         "$ref": "#/$defs/UpdateExisting",
         "default": "if_exists"
      }
   },
   "$defs": {
      "UpdateExisting": {
         "enum": [
            "no",
            "if_exists",
            "required"
         ],
         "title": "UpdateExisting",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "name",
      "url"
   ]
}

Config:
  • extra: str = forbid

Fields:
Validators:
field entity_id: int | None = None#

The ID of the entity that will be linked.

Validated by:
field entity_type: str = 'Workunit'#

The type of the entity that will be linked.

Validated by:
field name: str [Required]#

The name of the link.

Validated by:
field type: Literal['bfabric_link'] = 'bfabric_link'#
Validated by:
field update_existing: UpdateExisting = UpdateExisting.IF_EXISTS#

Behavior, if a link with the same name already exists.

Validated by:
field url: str [Required]#

The URL of the link.

Validated by:
validator require_entity_id_if_not_workunit  »  all fields#

Runner#

class bfabric_app_runner.app_runner.runner.ChunksFile(*, chunks: list[Path])#

Bases: BaseModel

chunks: list[Path]#
classmethod infer_from_directory(work_dir: Path) ChunksFile#

Infer chunks by scanning for subdirectories containing inputs.yml.

Parameters:

work_dir – The work directory to scan

Returns:

ChunksFile with discovered chunks

Raises:

ValueError – If no chunks are found

model_config = {}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

classmethod read(work_dir: Path) ChunksFile#

Reads the chunks.yml file from the specified work directory.

If chunks.yml is missing, automatically discovers chunks by scanning for subdirectories containing inputs.yml and writes the result to chunks.yml.

Parameters:

work_dir – The work directory containing chunks.yml or chunk subdirectories

Returns:

ChunksFile with chunk paths

class bfabric_app_runner.app_runner.runner.Runner(spec: AppVersion, client: Bfabric, ssh_user: str | None = None)#

Bases: object

run_collect(workunit_ref: int | Path, chunk_dir: Path) None#
run_dispatch(workunit_ref: int | Path, work_dir: Path) None#
run_inputs(chunk_dir: Path) None#
run_process(chunk_dir: Path) None#
bfabric_app_runner.app_runner.runner.run_app(app_spec: AppVersion, workunit_ref: int | Path, work_dir: Path, client: Bfabric, force_storage: Path | None, ssh_user: str | None = None, read_only: bool = False, dispatch_active: bool = True) None#

Executes all steps of the provided app.