flowserv.controller.worker.subprocess module

Workflow step processor that uses the Python subprocess package to execute a given list of commands in a container environment.

class flowserv.controller.worker.subprocess.SubprocessWorker(variables: Optional[Dict] = None, env: Optional[Dict] = None, identifier: Optional[str] = None, volume: Optional[str] = None)

Bases: flowserv.controller.worker.base.ContainerWorker

Container step engine that uses the subprocess package to execute the commands in a workflow step.

run(step: flowserv.model.workflow.step.ContainerStep, env: Dict, rundir: str) flowserv.controller.serial.workflow.result.ExecResult

Execute a list of shell commands in a workflow step synchronously.

Stops execution if one of the commands fails. Returns the combined result from all the commands that were executed.

Parameters
  • step (flowserv.controller.serial.workflow.ContainerStep) – Step in a serial workflow.

  • env (dict, default=None) – Default settings for environment variables when executing workflow steps. May be None.

  • rundir (string) – Path to the working directory of the workflow run.

Return type

flowserv.controller.serial.workflow.result.ExecResult

flowserv.controller.worker.subprocess.append(outstream: List[str], text: str)

Append the given text to an output stream if the text is not empty.