Coder Social home page Coder Social logo

ly0 / bb-storage Goto Github PK

View Code? Open in Web Editor NEW

This project forked from buildbarn/bb-storage

0.0 1.0 0.0 121 KB

Storage daemon, capable of storing data for the Remote Execution protocol

License: Apache License 2.0

Python 15.77% Go 84.11% Shell 0.12%

bb-storage's Introduction

The Buildbarn storage daemon Build status GoDoc

The Buildbarn project provides an implementation of the Remote Execution protocol. This protocol is used by tools such as Bazel, BuildStream and recc to cache and optionally execute build actions remotely.

This repository provides a copy of Buildbarn's storage daemon. This daemon can be used to build a scalable build cache. On its own, it cannot be used to execute build actions remotely. When using only this storage daemon, build actions will still be executed on the local system. This daemon does, however, facilitate remote execution by allowing execution requests to be forwarded to a separate remote execution service.

This storage daemon can be configured to use a whole series of backends. Examples include Redis and S3. It also provides a local on-disk storage backend that writes data to a circular file, using a hash table as an index. This storage backend is self-cleaning; no garbage collection is needed. The schema of the storage configuration file gives a good overview of which storage backends are available and how they can be configured.

Setting up the Buildbarn storage daemon

Run the following command to build the Buildbarn storage daemon from source, create container image and push it into the Docker daemon running on the current system:

$ bazel run //cmd/bb_storage:bb_storage_container
...
Tagging ... as bazel/cmd/bb_storage:bb_storage_container

This container image can then be launched using Docker as follows:

$ cat config/bb_storage.json
{
  "blobstore": {
    "contentAddressableStorage": {
      "circular": {
        "directory": "storage-cas",
        "offsetFileSizeBytes": 16777216,
        "offsetCacheSize": 10000,
        "dataFileSizeBytes": 10737418240,
        "dataAllocationChunkSizeBytes": 16777216
      }
    },
    "actionCache": {
      "circular": {
        "directory": "storage-ac",
        "offsetFileSizeBytes": 1048576,
        "offsetCacheSize": 1000,
        "dataFileSizeBytes": 104857600,
        "dataAllocationChunkSizeBytes": 1048576,
        "instance": ["foo", "bar"]
      }
    }
  },
  "jaeger": {},
  "schedulers": {
    "bar": "bar-scheduler:8981"
  },
  "allowAcUpdatesForInstances": ["foo"]
}

$ docker run \
      -p 8980:8980 \
      -v $(pwd)/config:/config \
      -v $(pwd)/storage-cas:/storage-cas \
      -v $(pwd)/storage-ac:/storage-ac \
      bazel/cmd/bb_storage:bb_storage_container \
      /config/bb_storage.json'

In the example above, the daemon is configured to store a single on-disk CAS. Two ACs are made, corresponding with instance names foo and bar. The former is intended just for remote caching, which is why it's made client-writable by adding allow-ac-updates-for-instance in the configuration file. The latter is intended for remote execution, which is why schedulers is used to forward build action execution requests to a separate scheduler service at address bar-scheduler:8981. By using an empty jaeger, tracing is configured to use default values as documented in the configuration schema. Omitting it will disable tracing altogether.

Bazel can be configured to use the remote cache as follows:

$ bazel build --remote_cache=localhost:8980 --remote_instance_name=foo //...

Prebuilt container images of the Buildbarn storage daemon may be found on Docker Hub. More examples of how the Buildbarn storage daemon may be deployed can be found in the Buildbarn deployments repository.

bb-storage's People

Contributors

apesternikov avatar edschouten avatar finnball avatar mickael-carl avatar

Watchers

 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.