diff options
author | Philip Kuryloski <kuryloskip@vmware.com> | 2021-11-12 09:15:39 -0800 |
---|---|---|
committer | Philip Kuryloski <kuryloskip@vmware.com> | 2021-11-14 13:49:45 +0100 |
commit | 92e174bb187c127171a8e2c911ea326f5a8a3470 (patch) | |
tree | 39436ef1df7395e7ed001b400e64c8f3372e3e68 | |
parent | 983afafdeeda936353c2727f0cea0baaac8afa48 (diff) | |
download | rabbitmq-server-git-92e174bb187c127171a8e2c911ea326f5a8a3470.tar.gz |
Use externailzed rbe config in bazeluse-bazel-toolchains-v2
-rw-r--r-- | .bazelrc | 44 | ||||
-rw-r--r-- | .github/workflows/perform-bazel-execution-comparison.yaml | 29 | ||||
-rw-r--r-- | .github/workflows/rabbitmq_peer_discovery_aws.yaml | 10 | ||||
-rw-r--r-- | .github/workflows/test-erlang-git.yaml | 13 | ||||
-rw-r--r-- | .github/workflows/test-mixed-versions.yaml | 4 | ||||
-rw-r--r-- | .github/workflows/test.yaml | 4 | ||||
-rw-r--r-- | .github/workflows/update-rbe-images.yaml | 60 | ||||
-rw-r--r-- | BUILD.bazel | 28 | ||||
-rw-r--r-- | WORKSPACE.bazel | 17 | ||||
-rw-r--r-- | user-template.bazelrc | 4 |
10 files changed, 154 insertions, 59 deletions
@@ -14,38 +14,42 @@ build:rbe --config=buildbuddy build:rbe --remote_executor=grpcs://remote.buildbuddy.io -build:rbe --crosstool_top=@buildbuddy_toolchain//:toolchain -build:rbe --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain -build:rbe --javabase=@buildbuddy_toolchain//:javabase_jdk8 -build:rbe --host_javabase=@buildbuddy_toolchain//:javabase_jdk8 -build:rbe --java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8 -build:rbe --host_java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8 +build:rbe --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:rbe --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:rbe --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 build:rbe --@bazel-erlang//:erlang_home=/usr/lib/erlang build:rbe --//:elixir_home=/usr/local build:rbe --spawn_strategy=remote build:rbe --test_strategy="" -build:rbe --jobs=50 +build:rbe --jobs=100 build:rbe-23 --config=rbe -build:rbe-23 --host_platform=//:erlang_23_platform -build:rbe-23 --platforms=//:erlang_23_platform -build:rbe-23 --extra_execution_platforms=//:erlang_23_platform +build:rbe-23 --host_javabase=@rbe_23//java:jdk +build:rbe-23 --javabase=@rbe_23//java:jdk +build:rbe-23 --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:rbe-23 --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:rbe-23 --crosstool_top=@rbe_23//cc:toolchain +build:rbe-23 --extra_toolchains=@rbe_23//config:cc-toolchain + +build:rbe-23 --host_platform=@rbe_23//config:platform +build:rbe-23 --platforms=@rbe_23//config:platform +build:rbe-23 --extra_execution_platforms=@rbe_23//config:platform + build:rbe-23 --@bazel-erlang//:erlang_version=23 build:rbe-24 --config=rbe -build:rbe-24 --host_platform=//:erlang_24_platform -build:rbe-24 --platforms=//:erlang_24_platform -build:rbe-24 --extra_execution_platforms=//:erlang_24_platform -build:rbe-24 --@bazel-erlang//:erlang_version=24 +build:rbe-24 --host_javabase=@rbe_24//java:jdk +build:rbe-24 --javabase=@rbe_24//java:jdk +build:rbe-24 --crosstool_top=@rbe_24//cc:toolchain +build:rbe-24 --extra_toolchains=@rbe_24//config:cc-toolchain -build:rbe-git --config=rbe -build:rbe-git --host_platform=//:erlang_git_platform -build:rbe-git --platforms=//:erlang_git_platform -build:rbe-git --extra_execution_platforms=//:erlang_git_platform -build:rbe-git --@bazel-erlang//:erlang_home=/usr/local/lib/erlang -build:rbe-git --@bazel-erlang//:erlang_version=25 +build:rbe-24 --host_platform=@rbe_24//config:platform +build:rbe-24 --platforms=@rbe_24//config:platform +build:rbe-24 --extra_execution_platforms=@rbe_24//config:platform + +build:rbe-24 --@bazel-erlang//:erlang_version=24 # Try importing a user specific .bazelrc # You can create your own by copying and editing the template-user.bazelrc template: diff --git a/.github/workflows/perform-bazel-execution-comparison.yaml b/.github/workflows/perform-bazel-execution-comparison.yaml index 4834cd1bf0..bc501571ad 100644 --- a/.github/workflows/perform-bazel-execution-comparison.yaml +++ b/.github/workflows/perform-bazel-execution-comparison.yaml @@ -6,13 +6,17 @@ on: description: 'A bazel label representing the test target' required: true default: '//deps/rabbit:rabbit_stream_queue_SUITE' -env: - ERLANG_MAJOR: "24" - CACHE_NAME: ci-bazel-cache-analysis jobs: run-a: name: Run A runs-on: ubuntu-latest + strategy: + matrix: + erlang_version: + - "24" + include: + - erlang_version: "24" + cache_name: ci-bazel-cache-analysis timeout-minutes: 120 steps: - name: CHECKOUT REPOSITORY @@ -23,12 +27,14 @@ jobs: build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} build:buildbuddy --build_metadata=ROLE=CI - build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${CACHE_NAME} + build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${{ matrix.cache_name }} + + build:rbe --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} EOF - name: RUN TESTS run: | bazelisk test ${{ github.event.inputs.target }} \ - --config=rbe-${ERLANG_MAJOR} \ + --config=rbe_${{ matrix.erlang_version }} \ --execution_log_binary_file=/tmp/exec.log - name: SAVE EXECUTION LOG BINARY uses: actions/upload-artifact@v2-preview @@ -39,6 +45,13 @@ jobs: name: Run B needs: run-a runs-on: ubuntu-latest + strategy: + matrix: + erlang_version: + - "24" + include: + - erlang_version: "24" + cache_name: ci-bazel-cache-analysis timeout-minutes: 120 steps: - name: CHECKOUT REPOSITORY @@ -49,12 +62,14 @@ jobs: build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} build:buildbuddy --build_metadata=ROLE=CI - build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${CACHE_NAME} + build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${{ matrix.cache_name }} + + build:rbe --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} EOF - name: RUN TESTS run: | bazelisk test ${{ github.event.inputs.target }} \ - --config=rbe-${ERLANG_MAJOR} \ + --config=rbe_${{ matrix.erlang_version }} \ --execution_log_binary_file=/tmp/exec.log - name: SAVE EXECUTION LOG BINARY uses: actions/upload-artifact@v2-preview diff --git a/.github/workflows/rabbitmq_peer_discovery_aws.yaml b/.github/workflows/rabbitmq_peer_discovery_aws.yaml index afc8a34be2..b8f177accd 100644 --- a/.github/workflows/rabbitmq_peer_discovery_aws.yaml +++ b/.github/workflows/rabbitmq_peer_discovery_aws.yaml @@ -20,6 +20,7 @@ jobs: include: - image_tag_suffix: otp-max erlang_version: "24" + rbe_default_branch: linux-erlang-24.1 timeout-minutes: 45 steps: - name: CHECKOUT REPOSITORY @@ -31,6 +32,11 @@ jobs: check-name: build-publish-dev (${{ matrix.image_tag_suffix }}) repo-token: ${{ secrets.GITHUB_TOKEN }} wait-interval: 30 # seconds + - name: SELECT ERLANG VERSION + run: | + sudo npm install --global --silent @bazel/buildozer + echo "$(cat WORKSPACE.bazel | npx buildozer 'set branch "${{ matrix.rbe_default_branch }}"' -:rbe_default)" > WORKSPACE.bazel + git diff - name: CONFIGURE BAZEL run: | cat << EOF >> user.bazelrc @@ -39,6 +45,8 @@ jobs: build:buildbuddy --build_metadata=ROLE=CI build:buildbuddy --build_metadata=VISIBILITY=PRIVATE build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-aws-${{ matrix.erlang_version }} + + build:rbe --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} EOF #! - name: Setup tmate session #! uses: mxschmitt/action-tmate@v3 @@ -46,7 +54,7 @@ jobs: run: | branch_or_tag="${GITHUB_REF##*/}" bazelisk test //deps/rabbitmq_peer_discovery_aws:integration_SUITE \ - --config=rbe-${{ matrix.erlang_version }} \ + --config=rbe \ --test_tag_filters=aws \ --build_tests_only \ --test_env AWS_ACCESS_KEY_ID=${{ secrets.CONCOURSE_AWS_ACCESS_KEY_ID }} \ diff --git a/.github/workflows/test-erlang-git.yaml b/.github/workflows/test-erlang-git.yaml index 8a6161ac48..2b05348b84 100644 --- a/.github/workflows/test-erlang-git.yaml +++ b/.github/workflows/test-erlang-git.yaml @@ -32,6 +32,19 @@ jobs: build:buildbuddy --build_metadata=ROLE=CI build:buildbuddy --build_metadata=VISIBILITY=PUBLIC build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-erlang-git + + build:rbe-git --crosstool_top=@buildbuddy_toolchain//:toolchain + build:rbe-git --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain + build:rbe-git --javabase=@buildbuddy_toolchain//:javabase_jdk8 + build:rbe-git --host_javabase=@buildbuddy_toolchain//:javabase_jdk8 + build:rbe-git --java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8 + build:rbe-git --host_java_toolchain=@buildbuddy_toolchain//:toolchain_jdk8 + + build:rbe-git --host_platform=//:erlang_git_platform + build:rbe-git --platforms=//:erlang_git_platform + build:rbe-git --extra_execution_platforms=//:erlang_git_platform + build:rbe-git --@bazel-erlang//:erlang_home=/usr/local/lib/erlang + build:rbe-git --@bazel-erlang//:erlang_version=25 EOF #! - name: Setup tmate session #! uses: mxschmitt/action-tmate@v3 diff --git a/.github/workflows/test-mixed-versions.yaml b/.github/workflows/test-mixed-versions.yaml index db33be643d..13d8202338 100644 --- a/.github/workflows/test-mixed-versions.yaml +++ b/.github/workflows/test-mixed-versions.yaml @@ -43,6 +43,8 @@ jobs: build:buildbuddy --build_metadata=ROLE=CI build:buildbuddy --build_metadata=VISIBILITY=PUBLIC build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${{ matrix.erlang_version }} + + build:rbe --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} EOF #! - name: Setup tmate session #! uses: mxschmitt/action-tmate@v3 @@ -50,7 +52,7 @@ jobs: run: | sudo ethtool -K eth0 tso off gso off gro off tx off rx off lro off bazelisk test //... \ - --config=rbe-${{ matrix.erlang_version }} \ + --config=rbe_${{ matrix.erlang_version }} \ --test_tag_filters=mixed-version-cluster,-exclusive,-aws \ --verbose_failures test-exclusive-mixed-versions: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4558f76f4a..8ab22b6862 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -35,6 +35,8 @@ jobs: build:buildbuddy --build_metadata=ROLE=CI build:buildbuddy --build_metadata=VISIBILITY=PUBLIC build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-${{ matrix.erlang_version }} + + build:rbe --@bazel-erlang//:erlang_version=${{ matrix.erlang_version }} EOF bazelisk info release @@ -44,7 +46,7 @@ jobs: run: | sudo ethtool -K eth0 tso off gso off gro off tx off rx off lro off bazelisk test //... \ - --config=rbe-${{ matrix.erlang_version }} \ + --config=rbe_${{ matrix.erlang_version }} \ --test_tag_filters=-exclusive,-aws,-mixed-version-cluster \ --verbose_failures test-exclusive: diff --git a/.github/workflows/update-rbe-images.yaml b/.github/workflows/update-rbe-images.yaml new file mode 100644 index 0000000000..c2174fedbd --- /dev/null +++ b/.github/workflows/update-rbe-images.yaml @@ -0,0 +1,60 @@ +name: Update Bazel RBE Images +on: + schedule: + - cron: '0 3 * * *' + workflow_dispatch: +jobs: + update-rbe-images: + name: Update Bazel RBE Images + runs-on: ubuntu-latest + strategy: + max-parallel: 1 + matrix: + erlang_version: + - "23.3" + - "24.1" + include: + - erlang_version: "23.3" + short_version: "23" + - erlang_version: "24.1" + short_version: "24" + timeout-minutes: 10 + steps: + - name: CHECKOUT REPOSITORY + uses: actions/checkout@v2.4.0 + with: + path: rabbitmq-server + - name: CHECKOUT rbe-erlang-platform REPOSITORY + uses: actions/checkout@v2.4.0 + with: + path: rbe-erlang-platform + repository: rabbitmq/rbe-erlang-platform + branch: linux-erlang-${{ matrix.erlang_version }} + - name: DETERMINE LATEST COMMIT + id: find-commit + working-directory: rbe-erlang-platform + run: | + echo "::set-output name=SHA::$(git rev-parse HEAD)" + - name: UPDATE rbe-erlang-platform COMMIT + working-directory: rabbitmq-server + run: | + sudo npm install --global --silent @bazel/buildozer + echo "$(cat WORKSPACE.bazel | npx buildozer 'set commit "${{ steps.find-commit.outputs.SHA }}"' -:rbe_${{ matrix.short_version }})" > WORKSPACE.bazel + git diff + - name: CREATE PULL REQUEST + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.REPO_SCOPED_TOKEN }} + committer: GitHub <noreply@github.com> + author: GitHub <noreply@github.com> + title: Adopt latest rabbitmq-server-buildenv:linux-erlang-${{ matrix.erlang_version }} for RBE + path: rabbitmq-server + commit-message: | + Use latest rbe-erlang-platform/linux-erlang-${{ matrix.erlang_version }} + + for remote build execution (RBE) with BuildBuddy + labels: | + backport-v3.9.x + backport-v3.8.x + branch: bump-rbe-${{ matrix.short_version }} + delete-branch: true diff --git a/BUILD.bazel b/BUILD.bazel index 95e4d1fa1c..9ea70fc6e3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -19,34 +19,6 @@ elixir_home( ) platform( - name = "erlang_23_platform", - constraint_values = [ - "@platforms//os:linux", - "@platforms//cpu:x86_64", - "@bazel_tools//tools/cpp:clang", - ], - exec_properties = { - "OSFamily": "Linux", - # linux-erlang-23.3 - "container-image": "docker://pivotalrabbitmq/rabbitmq-server-buildenv@sha256:5de95518e8d5f3724839ad46e450b80d89cb0e7e546872a63b7ce4fd482a696e", - }, -) - -platform( - name = "erlang_24_platform", - constraint_values = [ - "@platforms//os:linux", - "@platforms//cpu:x86_64", - "@bazel_tools//tools/cpp:clang", - ], - exec_properties = { - "OSFamily": "Linux", - # linux-erlang-24.0 - "container-image": "docker://pivotalrabbitmq/rabbitmq-server-buildenv@sha256:52a81330352656180952e9c3f09e510a529cc0ed4fd6bc3b480ad313f2ddc3ae", - }, -) - -platform( name = "erlang_git_platform", constraint_values = [ "@platforms//os:linux", diff --git a/WORKSPACE.bazel b/WORKSPACE.bazel index dbb54fd1f9..fa183dbd5d 100644 --- a/WORKSPACE.bazel +++ b/WORKSPACE.bazel @@ -14,7 +14,22 @@ buildbuddy_deps() load("@io_buildbuddy_buildbuddy_toolchain//:rules.bzl", "buildbuddy") -buildbuddy(name = "buildbuddy_toolchain") +buildbuddy( + name = "buildbuddy_toolchain", + llvm = True, +) + +git_repository( + name = "rbe_23", + commit = "13b3045476b02aaaa2c91030fdaff91e7ab9bced", + remote = "https://github.com/rabbitmq/rbe-erlang-platform.git", +) + +git_repository( + name = "rbe_24", + commit = "41a52ed360537f6794f6e759dd7eec7bbf65445c", + remote = "https://github.com/rabbitmq/rbe-erlang-platform.git", +) http_archive( name = "rules_pkg", diff --git a/user-template.bazelrc b/user-template.bazelrc index 15c514c2a2..f92ee3238a 100644 --- a/user-template.bazelrc +++ b/user-template.bazelrc @@ -11,3 +11,7 @@ build --spawn_strategy=local build --flaky_test_attempts=1 build:buildbuddy --remote_header=x-buildbuddy-api-key=YOUR_API_KEY + +# cross compile for linux (if on macOS) with rbe +build:rbe --host_cpu=k8 +build:rbe --cpu=k8 |