Skip to content

Commit

Permalink
Turn off BuildBuddy integration (#11343)
Browse files Browse the repository at this point in the history
Builds now execute on the github actions workers, using Google Cloud Storage (GCS) as a cache

(cherry picked from commit a6874e3)

# Conflicts:
#	.github/workflows/update-elixir-patches.yaml
#	.github/workflows/update-otp-patches.yaml
#	MODULE.bazel
#	WORKSPACE
#	deps/rabbitmq_peer_discovery_consul/test/system_SUITE_data/consul.hcl
  • Loading branch information
pjk25 authored and mergify[bot] committed Jun 6, 2024
1 parent c4b3daa commit 2c62185
Show file tree
Hide file tree
Showing 14 changed files with 2,953 additions and 384 deletions.
64 changes: 0 additions & 64 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,6 @@ build --test_timeout=7200

build --combined_report=lcov

build:buildbuddy --bes_results_url=https://app.buildbuddy.io/invocation/
build:buildbuddy --bes_backend=grpcs://remote.buildbuddy.io
build:buildbuddy --remote_cache=grpcs://remote.buildbuddy.io
build:buildbuddy --remote_timeout=1200
build:buildbuddy --grpc_keepalive_time=360s
build:buildbuddy --grpc_keepalive_timeout=360s
build:buildbuddy --remote_download_minimal
build:buildbuddy --build_metadata=REPO_URL=https://github.com/rabbitmq/rabbitmq-server.git
build:buildbuddy --experimental_remote_cache_compression
build:buildbuddy --experimental_remote_cache_async
build:buildbuddy --noslim_profile
build:buildbuddy --experimental_profile_include_target_label
build:buildbuddy --experimental_profile_include_primary_output
build:buildbuddy --remote_build_event_upload=minimal
build:buildbuddy --nolegacy_important_outputs

# buildbuddy implies remote cache, so ct_logdir is restored to its default for reproducibility
build:buildbuddy --@rules_erlang//:ct_logdir=

build:rbe --config=buildbuddy

build:rbe --remote_executor=grpcs://remote.buildbuddy.io

build:rbe --strategy=TestRunner=remote,worker,sandboxed,local
build:rbe --jobs=50

build:rbe --crosstool_top=@rbe//cc:toolchain
build:rbe --extra_toolchains=@rbe//config:cc-toolchain

build:rbe --host_platform=//bazel/platforms:erlang_internal_platform

build:rbe --host_cpu=k8
build:rbe --cpu=k8

build:rbe-24 --config=rbe
build:rbe-24 --platforms=//bazel/platforms:erlang_linux_24_platform

build:rbe-25 --config=rbe
build:rbe-25 --platforms=//bazel/platforms:erlang_linux_25_3_platform

build:rbe-25_0 --config=rbe
build:rbe-25_0 --platforms=//bazel/platforms:erlang_linux_25_0_platform

build:rbe-25_1 --config=rbe
build:rbe-25_1 --platforms=//bazel/platforms:erlang_linux_25_1_platform

build:rbe-25_2 --config=rbe
build:rbe-25_2 --platforms=//bazel/platforms:erlang_linux_25_2_platform

build:rbe-25_3 --config=rbe
build:rbe-25_3 --platforms=//bazel/platforms:erlang_linux_25_3_platform

build:rbe-26 --config=rbe
build:rbe-26 --platforms=//bazel/platforms:erlang_linux_26_2_platform

build:rbe-26_1 --config=rbe
build:rbe-26_1 --platforms=//bazel/platforms:erlang_linux_26_1_platform

build:rbe-26_2 --config=rbe
build:rbe-26_2 --platforms=//bazel/platforms:erlang_linux_26_2_platform

# no-op config so that --config=local does not error
build:local --color=auto

# Try importing a user specific .bazelrc
# You can create your own by copying and editing the template-user.bazelrc template:
# cp template-user.bazelrc user.bazelrc
Expand Down
51 changes: 38 additions & 13 deletions .github/workflows/rabbitmq_peer_discovery_aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ jobs:
peer-discovery-aws-integration-test:
name: Integration Test
runs-on: ubuntu-22.04
strategy:
matrix:
otp_version_id:
- 26_2
timeout-minutes: 45
steps:
- name: CHECK IF IMAGE WILL PUSH
Expand All @@ -43,34 +39,63 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }}
timeout-seconds: 3600
polling-seconds: 60
- name: COMPUTE REPO CACHE KEY
if: steps.authorized.outputs.authorized == 'true'
id: repo-cache-key
run: |
echo "value=bazel-repo-cache-${{ hashFiles('MODULE.bazel') }}" | tee -a $GITHUB_OUTPUT
- name: LOAD REPO CACHE
if: steps.authorized.outputs.authorized == 'true'
uses: actions/cache/restore@v4
with:
key: ${{ steps.repo-cache-key.outputs.value }}
path: /home/runner/repo-cache/
- name: CONFIGURE OTP & ELIXIR
if: steps.authorized.outputs.authorized == 'true'
uses: erlef/setup-beam@v1.17
with:
otp-version: 26
elixir-version: 1.15
- name: SETUP ecs-cli
if: steps.authorized.outputs.authorized == 'true'
env:
ECS_CLI_VERSION: 1.21.0
run: |
curl -Lo /usr/local/bin/ecs-cli https://amazon-ecs-cli.s3.amazonaws.com/ecs-cli-linux-amd64-v${ECS_CLI_VERSION} && \
chmod +x /usr/local/bin/ecs-cli && \
ecs-cli --version
- name: AUTHENTICATE TO GOOGLE CLOUD
if: steps.authorized.outputs.authorized == 'true'
uses: google-github-actions/auth@v2.1.2
with:
credentials_json: ${{ secrets.REMOTE_CACHE_CREDENTIALS_JSON }}
- name: CONFIGURE BAZEL
if: steps.authorized.outputs.authorized == 'true'
run: |
if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then
if [ -n "${{ secrets.REMOTE_CACHE_BUCKET_NAME }}" ]; then
cat << EOF >> user.bazelrc
build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }}
build --remote_cache=https://storage.googleapis.com/${{ secrets.REMOTE_CACHE_BUCKET_NAME }}
build --google_default_credentials
EOF
fi
cat << EOF >> user.bazelrc
build:buildbuddy --build_metadata=ROLE=CI
build:buildbuddy --build_metadata=VISIBILITY=PRIVATE
build:buildbuddy --color=yes
build --repository_cache=/home/runner/repo-cache/
build --color=yes
EOF
bazelisk info release
#! - name: Setup tmate session
#! uses: mxschmitt/action-tmate@v3
- name: RUN INTEGRATION TESTS
if: steps.authorized.outputs.authorized == 'true'
run: |
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
sudo ethtool -K eth0 tso off gso off gro off tx off rx off lro off
branch_or_tag="${GITHUB_REF##*/}"
bazelisk test //deps/rabbitmq_peer_discovery_aws:integration_SUITE \
--config=rbe-${{ matrix.otp_version_id }} \
--test_tag_filters=aws \
--build_tests_only \
--test_env AWS_ACCESS_KEY_ID=${{ secrets.CONCOURSE_AWS_ACCESS_KEY_ID }} \
--test_env AWS_SECRET_ACCESS_KEY=${{ secrets.CONCOURSE_AWS_SECRET_ACCESS_KEY }} \
--test_env RABBITMQ_IMAGE="pivotalrabbitmq/rabbitmq:sha-${{ github.sha }}" \
--test_env AWS_ECS_CLUSTER_NAME="rabbitmq-peer-discovery-aws-actions-${branch_or_tag//[._]/-}" \
--test_output=streamed \
--verbose_failures
199 changes: 199 additions & 0 deletions .github/workflows/templates/test-mixed-versions.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
#@ load("@ytt:data", "data")
#@yaml/text-templated-strings

