GithubHelp home page GithubHelp logo

prestonvanloon / bazel-buildbarn Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 6.0 301 KB

Alternative Bazel buildfarm implementation written in Go

License: Apache License 2.0

Python 28.21% Go 71.40% Shell 0.40%

bazel-buildbarn's Introduction

Bazel Buildbarn

Bazel Buildbarn is an implementation of a Bazel buildfarm written in the Go programming language. The intent behind this implementation is that it is fast and easy to scale. It consists of the following three components:

  • bbb_frontend: A service capable of processing RPCs from Bazel. It can store build input and serve cached build output and action results.
  • bbb_scheduler: A service that receives requests from bbb_frontend to queue build actions that need to be run.
  • bbb_worker: A service that runs build actions by fetching them from the bbb_scheduler.

The bbb_frontend and bbb_worker services can be replicated easily. It is also possible to start multiple bbb_scheduler processes if multiple build queues are desired (e.g., supporting multiple build operating systems).

These processes use Redis to store most of their data (in terms of object count). As Redis is not well suited for storing large elements, an S3 bucket is used to hold any Content Addressable Storage objects exceeding 1 MiB in size.

Below is a diagram of what a typical Bazel Buildbarn deployment may look like. In this diagram, the arrows represent the direction in which network connections are established.

Overview of a typical Bazel Buildbarn deployment

One common use case for this implementation is to be run in Docker containers on Kubernetes. In such environments it is generally impossible to use sandboxfs, meaning bbb_worker uses basic UNIX credentials management (privilege separation) to provide a rudimentary form of sandboxing. The bbb_worker daemon runs as user root, whereas the build action is run as user build. Input files are only readable to the latter.

Setting up Bazel Buildbarn

TODO(edsch): Provide example Kubernetes configuration files.

Using Bazel Buildbarn

Bazel can make use of Bazel Buildbarn by invoking it as follows:

bazel build \
    --cpu=k8 --experimental_strict_action_env --genrule_strategy=remote \
    --remote_executor=...:8980 --spawn_strategy=remote \
    --strategy=Closure=remote --strategy=Javac=remote \
    //...

bazel-buildbarn's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.