All Projects → bazelbuild → Bazel Buildfarm

bazelbuild / Bazel Buildfarm

Licence: apache-2.0
Bazel remote caching and execution service

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Bazel Buildfarm

Bazel Remote
A remote cache for Bazel
Stars: ✭ 260 (-26.14%)
Mutual labels:  bazel, caching
Foshttpcache
Integrate your PHP application with your HTTP caching proxy
Stars: ✭ 308 (-12.5%)
Mutual labels:  caching
speedtables
Speed tables is a high-performance memory-resident database. The speed table compiler reads a table definition and generates a set of C access routines to create, manipulate and search tables containing millions of rows. Currently oriented towards Tcl.
Stars: ✭ 56 (-84.09%)
Mutual labels:  caching
Rules scala
Scala rules for Bazel
Stars: ✭ 269 (-23.58%)
Mutual labels:  bazel
svelte-ts
[WIP] Tools for building Svelte apps with TS
Stars: ✭ 89 (-74.72%)
Mutual labels:  bazel
Scrapbook
PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APC(u), SQL and additional capabilities (e.g. transactions, stampede protection) built on top.
Stars: ✭ 279 (-20.74%)
Mutual labels:  caching
keen-analysis.js
A light JavaScript client for Keen
Stars: ✭ 40 (-88.64%)
Mutual labels:  caching
Cache
The Cache component provides an extended PSR-6 implementation for adding cache to your applications.
Stars: ✭ 3,606 (+924.43%)
Mutual labels:  caching
example-bazel-monorepo
🌿💚 Example Bazel-ified monorepo, supporting Golang, Java, Python, Scala, and Typescript
Stars: ✭ 213 (-39.49%)
Mutual labels:  bazel
Laravel Varnish
Making Varnish and Laravel play nice together
Stars: ✭ 291 (-17.33%)
Mutual labels:  caching
lambda-cache
Python utility for caching in Lambda Functions
Stars: ✭ 28 (-92.05%)
Mutual labels:  caching
blackjack
Build cargo dependencies with Bazel
Stars: ✭ 34 (-90.34%)
Mutual labels:  bazel
Sandboxfs
A virtual file system for sandboxing
Stars: ✭ 286 (-18.75%)
Mutual labels:  bazel
rules sh
Shell rules for Bazel
Stars: ✭ 18 (-94.89%)
Mutual labels:  bazel
Graphql Cache
A caching plugin for graphql-ruby
Stars: ✭ 313 (-11.08%)
Mutual labels:  caching
bazel-packages
[WIP] Collection of Bazel packages
Stars: ✭ 14 (-96.02%)
Mutual labels:  bazel
Rules typescript
MOVED to https://github.com/bazelbuild/rules_nodejs/tree/3.x/third_party/github.com/bazelbuild/rules_typescript
Stars: ✭ 280 (-20.45%)
Mutual labels:  bazel
Coherence
Oracle Coherence Community Edition
Stars: ✭ 328 (-6.82%)
Mutual labels:  caching
Maplebacon
🍁🥓 Lightweight and fast Swift library for image downloading, caching and transformations
Stars: ✭ 322 (-8.52%)
Mutual labels:  caching
Bazel
a fast, scalable, multi-language and extensible build system
Stars: ✭ 17,790 (+4953.98%)
Mutual labels:  bazel

Build status

Bazel Buildfarm

This repository hosts the Bazel remote caching and execution system.

Background information on the status of caching and remote execution in bazel can be found in the bazel documentation.

File issues here for bugs or feature requests, and ask questions via build team slack in the #buildfarm channel.

Buildfarm Wiki

Usage

All commandline options override corresponding config settings.

Bazel Buildfarm Server

Run via

bazel run //src/main/java/build/buildfarm:buildfarm-server <configfile> [<-p|--port> PORT]

Bazel Buildfarm Worker

Run via

bazel run //src/main/java/build/buildfarm:buildfarm-operationqueue-worker <configfile> [--root ROOT] [--cas_cache_directory CAS_CACHE_DIRECTORY]

Bazel Client

To use the example configured buildfarm with bazel (version 1.0 or higher), you can configure your .bazelrc as follows:

$ cat .bazelrc
build --remote_executor=grpc://localhost:8980

Then run your build as you would normally do.

Debugging

