Workload monitor for containers, unikernels, and VMs
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

OCaml 87.0%
Dune 4.2%
Other 8.8%
17 1 0

Clone this repository

https://tangled.org/gazagnaire.org/ocaml-monitor https://tangled.org/did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-monitor
git@git.recoil.org:gazagnaire.org/ocaml-monitor git@git.recoil.org:did:plc:jhift2vwcxhou52p3sewcrpx/ocaml-monitor

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

ocaml-monitor#

Workload monitor for containers, unikernels, and VMs.

ISC License

Overview#

This library provides an interface for monitoring and managing workloads across different runtimes. Each backend implements the Monitor.S signature for consistent lifecycle management.

Supported backends:

  • Process: Native process execution (for dev/testing)
  • Container: OCI containers via runc
  • Unikernel: Solo5 unikernels (planned)
  • Vm: QEMU/KVM virtual machines (planned)

Installation#

Install with opam:

$ opam install monitor

If opam cannot find the package, it may not yet be released in the public opam-repository. Add the overlay repository, then install it:

$ opam repo add samoht https://tangled.org/gazagnaire.org/opam-overlay.git
$ opam update
$ opam install monitor

Usage#

open Monitor

let run env =
  Eio.Switch.run @@ fun sw ->
  (* Create a monitor *)
  let mon = Process.create ~env () in
  (* Configure and start a process *)
  let config = Process_config.v "echo" [ "hello"; "world" ] in
  match Process.start ~sw mon config with
  | Ok handle ->
      let status = Process.wait mon handle in
      Format.printf "Process %a\n" pp_status status
  | Error msg ->
      Format.eprintf "Failed: %s\n" msg

Module Structure#

  • Monitor.S - Signature for monitor backends
  • Monitor.Process - Native process execution
  • Monitor.Process_config - Configuration for native processes

Future modules:

  • Monitor.Container - OCI/runc containers
  • Monitor.Unikernel - Solo5 unikernels
  • Monitor.Vm - QEMU/KVM virtual machines
  • OBuilder - Sandboxed build execution with snapshotting, by Thomas Leonard and the OCurrent team. OBuilder's sandbox abstraction inspired the Monitor.S module type.

  • Albatross - MirageOS unikernel orchestration, by Hannes Mehnert. Albatross provides patterns for unikernel lifecycle management.

Licence#

ISC License. See LICENSE.md.