Link Search Menu Expand Document

Developer Information

The recommended solution for deploying a complete dev environment is to use tilt. Follow the installation instructions here. Make sure you can use a local kubernetes cluster by following these steps. If everything is installed correctly, you can go to the root of the repo and run tilt up. Tilt will prompt you to open a web UI and see all the running services.

Below is information for running services directly.

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 eight terminal panes for this. Six for a minimal Redis cluster, one for the Buildfarm server and one for a Buildfarm worker.

  • ./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/config.yml

And your Buildfarm worker:

mkdir /tmp/worker
bazel run //src/main/java/build/buildfarm:buildfarm-shard-worker $PWD/examples/config.yml

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/config.minimal.yml 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

Committing

Please sign your commits and please use pre-commit before committing. This will help you avoid style drift in Java and Yaml files.