Generic.Op
include S.OPERATION
A short and unique name for this operation, used as a filename component and database key. e.g. "docker-build"
module Key : S.WITH_DIGEST
The id, Key.t
pair uniquely identifies the operation.
module Value : S.WITH_DIGEST
A second input value, which is not part of the key (so there can be only one value for any key at one time). For outputs, this is used to hold the value to which the output should be set. For builds, non-essential inputs can be placed here instead of in the key so that the old outcome can be latched for minor changes. For example, when testing a Git commit the commit to test would be the key, but the latest version of the test platform might be the value.
module Outcome : S.WITH_MARSHAL
The output of the pipeline stage.
val run :
t ->
Current.Job.t ->
Key.t ->
Value.t ->
Outcome.t Current.or_error Lwt.t
run t j k v
performs the operation. Call Job.start j
once any required resources have been acquired. Log messages can be written to j
.
This affects what happens if we're in the process of outputting a value and then we decide to output a different value instead. If true
, the old operation will be cancelled immediately. If false
, the old operation will run to completion first.