GithubHelp home page GithubHelp logo

qinusty / bb-asset-hub Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 1.0 155 KB

A remote asset compatible server supporting REv2 compatible GRPC caches

License: Apache License 2.0

Starlark 50.11% Go 45.89% Shell 0.19% Jsonnet 3.81%
remote-execution remote-asset build buildbarn

bb-asset-hub's Introduction

Buildbarn Asset Hub

This project is now maintained at https://github.com/buildbarn/bb-remote-asset under the buildbarn namespace.

This repository provides a service for the remote asset protocol. This protocol is used by tools such as bazel / buildstream to provide a mapping between URIs and qualifiers to digests which can be used by the remote execution (REv2) protocol.

The asset hub daemon can be configured with bb-storage blobstore backends to enable a scalable remote asset service which can be integrated with any REv2 compatible GRPC cache.

Setting up the Asset Hub daemon

$ cat config/bb_asset_hub.jsonnet
{
  fetcher: {
    caching: {
      fetcher: {
        http: {
          allowUpdatesForInstances: ['foo'],
          contentAddressableStorage: {
            grpc: {
              address: "<cache_address>:<cache grpc port>"
            },
    }}}}},

  assetStore: {
    circular: {
      directory: '/storage-asset',
      offsetFileSizeBytes: 1024 * 1024,
      offsetCacheSize: 1000,
      dataFileSizeBytes: 100 * 1024 * 1024,
      dataAllocationChunkSizeBytes: 1048576,
      instances: ['foo'],
    },
  },
  httpListenAddress: ':7982',
  grpcServers: [{
    listenAddresses: [':8981'],
    authenticationPolicy: { allow: {} },
  }],
  allowUpdatesForInstances: ['foo'],
  maximumMessageSizeBytes: 16 * 1024 * 1024 * 1024,
}

$ docker run \
    -p 8981:8981 \
    -v $(pwd)/config:/config \
    -v $(pwd)/storage-asset:/storage-asset \
    bazel/cmd/bb_asset_hub:bb_asset_hub_container \
    /config/bb_asset_hub.jsonnet

In the example above, the daemon is configured to store asset references within a disk backed circular storage backend. The fetcher is configured to support fetching via HTTP when a reference is not found matching the request URI/Qualifier criteria, these fetched blobs are placed into a REv2 compatible GRPC cache and the digest returned to the remote asset client. HTTP Fetched blobs are configured to be cached references to newly fetched blobs in the asset store for future fetches.

Bazel can be configured to use this service as a remote uploader as follows:

$ bazel build --remote_cache=grpc://<cache_address>:<cache grpc port> --remote_instance_name=foo --experimental_remote_downloader="grpc://localhost:8981" //...

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.