flowserv.controller.remote.engine module
Implementation for a workflow controller backend that uses an external (remote) workflow engine (e.g., an existing REANA cluster) for workflow execution. The controller provides functionality for workflow creation, start, stop, and monitpring using an (abstract) client class. For different types of workflow engines only the RemoteClient class needs to be implements.
- class flowserv.controller.remote.engine.RemoteWorkflowController(client: flowserv.controller.remote.client.RemoteClient, poll_interval: float, is_async: bool, service: Optional[flowserv.service.api.APIFactory] = None)
Bases:
flowserv.controller.base.WorkflowControllerWorkflow controller that executes workflow templates for a given set of arguments using an external workflow engine. Each workflow is monitored by a separate process that continuously polls the workflow state.
- cancel_run(run_id: str)
Request to cancel execution of the given run. This method is usually called by the workflow engine that uses this controller for workflow execution. It is threfore assumed that the state of the workflow run is updated accordingly by the caller.
- Parameters
run_id (string) – Unique run identifier.
- exec_workflow(run: flowserv.model.base.RunObject, template: flowserv.model.template.base.WorkflowTemplate, arguments: Dict, staticfs: flowserv.volume.base.StorageVolume, config: Optional[Dict] = None) Tuple[flowserv.model.workflow.state.WorkflowState, flowserv.volume.base.StorageVolume]
Initiate the execution of a given workflow template for a set of argument values. This will start a new process that executes a serial workflow asynchronously. Returns the state of the workflow after the process is stated (the state will therefore be RUNNING).
The set of arguments is not further validated. It is assumed that the validation has been performed by the calling code (e.g., the run service manager).
If the state of the run handle is not pending, an error is raised.
- Parameters
run (flowserv.model.base.RunObject) – Handle for the run that is being executed.
template (flowserv.model.template.base.WorkflowTemplate) – Workflow template containing the parameterized specification and the parameter declarations.
arguments (dict) – Dictionary of argument values for parameters in the template.
staticfs (flowserv.volume.base.StorageVolume) – Storage volume that contains the static files from the workflow template.
config (dict, default=None) – Optional configuration settings are currently ignored. Included for API completeness.
- Return type
flowserv.model.workflow.state.WorkflowState, flowserv.volume.base.StorageVolume