This module provides combinators to define new workflows that execute shell commands.
include module type of Template with type Template.t := Template.t
Represents a text with special symbols
val tmp : t
Symbol representing an existing empty directory that can be used as a temporary space for a workflow's execution.
val workflow : ?descr:string ‑> ?mem:int ‑> ?np:int ‑> ?version:int ‑> command list ‑> 'a workflow
Workflow constructor, taking a list of commands in input. Other arguments are:
Parameter descr: description of the workflow, used for logging
Parameter mem: required memory
Parameter np: maximum number of cores (could be given less at execution)
val input : ?may_change:bool ‑> string ‑> 'a workflow
Constructs a workflow from an existing file on the
filesystem. The argument may_change
indicates that the file
may be modified, which is detected by giving the workflow a
digest of the file as an input.
val cmd : string ‑> ?env:docker_image ‑> ?stdin:Template.t ‑> ?stdout:Template.t ‑> ?stderr:Template.t ‑> Template.t list ‑> command
Command-line constructor, e.g. cmd "echo" ~stdout:dest [ string
"foo" ]
will generate a shell command like "echo foo >
/some/path"
.
Parameter env: specifies a Docker image where to run the command
Parameter stdin: adds a "< /some/path"
token at the end of the command
Parameter stdout: adds a "> /some/path"
token at the end of the command
"2> /some/path"
token at the end of the commandval internal_cmd : string ‑> ?stdin:Template.t ‑> ?stdout:Template.t ‑> ?stderr:Template.t ‑> Template.t list ‑> command
Alternative command-line constructor, calling the current
executable as specified by Sys.argv.(0)
. More precisely
internal_cmd subcmd
calls Sys.argv.(0)
with subcommand
subcmd
.
val opt : string ‑> ('a ‑> Template.t) ‑> 'a ‑> Template.t
Command-line option formatting, e.g.: opt "--output" dep dest
will be rendered like "--output /some/path"
val opt' : string ‑> ('a ‑> Template.t) ‑> 'a ‑> Template.t
Same as opt but renders options with an equal sign,
e.g. "--output=/some/path"
val mkdir : Template.t ‑> command
val mkdir_p : Template.t ‑> command
val wget : ?no_check_certificate:bool ‑> ?user:string ‑> ?password:string ‑> ?dest:Template.t ‑> string ‑> command
val cd : Template.t ‑> command
val rm_rf : Template.t ‑> command
val mv : Template.t ‑> Template.t ‑> command
val docker_image : ?tag:string ‑> ?registry:string ‑> account:string ‑> name:string ‑> unit ‑> docker_image
Construct a description of a publicly available docker image
val docker : docker_image ‑> command ‑> command
docker cmd
transforms cmd
so that it can be executed in a
Docker container.