sig
  module Authentication :
    sig
      type t
      val log :
        Ketrew.Authentication.t -> Ketrew_pure.Internal_pervasives.Log.t
      val load :
        [ `Inline of string * string
        | `Path of Ketrew_pure.Internal_pervasives.String.t ] list ->
        (Ketrew.Authentication.t,
         [> `IO of [> `Read_file_exn of Unix_io.IO.path * exn ] ])
        Unix_io.Deferred_result.t
      val reload :
        Ketrew.Authentication.t ->
        (Ketrew.Authentication.t,
         [> `IO of [> `Read_file_exn of Unix_io.IO.path * exn ] ])
        Unix_io.Deferred_result.t
      type capabilities =
          [ `Browse_gui
          | `Kill_targets
          | `Play_with_process_holder
          | `Query_targets
          | `Restart_targets
          | `See_server_status
          | `See_targets
          | `Submit_targets ]
      val can :
        Ketrew.Authentication.t ->
        read_only_mode:bool ->
        ?token:string -> Ketrew.Authentication.capabilities -> bool
    end
  module Client :
    sig
      module Error :
        sig
          type t =
              [ `Http of
                  [ `Call of
                      [ `GET | `POST ] *
                      Ketrew_pure.Internal_pervasives.Uri.t
                  | `Process_holder
                  | `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 ] *
                      Ketrew_pure.Internal_pervasives.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 ->
           ('result,
            [> `Database of Trakeva.Error.t
             | `Database_unavailable of string
             | `Dyn_plugin of
                 [> `Dynlink_error of Dynlink.error | `Findlib of exn ]
             | `Failure of string
             | `Fetching_node of Persistent_data.Error.fetching_node
             | `Target of [> `Deserilization of string ]
             | `Wrong_configuration of
                 [> `Found of string ] * [> `Exn of exn ] ]
            as 'a)
           Unix_io.Deferred_result.t) ->
        ('result, '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_visible_targets :
        Ketrew.Client.t ->
        (Ketrew_pure.Target.t list,
         [> `Client of Ketrew.Client.Error.t
          | `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `IO of
              [> `Read_file_exn of string * exn
               | `Write_file_exn of string * exn ]
          | `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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `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
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `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
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val add_targets :
        Ketrew.Client.t ->
        Ketrew_pure.Target.t list ->
        (unit,
         [> `Client of Ketrew.Client.Error.t
          | `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val call_process_holder :
        Ketrew.Client.t ->
        Ketrew_pure.Protocol.Process_sub_protocol.up ->
        (Ketrew_pure.Protocol.Process_sub_protocol.down,
         [> `Client of Ketrew.Client.Error.t | `Failure of string ])
        Unix_io.Deferred_result.t
      val submit_workflow :
        ?override_configuration:Configuration.t ->
        ?add_tags:string list ->
        < is_done : EDSL.Condition.t option; .. > EDSL.product
        EDSL.workflow_node -> unit
      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 ->
        ?concurrent_automaton_steps:int ->
        ?archival_age_threshold:[ `Days of float ] ->
        ?freeze_state_duration:float -> 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 ssh_connection
      val ssh_connection :
        uri:string -> string -> Ketrew.Configuration.ssh_connection
      val ssh_connection_name_uri :
        Ketrew.Configuration.ssh_connection -> string * string
      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 ->
        ?read_only_mode:bool ->
        ?ssh_connections:Ketrew.Configuration.ssh_connection list ->
        ?ssh_processes_ui: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 ->
        ?tmp_dir:string ->
        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 concurrent_automaton_steps : Ketrew.Configuration.engine -> int
      val host_timeout_upper_bound :
        Ketrew.Configuration.engine -> float option
      val archival_age_threshold :
        Ketrew.Configuration.engine -> [ `Days of float ]
      val freeze_state_duration : Ketrew.Configuration.engine -> float
      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 ssh_connections :
        Ketrew.Configuration.server ->
        Ketrew.Configuration.ssh_connection list
      val ssh_processes_ui : Ketrew.Configuration.server -> bool
      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 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 ->
        Ketrew.Daemonize.run_parameters Ppx_deriving_yojson_runtime.error_or
      val name : string
      val serialize : run_parameters -> string
      val deserialize_exn : string -> run_parameters
      val start :
        run_parameters ->
        host_io:Host_io.t ->
        (run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
      val update :
        run_parameters ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        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
      val get_playground :
        Ketrew.Daemonize.run_parameters -> Ketrew_pure.Path.t option
    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 program :
            ?returns:int ->
            ?host:Ketrew.EDSL.Host.t ->
            Ketrew.EDSL.Program.t -> Ketrew.EDSL.Condition.t
          module Volume :
            sig
              type t = Ketrew_pure.Target.Volume.t
              type structure = Ketrew_pure.Target.Volume.structure
              val create :
                host:Ketrew.EDSL.Host.t ->
                root:string ->
                Ketrew.EDSL.Condition.Volume.structure ->
                Ketrew.EDSL.Condition.Volume.t
              val file : string -> Ketrew.EDSL.Condition.Volume.structure
              val dir :
                string ->
                Ketrew.EDSL.Condition.Volume.structure list ->
                Ketrew.EDSL.Condition.Volume.structure
            end
          val volume_exists :
            Ketrew.EDSL.Condition.Volume.t -> Ketrew.EDSL.Condition.t
          val volume_size_greater_of_equal :
            Ketrew.EDSL.Condition.Volume.t -> int -> Ketrew.EDSL.Condition.t
        end
      module Build_process :
        sig type t = Ketrew_pure.Target.Build_process.t end
      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.EDSL.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 ->
        ?request_memory:[ `GB of int | `MB of int ] ->
        ?raw_options:string list ->
        Ketrew.EDSL.Program.t -> Ketrew.EDSL.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 -> Ketrew.EDSL.Build_process.t
      val yarn_application :
        ?host:Ketrew.EDSL.Host.t ->
        ?daemonize_using:[ `Nohup_setsid | `Python_daemon ] ->
        ?daemon_start_timeout:float ->
        Ketrew.EDSL.Program.t -> Ketrew.EDSL.Build_process.t
      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_vcores:int ->
        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 -> Ketrew.EDSL.Build_process.t
      module Internal_representation :
        sig
          type t =
              < activate : unit; add_recursive_tags : string list -> unit;
                add_tags : string list -> unit;
                depends_on : Ketrew.EDSL.Internal_representation.t list;
                get_recursive_tags : string list;
                id : Ketrew_pure.Internal_pervasives.Unique_id.t;
                name : string;
                on_failure_activate : Ketrew.EDSL.Internal_representation.t
                                      list;
                on_success_activate : Ketrew.EDSL.Internal_representation.t
                                      list;
                render : Ketrew_pure.Target.t >
        end
      type 'a product = 'a
        constraint 'a = < is_done : Ketrew.EDSL.Condition.t option; .. >
      type 'a workflow_node =
          < product : 'Ketrew.EDSL.product;
            render : Ketrew.EDSL.Internal_representation.t >
        constraint 'a = < is_done : Ketrew.EDSL.Condition.t option; .. >
      type workflow_edge
      val depends_on :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> Ketrew.EDSL.workflow_edge
      val on_success_activate :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> Ketrew.EDSL.workflow_edge
      val on_failure_activate :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> Ketrew.EDSL.workflow_edge
      type ensures_option =
          [ `Is_verified of Ketrew.EDSL.Condition.t
          | `Nothing
          | `Product_is_done ]
      val workflow_node :
        ?name:string ->
        ?active:bool ->
        ?make:Ketrew.EDSL.Build_process.t ->
        ?ensures:Ketrew.EDSL.ensures_option ->
        ?metadata:[ `String of string ] ->
        ?equivalence:Ketrew_pure.Target.Equivalence.t ->
        ?tags:string list ->
        ?edges:Ketrew.EDSL.workflow_edge list ->
        (< is_done : Ketrew.EDSL.Condition.t option; .. > as 'a)
        Ketrew.EDSL.product -> 'Ketrew.EDSL.workflow_node
      type not_already_done = < is_done : Ketrew.EDSL.Condition.t option >
      val without_product : Ketrew.EDSL.not_already_done
      type single_file =
          < exists : Ketrew_pure.Target.Condition.t;
            host : Ketrew.EDSL.Host.t;
            is_bigger_than : int -> Ketrew_pure.Target.Condition.t;
            is_done : Ketrew_pure.Target.Condition.t option; path : string >
      val single_file :
        ?host:Ketrew.EDSL.Host.t ->
        string -> Ketrew.EDSL.single_file Ketrew.EDSL.product
      type list_of_files =
          < is_done : Ketrew_pure.Target.Condition.t option;
            paths : string list >
      val list_of_files :
        ?host:Ketrew.EDSL.Host.t ->
        string list -> Ketrew.EDSL.list_of_files Ketrew.EDSL.product
      type unknown_product = < is_done : Ketrew.EDSL.Condition.t option >
      val forget_product :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node ->
        Ketrew.EDSL.unknown_product Ketrew.EDSL.workflow_node
      val workflow_to_string :
        ?ansi_colors:bool ->
        ?indentation:int ->
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> string
      val add_tags :
        ?recursive:bool ->
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> string list -> unit
      val node_id :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> string
      val node_name :
        < is_done : Ketrew.EDSL.Condition.t option; .. >
        Ketrew.EDSL.workflow_node -> string
      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_recursive_tags : string list -> unit
          method add_tags : string list -> unit
          method depends_on : Ketrew.EDSL.user_target list
          method get_recursive_tags : string 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.EDSL.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.EDSL.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 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
           | `Fetching_node of Persistent_data.Error.fetching_node
           | `Target of [> `Deserilization of string ] ]
          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
          | `Database_unavailable of string
          | `Dyn_plugin of
              [> `Dynlink_error of Dynlink.error | `Findlib of exn ]
          | `Failure of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        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
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val all_visible_targets :
        Ketrew.Engine.t ->
        (Ketrew_pure.Target.t list,
         [> `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `IO of
              [> `Read_file_exn of string * exn
               | `Write_file_exn of string * exn ]
          | `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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val next_changes :
        Ketrew.Engine.t ->
        (Persistent_data.Change.t list, 'a) Unix_io.Deferred_result.t
      module Run_automaton :
        sig
          type step_allowed_errors =
              [ `Database of Trakeva.Error.t
              | `Database_unavailable of string
              | `Fetching_node of Persistent_data.Error.fetching_node
              | `List of Ketrew.Engine.Run_automaton.step_allowed_errors list
              | `Target of [ `Deserilization of string ] ]
          val step :
            Ketrew.Engine.t ->
            (bool, Ketrew.Engine.Run_automaton.step_allowed_errors)
            Unix_io.Deferred_result.t
          val fix_point :
            Ketrew.Engine.t ->
            ([ `Steps of int ],
             Ketrew.Engine.Run_automaton.step_allowed_errors)
            Unix_io.Deferred_result.t
          val try_to_fix_step_error :
            Ketrew.Engine.t ->
            info:string ->
            Ketrew.Engine.Run_automaton.step_allowed_errors ->
            (unit,
             [> `Database of
                  [> `Act of Trakeva.Action.t | `Load of string ] * string
              | `Database_unavailable of string
              | `Not_fixable of
                  Ketrew.Engine.Run_automaton.step_allowed_errors ])
            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
          | `Database_unavailable of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `IO of
              [> `Read_file_exn of string * exn
               | `Write_file_exn of string * exn ]
          | `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:Ketrew_pure.Internal_pervasives.Unique_id.t ->
        (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
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val host_io : Ketrew.Engine.t -> Host_io.t
    end
  module Eval_condition :
    sig
      val bool :
        host_io:Host_io.t ->
        Ketrew_pure.Target.Condition.t ->
        (bool,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 Host_io.Error.non_zero_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
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `IO of
              [> `Read_file_exn of string * exn
               | `Write_file_exn of string * exn ]
          | `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 >
               | `Named_host_not_found of string
               | `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 >
                | `Named_host_not_found of string
                | `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 >
            | `Named_host_not_found of string
            | `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 ] ->
            [ `Command_execution | `Connectivity | `Local_system ]
          val log :
            [< `Execution of
                 < host : string; message : string; stderr : string option;
                   stdout : string option; .. >
             | `Named_host_not_found of string
             | `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
      val create : unit -> Ketrew.Host_io.t
      val default_timeout_upper_bound : float Pervasives.ref
      type timeout =
          [ `At_most_seconds of float
          | `Host_default
          | `None
          | `Seconds of float ]
      val set_named_host :
        Ketrew.Host_io.t ->
        name:string ->
        Ketrew_pure.Host.Ssh.t -> (unit, 'a) Unix_io.Deferred_result.t
      val delete_named_host :
        Ketrew.Host_io.t ->
        name:string -> (unit, 'a) Unix_io.Deferred_result.t
      val execute :
        ?timeout:Ketrew.Host_io.timeout ->
        Ketrew.Host_io.t ->
        host:Ketrew_pure.Host.t ->
        string list ->
        (< exited : int; stderr : string; stdout : string >,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        string ->
        (string * string,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        string ->
        (int,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        string ->
        (unit,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        Ketrew_pure.Path.t list ->
        (bool,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t -> Ketrew_pure.Path.t option
      val ensure_directory :
        ?timeout:Ketrew.Host_io.timeout ->
        ?with_shell:Ketrew.Host_io.shell ->
        Ketrew.Host_io.t ->
        host:Ketrew_pure.Host.t ->
        path:Ketrew_pure.Path.t ->
        (unit,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        path:Ketrew_pure.Path.t ->
        content:string ->
        (unit,
         [> `Host of
              [> `Execution of
                   < host : string; message : string; stderr : string option;
                     stdout : string option >
               | `Named_host_not_found of string
               | `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 ->
        host:Ketrew_pure.Host.t ->
        path:Ketrew_pure.Path.t ->
        (string,
         [> `Cannot_read_file of string * string
          | `Host of [> `Named_host_not_found of 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 ->
        host:Ketrew_pure.Host.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 -> '-> 'Ketrew.Interaction.menu_item
      val menu :
        ?max_per_page:int ->
        ?always_there:'Ketrew.Interaction.menu_item list ->
        sentence:SmartPrint.t ->
        '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
          | `Database_unavailable of string
          | `Failure of string
          | `Fetching_node of Persistent_data.Error.fetching_node
          | `IO of
              [> `Read_file_exn of string * exn
               | `Write_file_exn of string * exn ]
          | `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
      val read_password_exn : unit -> string
    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 >
              | `Named_host_not_found of string
              | `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 :
        host_io:Ketrew.Host_io.t ->
        Ketrew_pure.Host.t ->
        (Ketrew_pure.Path.t, [> `Fatal of string ]) Unix_io.Deferred_result.t
      val get_log_of_monitored_script :
        host_io:Ketrew.Host_io.t ->
        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,
         [> `Host of [> `Named_host_not_found of string ] | `Timeout of float ])
        Unix_io.Deferred_result.t
      val get_pid_of_monitored_script :
        host_io:Ketrew.Host_io.t ->
        host:Ketrew_pure.Host.t ->
        script:Ketrew_pure.Monitored_script.t ->
        (int option,
         [> `Host of [> `Named_host_not_found of string ] | `Timeout of float ])
        Unix_io.Deferred_result.t
      val shell_command_output_or_log :
        host_io:Ketrew.Host_io.t ->
        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 ->
        host_io:Host_io.t ->
        (run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
      val update :
        run_parameters ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        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 ->
        ?request_memory:[ `GB of int | `MB of int ] ->
        ?raw_options:string list ->
        Ketrew_pure.Program.t -> [> `Long_running of string * string ]
    end
  module Named_hosts_text_ui :
    sig
      val sub_commands :
        version:string ->
        prefix:string ->
        configuration_arg:Ketrew.Configuration.t Cmdliner.Term.t ->
        unit ->
        ((unit,
          [> `Client of Ketrew.Client.Error.t
           | `Database of Trakeva.Error.t
           | `Database_unavailable of string
           | `Dyn_plugin of
               [> `Dynlink_error of Dynlink.error | `Findlib of exn ]
           | `Failure of string
           | `Fetching_node of Persistent_data.Error.fetching_node
           | `IO of [> `Write_file_exn of string * exn ]
           | `Target of [> `Deserilization of string ]
           | `Wrong_configuration of [> `Found of string ] * [> `Exn of exn ] ])
         Unix_io.Deferred_result.t Cmdliner.Term.t * Cmdliner.Term.info)
        list
    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 ->
        host_io:Host_io.t ->
        (run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
      val update :
        run_parameters ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        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
      module Error :
        sig
          type fetching_node =
              [ `Get_stored_target
              | `Pointer_loop_max_depth of int
              | `Target_to_add ] * [ `Id of string ]
        end
      val create :
        database_parameters:string ->
        archival_age_threshold:[ `Days of float ] ->
        (Ketrew.Persistent_data.t,
         [> `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
          | `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 Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val all_visible_targets :
        Ketrew.Persistent_data.t ->
        (Ketrew_pure.Target.t list,
         [> `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
          | `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
               | `Get of Trakeva.Key_in_collection.t
               | `Get_all of string
               | `Load of string ] *
              string
          | `Database_unavailable of string
          | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      val fold_active_targets :
        Ketrew.Persistent_data.t ->
        init:'->
        f:('->
           target:Ketrew_pure.Target.t ->
           ('a,
            [> `Database of
                 [> `Get of Trakeva.Key_in_collection.t
                  | `Iter of string
                  | `Load of string ] *
                 string
             | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
             | `Target of [> `Deserilization of string ] ]
            as 'combined_errors)
           Unix_io.Deferred_result.t) ->
        ('a, 'combined_errors) 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
      val find_all_orphans :
        Ketrew.Persistent_data.t ->
        (Ketrew_pure.Target.t list,
         [> `Database of Trakeva.Error.t
          | `Database_unavailable of string
          | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
          | `Target of [> `Deserilization of string ] ])
        Unix_io.Deferred_result.t
      module Change :
        sig
          type t =
              [ `New_nodes of string list
              | `Nodes_changed of string list
              | `Started ]
          val pp :
            Format.formatter ->
            Ketrew.Persistent_data.Change.t -> Ppx_deriving_runtime.unit
          val show :
            Ketrew.Persistent_data.Change.t -> Ppx_deriving_runtime.string
        end
      val next_changes :
        Ketrew.Persistent_data.t ->
        (Ketrew.Persistent_data.Change.t list, 'a) 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
              | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
              | `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
              | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
              | `Target of [> `Deserilization of string ] ])
            Unix_io.Deferred_result.t
          val force_add_passive_target :
            Ketrew.Persistent_data.t ->
            Ketrew_pure.Target.Stored_target.target ->
            (unit,
             [> `Database of
                  [> `Act of Trakeva.Action.t | `Load of string ] * string
              | `Database_unavailable of string ])
            Unix_io.Deferred_result.t
        end
      module Synchronize :
        sig
          val copy :
            string ->
            string ->
            (unit,
             [> `Database of Trakeva.Error.t
              | `Database_unavailable of string
              | `Fetching_node of Ketrew.Persistent_data.Error.fetching_node
              | `IO of
                  [> `Read_file_exn of string * exn
                   | `Write_file_exn of string * exn ]
              | `Not_a_directory of string
              | `System of
                  [> `File_info of string
                   | `List_directory of string
                   | `Make_directory of string ] *
                  [> `Exn of exn | `Wrong_access_rights of int ]
              | `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 ->
        host_io:Ketrew.Host_io.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 Process_holder :
    sig
      module Ssh_connection :
        sig
          val setsid_ssh :
            session_id_file:Unix_io.IO.path ->
            control_path:string ->
            log_to:string ->
            pipe_in:string ->
            pipe_out:string ->
            command:string ->
            temp_dir:string ->
            string ->
            (unit,
             [> `IO of
                  [> `Exn of exn
                   | `File_exists of string
                   | `Write_file_exn of string * exn
                   | `Wrong_path of string ] ])
            Unix_io.Deferred_result.t
          type t
          val create :
            ?ketrew_bin:string ->
            ?command:string ->
            name:string -> string -> Ketrew.Process_holder.Ssh_connection.t
          val markup_with_daemon_logs :
            Ketrew.Process_holder.Ssh_connection.t ->
            (Ketrew_pure.Internal_pervasives.Display_markup.t, 'a)
            Unix_io.Deferred_result.t
          val write_to_fifo :
            Ketrew.Process_holder.Ssh_connection.t ->
            string ->
            (unit, [> `Failure of string ]) Unix_io.Deferred_result.t
          val host_uri : Ketrew.Process_holder.Ssh_connection.t -> string
          val kill :
            Ketrew.Process_holder.Ssh_connection.t ->
            (unit,
             [> `Failure of string
              | `IO of [> `Read_file_exn of string * exn ]
              | `Shell of
                  string *
                  [> `Exited of int
                   | `Exn of exn
                   | `Signaled of int
                   | `Stopped of int ] ])
            Unix_io.Deferred_result.t
        end
      type t
      val load :
        ?preconfigure:Ketrew.Configuration.ssh_connection list ->
        unit -> (Ketrew.Process_holder.t, 'a) Unix_io.Deferred_result.t
      val unload :
        Ketrew.Process_holder.t ->
        (unit,
         [> `List of
              [> `Failure of string
               | `IO of [> `Read_file_exn of string * exn ]
               | `Shell of
                   string *
                   [> `Exited of int
                    | `Exn of exn
                    | `Signaled of int
                    | `Stopped of int ] ]
              list ])
        Unix_io.Deferred_result.t
      val answer_message :
        Ketrew.Process_holder.t ->
        host_io:Ketrew.Host_io.t ->
        Ketrew_pure.Protocol.Process_sub_protocol.up ->
        (Ketrew_pure.Protocol.Process_sub_protocol.down, 'a)
        Unix_io.Deferred_result.t
    end
  module Server :
    sig
      val start :
        just_before_listening:(unit ->
                               (unit,
                                [> `Database of Trakeva.Error.t
                                 | `Database_unavailable of string
                                 | `Dyn_plugin of
                                     [> `Dynlink_error of Dynlink.error
                                      | `Findlib of exn ]
                                 | `Failure of string
                                 | `Fetching_node of
                                     Ketrew.Persistent_data.Error.fetching_node
                                 | `IO of [> `Read_file_exn of string * exn ]
                                 | `Server_status_error of string
                                 | `Start_server_error of string
                                 | `System of
                                     [> `File_info of string
                                      | `List_directory of string
                                      | `Remove of string ] *
                                     [> `Exn of exn ]
                                 | `Target of [> `Deserilization of string ] ]
                                as 'propagated_error)
                               Unix_io.t) ->
        configuration:Ketrew.Configuration.server ->
        (unit, 'propagated_error) Unix_io.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 User_initialization :
    sig
      val generate_configuration_directory :
        debug_level:int ->
        config_path:string ->
        [ `Client_from_url of string
        | `Full of
            [ `Default_database | `User_set_database of string ] *
            [ `TLS_create_self_signed
            | `TLS_disable
            | `TLS_use of string * string ] * [ `Port of int ] *
            [ `Tokens of string list ] ] ->
        (unit,
         [> `Failure of string
          | `IO of [> `Write_file_exn of Unix_io.IO.path * exn ]
          | `Shell of
              string *
              [> `Exited of int
               | `Exn of exn
               | `Signaled of int
               | `Stopped of int ]
          | `System of
              [> `Make_directory of string ] *
              [> `Exn of exn | `Wrong_access_rights of int ] ])
        Unix_io.Deferred_result.t
    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 ->
        host_io:Host_io.t ->
        (run_parameters, Host_io.Error.classified) Unix_io.Deferred_result.t
      val update :
        run_parameters ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        ([ `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 ->
        host_io:Host_io.t ->
        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_vcores:int ->
        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 ]
      val max_name_length : int Pervasives.ref
    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 ->
            host_io:Ketrew.Host_io.t ->
            (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 ->
            host_io:Ketrew.Host_io.t ->
            ([ `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 ->
            host_io:Ketrew.Host_io.t ->
            ([ `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 ->
            host_io:Ketrew.Host_io.t ->
            string ->
            (string, Ketrew_pure.Internal_pervasives.Log.t)
            Unix_io.Deferred_result.t
        end
    end
end