Tools and Workflows — Renku 0.1.0.dev20180613 documentation

Join us on GitHub

# Tools and Workflows

Manage creation of tools and workflows using the Common Workflow Language (CWL).

## Common Workflow language

Renku uses CWL to represent runnable steps (tools) along with their inputs and outputs. Similarly, tools can be chained together to form CWL-defined workflows.

### Command-line tool

Represent a `CommandLineTool` from the Common Workflow Language.

class `renku.models.cwl.command_line_tool.` `CommandLineTool`(requirements=NOTHING, hints=NOTHING, label=None, doc=None, cwlVersion='v1.0', baseCommand='', arguments=NOTHING, stdin=None, stdout=None, stderr=None, inputs=NOTHING, outputs=NOTHING, successCodes=NOTHING, temporaryFailCodes=NOTHING, permanentFailCodes=NOTHING) → None

  Represent a command line tool.

  `get_output_id`(path)

    Return an id of the matching path from default values.

  `to_argv`(job=None)

    Generate arguments for system call.

class `renku.models.cwl.command_line_tool.` `CommandLineToolFactory`(command_line, directory='.', stdin=None, stderr=None, stdout=None) → None

  Command Line Tool Factory.

  `file_candidate`(candidate, ignore=None)

    Return a path instance if it exists in current directory.

  `generate_tool`()

    Return an instance of command line tool.

  `guess_inputs`(*arguments)

    Yield command input parameters and command line bindings.

  `guess_outputs`(paths)

    Yield detected output and changed command input parameter.

  `guess_type`(value, ignore_filenames=None)

    Return new value and CWL parameter type.

  `split_command_and_args`()

    Return tuple with command and args from command line arguments.

  `validate_command_line`(attribute, value)

    Check the command line structure.

  `validate_path`(attribute, value)

    Path must exists.

  `watch`(repo=None, no_output=False)

    Watch a Renku repository for changes to detect outputs.

### Parameter

Represent parameters from the Common Workflow Language.

class `renku.models.cwl.parameter.` `CommandInputParameter`(id, streamable=None, type='string', description=None, default=None, inputBinding=None) → None

  An input parameter for a CommandLineTool.

  `to_argv`()

    Format command input parameter as shell argument.

class `renku.models.cwl.parameter.` `CommandLineBinding`(position=None, prefix=None, separate: bool = True, itemSeparator=None, valueFrom=None, shellQuote: bool = True) → None

  Define the binding behavior when building the command line.

  `to_argv`(default=None)

    Format command line binding as shell argument.

class `renku.models.cwl.parameter.` `CommandOutputBinding`(glob=None) → None

  Define the binding behavior for outputs.

class `renku.models.cwl.parameter.` `CommandOutputParameter`(id, streamable=None, type='string', description=None, format=None, outputBinding=None) → None

  Define an output parameter for a CommandLineTool.

class `renku.models.cwl.parameter.` `InputParameter`(id, streamable=None, type='string', description=None, default=None, inputBinding=None) → None

  An input parameter.

class `renku.models.cwl.parameter.` `OutputParameter`(id, streamable=None, type='string', description=None, format=None, outputBinding=None) → None

  An output parameter.

class `renku.models.cwl.parameter.` `Parameter`(streamable=None) → None

  Define an input or output parameter to a process.

class `renku.models.cwl.parameter.` `WorkflowOutputParameter`(id, streamable=None, type='string', description=None, format=None, outputBinding=None, outputSource=None) → None

  Define an output parameter for a Workflow.

`renku.models.cwl.parameter.` `convert_default`(value)

  Convert a default value.

### Process

Represent a `Process` from the Common Workflow Language.

class `renku.models.cwl.process.` `Process`

  Represent a process.

### Types

Represent the Common Workflow Language types.

class `renku.models.cwl.types.` `File`(path) → None

  Represent a file.

### Workflow

Represent workflows from the Common Workflow Language.

class `renku.models.cwl.workflow.` `Workflow`(inputs=NOTHING, requirements=NOTHING, hints=NOTHING, label=None, doc=None, cwlVersion='v1.0', outputs=NOTHING, steps=NOTHING) → None

  Define a workflow representation.

  `add_step`(**kwargs)

    Add a workflow step.

  `get_output_id`(path)

    Return an id of the matching path from default values.

class `renku.models.cwl.workflow.` `WorkflowStep`(run, id=NOTHING, in_=None, out=None) → None

  Define an executable element of a workflow.