package ocluster-worker

  1. Overview
  2. Docs
Module type
Class type
type job_spec = [
  1. | `Docker of [ `Contents of string | `Path of string ] * Cluster_api.Docker.Spec.options
  2. | `Obuilder of [ `Contents of string ]
  3. | `Custom of Cluster_api.Custom.recv
module Obuilder_config : sig ... end
type build = switch:Lwt_switch.t -> log:Log_data.t -> src:string -> secrets:(string * string) list -> job_spec -> (string, [ `Cancelled | `Msg of string ]) Lwt_result.t
val default_build : ?obuilder:Cluster_worker__.Obuilder_build.t -> build

The default build that is used if no build argument is given to run.

val run : ?switch:Lwt_switch.t -> ?build:build -> ?allow_push:string list -> healthcheck_period:float -> ?prune_threshold:float -> ?docker_max_df_size:float -> ?obuilder_prune_threshold:float -> ?obuilder_prune_item_threshold:int64 -> ?obuilder_prune_limit:int -> ?obuilder:Obuilder_config.t -> ?additional_metrics:(string * Uri.t) list -> update:(unit -> (unit -> unit Lwt.t) Lwt.t) -> capacity:int -> name:string -> state_dir:string -> Cluster_api.Raw.Client.Registration.t Capnp_rpc_lwt.Sturdy_ref.t -> unit Lwt.t

run ~capacity ~name ~state_dir registry runs a builder that connects to registry and runs up to capacity jobs at once. The builder registers using the unique ID name.

  • parameter switch

    Turning this off causes the builder to exit (for unit-tests).

  • parameter build

    Used to override the default build action (for unit-tests or custom job specifications).

  • parameter allow_push

    Docker repositories to which results can be pushed.

  • parameter healthcheck_period

    Time period, in seconds, at which the health of the worker is checked.

  • parameter prune_threshold

    Stop and run docker system prune -af if free-space is less than this percentage (0 to 100).

  • parameter docker_max_df_size

    Run docker system df to get the amount of memory being taken up by the images and if this is greater than docker_max_df_size, run docker system prune.

  • parameter obuilder_prune_threshold

    The threshold for OBuilder to prune the store of cached build steps.

  • parameter obuilder

    OBuilder's configuration.

  • parameter additional_metrics

    A list of additional prometheus endpoints with a descriptive name to collect.

  • parameter update

    Function to run on "selfUpdate" requests. It should do any preparation (such as downloading new images), then return a function to do the actual update. This is so that the first part can run while the node finishes its remaining jobs. The second part is called once all jobs are finished. If the second function returns, the process will exit.

  • parameter capacity

    The number of builds that can run in parallel.

  • parameter name

    Unique builder name.

  • parameter state_dir

    A persistent directory for Git caches, etc.

module Process : sig ... end
module Log_data : sig ... end

Innovation. Community. Security.