diff --git a/.bazelrc b/.bazelrc index bd77d46..3cfd307 100644 --- a/.bazelrc +++ b/.bazelrc @@ -23,11 +23,12 @@ build:docker --experimental_docker_use_customized_images build:docker --strategy=CppCompile=docker --strategy=CppLink=docker --strategy=CcStrip=docker --strategy=MakeRpm=docker --strategy=MakeDeb=docker build:docker --experimental_docker_privileged -build:remote --bes_results_url=http://localhost:8080/invocation/ -build:remote --bes_backend=grpc://localhost:1985 -build:remote --remote_cache=grpc://localhost:1985 -build:remote --remote_timeout=120 -build:remote --remote_executor=grpc://localhost:1985 +build:bf --bes_results_url=http://localhost:8080/invocation/ +build:bf --bes_backend=grpc://localhost:8980 +build:bf --remote_cache=grpc://localhost:8980 +build:bf --remote_timeout=120 +build:bf --remote_executor=grpc://localhost:8980 +build:bb --remote_upload_local_results build:bb --bes_results_url=https://app.buildbuddy.io/invocation/ build:bb --bes_backend=grpcs://remote.buildbuddy.io diff --git a/README.md b/README.md index 9aef471..a08f4e9 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,10 @@ Emulate remote builds with the experimental docker strategy: ( cd executors; docker buildx bake ) bazel test --config docker //:platform-{hello,tar,deb,rpm}-test-suite -Start a local instance of BuildBuddy with remote execution enabled and your API -Key configured in `~/.bazelrc` -as `build:remote --remote_header=x-buildbuddy-api-key=[REDACTED]`: +Start a local instance of BuildFarm: docker compose up -d - bazel test --config remote //:platform-{hello,tar,deb,rpm}-test-suite + bazel test --config bf //:platform-{hello,tar,deb,rpm}-test-suite Use BuildBuddy Cloud and your API Key configured in `~/.bazelrc` as `build:bb --remote_header=x-buildbuddy-api-key=[REDACTED]`: @@ -118,7 +116,7 @@ What next? Problems... -1. Failures on Ubuntu 23.04/lunar with docker provided by Ubuntu's docker.io package. +1. Failures on Ubuntu 23.04/lunar with docker provided by Ubuntu's docker snap: bazel test --config docker //:platform-{hello,tar,deb,rpm}-test-suite --keep_going @@ -131,7 +129,7 @@ Problems... > sudo: /bin/sudo must be owned by uid 0 and have the setuid bit set > ================================================================================ - and similar for all DEB and RPM tests. Does not happen in GitHub Actions nor remotely. + and similar for all DEB and RPM tests. Does not happen in GitHub Actions nor remotely. 2. Excluding `exec_platforms` from `//:tars` theoretically means it should declare that it is executable on the host: that seems to propagate to being diff --git a/buildfarm.config.yaml b/buildfarm.config.yaml new file mode 100644 index 0000000..d024a0e --- /dev/null +++ b/buildfarm.config.yaml @@ -0,0 +1,10 @@ +backplane: + queues: + - name: "cpu" + properties: + - name: "min-cores" + value: "*" + - name: "max-cores" + value: "*" +worker: + allowBringYourOwnContainer: true \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 016ce0f..73071ed 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,62 +1,40 @@ volumes: - mysql: redis: + +configs: + buildfarm: + file: ./buildfarm.config.yaml + services: - mysql: - image: mariadb:latest - environment: - MYSQL_RANDOM_ROOT_PASSWORD: yes - MYSQL_USER: buildbuddy - MYSQL_PASSWORD: buildbuddy - MYSQL_DATABASE: buildbuddy - volumes: - - mysql:/var/lib/mysql - healthcheck: - test: [CMD-SHELL, "mariadb -u$${MYSQL_USER?} -p$${MYSQL_PASSWORD?} $${MYSQL_DATABASE?}"] - redis: - image: redis:latest + backplane: + image: redis volumes: - redis:/data healthcheck: test: [CMD, redis-cli, ping] - app: + server: depends_on: - mysql: + backplane: condition: service_healthy - redis: - condition: service_healthy - image: gcr.io/flame-public/buildbuddy-app-enterprise:latest + image: bazelbuild/buildfarm-server + configs: + - buildfarm environment: - ENV: onprem + CONFIG_PATH: /buildfarm + REDIS_URI: "redis://backplane:6379" ports: - - 8080:8080 - - 1985:1985 - command: - - "--app.build_buddy_url=http://localhost:8080" - - "--app.events_api_url=grpc://localhost:1985" - - "--app.cache_api_url=grpc://localhost:1985" - - "--app.remote_execution_api_url=grpc://localhost:1985" - - "--app.default_redis_target=redis:6379" - - "--auth.enable_anonymous_usage=true" - - "--auth.enable_self_auth=true" - - "--cache.redis.redis_target=redis:6379" - - "--cache.redis_target=redis:6379" - - "--database.data_source=mysql://buildbuddy:buildbuddy@tcp(mysql)/buildbuddy" - - "--remote_execution.enable_remote_exec=true" - - "--storage.disk.root_directory=/var/cache/buildbuddy" - volumes: - - /var/cache/buildbuddy - executor: + - 8980:8980 + worker: + ports: + - 8981:8981 depends_on: - - app - image: gcr.io/flame-public/buildbuddy-executor-enterprise:latest + - server + image: bazelbuild/buildfarm-worker privileged: true - command: - - "--executor.app_target=grpc://app:1985" - - "--executor.local_cache_size_bytes=5368709120" - - "--executor.docker_socket=/var/run/docker.sock" - - "--executor.root_directory=/var/tmp/buildbuddy" - - "--executor.disable_local_cache=true" + configs: + - buildfarm + environment: + CONFIG_PATH: /buildfarm + REDIS_URI: "redis://backplane:6379" volumes: - - /var/tmp/buildbuddy:/var/tmp/buildbuddy:rw - /var/run/docker.sock:/var/run/docker.sock