sig
module Command :
sig
type t = { host : Ketrew_host.t; action : Ketrew_program.t; }
val shell : ?host:Ketrew_host.t -> string -> Ketrew_target.Command.t
val program :
?host:Ketrew_host.t -> Ketrew_program.t -> Ketrew_target.Command.t
val get_host : Ketrew_target.Command.t -> Ketrew_host.t
val log : Ketrew_target.Command.t -> Ketrew_pervasives.Log.t
val to_string_hum : Ketrew_target.Command.t -> string
end
module Volume :
sig
type structure =
[ `Directory of string * Ketrew_target.Volume.structure list
| `File of string ]
type t = {
host : Ketrew_host.t;
root : Ketrew_path.t;
structure : Ketrew_target.Volume.structure;
}
val create :
host:Ketrew_host.t ->
root:Ketrew_path.t ->
Ketrew_target.Volume.structure -> Ketrew_target.Volume.t
val file : string -> Ketrew_target.Volume.structure
val dir :
string ->
Ketrew_target.Volume.structure list -> Ketrew_target.Volume.structure
val all_paths : Ketrew_target.Volume.t -> Ketrew_path.t list
val log_structure :
Ketrew_target.Volume.structure -> Ketrew_pervasives.Log.t
val log : Ketrew_target.Volume.t -> Ketrew_pervasives.Log.t
val to_string_hum : Ketrew_target.Volume.t -> string
end
module Build_process :
sig
type t = [ `Long_running of string * string | `No_operation ]
val nop : Ketrew_target.Build_process.t
end
type id = Ketrew_pervasives.Unique_id.t
module Condition :
sig
type t =
[ `And of Ketrew_target.Condition.t list
| `Command_returns of Ketrew_target.Command.t * int
| `Never
| `Satisfied
| `Volume_exists of Ketrew_target.Volume.t
| `Volume_size_bigger_than of Ketrew_target.Volume.t * int ]
val log : Ketrew_target.Condition.t -> Ketrew_pervasives.Log.t
val to_string_hum : Ketrew_target.Condition.t -> string
end
module Equivalence : sig type t = [ `None | `Same_active_condition ] end
module State :
sig
type t
val simplify :
Ketrew_target.State.t ->
[ `Activable | `Failed | `In_progress | `Successful ]
val name : Ketrew_target.State.t -> string
val summary :
Ketrew_target.State.t ->
[ `Time of Ketrew_pervasives.Time.t ] * [ `Log of string option ] *
[ `Info of string list ]
val log :
?depth:int -> Ketrew_target.State.t -> Ketrew_pervasives.Log.t
val passive_time : Ketrew_target.State.t -> Ketrew_pervasives.Time.t
val finished_time :
Ketrew_target.State.t -> Ketrew_pervasives.Time.t option
module Is :
sig
val building : Ketrew_target.State.t -> bool
val tried_to_start : Ketrew_target.State.t -> bool
val started_running : Ketrew_target.State.t -> bool
val starting : Ketrew_target.State.t -> bool
val still_building : Ketrew_target.State.t -> bool
val still_running : Ketrew_target.State.t -> bool
val ran_successfully : Ketrew_target.State.t -> bool
val successfully_did_nothing : Ketrew_target.State.t -> bool
val active : Ketrew_target.State.t -> bool
val verified_success : Ketrew_target.State.t -> bool
val already_done : Ketrew_target.State.t -> bool
val dependencies_failed : Ketrew_target.State.t -> bool
val failed_running : Ketrew_target.State.t -> bool
val failed_to_kill : Ketrew_target.State.t -> bool
val failed_to_start : Ketrew_target.State.t -> bool
val killing : Ketrew_target.State.t -> bool
val tried_to_kill : Ketrew_target.State.t -> bool
val did_not_ensure_condition : Ketrew_target.State.t -> bool
val killed : Ketrew_target.State.t -> bool
val finished : Ketrew_target.State.t -> bool
val passive : Ketrew_target.State.t -> bool
val killable : Ketrew_target.State.t -> bool
val finished_because_dependencies_died :
Ketrew_target.State.t -> bool
end
module Count :
sig
val consecutive_recent_attempts : Ketrew_target.State.t -> int
end
end
type t
val to_yojson : Ketrew_target.t -> Yojson.Safe.json
val of_yojson :
Yojson.Safe.json -> [ `Error of string | `Ok of Ketrew_target.t ]
val create :
?id:Ketrew_target.id ->
?name:string ->
?metadata:[ `String of string ] ->
?depends_on:Ketrew_target.id list ->
?on_failure_activate:Ketrew_target.id list ->
?on_success_activate:Ketrew_target.id list ->
?make:Ketrew_target.Build_process.t ->
?condition:Ketrew_target.Condition.t ->
?equivalence:Ketrew_target.Equivalence.t ->
?tags:string list -> unit -> Ketrew_target.t
val id : Ketrew_target.t -> Ketrew_pervasives.Unique_id.t
val name : Ketrew_target.t -> string
val depends_on : Ketrew_target.t -> Ketrew_target.id list
val on_success_activate : Ketrew_target.t -> Ketrew_target.id list
val on_failure_activate : Ketrew_target.t -> Ketrew_target.id list
val metadata : Ketrew_target.t -> [ `String of string ] option
val build_process : Ketrew_target.t -> Ketrew_target.Build_process.t
val condition : Ketrew_target.t -> Ketrew_target.Condition.t option
val equivalence : Ketrew_target.t -> Ketrew_target.Equivalence.t
val additional_log :
Ketrew_target.t -> (Ketrew_pervasives.Time.t * string) list
val tags : Ketrew_target.t -> string list
val state : Ketrew_target.t -> Ketrew_target.State.t
module Automaton :
sig
type failure_reason
type progress = [ `Changed_state | `No_change ]
type 'a transition_callback =
?log:string ->
'a -> Ketrew_target.t * Ketrew_target.Automaton.progress
type severity = [ `Fatal | `Try_again ]
type bookkeeping = { plugin_name : string; run_parameters : string; }
type long_running_failure =
Ketrew_target.Automaton.severity * string *
Ketrew_target.Automaton.bookkeeping
type long_running_action =
(Ketrew_target.Automaton.bookkeeping,
Ketrew_target.Automaton.long_running_failure)
Pvem.Result.t
type process_check =
[ `Still_running of Ketrew_target.Automaton.bookkeeping
| `Successful of Ketrew_target.Automaton.bookkeeping ]
type process_status_check =
(Ketrew_target.Automaton.process_check,
Ketrew_target.Automaton.long_running_failure)
Pvem.Result.t
type condition_evaluation =
(bool, Ketrew_target.Automaton.severity * string) Pvem.Result.t
type dependencies_status =
[ `All_succeeded
| `At_least_one_failed of Ketrew_target.id list
| `Still_processing ]
type transition =
[ `Activate of
Ketrew_target.id list *
unit Ketrew_target.Automaton.transition_callback
| `Check_and_activate_dependencies of
Ketrew_target.Automaton.dependencies_status
Ketrew_target.Automaton.transition_callback
| `Check_process of
Ketrew_target.Automaton.bookkeeping *
Ketrew_target.Automaton.process_status_check
Ketrew_target.Automaton.transition_callback
| `Do_nothing of unit Ketrew_target.Automaton.transition_callback
| `Eval_condition of
Ketrew_target.Condition.t *
Ketrew_target.Automaton.condition_evaluation
Ketrew_target.Automaton.transition_callback
| `Kill of
Ketrew_target.Automaton.bookkeeping *
Ketrew_target.Automaton.long_running_action
Ketrew_target.Automaton.transition_callback
| `Start_running of
Ketrew_target.Automaton.bookkeeping *
Ketrew_target.Automaton.long_running_action
Ketrew_target.Automaton.transition_callback ]
val transition : Ketrew_target.t -> Ketrew_target.Automaton.transition
end
val activate_exn :
?log:string ->
Ketrew_target.t ->
reason:[ `Dependency of Ketrew_target.id | `User ] -> Ketrew_target.t
val kill : ?log:string -> Ketrew_target.t -> Ketrew_target.t option
val reactivate :
?with_id:Ketrew_target.id ->
?with_name:string ->
?with_metadata:[ `String of string ] option ->
?log:string -> Ketrew_target.t -> Ketrew_target.t
val is_equivalent : Ketrew_target.t -> Ketrew_target.t -> bool
val log : Ketrew_target.t -> Ketrew_pervasives.Log.t
val latest_run_parameters : Ketrew_target.t -> string option
module Stored_target :
sig
type target = Ketrew_target.t
type t
val to_json : Ketrew_target.Stored_target.t -> Ketrew_pervasives.Json.t
val serialize : Ketrew_target.Stored_target.t -> string
val deserialize :
string ->
(Ketrew_target.Stored_target.t,
[> `Target of [> `Deserilization of string ] ])
Ketrew_pervasives.Result.t
val get_target :
Ketrew_target.Stored_target.t ->
[ `Pointer of Ketrew_target.id
| `Target of Ketrew_target.Stored_target.target ]
val of_target :
Ketrew_target.Stored_target.target -> Ketrew_target.Stored_target.t
val id : Ketrew_target.Stored_target.t -> Ketrew_target.id
val make_pointer :
from:Ketrew_target.Stored_target.target ->
pointing_to:Ketrew_target.Stored_target.target ->
Ketrew_target.Stored_target.t
end
end