#@ def job_names(plugins):
#@ names = []
#@ for p in plugins:
#@ names.append("test-"+p)
#@ end
#@ return names
#@ end

#@ def sharded_job_names(plugin, shard_count):
#@ names = []
#@ for shard_index in range(0, shard_count):
#@ names.append("test-"+plugin+"-"+str(shard_index))
#@ end
#@ return names
#@ end

---
name: Test Mixed Version Clusters
on:
push:
branches:
- main
- v3.12.x
- v3.11.x
- v3.10.x
- v3.9.x
- v3.8.x
- bump-otp-*
- bump-elixir-*
- bump-rbe-*
- bump-rules_erlang
paths:
- 'deps/**'
- 'scripts/**'
- Makefile
- plugins.mk
- rabbitmq-components.mk
- .bazelrc
- .bazelversion
- BUILD.*
- '*.bzl'
- '*.bazel'
- .github/workflows/test-mixed-versions.yaml
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
ensure-mixed-version-archive:
runs-on: ubuntu-22.04
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
with:
path: primary-umbrella
#! - name: Setup tmate session
#! uses: mxschmitt/action-tmate@v3
- name: CHECK FOR ARCHIVE ON S3
id: check
working-directory: primary-umbrella
run: |
set -u
ARCHIVE_URL="$(grep -Eo 'https://rabbitmq-github-actions.s3.eu-west-1.amazonaws.com.*.tar.xz' bazel/bzlmod/secondary_umbrella.bzl)"
echo "ARCHIVE_URL: ${ARCHIVE_URL}"
curl -LO "${ARCHIVE_URL}"
if xzcat --test package-generic-unix-for-mixed-version-testing-v*.tar.xz; then
exists=true
else
exists=false
fi
echo "exists=${exists}" | tee $GITHUB_ENV
OTP_VERSION_ID=${ARCHIVE_URL#*secondary-umbrellas/rbe-}
OTP_VERSION_ID=${OTP_VERSION_ID%*/package-generic-unix-for-mixed-version-testing-v*.tar.xz}
echo "otp_version_id=${OTP_VERSION_ID}" | tee -a $GITHUB_OUTPUT
VERSION=${ARCHIVE_URL#*package-generic-unix-for-mixed-version-testing-v}
VERSION=${VERSION%*.tar.xz}
echo "version=${VERSION}" | tee -a $GITHUB_OUTPUT
- name: CHECKOUT REPOSITORY (MIXED VERSION)
if: env.exists != 'true'
uses: actions/checkout@v4
with:
ref: v${{ steps.check.outputs.version }}
path: secondary-umbrella
- name: BUILD SECONDARY UMBRELLA ARCHIVE
if: env.exists != 'true'
working-directory: secondary-umbrella
run: |
if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then
cat << EOF >> user.bazelrc
build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }}
EOF
fi
cat << EOF >> user.bazelrc
build:buildbuddy --build_metadata=ROLE=CI
build:buildbuddy --build_metadata=VISIBILITY=PRIVATE
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-secondary-umbrella
build:buildbuddy --color=yes
build:buildbuddy --remote_download_toplevel
EOF
sed -i"_orig" -E "/APP_VERSION/ s/3\.[0-9]+\.[0-9]+/${{ steps.check.outputs.version }}/" rabbitmq.bzl
bazelisk build :package-generic-unix \
--config=rbe-${{ steps.check.outputs.otp_version_id }} \
--test_build \
--verbose_failures
OUTPUT_DIR=${{ github.workspace }}/output
mkdir -p ${OUTPUT_DIR}/rbe-${{ steps.check.outputs.otp_version_id }}
cp \
bazel-bin/package-generic-unix.tar.xz \
${OUTPUT_DIR}/rbe-${{ steps.check.outputs.otp_version_id }}/package-generic-unix-for-mixed-version-testing-v${{ steps.check.outputs.version }}.tar.xz
- name: UPLOAD THE ARCHIVE TO S3
if: env.exists != 'true'
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --acl public-read --follow-symlinks
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
SOURCE_DIR: output
DEST_DIR: secondary-umbrellas

