CWLDockerTranslator

StreamFlow relies on a CWLDockerTranslator object to convert a CWL DockerRequirement specification into a step binding on a given Connector instance. By default, the DockerCWLDockerTranslator is used to spawn a DockerConnector. However, StreamFlow also supports translators for Kubernetes, Singularity and NoContainer. This latter allows to execute the step without a container, even if the DockerRequirement feature is defined. More CWLDockerTranslators can be implemented by the community using the plugins mechanism (see here).

The CWLDockerTranslator interface is defined in the streamflow.cwl.requirement.docker.translator module and exposes a single public method get_target:

def get_target(
    self,
    image: str,
    output_directory: str | None,
    network_access: bool,
    target: Target,
) -> Target:
    ...

The get_target method returns a Target object that contains an auto-generated DeploymentConfig that reflects the CWLDockerTranslator configuration. The target parameter contains the original Target object of the related step. If the Connector created by the CWLDockerTranslator extends the ConnectorWrapper class and the wrapper directive is defined as True in the StreamFlow file, the newly created Target object wraps the original one.

The other parameters derive from the CWL workflow specification. In particular, the image parameter points to the Docker image needed by the step. The output_directory parameter reflects the dockerOutputDirectory option of a CWL DockerRequirement. The network_access parameter derives from the CWL NetworkAccess requirement.

Implementations

Type

Class

docker

streamflow.cwl.requirement.docker.DockerCWLDockerTranslator

kubernetes

streamflow.cwl.requirement.docker.KubernetesCWLDockerTranslator

singularity

streamflow.cwl.requirement.docker.SingularityCWLDockerTranslator