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:
renku.infrastructure.persistent.Persistent
,abc.ABC
Abstract base class for all plans.
- assign_new_id()[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=datetime.datetime(2023, 2, 3, 16, 40, 50, tzinfo=datetime.timezone(datetime.timedelta(0), 'UTC')))[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:
renku.domain_model.workflow.plan.AbstractPlan
Represent a renku run execution template.
- assign_new_id()[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.
- is_similar_to(other)[source]¶
Return true if plan has the same inputs/outputs/arguments as another plan.
- property keywords_csv¶
Comma-separated list of keywords associated with workflow.
composite_plan¶
Represent a group of run templates.
- class renku.domain_model.workflow.composite_plan.CompositePlan(*args, **kwargs)[source]¶
Bases:
renku.domain_model.workflow.plan.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, position=None, prefix=None, encoding_format=None, derived_from=None, postfix=None)[source]¶
Bases:
renku.domain_model.workflow.parameter.CommandParameterBase
An input to a command.
- class renku.domain_model.workflow.parameter.CommandOutput(*, create_folder=False, default_value=None, description=None, id, mapped_to=None, name=None, position=None, prefix=None, encoding_format=None, derived_from=None, postfix=None)[source]¶
Bases:
renku.domain_model.workflow.parameter.CommandParameterBase
An output from a command.
- class renku.domain_model.workflow.parameter.CommandParameter(*, default_value=None, description=None, id, name=None, position=None, prefix=None, derived_from=None, postfix=None)[source]¶
Bases:
renku.domain_model.workflow.parameter.CommandParameterBase
An argument to a command that is neither input nor output.
- class renku.domain_model.workflow.parameter.CommandParameterBase(*, default_value, description, id, name, 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.
- property role¶
Return a unique role for this parameter within its Plan.
- 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, mapped_parameters, **kwargs)[source]¶
Bases:
renku.domain_model.workflow.parameter.CommandParameterBase
A mapping of child parameter(s) to a parent CompositePlan.
- property actual_value¶
Get the actual value to be used for execution.
- property leaf_parameters¶
Return leaf (non-Mapping) parameters contained by this Mapping.
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.