check-workflow:
needs: ensure-mixed-version-archive
runs-on: ubuntu-latest
outputs:
repo_cache_key: ${{ steps.repo-cache-key.outputs.value }}
steps:
- name: CHECKOUT REPOSITORY
uses: actions/checkout@v4
- name: SETUP ERLANG/ELIXIR
uses: erlef/setup-beam@v1
with:
otp-version: 26
elixir-version: 1.15
- name: ENSURE WORKFLOWS ARE UP TO DATE
run: |
mkdir local-bin/
curl -L https://carvel.dev/install.sh | K14SIO_INSTALL_BIN_DIR=local-bin bash
make actions-workflows YTT=$PWD/local-bin/ytt
git diff --exit-code
- name: COMPUTE REPO CACHE KEY
id: repo-cache-key
run: |
echo "value=bazel-repo-cache-${{ hashFiles('MODULE.bazel') }}" | tee -a $GITHUB_OUTPUT
#@ for plugin in data.values.internal_deps:
test-(@= plugin @):
needs: check-workflow
uses: ./.github/workflows/test-plugin-mixed.yaml
with:
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
plugin: #@ plugin
secrets: inherit
#@ end

#@ rabbit_shard_count = 10
#@ for shard_index in range(0, rabbit_shard_count):
test-rabbit-(@= str(shard_index) @):
needs: #@ ["check-workflow"] + job_names(data.values.internal_deps)
uses: ./.github/workflows/test-plugin-mixed.yaml
with:
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
plugin: rabbit
shard_index: #@ shard_index
shard_count: #@ rabbit_shard_count
secrets: inherit
#@ end

#@ for plugin in data.values.tier1_plugins:
test-(@= plugin @):
needs: #@ ["check-workflow"] + sharded_job_names("rabbit", rabbit_shard_count)
uses: ./.github/workflows/test-plugin-mixed.yaml
with:
repo_cache_key: ${{ needs.check-workflow.outputs.repo_cache_key }}
plugin: #@ plugin
secrets: inherit
#@ end

summary-test:
needs: #@ job_names(data.values.internal_deps + data.values.tier1_plugins) + sharded_job_names("rabbit", rabbit_shard_count)
runs-on: ubuntu-latest
steps:
- name: SUMMARY
run: |
cat << 'EOF' | jq -e 'map(.result == "success") | all(.)'
${{ toJson(needs) }}
EOF
Loading

0 comments on commit 2c62185

Please sign in to comment.