package bistro

  1. Overview
  2. Docs
On This Page
  1. Useful commands
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Bistro.Shell_dslSource

Command-line construction

Sourcetype command
include module type of Template_dsl with type template := template
Sourceval dest : template

Symbol representing the location where a workflow is expected to produce its result

Sourceval tmp : template

Symbol representing an existing empty directory that can be used as a temporary space for a workflow's execution.

Symbol representing the number of cores allocated to the workflow

Sourceval mem : template

Symbol representing the memory size allocated to the workflow, in GB.

Sourceval string : string -> template

A chunk of text

Sourceval int : int -> template

Int formatting

Sourceval float : float -> template

Float formatting

dep w is interpreted as the path where to find the result of workflow w

Sourceval deps : ?quote:char -> sep:string -> _ path list workflow -> template
Sourceval string_dep : string workflow -> template

string_dep w is interpreted as the result of workflow w

Sourceval int_dep : int workflow -> template

int_dep w is interpreted as result of workflow w

Sourceval quote : ?using:char -> template -> template

quote ~using:c t surrounds template t with character c

Sourceval option : ('a -> template) -> 'a option -> template

option f o is f x if o = Some x and string "" otherwise

Sourceval list : ('a -> template) -> ?sep:string -> 'a list -> template

list combinator, optional value of sep is ","

Sourceval seq : ?sep:string -> template list -> template

another list combinator, default value for sep is ""

Sourceval enum : ('a * string) list -> 'a -> template

combinator for enumerations

Sourceval file_dump : template -> template

file_dump t can be used when a command needs a configuration script: at run-time, it will generate a text using t, save it to a path, deterministically chosen as a function of t. Finally the template file_dump t is interpreted as this path.

Sourceval cmd : string -> ?stdin:template -> ?stdout:template -> ?stderr:template -> template 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

  • parameter stderr

    adds a "2> /some/path" token at the end of the command

Sourceval bash : template -> command

Run a bash script, best used with %script {|...|}

Sourceval opt : string -> ('a -> template) -> 'a -> template

Command-line option formatting, e.g.: opt "--output" dep dest will be rendered like "--output /some/path"

Sourceval opt' : string -> ('a -> template) -> 'a -> template

Same as opt but renders options with an equal sign, e.g. "--output=/some/path"

Sourceval flag : ('a -> template) -> 'a -> bool -> template

flag f x b renders as f x if b is true

Sourceval or_list : command list -> command

OR-sequence of commands ( || )

Sourceval and_list : command list -> command

AND-sequence of commands ( && )

Sourceval pipe : command list -> command

Pipe of commands ( | )

Sourceval (//) : template -> string -> template

Similar to Filename.concat, but with other types.

Useful commands
Sourceval mkdir : template -> command
Sourceval mkdir_p : template -> command
Sourceval rm_rf : template -> command
Sourceval docker_image : ?tag:string -> ?registry:string -> account:string -> name:string -> unit -> container_image

Construct a description of a publicly available docker image

Sourceval (%) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c
OCaml

Innovation. Community. Security.