flowserv.service.workflow.base module

Base class for the workflow API component that provides methods to create and access workflows and workflow result rankings.

class flowserv.service.workflow.base.WorkflowService

Bases: object

API component that provides methods to access workflows and workflow evaluation rankings (benchmark leader boards).

abstract get_ranking(workflow_id: str, order_by: Optional[List[flowserv.model.template.schema.SortColumn]] = None, include_all: Optional[bool] = False) Dict

Get serialization of the evaluation ranking for the given workflow.

Parameters
  • workflow_id (string) – Unique workflow identifier

  • order_by (list(flowserv.model.template.schema.SortColumn), default=None) – Use the given attribute to sort run results. If not given, the schema default sort order is used

  • include_all (bool, default=False) – Include all entries (True) or at most one entry (False) per user group in the returned ranking

Return type

dict

abstract get_result_archive(workflow_id: str) IO

Get compressed tar-archive containing all result files that were generated by the most recent post-processing workflow. If the workflow does not have a post-processing step or if the post-processing workflow run is not in SUCCESS state, a unknown resource error is raised.

Parameters

workflow_id (string) – Unique workflow identifier

Return type

io.BytesIO

abstract get_result_file(workflow_id: str, file_id: str) IO

Get file handle for a file that was generated as the result of a successful post-processing workflow run.

Parameters
  • workflow_id (string) – Unique workflow identifier

  • file_id (string) – Unique resource file identifier

Return type

flowserv.model.files.FileHandle

Raises
abstract get_workflow(workflow_id: str) Dict

Get serialization of the handle for the given workflow.

Parameters

workflow_id (string) – Unique workflow identifier

Return type

dict

abstract list_workflows() Dict

Get serialized listing of descriptors for all workflows in the repository.

Return type

dict