sig
module Client :
sig
module Error :
sig
type t =
[ `Http of
[ `Call of [ `GET | `POST ] * Uri.t
| `Target_query of
Ketrew_pure.Internal_pervasives.Unique_id.t * string
| `Targets ] *
[ `Exn of exn
| `Json_parsing of string * [ `Exn of exn ]
| `Unexpected_message of
Ketrew_pure.Protocol.Down_message.t
| `Wrong_json of Yojson.Safe.json
| `Wrong_response of Cohttp.Response.t * string ]
| `Server_error_response of
[ `Call of [ `GET | `POST ] * Uri.t ] * string ]
val log :
Ketrew.Client.Error.t -> Ketrew_pure.Internal_pervasives.Log.t
end
type t
val as_client :
configuration:Configuration.t ->
f:(client:Ketrew.Client.t ->
(unit,
[> `Database of Trakeva.Error.t
| `Database_unavailable of bytes
| `Dyn_plugin of
[> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of bytes
| `Missing_data of bytes
| `Target of [> `Deserilization of bytes ]
| `Wrong_configuration of
[> `Found of bytes ] * [> `Exn of exn ] ]
as 'a)
Unix_io.Deferred_result.t) ->
(unit, 'a) Unix_io.Deferred_result.t
val configuration : Ketrew.Client.t -> Configuration.t
val get_local_engine : Ketrew.Client.t -> Engine.t option
val all_targets :
Ketrew.Client.t ->
(Ketrew_pure.Target.t list,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `IO of
[> `Read_file_exn of string * exn
| `Write_file_exn of string * exn ]
| `Missing_data of Ketrew_pure.Target.id
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val get_list_of_target_ids :
Ketrew.Client.t ->
query:Ketrew_pure.Protocol.Up_message.target_query ->
(Ketrew_pure.Target.id list,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val get_target :
Ketrew.Client.t ->
id:Ketrew_pure.Target.id ->
(Ketrew_pure.Target.t,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val get_targets :
Ketrew.Client.t ->
id_list:Ketrew_pure.Target.id list ->
(Ketrew_pure.Target.t list,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val call_query :
Ketrew.Client.t ->
target:Ketrew_pure.Target.t ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
val kill :
Ketrew.Client.t ->
Ketrew_pure.Target.id list ->
(unit,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val restart :
Ketrew.Client.t ->
Ketrew_pure.Target.id list ->
(unit,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val submit :
?override_configuration:Configuration.t ->
?add_tags:string list -> EDSL.user_target -> unit
end
module Command_line :
sig
val run_main :
?argv:string array ->
?override_configuration:Configuration.t ->
?additional_commands:((unit, string) Unix_io.Deferred_result.t
Cmdliner.Term.t * Cmdliner.Term.info)
list ->
unit -> [ `Never_returns ]
end
module Configuration :
sig
type t
type plugin = [ `Compiled of string | `OCamlfind of string ]
type explorer_defaults
val default_explorer_defaults : Ketrew.Configuration.explorer_defaults
val explorer :
?request_targets_ids:[ `All | `Younger_than of [ `Days of float ] ] ->
?targets_per_page:int ->
?targets_to_prefetch:int ->
unit -> Ketrew.Configuration.explorer_defaults
type ui
val ui :
?with_color:bool ->
?explorer:Ketrew.Configuration.explorer_defaults ->
?with_cbreak:bool -> unit -> Ketrew.Configuration.ui
type engine
val engine :
?database_parameters:string ->
?turn_unix_ssh_failure_into_target_failure:bool ->
?host_timeout_upper_bound:float ->
?maximum_successive_attempts:int ->
unit -> Ketrew.Configuration.engine
type authorized_tokens
val authorized_token :
name:string -> string -> Ketrew.Configuration.authorized_tokens
val authorized_tokens_path :
string -> Ketrew.Configuration.authorized_tokens
type server
val server :
?ui:Ketrew.Configuration.ui ->
?engine:Ketrew.Configuration.engine ->
?authorized_tokens:Ketrew.Configuration.authorized_tokens list ->
?return_error_messages:bool ->
?command_pipe:string ->
?daemon:bool ->
?log_path:string ->
?max_blocking_time:float ->
?block_step_time:float ->
?read_only_mode:bool ->
[ `Tcp of int | `Tls of string * string * int ] ->
[> `Server of Ketrew.Configuration.server ]
type standalone
val standalone :
?ui:Ketrew.Configuration.ui ->
?engine:Ketrew.Configuration.engine ->
unit -> [> `Standalone of Ketrew.Configuration.standalone ]
type client
val client :
?ui:Ketrew.Configuration.ui ->
token:string -> string -> [> `Client of Ketrew.Configuration.client ]
type mode =
[ `Client of Ketrew.Configuration.client
| `Server of Ketrew.Configuration.server
| `Standalone of Ketrew.Configuration.standalone ]
val create :
?debug_level:int ->
?plugins:Ketrew.Configuration.plugin list ->
Ketrew.Configuration.mode -> Ketrew.Configuration.t
type profile
val profile :
string -> Ketrew.Configuration.t -> Ketrew.Configuration.profile
val output : Ketrew.Configuration.profile list -> unit
val to_json : Ketrew.Configuration.profile list -> string
val default_configuration_directory_path : string
val database_parameters : Ketrew.Configuration.engine -> string
val is_unix_ssh_failure_fatal : Ketrew.Configuration.engine -> bool
val maximum_successive_attempts : Ketrew.Configuration.engine -> int
val plugins :
Ketrew.Configuration.t -> Ketrew.Configuration.plugin list
val mode : Ketrew.Configuration.t -> Ketrew.Configuration.mode
val standalone_engine :
Ketrew.Configuration.standalone -> Ketrew.Configuration.engine
val server_engine :
Ketrew.Configuration.server -> Ketrew.Configuration.engine
val server_configuration :
Ketrew.Configuration.t -> Ketrew.Configuration.server option
val authorized_tokens :
Ketrew.Configuration.server ->
[ `Inline of string * string | `Path of string ] list
val listen_to :
Ketrew.Configuration.server ->
[ `Tcp of int | `Tls of string * string * int ]
val return_error_messages : Ketrew.Configuration.server -> bool
val command_pipe : Ketrew.Configuration.server -> string option
val daemon : Ketrew.Configuration.server -> bool
val log_path : Ketrew.Configuration.server -> string option
val log :
Ketrew.Configuration.t -> Ketrew_pure.Internal_pervasives.Log.t
val connection : Ketrew.Configuration.client -> string
val token : Ketrew.Configuration.client -> string
val standalone_of_server :
Ketrew.Configuration.server -> Ketrew.Configuration.standalone
val with_color : Ketrew.Configuration.t -> bool
val request_targets_ids :
Ketrew.Configuration.t ->
[ `All | `Younger_than of [ `Days of float ] ]
val targets_per_page : Ketrew.Configuration.t -> int
val targets_to_prefetch : Ketrew.Configuration.t -> int
val max_blocking_time : Ketrew.Configuration.server -> float
val block_step_time : Ketrew.Configuration.server -> float
val read_only_mode : Ketrew.Configuration.server -> bool
val use_cbreak : unit -> bool
val load_exn :
?and_apply:bool ->
?profile:string ->
[ `From_path of string
| `Guess
| `In_directory of string
| `Override of Ketrew.Configuration.t ] -> Ketrew.Configuration.t
end
module Daemonize :
sig
type run_parameters
val run_parameters_to_yojson :
Ketrew.Daemonize.run_parameters -> Yojson.Safe.json
val run_parameters_of_yojson :
Yojson.Safe.json ->
[ `Error of string | `Ok of Ketrew.Daemonize.run_parameters ]
val name : string
val serialize : run_parameters -> string
val deserialize_exn : string -> run_parameters
val start :
run_parameters ->
(run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
val update :
run_parameters ->
([ `Failed of run_parameters * string
| `Still_running of run_parameters
| `Succeeded of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val kill :
run_parameters ->
([ `Killed of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val log :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val query :
run_parameters ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
val create :
?starting_timeout:float ->
?call_script:(string -> string list) ->
?using:[ `Nohup_setsid | `Python_daemon ] ->
?host:Ketrew_pure.Host.t ->
?no_log_is_ok:bool ->
Ketrew_pure.Program.t -> [> `Long_running of string * string ]
val markup :
Ketrew.Daemonize.run_parameters ->
Ketrew_pure.Internal_pervasives.Display_markup.t
end
module Document :
sig
val build_process :
?with_details:bool ->
[< `Long_running of string * string | `No_operation ] -> SmartPrint.t
val target_for_menu : Ketrew_pure.Target.t -> Internal_pervasives.Log.t
val metadata :
full:bool -> [ `String of string ] -> Internal_pervasives.Log.t
val target :
?build_process_details:bool ->
?condition_details:bool ->
?metadata_details:bool ->
Ketrew_pure.Target.t -> Internal_pervasives.Log.t
end
module EDSL :
sig
module Host :
sig
type t = Ketrew_pure.Host.t
val parse : string -> Ketrew.EDSL.Host.t
val tmp_on_localhost : Ketrew.EDSL.Host.t
val ssh :
?add_ssh_options:string list ->
?playground:string ->
?port:int ->
?user:string -> ?name:string -> string -> Ketrew.EDSL.Host.t
val cmdliner_term :
?doc:string ->
[ `Flag of string list | `Required of int ] ->
Ketrew.EDSL.Host.t Cmdliner.Term.t
end
module Program :
sig
type t = Ketrew_pure.Program.t
val sh : string -> Ketrew.EDSL.Program.t
val shf :
('a, unit, string, Ketrew.EDSL.Program.t) Pervasives.format4 ->
'a
val exec : string list -> Ketrew.EDSL.Program.t
val ( && ) :
Ketrew.EDSL.Program.t ->
Ketrew.EDSL.Program.t -> Ketrew.EDSL.Program.t
val chain : Ketrew.EDSL.Program.t list -> Ketrew.EDSL.Program.t
end
module Condition :
sig
type t = Ketrew_pure.Target.Condition.t
val ( && ) :
Ketrew.EDSL.Condition.t ->
Ketrew.EDSL.Condition.t -> Ketrew.EDSL.Condition.t
val chain_and :
Ketrew.EDSL.Condition.t list -> Ketrew.EDSL.Condition.t
val never : Ketrew.EDSL.Condition.t
val program :
?returns:int ->
?host:Ketrew.EDSL.Host.t ->
Ketrew.EDSL.Program.t -> Ketrew.EDSL.Condition.t
end
class type user_artifact =
object
method exists : Ketrew_pure.Target.Condition.t
method is_bigger_than : int -> Ketrew_pure.Target.Condition.t
method path : string
end
val file :
?host:Ketrew.EDSL.Host.t -> string -> Ketrew.EDSL.user_artifact
val unit : Ketrew.EDSL.user_artifact
class type user_target =
object
method activate : unit
method add_tags : string list -> unit
method depends_on : Ketrew.EDSL.user_target list
method id : Ketrew_pure.Internal_pervasives.Unique_id.t
method is_active : bool
method metadata : [ `String of string ] option
method name : string
method on_failure_activate : Ketrew.EDSL.user_target list
method on_success_activate : Ketrew.EDSL.user_target list
method product : Ketrew.EDSL.user_artifact
method render : Ketrew_pure.Target.t
end
val target :
?active:bool ->
?depends_on:Ketrew.EDSL.user_target list ->
?make:Ketrew_pure.Target.Build_process.t ->
?done_when:Ketrew_pure.Target.Condition.t ->
?metadata:[ `String of string ] ->
?product:Ketrew.EDSL.user_artifact ->
?equivalence:Ketrew_pure.Target.Equivalence.t ->
?on_failure_activate:Ketrew.EDSL.user_target list ->
?on_success_activate:Ketrew.EDSL.user_target list ->
?tags:string list -> string -> Ketrew.EDSL.user_target
val file_target :
?depends_on:Ketrew.EDSL.user_target list ->
?make:Ketrew_pure.Target.Build_process.t ->
?metadata:[ `String of string ] ->
?name:string ->
?host:Ketrew.EDSL.Host.t ->
?equivalence:Ketrew_pure.Target.Equivalence.t ->
?on_failure_activate:Ketrew.EDSL.user_target list ->
?on_success_activate:Ketrew.EDSL.user_target list ->
?tags:string list -> string -> Ketrew.EDSL.user_target
val daemonize :
?starting_timeout:float ->
?call_script:(string -> string list) ->
?using:[ `Nohup_setsid | `Python_daemon ] ->
?host:Ketrew.EDSL.Host.t ->
?no_log_is_ok:bool ->
Ketrew.EDSL.Program.t -> Ketrew_pure.Target.Build_process.t
val lsf :
?host:Ketrew.EDSL.Host.t ->
?queue:string ->
?name:string ->
?wall_limit:string ->
?processors:[ `Min of int | `Min_max of int * int ] ->
?project:string ->
Ketrew.EDSL.Program.t -> Ketrew_pure.Target.Build_process.t
val pbs :
?host:Ketrew.EDSL.Host.t ->
?queue:string ->
?name:string ->
?wall_limit:[ `Hours of float ] ->
?processors:int ->
?email_user:[ `Always of string | `Never ] ->
?shell:string ->
Ketrew.EDSL.Program.t -> [> `Long_running of string * string ]
val yarn_application :
?host:Ketrew.EDSL.Host.t ->
?daemonize_using:[ `Nohup_setsid | `Python_daemon ] ->
?daemon_start_timeout:float ->
Ketrew.EDSL.Program.t -> [> `Long_running of string * string ]
val yarn_distributed_shell :
?host:Ketrew.EDSL.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.EDSL.Program.t -> [> `Long_running of string * string ]
val to_display_string :
?ansi_colors:bool ->
?indentation:int -> Ketrew.EDSL.user_target -> string
end
module Engine :
sig
type t
val with_engine :
configuration:Ketrew.Configuration.engine ->
(engine:Ketrew.Engine.t ->
(unit,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Dyn_plugin of
[> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of string
| `Missing_data of bytes
| `Target of [> `Deserilization of bytes ] ]
as 'merge_error)
Unix_io.Deferred_result.t) ->
(unit, 'merge_error) Unix_io.Deferred_result.t
val load :
configuration:Ketrew.Configuration.engine ->
(Ketrew.Engine.t,
[> `Database of Trakeva.Error.t
| `Dyn_plugin of
[> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of string
| `Missing_data of bytes
| `Target of [> `Deserilization of bytes ] ])
Unix_io.Deferred_result.t
val unload :
Ketrew.Engine.t ->
(unit,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id ])
Unix_io.Deferred_result.t
val configuration : Ketrew.Engine.t -> Ketrew.Configuration.engine
val add_targets :
Ketrew.Engine.t ->
Ketrew_pure.Target.t list ->
(unit,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val get_target :
Ketrew.Engine.t ->
Ketrew_pure.Internal_pervasives.Unique_id.t ->
(Ketrew_pure.Target.t,
[> `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val all_targets :
Ketrew.Engine.t ->
(Ketrew_pure.Target.t list,
[> `Database of Trakeva.Error.t
| `IO of
[> `Read_file_exn of string * exn
| `Write_file_exn of string * exn ]
| `Missing_data of Ketrew_pure.Target.id
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val get_list_of_target_ids :
Ketrew.Engine.t ->
Ketrew_pure.Protocol.Up_message.target_query ->
(Ketrew_pure.Target.id list,
[> `Database of Trakeva.Error.t
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
module Run_automaton :
sig
val step :
Ketrew.Engine.t ->
(bool,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val fix_point :
Ketrew.Engine.t ->
([ `Steps of int ],
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
end
val get_status :
Ketrew.Engine.t ->
Ketrew_pure.Target.id ->
(Ketrew_pure.Target.State.t,
[> `Database of Trakeva.Error.t
| `IO of
[> `Read_file_exn of string * exn
| `Write_file_exn of string * exn ]
| `Missing_data of string
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val kill :
Ketrew.Engine.t ->
id:string ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
val restart_target :
Ketrew.Engine.t ->
Ketrew_pure.Target.id ->
(Ketrew_pure.Target.id,
[> `Database of Trakeva.Error.t
| `Database_unavailable of Ketrew_pure.Target.id
| `Missing_data of Ketrew_pure.Target.id
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
end
module Eval_condition :
sig
val bool :
Ketrew_pure.Target.Condition.t ->
(bool,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Host_io.Error.execution
| `Volume of [> `No_size of Ketrew_pure.Internal_pervasives.Log.t ] ])
Unix_io.Deferred_result.t
end
module Explorer :
sig
type t
val create : client:Ketrew.Client.t -> unit -> Ketrew.Explorer.t
val explore :
Ketrew.Explorer.t ->
(unit,
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Database_unavailable of string
| `Failure of string
| `IO of
[> `Read_file_exn of string * exn
| `Write_file_exn of string * exn ]
| `Missing_data of string
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
end
module Host_io :
sig
module Ssh :
sig
val scp_push :
Ketrew_pure.Host.Ssh.t ->
src:string list -> dest:string -> string list
val scp_pull :
Ketrew_pure.Host.Ssh.t ->
src:string list -> dest:string -> string list
end
module Error :
sig
type 'a execution = 'a
constraint 'a =
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
type 'a non_zero_execution = 'a
constraint 'a =
([> `Execution of
< host : string; message : string;
stderr : string option; stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
as 'b)
Ketrew.Host_io.Error.execution
type classified = [ `Fatal of string | `Recoverable of string ]
val classify :
[ `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [ `Sleep of float ] * [ `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ] -> [ `Execution | `Ssh | `Unix ]
val log :
[< `Execution of
< host : string; message : string; stderr : string option;
stdout : string option; .. >
| `Non_zero of string * int
| `Ssh_failure of
[< `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [< `Sleep of float ] * [< `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ] ->
Ketrew_pure.Internal_pervasives.Log.t
end
type t = Ketrew_pure.Host.t
val default_timeout_upper_bound : float Pervasives.ref
type timeout =
[ `At_most_seconds of float
| `Host_default
| `None
| `Seconds of float ]
val execute :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
string list ->
(< exited : int; stderr : string; stdout : string >,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
type shell = string -> string list
val shell_sh : sh:string -> Ketrew.Host_io.shell
val get_shell_command_output :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
string ->
(string * string,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val get_shell_command_return_value :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
string ->
(int,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
val run_shell_command :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
string ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val do_files_exist :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
Ketrew_pure.Path.t list ->
(bool,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution ])
Unix_io.Deferred_result.t
val get_fresh_playground :
Ketrew.Host_io.t -> Ketrew_pure.Path.t option
val ensure_directory :
?timeout:Ketrew.Host_io.timeout ->
?with_shell:Ketrew.Host_io.shell ->
Ketrew.Host_io.t ->
path:Ketrew_pure.Path.t ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
Ketrew.Host_io.Error.non_zero_execution ])
Unix_io.Deferred_result.t
val put_file :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
path:Ketrew_pure.Path.t ->
content:string ->
(unit,
[> `Host of
[> `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Ssh_failure of
[> `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] *
string
| `System of [> `Sleep of float ] * [> `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
Ketrew.Host_io.Error.execution
| `IO of [> `Write_file_exn of Unix_io.IO.path * exn ] ])
Unix_io.Deferred_result.t
val get_file :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
path:Ketrew_pure.Path.t ->
(string,
[> `Cannot_read_file of string * string
| `Timeout of Ketrew_pure.Internal_pervasives.Time.t ])
Unix_io.Deferred_result.t
val grab_file_or_log :
?timeout:Ketrew.Host_io.timeout ->
Ketrew.Host_io.t ->
Ketrew_pure.Path.t ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
end
module Interaction :
sig
val init : unit -> unit
val toggle_verbose : unit -> unit
type +'a menu_item
val menu_item :
?char:char ->
?log:SmartPrint.t -> 'a -> 'a Ketrew.Interaction.menu_item
val menu :
?max_per_page:int ->
?always_there:'a Ketrew.Interaction.menu_item list ->
sentence:SmartPrint.t ->
'a Ketrew.Interaction.menu_item list ->
('a, [> `Failure of string ]) Unix_io.t
val open_in_dollar_editor :
string -> (unit, 'a) Unix_io.Deferred_result.t
val view_in_dollar_editor :
?extension:string ->
string ->
(unit, [> `IO of [> `Write_file_exn of string * exn ] ])
Unix_io.Deferred_result.t
val ask_for_edition :
?extension:string ->
string ->
(string,
[> `IO of
[> `Read_file_exn of Unix_io.IO.path * exn
| `Write_file_exn of Unix_io.IO.path * exn ] ])
Unix_io.Deferred_result.t
val get_key : unit -> (char, [> `Failure of string ]) Unix_io.t
val build_sublist_of_targets :
client:Ketrew.Client.t ->
list_name:string ->
all_log:SmartPrint.t ->
go_verb:SmartPrint.t ->
filter:(Ketrew_pure.Target.t -> bool) ->
([> `Cancel | `Go of string list ],
[> `Client of Ketrew.Client.Error.t
| `Database of Trakeva.Error.t
| `Failure of string
| `IO of
[> `Read_file_exn of string * exn
| `Write_file_exn of string * exn ]
| `Missing_data of string
| `System of [> `File_info of string ] * [> `Exn of exn ]
| `Target of [> `Deserilization of string ] ])
Unix_io.t
val make_target_menu :
targets:Ketrew_pure.Target.t list ->
?filter_target:(Ketrew_pure.Target.t -> bool) ->
unit -> [> `Go of string ] Ketrew.Interaction.menu_item list
val run_with_quit_key :
< start : (unit, [> `Failure of string ] as 'start_error)
Unix_io.Deferred_result.t;
stop : unit > ->
(unit, 'start_error) Unix_io.Deferred_result.t
end
module Long_running_utilities :
sig
val fail_fatal :
string -> ('b, [> `Fatal of string ]) Unix_io.Deferred_result.t
val out_file_path : playground:Ketrew_pure.Path.t -> Ketrew_pure.Path.t
val err_file_path : playground:Ketrew_pure.Path.t -> Ketrew_pure.Path.t
val script_path : playground:Ketrew_pure.Path.t -> Ketrew_pure.Path.t
val classify_and_transform_errors :
('a,
[< `Fatal of string
| `Host of
[ `Execution of
< host : string; message : string; stderr : string option;
stdout : string option >
| `Non_zero of string * int
| `Ssh_failure of
[ `Wrong_log of string
| `Wrong_status of Unix_process.Exit_code.t ] * string
| `System of [ `Sleep of float ] * [ `Exn of exn ]
| `Timeout of float
| `Unix_exec of string ]
| `IO of
[< `Exn of exn
| `File_exists of string
| `Read_file_exn of string * exn
| `Write_file_exn of string * exn
| `Wrong_path of string ]
| `System of
[< `Copy of string
| `File_info of string
| `File_tree of string
| `List_directory of string
| `Make_directory of string
| `Make_symlink of string * string
| `Move of string
| `Remove of string ] *
[< `Already_exists
| `Exn of exn
| `File_exists of string
| `File_not_found of string
| `IO of
[< `Exn of exn
| `File_exists of string
| `Read_file_exn of string * exn
| `Write_file_exn of string * exn
| `Wrong_path of string ]
| `Not_a_directory of string
| `Wrong_access_rights of int
| `Wrong_file_kind of string * Unix_io.System.file_info
| `Wrong_path of string ]
| `Timeout of 'b ])
Ketrew_pure.Internal_pervasives.Result.t ->
('a, [ `Fatal of string | `Recoverable of string ])
Unix_io.Deferred_result.t
val fresh_playground_or_fail :
Ketrew_pure.Host.t ->
(Ketrew_pure.Path.t, [> `Fatal of string ]) Unix_io.Deferred_result.t
val get_log_of_monitored_script :
host:Ketrew_pure.Host.t ->
script:Ketrew_pure.Monitored_script.t ->
([ `After of string * string * string
| `Before of string * string * string
| `Error of string list
| `Failure of string * string * string
| `Start of string
| `Success of string ] list option,
[> `Timeout of Ketrew_pure.Internal_pervasives.Time.t ])
Unix_io.Deferred_result.t
val get_pid_of_monitored_script :
host:Ketrew_pure.Host.t ->
script:Ketrew_pure.Monitored_script.t ->
(int option, [> `Timeout of Ketrew_pure.Internal_pervasives.Time.t ])
Unix_io.Deferred_result.t
val shell_command_output_or_log :
host:Ketrew_pure.Host.t ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
end
module Lsf :
sig
type run_parameters
val name : string
val serialize : run_parameters -> string
val deserialize_exn : string -> run_parameters
val start :
run_parameters ->
(run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
val update :
run_parameters ->
([ `Failed of run_parameters * string
| `Still_running of run_parameters
| `Succeeded of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val kill :
run_parameters ->
([ `Killed of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val log :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val query :
run_parameters ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
val create :
?host:Ketrew_pure.Host.t ->
?queue:string ->
?name:string ->
?wall_limit:string ->
?processors:[ `Min of int | `Min_max of int * int ] ->
?project:string ->
Ketrew_pure.Program.t -> [> `Long_running of string * string ]
end
module Pbs :
sig
type run_parameters
val name : string
val serialize : run_parameters -> string
val deserialize_exn : string -> run_parameters
val start :
run_parameters ->
(run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
val update :
run_parameters ->
([ `Failed of run_parameters * string
| `Still_running of run_parameters
| `Succeeded of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val kill :
run_parameters ->
([ `Killed of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val log :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val query :
run_parameters ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
val create :
?host:Ketrew_pure.Host.t ->
?queue:string ->
?name:string ->
?wall_limit:[ `Hours of float ] ->
?processors:int ->
?email_user:[ `Always of string | `Never ] ->
?shell:string ->
Ketrew_pure.Program.t -> [> `Long_running of string * string ]
end
module Persistent_data :
sig
type t
val create :
database_parameters:string ->
(Ketrew.Persistent_data.t,
[> `Database of
[> `Get of Trakeva.Key_in_collection.t
| `Get_all of string
| `Load of string ] *
string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val unload :
Ketrew.Persistent_data.t ->
(unit, [> `Database of [> `Close ] * string ])
Unix_io.Deferred_result.t
val get_target :
Ketrew.Persistent_data.t ->
Ketrew_pure.Target.id ->
(Ketrew_pure.Target.t,
[> `Database of
[> `Get of Trakeva.Key_in_collection.t | `Load of string ] *
string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val all_targets :
Ketrew.Persistent_data.t ->
(Ketrew_pure.Target.t list,
[> `Database of
[> `Get of Trakeva.Key_in_collection.t
| `Get_all of string
| `Load of string ] *
string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val activate_target :
Ketrew.Persistent_data.t ->
target:Ketrew_pure.Target.t ->
reason:[ `Dependency of Ketrew_pure.Target.id | `User ] ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
val fold_active_targets :
Ketrew.Persistent_data.t ->
init:'a ->
f:('a ->
target:Ketrew_pure.Target.t ->
('a,
[> `Database of
[> `Get of Trakeva.Key_in_collection.t
| `Iter of string
| `Load of string ] *
string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ]
as 'combined_errors)
Unix_io.Deferred_result.t) ->
('a, 'combined_errors) Unix_io.Deferred_result.t
val move_target_to_finished_collection :
Ketrew.Persistent_data.t ->
target:Ketrew_pure.Target.t ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
val update_target :
Ketrew.Persistent_data.t ->
Ketrew_pure.Target.t ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
module Killing_targets :
sig
val proceed_to_mass_killing :
Ketrew.Persistent_data.t ->
(bool,
[> `Database of
[> `Act of Trakeva.Action.t
| `Get of Trakeva.Key_in_collection.t
| `Get_all of string
| `Load of string ] *
string
| `Database_unavailable of string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
val add_target_ids_to_kill_list :
Ketrew.Persistent_data.t ->
string list ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
end
module Adding_targets :
sig
val register_targets_to_add :
Ketrew.Persistent_data.t ->
Ketrew_pure.Target.t list ->
(unit,
[> `Database of
[> `Act of Trakeva.Action.t | `Load of string ] * string
| `Database_unavailable of string ])
Unix_io.Deferred_result.t
val check_and_really_add_targets :
Ketrew.Persistent_data.t ->
(bool,
[> `Database of
[> `Act of Trakeva.Action.t
| `Get of Trakeva.Key_in_collection.t
| `Get_all of string
| `Load of string ] *
string
| `Database_unavailable of string
| `Missing_data of string
| `Target of [> `Deserilization of string ] ])
Unix_io.Deferred_result.t
end
end
module Plugin :
sig
val default_plugins :
(string * (module Long_running.LONG_RUNNING)) list
val register_long_running_plugin :
name:string -> (module Long_running.LONG_RUNNING) -> unit
val long_running_log :
string ->
string -> (string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
Ketrew_pure.Target.t ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val call_query :
target:Ketrew_pure.Target.t ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
val find_plugin : string -> (module Long_running.LONG_RUNNING) option
val load_plugins :
[ `Compiled of string | `OCamlfind of string ] list ->
(unit,
[> `Dyn_plugin of
[> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of string ])
Unix_io.Deferred_result.t
val load_plugins_no_lwt_exn :
[ `Compiled of string | `OCamlfind of string ] list -> unit
end
module Server :
sig
val start :
configuration:Ketrew.Configuration.server ->
(unit,
[> `Database of Trakeva.Error.t
| `Dyn_plugin of
[> `Dynlink_error of Dynlink.error | `Findlib of exn ]
| `Failure of bytes
| `IO of [> `Read_file_exn of bytes * exn ]
| `Missing_data of bytes
| `Server_status_error of bytes
| `Start_server_error of bytes
| `System of
[> `File_info of bytes
| `List_directory of bytes
| `Remove of bytes ] *
[> `Exn of exn ]
| `Target of [> `Deserilization of bytes ] ])
Unix_io.Deferred_result.t
val status :
configuration:Ketrew.Configuration.server ->
([ `Not_responding of string
| `Running
| `Wrong_response of Cohttp.Response.t ],
[> `Failure of string | `Server_status_error of string ])
Unix_io.Deferred_result.t
val stop :
configuration:Ketrew.Configuration.server ->
([ `Done | `Timeout ],
[> `IO of
[> `Exn of exn | `File_exists of string | `Wrong_path of string ]
| `Stop_server_error of string
| `System of [> `File_info of string ] * [> `Exn of exn ] ])
Unix_io.Deferred_result.t
end
module Unix_process :
sig
module Exit_code :
sig
type t = [ `Exited of int | `Signaled of int | `Stopped of int ]
val to_string : Ketrew.Unix_process.Exit_code.t -> string
val to_log :
Ketrew.Unix_process.Exit_code.t ->
Ketrew_pure.Internal_pervasives.Log.t
end
val exec :
?bin:string ->
string list ->
(string * string * Ketrew.Unix_process.Exit_code.t,
[> `Process of [> `Exec of string * string list ] * [> `Exn of exn ] ])
Unix_io.Deferred_result.t
val succeed :
?bin:string ->
string list ->
(string * string,
[> `Process of
[> `Exec of string * string list ] *
[> `Exn of exn | `Non_zero of string ] ])
Unix_io.Deferred_result.t
val error_to_string :
[< `Process of
[< `Exec of string * string list ] *
[< `Exn of exn | `Non_zero of string ] ] ->
string
end
module Yarn :
sig
type run_parameters
val name : string
val serialize : run_parameters -> string
val deserialize_exn : string -> run_parameters
val start :
run_parameters ->
(run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
val update :
run_parameters ->
([ `Failed of run_parameters * string
| `Still_running of run_parameters
| `Succeeded of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val kill :
run_parameters ->
([ `Killed of run_parameters ], Host_io.Error.classified)
Unix_io.Deferred_result.t
val log :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val query :
run_parameters ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
type distributed_shell_parameters
val distributed_shell_program :
?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_pure.Program.t ->
[> `Distributed_shell of
Ketrew.Yarn.distributed_shell_parameters * Ketrew_pure.Program.t ]
val create :
?host:Ketrew_pure.Host.t ->
?daemonize_using:[ `Nohup_setsid | `Python_daemon ] ->
?daemon_start_timeout:float ->
[ `Distributed_shell of
Ketrew.Yarn.distributed_shell_parameters * Ketrew_pure.Program.t
| `Yarn_application of Ketrew_pure.Program.t ] ->
[> `Long_running of string * string ]
end
module Long_running :
sig
module type LONG_RUNNING =
sig
type run_parameters
val name : string
val serialize :
Ketrew.Long_running.LONG_RUNNING.run_parameters -> string
val deserialize_exn :
string -> Ketrew.Long_running.LONG_RUNNING.run_parameters
val start :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
(Ketrew.Long_running.LONG_RUNNING.run_parameters,
Ketrew.Host_io.Error.classified)
Unix_io.Deferred_result.t
val update :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
([ `Failed of
Ketrew.Long_running.LONG_RUNNING.run_parameters * string
| `Still_running of
Ketrew.Long_running.LONG_RUNNING.run_parameters
| `Succeeded of Ketrew.Long_running.LONG_RUNNING.run_parameters ],
Ketrew.Host_io.Error.classified)
Unix_io.Deferred_result.t
val kill :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
([ `Killed of Ketrew.Long_running.LONG_RUNNING.run_parameters ],
Ketrew.Host_io.Error.classified)
Unix_io.Deferred_result.t
val log :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val additional_queries :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
(string * Ketrew_pure.Internal_pervasives.Log.t) list
val query :
Ketrew.Long_running.LONG_RUNNING.run_parameters ->
string ->
(string, Ketrew_pure.Internal_pervasives.Log.t)
Unix_io.Deferred_result.t
end
end
end