Renku Workflow
Renku uses PROV-O and its own Renku ontology to represent workflows.
plan
Represent run templates.
- class renku.domain_model.workflow.plan.AbstractPlan(*args, **kwargs)[source]
Bases:
Persistent
,ABC
Abstract base class for all plans.
- assign_new_id(*, uuid=None)[source]
Assign a new UUID.
This is required only when there is another plan which is exactly the same except the parameters’ list.
- delete(when=None)[source]
Mark a plan as deleted.
NOTE: Don’t call this function for deleting plans since it doesn’t delete the whole plan derivatives chain. Use renku.core.workflow.plan::remove_plan instead.
- property deleted
True if plan is deleted.
- class renku.domain_model.workflow.plan.Plan(*args, **kwargs)[source]
Bases:
AbstractPlan
Represent a renku run execution template.
- assign_new_id(*, uuid=None)[source]
Assign a new UUID.
This is required only when there is another plan which is exactly the same except the parameters’ list.
- copy()[source]
Create a copy of this plan.
Required where a plan is used several times in a workflow but we need to set different values on them.
Includes a list of dependencies that are defined by Renku and should be hidden from users.
- property keywords_csv
Comma-separated list of keywords associated with workflow.
- class renku.domain_model.workflow.plan.PlanDetailsJson(*, only=None, exclude=(), many=None, context=None, load_only=(), dump_only=(), partial=None, unknown=None)[source]
Bases:
Schema
Serialize a plan to a response object.
composite_plan
Represent a group of run templates.
- class renku.domain_model.workflow.composite_plan.CompositePlan(*args, **kwargs)[source]
Bases:
AbstractPlan
A plan containing child plans.
- find_link_by_target(target)[source]
Find a link on this or a child workflow that has target as a sink.
parameter
Classes to represent inputs/outputs/parameters in a Plan.
- class renku.domain_model.workflow.parameter.CommandInput(*, default_value=None, description=None, id, mapped_to=None, name=None, name_set_by_user=False, position=None, prefix=None, encoding_format=None, derived_from=None, postfix=None)[source]
Bases:
CommandParameterBase
An input to a command.
- static generate_id(plan_id, position=None, postfix=None, name=None)[source]
Generate an id for CommandInput.
- class renku.domain_model.workflow.parameter.CommandOutput(*, create_folder=False, default_value=None, description=None, id, mapped_to=None, name=None, name_set_by_user=False, position=None, prefix=None, encoding_format=None, derived_from=None, postfix=None)[source]
Bases:
CommandParameterBase
An output from a command.
- static generate_id(plan_id, position=None, postfix=None, name=None)[source]
Generate an id for CommandOutput.
- class renku.domain_model.workflow.parameter.CommandParameter(*, default_value=None, description=None, id, name=None, name_set_by_user=False, position=None, prefix=None, derived_from=None, postfix=None)[source]
Bases:
CommandParameterBase
An argument to a command that is neither input nor output.
- class renku.domain_model.workflow.parameter.CommandParameterBase(*, default_value, description, id, name, name_set_by_user=False, position=None, prefix=None, derived_from=None, postfix=None)[source]
Bases:
object
Represents a parameter for a Plan.
- property actual_value
Get the actual value to be used for execution.
- property actual_value_set
Whether the actual_value on this parameter has been set at least once.
- is_equal_to(other)[source]
Return if attributes that cause a change in the parameter, are the same.
- property role
Return a unique role for this parameter within its Plan.
- class renku.domain_model.workflow.parameter.HiddenInput(*, default_value=None, description=None, id, mapped_to=None, name=None, name_set_by_user=False, position=None, prefix=None, encoding_format=None, derived_from=None, postfix=None)[source]
Bases:
CommandInput
An input to a command that is added by Renku and should be hidden from users.
- class renku.domain_model.workflow.parameter.MappedIOStream(*, id=None, stream_type)[source]
Bases:
object
Represents an IO stream (stdin, stdout, stderr).
- class renku.domain_model.workflow.parameter.ParameterLink(source, sinks, id)[source]
Bases:
object
A link between a source and one or more sink parameters.
- class renku.domain_model.workflow.parameter.ParameterMapping(*, default_value, description=None, id, name=None, name_set_by_user=False, mapped_parameters, **kwargs)[source]
Bases:
CommandParameterBase
A mapping of child parameter(s) to a parent CompositePlan.
- property actual_value
Get the actual value to be used for execution.
- static generate_id(plan_id, position=None, postfix=None, name=None)[source]
Generate an id for ParameterMapping.
- property leaf_parameters
Return leaf (non-Mapping) parameters contained by this Mapping.
workflow_file
Models to represent a workflow file run templates.
- class renku.domain_model.workflow.workflow_file.WorkflowFileCompositePlan(*args, **kwargs)[source]
Bases:
CompositePlan
A workflow file composite plan.
- class renku.domain_model.workflow.workflow_file.WorkflowFilePlan(*args, **kwargs)[source]
Bases:
Plan
Represent a Plan that is converted from a workflow file.
- static generate_id(path=None, name=None, sequence=None, uuid_only=False, **_)[source]
Generate an identifier for Plan.
- property unqualified_name
Name of the plan as appears in the workflow file definition.
Renku Workflow Conversion
Renku allows conversion of tracked workflows to runnable workflows in supported tools (Currently CWL)
CWL
Converter for workflows to CWL.
- class renku.core.workflow.converters.cwl.CWLExporter[source]
Converts a
CompositePlan
or aPlan
to CWL format.- workflow_convert(workflow, basedir, output, output_format, resolve_paths, nest_workflows)[source]
Converts the specified workflow to CWL format.
- Parameters:
worflow (Union[CompositePlan, Plan]) – The plan or composite plan to be converted to cwl.
basedir (Path) – The path of the base location used as a prefix for all workflow input and outputs.
output (Optional[Path]) – The file where the CWL specification should be saved, if None then no file is created.
output_format (Optional[str]) – Not used. Only YAML is generated, regardless of what is provided.
resolve_paths (Optional[bool]) – Whether to make all paths absolute and resolve all symlinks, True by default.
nest_workflows (Optional[bool]) – Whether nested CWL workflows should be used or each sub-workflow should be a separate file, False by default.
- Returns:
The contents of the CWL workflow as string. If nested workflows are used then only the parent specification is returned.