flowserv.client.app.base module

Helper methods for test runs of workflow templates.

class flowserv.client.app.base.Flowserv(env: Optional[Dict] = None, basedir: Optional[str] = None, database: Optional[str] = None, open_access: Optional[bool] = None, run_async: Optional[bool] = None, clear: Optional[bool] = False, user_id: Optional[str] = None)

Bases: object

Client environment for interacting with a flowserv instance. This class provides additional functionality for installing flowserv applications. It is primarily intended running flowserv in programming environments, e.g., Jupyter Notebooks.

create_submission(workflow_id: str, name: str, members: Optional[List[str]] = None, parameters: Optional[List[flowserv.model.parameter.base.Parameter]] = None, engine_config: Optional[Dict] = None) str

Create a new user group for a given workflow. Each group has a a unique name for the workflow, a list of additional group members, and a specification of additional parameters. The parameters allow to define variants of the original workflow template.

Parameters
  • workflow_id (string) – Unique workflow identifier

  • name (string) – Unique team name

  • members (list(string), default=None) – List of user identifier for group members

  • parameters (list of flowserv.model.parameter.base.Parameter, default=None) – Optional list of parameter declarations that are used to modify the template parameters for submissions of the created group.

  • engine_config (dict, default=None) – Optional configuration settings that will be used as the default when running a workflow.

Return type

string

erase()

Delete the base folder for the test environment that contains all workflow files.

install(source: str, identifier: Optional[str] = None, name: Optional[str] = None, description: Optional[str] = None, instructions: Optional[str] = None, specfile: Optional[str] = None, manifestfile: Optional[str] = None, engine_config: Optional[Dict] = None, ignore_postproc: Optional[bool] = False, multi_user: Optional[bool] = False, verbose: Optional[bool] = False) str

Create a new workflow in the environment that is defined by the template referenced by the source parameter. Returns the identifier of the created workflow.

If the multi user flag is False this method will also create a group with the same identifier as the workflow.

Parameters
  • source (string) – Path to local template, name or URL of the template in the repository.

  • identifier (string, default=None) – Unique user-provided workflow identifier. If no identifier is given a unique identifier will be generated for the application.

  • name (string, default=None) – Unique workflow name

  • description (string, default=None) – Optional short description for display in workflow listings

  • instructions (string, default=None) – File containing instructions for workflow users.

  • specfile (string, default=None) – Path to the workflow template specification file (absolute or relative to the workflow directory)

  • manifestfile (string, default=None) – Path to manifest file. If not given an attempt is made to read one of the default manifest file names in the base directory.

  • engine_config (dict, default=None) – Optional configuration settings that will be used as the default when running a workflow.

  • ignore_postproc (bool, default=False) – Ignore post-processing workflow specification if True.

  • multi_user (bool, default=False) – If the multi user flag is False a group will be created for the workflow with the same identifier as the workflow.

  • verbose (bool, default=False) – Print information about source and target volume and the files that are being copied.

Return type

string

login(username: str, password: str)

Authenticate the user using the given credentials.

Parameters
  • username (string) – Unique user name

  • password (string) – User password

logout()

Logout the currently authenticated user.

open(identifier: str) flowserv.client.app.workflow.Workflow

Get an instance of the floserv app for the workflow with the given identifier.

Parameters

identifier (string) – Unique workflow identifier.

Return type

flowserv.client.app.workflow.Workflow

register(username: str, password: str) str

Register a new user with the given credentials.

Parameters
  • username (string) – Unique user name.

  • password (string) – User password.

Return type

string

submission(workflow_id: str, group_id: str) flowserv.client.app.workflow.Workflow

Get the handle for a workflow with a given identifier and for a given user group.

Parameters
  • workflow_id (string) – Unique workflow identifier.

  • group_id (string) – Unique user group identifier.

Return type

flowserv.client.app.workflow.Workflow

uninstall(identifier: str)

Remove the workflow with the given identifier. This will also remove all run files for that workflow.

Parameters

identifier (string) – Unique workflow identifier.