/mbs

a Meta Build System for monorepo

Primary LanguageElixirMIT LicenseMIT

MBS - a Monorepo Build System

DISCLAIMER: this is a personal POC, it's not used in any product, it's not supported or sponsored by any company. Feel free to play with it and if interested keep in touch.

A fully dockerized Monorepo Build System to build, release and deploy a large service oriented mono-repository with focus on consistency, reproducibility and extensibility.

Containerization is used both to run mbs and to define your own standardized toolchains to build and deploy your software components.

With MBS you can define the toolchains to build and deploy the different type of software components in you mono-repo and express the dependency graph among them (DAG), to consistently build only what's really changed (checksum based) and cache the results, a radically different approach to "git trigger based" pipeline services. Even the toolchains used to build your components should be part of the repository: change a toolchain -> rebuild everything that depends on the toolchain.

image info

This will give you parallelized fast builds for free that can consistenly run on your dev machine (exactly like your CI runner) without any need for specific software installed, but only docker and your mono-repo.

The user experience we aim to is a build system that let you properly work in a mono-repo that you feel like a modular monolith, but is built and deployed like a service oriented solution.

To summarize:

  • build / release / deploy support
  • first class DAG dependencies (parallelized execution)
  • language independent (polyglot monorepo)
  • checksum based diff detection
  • sandboxed build
  • no development environment on your machine, just docker (and the possibility the execute a container in privileged mode)

Vision

Imagine a place where:

  • you can define in a single repository all the pieces of a project (or multiple projects): infrastructure, applications, ops tools, toolchains to build or deploy everything in the repo. All these pieces versioned together so that you can easily work orthogonally through the stack with a single view, atomic commits, explicit dependencies and no internal versioning.
  • you can onboard in almost zero time: get access to the code, clone it on a dev machine with docker, build / test / develop everything in the repo, no matter the language, runtime, framework... without the need too install any software on the host.
  • you can have (if you want) a very consistent way of doing things (no snowflakes).

Documentation

Live demo

Basic build

asciicast

Dependencies and changes

asciicast

Sandboxed execution

asciicast

Build development shell

asciicast

Release, deploy, destroy

asciicast