Module Ketrew_edsl (.ml)

module Ketrew_edsl: sig .. end
Easy interface to the library for end users.


This is a more stable EDSL/API for end-users to make workflows and deal with the system.

Many functions may raise exceptions when called improperly, but this should happen while building the workflow, not after it starts running.

This is a more stable EDSL/API for end-users to make workflows and deal with the system.

Many functions may raise exceptions when called improperly, but this should happen while building the workflow, not after it starts running.

Hosts


module Host: sig .. end

Build Programs


module Program: sig .. end
Build “things to run”, i.e.

Conditions


module Condition: sig .. end

Artifacts


class type user_artifact = object .. end
Artifacts are things to be built (they may already exist), most often file-tree-locations on a given host (see also Ketrew_artifact.t).
val file : ?host:Ketrew_host.t -> string -> user_artifact
Create a volume containing one file.
val unit : user_artifact
The artifact that is “never done” (i.e. the target associated will always be (re-)run if activated).

Targets


class type user_target = object .. end
Targets are the nodes in the workflow arborescence (see also Ketrew_target.t).
val target : ?active:bool ->
?depends_on:user_target list ->
?make:Ketrew_target.Build_process.t ->
?done_when:Ketrew_target.Condition.t ->
?metadata:[ `String of string ] ->
?product:user_artifact ->
?equivalence:Ketrew_target.Equivalence.t ->
?on_failure_activate:user_target list ->
?on_success_activate:user_target list ->
?tags:string list -> string -> user_target
Construct a new target, the node of a workflow graph. The main argument (the string) is its name, then all optional arguments mean:


val file_target : ?depends_on:user_target list ->
?make:Ketrew_target.Build_process.t ->
?metadata:[ `String of string ] ->
?name:string ->
?host:Host.t ->
?equivalence:Ketrew_target.Equivalence.t ->
?on_failure_activate:user_target list ->
?on_success_activate:user_target list ->
?tags:string list -> string -> user_target
Create a file Ketrew_edsl.user_artifact and the Ketrew_edsl.user_target that produces it.

The ?product of the target will be the file given as argument on the host given by the ?host option (default: localhost using "/tmp").

The ?done_when condition will be the existence of that file.

This can be seen as a classical make-like file-producing target, but on any arbitrary host.

val daemonize : ?starting_timeout:float ->
?call_script:(string -> string list) ->
?using:[ `Nohup_setsid | `Python_daemon ] ->
?host:Host.t ->
?no_log_is_ok:bool -> Program.t -> Ketrew_target.Build_process.t
Create a “daemonize” build process:


val lsf : ?host:Host.t ->
?queue:string ->
?name:string ->
?wall_limit:string ->
?processors:[ `Min of int | `Min_max of int * int ] ->
?project:string -> Program.t -> Ketrew_target.Build_process.t
Create an “LSF” build process.
val pbs : ?host:Ketrew_host.t ->
?queue:string ->
?name:string ->
?wall_limit:[ `Hours of float ] ->
?processors:int ->
?email_user:[ `Always of string | `Never ] ->
?shell:string ->
Program.t -> [> `Long_running of string * string ]
Create a “PSB” build process.
val yarn_application : ?host:Ketrew_host.t ->
?daemonize_using:[ `Nohup_setsid | `Python_daemon ] ->
?daemon_start_timeout:float ->
Ketrew_program.t -> [> `Long_running of string * string ]
Create a build process that requests resources from Yarn, the command must be an application in the Yarn sense (i.e. a program that is going to contact Yarn by itself to request containers):


val yarn_distributed_shell : ?host:Ketrew_host.t ->
?daemonize_using:[ `Nohup_setsid | `Python_daemon ] ->
?daemon_start_timeout:float ->
?hadoop_bin:string ->
?distributed_shell_shell_jar:string ->
container_memory:[ `GB of int | `MB of int | `Raw of string ] ->
timeout:[ `Raw of string | `Seconds of int ] ->
application_name:string ->
Ketrew_program.t -> [> `Long_running of string * string ]
Create a build process that will use Hadoop's `DistributedShell` class to request a container to run the given arbitrary program.



Utilities


val to_display_string : ?ansi_colors:bool -> ?indentation:int -> user_target -> string
Build a display-friendly string summarizing the workflow.