flowserv.controller.serial.workflow.parser module

Parser for serial workflow templates.

flowserv.controller.serial.workflow.parser.Step(identifier: str, action: Dict, inputs: Optional[List[str]] = None, outputs: Optional[List[str]] = None) flowserv.model.workflow.step.WorkflowStep

Create workflow step instance from dictionary serialization.

The type of the generated workflow step will depend on the elements in the given dictionary serialization.

Raises a ValueError if the given dictionary is not a valid serialization for a workflow step.

Parameters
  • identifier (string) – Unique step name (identifier).

  • action (Dict) – Dictionary serialization for the workflow step.

  • inputs (list of string, default=None) – List of files that are required by the workflow step as inputs.

  • outputs (list of string, default=None) – List of files that are generated by the workflow step as outputs.

Return type

flowserv.model.workflow.step.WorkflowStep

flowserv.controller.serial.workflow.parser.parse_template(template: flowserv.model.template.base.WorkflowTemplate, arguments: Dict) Tuple[List[flowserv.model.workflow.step.ContainerStep], Dict, List[str]]

Parse a serial workflow template to extract workflow steps and output files.

The expected schema of the workflow specification is as follows:

workflow:
    files:
        inputs:
        - "str"
        outputs:
        - "str"
    parameters:
    - name: "scalar"
    steps:
    - name: "str"
      files:
        inputs:
        - "str"
        outputs:
        - "str"
      action: "object depending on the step type"

The schema for the action specification for a workflow step is dependent on the step type. For container steps, the expected schema is:

action:
    environment: "str"
    commands:
    - "str"

Expands template parameter references in the workflow argument specification and the step inputs list. Returns the modified argument list as part of the result.

Parameters

template (flowserv.model.template.base.WorkflowTemplate) – Template for a serial workflow.

Return type

tuple of list of flowsert.controller.serial.workflow.step.ContainerStep, dict and list of string

flowserv.controller.serial.workflow.parser.parse_varnames(action: Dict) Dict

Parse mapping of function or notebook argument names to the names of variables (e.g., parameters) in the workflow context.

Parameters

action (dict) – Workflow step serialization.

Return type

dict