[ANN] OCurrent 0.1 (CI/CD pipeline eDSL)

OCurrent 0.1 has just been released to opam-repository.

OCurrent is an OCaml eDSL intended for writing build/test/deploy pipelines. It is being used as the engine for ocaml-ci and the docker-base-images builder (used to build the OCaml Docker images, such as ocurrent/opam:alpine-3.10-ocaml-4.08). Other good uses might be building and redeploying a Docker service or a unikernel whenever its source repository changes. It can be run locally as a single Unix process.

An OCurrent pipeline is written as an OCaml program, but the OCurrent engine ensures that it is kept up-to-date by re-running stages when their inputs change. A web UI is available so you can view your pipeline and see its current state.

OCurrent can statically analyse the pipelines before they have run, allowing it to run steps in parallel automatically and to display the whole pipeline. It does this using a light-weight alternative to arrows, which doesn’t require programming in an awkward point-free style. See
CI/CD Pipelines: Monad, Arrow or Dart? for more about that.

The basic functionality can be extended using “plugins” (just normal OCaml libraries). Plugins are available for interacting with Docker, Git, GitHub and Slack. These are in separate packages (e.g. current_github) to avoid having the base package pull in too many dependencies).

There is also an optional Cap’n Proto RPC interface, in the current_rpc opam package. This is used, for example, by citty to provide a TTY interface to ocaml-ci.

The OCurrent wiki contains examples, and documentation on the various plugins.

Here’s an example pipeline (from the base image builder):


For those curious about the relation to the existing CI used in opam-repository, then it is no coincidence that @talex5 is the author of both :slight_smile:

This DSL is the next iteration of the datakit-ci, but specialised to be faster and simpler for extending with OCaml and more complex workflows that our OCaml Platform tools need these days (like ocamlformat linting, or dune expect promotion, or odoc cross-referenced doc generation). We are planning a smooth migration next year over to the new system, but wanted to release this early to show you some of the pieces going into this new iteration. I am particularly excited about the new tty-based interface that saves an awful lot of clicking around on web UIs for CI results…