-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make rabbitmq-server work with rules_erlang 3
Also rework elixir dependency handling, so we no longer rely on mix to fetch the rabbitmq_cli deps Also: - Specify ra version with a commit rather than a branch - Fixup compilation options for erlang 23 - Add missing ra reference in MODULE.bazel - Add missing flag in oci.yaml - Reduce bazel rbe jobs to try to save memory - Use bazel built erlang for erlang git master tests - Use the same cache for all the workflows but windows - Avoid using `mix local.hex --force` in elixir rules - Fetching seems blocked in CI, and this should reduce hex api usage in all builds, which is always nice - Remove xref and dialyze tags since rules_erlang 3 includes them in the defaults
- Loading branch information
Showing
85 changed files
with
1,527 additions
and
880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ on: | |
workflow_dispatch: | ||
env: | ||
GENERIC_UNIX_ARCHIVE: ${{ github.workspace }}/bazel-bin/package-generic-unix.tar.xz | ||
RABBITMQ_VERSION: ${{ github.sha }} | ||
VERSION: ${{ github.sha }} | ||
RABBITMQ_VERSION: ${{ github.event.pull_request.head.sha || github.sha }} | ||
VERSION: ${{ github.event.pull_request.head.sha || github.sha }} | ||
jobs: | ||
|
||
# This job will build one docker image per supported Erlang major version. | ||
|
@@ -30,43 +30,28 @@ jobs: | |
image_tag_suffix: | ||
- otp-min | ||
- otp-max | ||
#! - otp-rc | ||
include: | ||
- image_tag_suffix: otp-min | ||
skip_otp_verify: false | ||
- image_tag_suffix: otp-max | ||
skip_otp_verify: false | ||
#! - image_tag_suffix: otp-rc | ||
#! skip_otp_verify: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Load version info | ||
id: load-info | ||
run: | | ||
# TODO: de-duplicate the info these files and MODULE.bazel | ||
FILE=packaging/docker-image/otp-versions/${{ matrix.image_tag_suffix }}.yaml | ||
echo "::set-output name=otp::$(yq eval '.otp' $FILE)" | ||
echo "::set-output name=otp_major::$(yq eval '.otp_major' $FILE)" | ||
echo "::set-output name=otp_sha256::$(yq eval '.otp_sha256' $FILE)" | ||
echo "::set-output name=elixir::$(yq eval '.elixir' $FILE)" | ||
- name: Set up Erlang & Elixir | ||
uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{ steps.load-info.outputs.otp }} | ||
elixir-version: ${{ steps.load-info.outputs.elixir }} | ||
version-type: strict | ||
|
||
- name: MOUNT BAZEL CACHE | ||
uses: actions/[email protected] | ||
- name: Mount Bazel Cache | ||
uses: actions/[email protected] | ||
with: | ||
path: "/home/runner/repo-cache/" | ||
key: repo-cache | ||
|
||
- name: CONFIGURE BAZEL | ||
- name: Configure Bazel | ||
run: | | ||
ERLANG_HOME="$(dirname $(dirname $(which erl)))" | ||
ELIXIR_HOME="$(dirname $(dirname $(which iex)))" | ||
if [ -n "${{ secrets.BUILDBUDDY_API_KEY }}" ]; then | ||
cat << EOF >> user.bazelrc | ||
build:buildbuddy --remote_header=x-buildbuddy-api-key=${{ secrets.BUILDBUDDY_API_KEY }} | ||
|
@@ -75,20 +60,29 @@ jobs: | |
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-oci | ||
build:buildbuddy --repository_cache=/home/runner/repo-cache/ | ||
build:buildbuddy --color=yes | ||
build:buildbuddy --disk_cache= | ||
build --@rules_erlang//:erlang_version=${{ steps.load-info.outputs.otp }} | ||
build --@rules_erlang//:erlang_home=${ERLANG_HOME} | ||
build --//:elixir_home=${ELIXIR_HOME} | ||
build:buildbuddy --remote_download_toplevel | ||
EOF | ||
- name: Check for otp & elixir version exact match | ||
run: | | ||
bazelisk build :otp_version --config=rbe-${{ steps.load-info.outputs.otp_major }} | ||
if [ ! "$(cat bazel-bin/otp_version.txt)" == "${{ steps.load-info.outputs.otp }}" ]; then | ||
exit 1 | ||
fi | ||
bazelisk build :elixir_version --config=rbe-${{ steps.load-info.outputs.otp_major }} | ||
if [ ! "$(cat bazel-bin/elixir_version.txt)" == "${{ steps.load-info.outputs.elixir }}" ]; then | ||
exit 1 | ||
fi | ||
- name: Build generic unix package | ||
run: | | ||
sed -i"_orig" -E '/APP_VERSION/ s/3\.[0-9]+\.[0-9]+/${{ github.sha }}/' rabbitmq.bzl | ||
bazelisk build :package-generic-unix | ||
sed -i"_orig" -E '/APP_VERSION/ s/3\.[0-9]+\.[0-9]+/${{ github.event.pull_request.head.sha || github.sha }}/' rabbitmq.bzl | ||
bazelisk build :package-generic-unix \ | ||
--config=rbe-${{ steps.load-info.outputs.otp_major }} | ||
- name: Resolve generic unix package path | ||
run: | | ||
|
@@ -108,7 +102,7 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-${{ github.sha }} | ||
key: ${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx-${{ github.event.pull_request.head.sha || github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ matrix.image_tag_suffix }}-buildx- | ||
|
@@ -131,12 +125,12 @@ jobs: | |
- name: Expand generic-unix-package | ||
working-directory: packaging/docker-image | ||
run: | | ||
xzcat ${GENERIC_UNIX_ARCHIVE} | tar xvf - | ||
xzcat ${{ steps.resolve-artifact-path.outputs.ARTIFACT_PATH }} | tar xvf - | ||
- name: Compute image tags | ||
id: compute-tags | ||
run: | | ||
echo "::set-output name=TAG_1::${{ github.sha }}-${{ matrix.image_tag_suffix }}" | ||
echo "::set-output name=TAG_1::${{ github.event.pull_request.head.sha || github.sha }}-${{ matrix.image_tag_suffix }}" | ||
echo "::set-output name=TAG_2::${GITHUB_REF##*/}-${{ matrix.image_tag_suffix }}" | ||
- name: Build and push | ||
|
@@ -152,8 +146,7 @@ jobs: | |
PGP_KEYSERVER=pgpkeys.eu | ||
OTP_VERSION=${{ steps.load-info.outputs.otp }} | ||
OTP_SHA256=${{ steps.load-info.outputs.otp_sha256 }} | ||
SKIP_OTP_VERIFY=${{ matrix.skip_otp_verify }} | ||
RABBITMQ_BUILD=rabbitmq_server-${{ github.sha }} | ||
RABBITMQ_BUILD=rabbitmq_server-${{ github.event.pull_request.head.sha || github.sha }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,19 +11,6 @@ jobs: | |
steps: | ||
- name: CHECKOUT REPOSITORY | ||
uses: actions/checkout@v3 | ||
- name: UPDATE RBE IMAGE SHA | ||
env: | ||
IMAGE: pivotalrabbitmq/rabbitmq-server-buildenv | ||
TAG: linux-erlang-git-master | ||
run: | | ||
# buildbuddy caches the container image, so we must use a specific sha to ensure | ||
# the latest is used | ||
DIGEST="$(skopeo inspect --format '{{.Digest}}' docker://${IMAGE}:${TAG})" | ||
echo "Will use ${IMAGE}@${DIGEST}" | ||
sudo npm install --global --silent @bazel/buildozer | ||
npx buildozer \ | ||
"dict_set exec_properties container-image:docker://${IMAGE}@${DIGEST}" \ | ||
//:erlang_git_platform | ||
- name: MOUNT BAZEL CACHE | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -39,28 +26,22 @@ jobs: | |
cat << EOF >> user.bazelrc | ||
build:buildbuddy --build_metadata=ROLE=CI | ||
build:buildbuddy --build_metadata=VISIBILITY=PUBLIC | ||
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-erlang-git | ||
build:buildbuddy --repository_cache=/home/runner/repo-cache/ | ||
build:buildbuddy --color=yes | ||
build:buildbuddy --disk_cache= | ||
build:rbe-git --config=rbe | ||
build:rbe-git --crosstool_top=@buildbuddy_toolchain//:toolchain | ||
build:rbe-git --extra_toolchains=@buildbuddy_toolchain//:cc_toolchain | ||
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 --@rules_erlang//:erlang_home=/usr/local/lib/erlang | ||
build:rbe-git --@rules_erlang//:erlang_version=25 | ||
build:rbe --platforms=//bazel/platforms:erlang_git_master_platform | ||
build:rbe --extra_execution_platforms=//bazel/platforms:erlang_git_master_platform | ||
EOF | ||
bazelisk info release | ||
#! - name: Setup tmate session | ||
#! uses: mxschmitt/action-tmate@v3 | ||
- name: RUN TESTS | ||
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 | ||
bazelisk test //... \ | ||
--config=rbe-git \ | ||
--config=rbe \ | ||
--test_tag_filters=-mixed-version-cluster,-exclusive,-aws \ | ||
--verbose_failures |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,9 +29,9 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
erlang_version: | ||
- "23" | ||
erlang_major: | ||
- "24" | ||
#! - "25" | ||
timeout-minutes: 120 | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
|
@@ -51,7 +51,6 @@ jobs: | |
cat << EOF >> user.bazelrc | ||
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:buildbuddy --repository_cache=/home/runner/repo-cache/ | ||
build:buildbuddy --color=yes | ||
build:buildbuddy --disk_cache= | ||
|
@@ -63,17 +62,19 @@ jobs: | |
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 | ||
bazelisk test //... \ | ||
--config=rbe-${{ matrix.erlang_version }} \ | ||
--config=rbe-${{ matrix.erlang_major }} \ | ||
--test_tag_filters=mixed-version-cluster,-exclusive,-aws \ | ||
--verbose_failures | ||
test-exclusive-mixed-versions: | ||
name: Test (Exclusive Tests with Mixed Version Cluster) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
erlang_version: | ||
- "23" | ||
- "24" | ||
include: | ||
- erlang_version: "24" | ||
elixir_version: 1.12.3 | ||
#! - erlang_version: "25" | ||
#! elixir_version: 1.13.4 | ||
timeout-minutes: 60 | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
|
@@ -82,7 +83,7 @@ jobs: | |
uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{ matrix.erlang_version }} | ||
elixir-version: 1.12.3 | ||
elixir-version: ${{ matrix.elixir_version }} | ||
- name: MOUNT BAZEL CACHE | ||
uses: actions/[email protected] | ||
with: | ||
|
@@ -100,14 +101,15 @@ jobs: | |
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-exclusive-${{ matrix.erlang_version }} | ||
build:buildbuddy --repository_cache=/home/runner/repo-cache/ | ||
build:buildbuddy --color=yes | ||
build:buildbuddy --disk_cache= | ||
build --@rules_erlang//:erlang_version=${{ matrix.erlang_version }} | ||
build --@rules_erlang//:erlang_home=${ERLANG_HOME} | ||
build --//:elixir_home=${ELIXIR_HOME} | ||
build --platforms=//bazel/platforms:erlang_external_platform | ||
build --extra_execution_platforms=//bazel/platforms:erlang_external_platform | ||
EOF | ||
#! - name: Setup tmate session | ||
#! uses: mxschmitt/action-tmate@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,11 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
erlang_version: | ||
#! - "23" | ||
- "24" | ||
include: | ||
- erlang_version: "24" | ||
elixir_version: 1.12.3 | ||
- erlang_version: "25" | ||
elixir_version: 1.13.4 | ||
timeout-minutes: 120 | ||
steps: | ||
- name: CHECKOUT REPOSITORY | ||
|
@@ -21,7 +23,7 @@ jobs: | |
uses: erlef/[email protected] | ||
with: | ||
otp-version: ${{ matrix.erlang_version }} | ||
elixir-version: 1.12.3 | ||
elixir-version: ${{ matrix.elixir_version }} | ||
#! - name: MOUNT BAZEL CACHE | ||
#! uses: actions/cache@v1 | ||
#! with: | ||
|
@@ -42,14 +44,16 @@ jobs: | |
build:buildbuddy --build_metadata=ROLE=CI | ||
build:buildbuddy --build_metadata=VISIBILITY=PUBLIC | ||
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-windows-${{ matrix.erlang_version }} | ||
build:buildbuddy --remote_instance_name=buildbuddy-io/buildbuddy/ci-windows | ||
# build:buildbuddy --repository_cache=/home/runner/repo-cache/ | ||
build:buildbuddy --color=yes | ||
build:buildbuddy --disk_cache= | ||
build --@rules_erlang//:erlang_version=${{ matrix.erlang_version }} | ||
build --@rules_erlang//:erlang_home="${ERL_PATH/\/bin\/erl/}" | ||
build --//:elixir_home="${IEX_PATH/\/bin\/iex/}" | ||
build --platforms=//bazel/platforms:erlang_external_platform | ||
build --extra_execution_platforms=//bazel/platforms:erlang_external_platform | ||
EOF | ||
bazelisk info release | ||
|
Oops, something went wrong.