Buildfarm uses Java's Logging framework and outputs all routine behavior to the NICE Level.

You can use typical Java logging configuration to filter these results and observe the flow of executions through your running services. An example logging.properties file has been provided at examples/debug.logging.properties for use as follows:

bazel run //src/main/java/build/buildfarm:buildfarm-server -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/debug.logging.properties $PWD/examples/server.config.example

and

bazel run //src/main/java/build/buildfarm:buildfarm-operationqueue-worker -- --jvm_flag=-Djava.util.logging.config.file=$PWD/examples/debug.logging.properties $PWD/examples/worker.config.example

To attach a remote debugger, run the executable with the --debug=<PORT> flag. For example:

bazel run //src/main/java/build/buildfarm:buildfarm-server -- --debug=5005 $PWD/examples/server.config.example

Developer Information

Setting up Redis for local testing

This is done using examples/development-redis-cluster.sh.

Tested with Redis 6.0.10, other versions probably work fine as well.

First of all you need Redis installed:

  • macOS: brew install redis
  • Debian / Ubuntu: sudo apt-get update && sudo apt-get install redis-server redis-tools

Then you need seven terminal panes for this, six for a minimal Redis cluster and one for Buildfarm.

  • ./examples/development-redis-cluster.sh 0
  • ./examples/development-redis-cluster.sh 1
  • ./examples/development-redis-cluster.sh 2
  • ./examples/development-redis-cluster.sh 3
  • ./examples/development-redis-cluster.sh 4
  • ./examples/development-redis-cluster.sh 5
  • redis-cli --cluster create 127.0.0.1:6379 127.0.0.1:6380 127.0.0.1:6381 127.0.0.1:6382 127.0.0.1:6383 127.0.0.1:6384 --cluster-replicas 1
    

Your Redis cluster is now up, and you can now start your Buildfarm server talking to it:

bazel run //src/main/java/build/buildfarm:buildfarm-server $PWD/examples/shard-server.config.example

Setting up intelliJ

  1. Check which IntelliJ versions are supported by the Bazel plugin

  2. Make sure you have a supported IntelliJ version, otherwise download one here

  3. Follow the Bazel plugin instructions and import ij.bazelproject

  4. Once IntelliJ is done loading your project, open BuildFarmServer.java and find the main() method at the bottom

  5. Press the green play button symbol in the gutter next to main() to create a Bazel build configuration for starting a server. Launching this configuration should get you a help text from Buildfarm Server indicating missing a config file.

    This indicates a successful launch!

  6. To add a config file, edit your new run configuration and enter the absolute path to examples/server.config.example in the "Executable flags" text box.

Now, you should have something like this, and you can now run / debug Buildfarm Server from inside of IntelliJ, just like any other program:

IntelliJ Buildfarm Server run configuration

Third-party Dependencies

Most third-party dependencies (e.g. protobuf, gRPC, ...) are managed automatically via rules_jvm_external. These dependencies are enumerated in the WORKSPACE with a maven_install artifacts parameter.

Things that aren't supported by rules_jvm_external are being imported as manually managed remote repos via the WORKSPACE file.

Deployments

Buildfarm can be used as an external repository for composition into a deployment of your choice.

Add the following to your WORKSPACE to get access to buildfarm targets, filling in the commit and sha256 values:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

BUILDFARM_EXTERNAL_COMMIT = "<revision commit id>"
BUILDFARM_EXTERNAL_SHA256 = "<sha256 digest of url below>"

http_archive(
    name = "build_buildfarm",
    strip_prefix = "bazel-buildfarm-%s" % BUILDFARM_EXTERNAL_COMMIT,
    sha256 = BUILDFARM_EXTERNAL_SHA256,
    url = "https://github.com/bazelbuild/bazel-buildfarm/archive/%s.zip" % BUILDFARM_EXTERNAL_COMMIT,
)

load("@build_buildfarm//:deps.bzl", "buildfarm_dependencies")

buildfarm_dependencies()

load("@build_buildfarm//:defs.bzl", "buildfarm_init")

buildfarm_init()

Optionally, if you want to use the buildfarm docker container image targets, you can add this:

load("@build_buildfarm//:images.bzl", "buildfarm_images")

buildfarm_images()

load("@build_buildfarm//:pip.bzl", "buildfarm_pip")

buildfarm_pip()
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].