# \[ANN\] OCluster and OBuilder

**URL:** https://discuss.ocaml.org/t/ann-ocluster-and-obuilder/7035
**Category:** Community
**Tags:** docker, capnp, ci
**Created:** [December 31, 2020, 8:36pm UTC](https://discuss.ocaml.org/t/ann-ocluster-and-obuilder/7035 "2020-12-31T20:36:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![talex5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/talex5/32/353_2.png) [@talex5](https://discuss.ocaml.org/u/talex5)
#### Post date: [December 31, 2020, 8:36pm UTC](https://discuss.ocaml.org/t/ann-ocluster-and-obuilder/7035/1 "2020-12-31T20:36:17Z")

</div>

I’m pleased to announce the first release of [OCluster](https://github.com/ocurrent/ocluster). A user can submit a build job (either a Dockerfile or an OBuilder spec) to the scheduler, which then runs the build on a worker machine, streaming the logs back to the client.

This is the build scheduler / cluster manager that we use for e.g. [opam-repo-ci](https://github.com/ocurrent/opam-repo-ci) (which you may have seen in action if you submitted a package to opam-repository recently).

See [ocurrent/overview](https://github.com/ocurrent/overview) for a quick overview of the various other CI services using it too.

To install and run the scheduler use e.g.

```bash
opam depext -i ocluster
mkdir capnp-secrets
ocluster-scheduler \
  --capnp-secret-key-file=./capnp-secrets/key.pem \
  --capnp-listen-address=tcp:0.0.0.0:9000 \
  --capnp-public-address=tcp:127.0.0.1:9000 \
  --state-dir=/var/lib/ocluster-scheduler \
  --pools=linux-arm32,linux-x86_64

```

It will generate `key.pem` on the first run, as well as various capability files granting access for workers and clients. You then copy each generated pool capability (e.g. `pool-linux-x86_64.cap`) to each machine you want in that pool, and run `ocluster-worker pool-linux-x86_64.cap` to start the worker agent. See the [README](https://github.com/ocurrent/ocluster/blob/master/README.md) for full details.

[OBuilder](https://github.com/ocurrent/obuilder) is an alternative to `docker build`. The main differences are that it takes a spec in S-expression format, which is easier to generate than a Dockerfile, handles concurrent builds reliably, and keeps copies of the logs so that you still see the output even if someone else performed the same build step earlier and the result is therefore taken from the cache.

It currently supports ZFS and Btrfs for storage (it needs cheap snapshots) and `runc` for sandboxing builds. [macos support](https://github.com/ocurrent/obuilder/issues/57) is under development, but not yet upstreamed. It should be fairly easy to add support for any platform that has some form of secure chroot.

OCluster supports monitoring with Prometheus, so you can see what the cluster is doing:

 ![cluster](https://us1.discourse-cdn.com/flex020/uploads/ocaml/original/2X/d/d5ff5aaa0259d7b59445b156e6b642a421040b64.png)

---

<div class="post-metadata">

### Author: ![ulrikstrid](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/ulrikstrid/32/1600_2.png) [@ulrikstrid](https://discuss.ocaml.org/u/ulrikstrid)
#### Post date: [January 1, 2021, 4:25pm UTC](https://discuss.ocaml.org/t/ann-ocluster-and-obuilder/7035/2 "2021-01-01T16:25:35Z")

</div>

This looks very cool!

Can I run it inside of a unprivileged container? Both OCluster and OBuilder.

---

<div class="post-metadata">

### Author: ![talex5](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/talex5/32/353_2.png) [@talex5](https://discuss.ocaml.org/u/talex5)
#### Post date: [January 2, 2021, 10:53am UTC](https://discuss.ocaml.org/t/ann-ocluster-and-obuilder/7035/3 "2021-01-02T10:53:27Z")

</div>

The cluster scheduler can run without privileges (we run ours in a container). The worker needs the ability to create new sandboxes, which generally isn’t allowed inside an unprivileged container I think, although it may be possible to make it work.
