Skip to content

Allow to use Khepri database to store metadata instead of Mnesia #7206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test-mixed-versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ jobs:
matrix:
otp_version_id:
- "25_3"
metadata_store:
- mnesia
- khepri
timeout-minutes: 120
steps:
- name: CHECKOUT REPOSITORY
Expand Down Expand Up @@ -164,6 +167,7 @@ jobs:
sudo ethtool -K eth0 tso off gso off gro off tx off rx off lro off
bazelisk test //... \
--config=rbe-${{ matrix.otp_version_id }} \
--test_env RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} \
--test_tag_filters=mixed-version-cluster,-aws,-docker \
--build_tests_only \
--verbose_failures
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
include:
- erlang_version: "26.1"
elixir_version: "1.15.2"
metadata_store:
- mnesia
- khepri
timeout-minutes: 120
steps:
- name: CHECKOUT REPOSITORY
Expand Down Expand Up @@ -57,6 +60,7 @@ jobs:
run: |
bazelisk test //... ^
--config=buildbuddy ^
--test_env RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} ^
--test_tag_filters=-aws,-docker,-bats,-starts-background-broker,-dialyze ^
--build_tests_only ^
--verbose_failures
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
otp_version_id:
- 25_3
- 26
metadata_store:
- mnesia
- khepri
timeout-minutes: 120
steps:
- name: CHECKOUT REPOSITORY
Expand Down Expand Up @@ -72,6 +75,7 @@ jobs:
sudo ethtool -K eth0 tso off gso off gro off tx off rx off lro off
bazelisk test //... \
--config=rbe-${{ matrix.otp_version_id }} \
--test_env RABBITMQ_METADATA_STORE=${{ matrix.metadata_store }} \
--test_tag_filters=-aws,-docker,-mixed-version-cluster \
--build_tests_only \
--verbose_failures
Expand Down
42 changes: 42 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,13 @@ erlang_package.hex_package(
version = "1.3.3",
)

erlang_package.git_package(
name = "horus",
build_file = "@rabbitmq-server//bazel:BUILD.horus",
commit = "253f9af23e539b7370a5105df19dcbb66762b247",
repository = "rabbitmq/horus",
)

erlang_package.git_package(
name = "jose",
build_file = "@rabbitmq-server//bazel:BUILD.jose",
Expand All @@ -277,6 +284,20 @@ erlang_package.hex_package(
version = "1.4.1",
)

erlang_package.git_package(
name = "khepri",
build_file = "@rabbitmq-server//bazel:BUILD.khepri",
commit = "952a52969eaa97a4327806b4fc062238dc3e6214",
repository = "rabbitmq/khepri",
)

erlang_package.git_package(
name = "khepri_mnesia_migration",
build_file = "@rabbitmq-server//bazel:BUILD.khepri_mnesia_migration",
repository = "rabbitmq/khepri_mnesia_migration",
commit = "ec891800b449f6a8fc975f959447039b3df343ed",
)

erlang_package.hex_package(
name = "thoas",
build_file = "@rabbitmq-server//bazel:BUILD.thoas",
Expand Down Expand Up @@ -305,6 +326,22 @@ erlang_package.hex_package(
version = "0.2.1",
)

erlang_package.hex_package(
name = "ra_alt",
pkg = "ra",
build_file = "@rabbitmq-server//bazel:BUILD.ra",
sha256 = "f4dd317ab4030c0b14453bcf70179130f388dec35f7d59b6c7edcdfa25270397",
version = "2.7.0",
)

erlang_package.hex_package(
name = "seshat_alt",
pkg = "seshat",
build_file = "@rabbitmq-server//bazel:BUILD.seshat",
sha256 = "7cef700f92831dd7cae6a6dd223ccc55ac88ecce0631ee9ab0f2b5fb70e79b90",
version = "0.6.0",
)

erlang_package.hex_package(
name = "ranch",
build_file = "@rabbitmq-server//bazel:BUILD.ranch",
Expand Down Expand Up @@ -370,13 +407,18 @@ use_repo(
"gen_batch_server",
"getopt",
"gun",
"horus",
"jose",
"json",
"khepri",
"khepri_mnesia_migration",
"observer_cli",
"prometheus",
"ra_alt",
"ranch",
"recon",
"redbug",
"seshat_alt",
"stdout_formatter",
"syslog",
"sysmon_handler",
Expand Down
114 changes: 114 additions & 0 deletions bazel/BUILD.horus
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
load("@rules_erlang//:erlang_bytecode2.bzl", "erlang_bytecode", "erlc_opts")
load("@rules_erlang//:erlang_app.bzl", "erlang_app")

erlc_opts(
name = "erlc_opts",
values = select({
"@rules_erlang//:debug_build": [
"+debug_info",
"+warn_export_vars",
"+warnings_as_errors",
],
"//conditions:default": [
"+debug_info",
"+deterministic",
"+warn_export_vars",
"+warnings_as_errors",
],
}),
visibility = [":__subpackages__"],
)

erlang_bytecode(
name = "other_beam",
srcs = [
"src/horus.erl",
"src/horus_cover.erl",
"src/horus_utils.erl",
],
hdrs = [":public_and_private_hdrs"],
app_name = "horus",
dest = "ebin",
erlc_opts = "//:erlc_opts",
)

filegroup(
name = "beam_files",
srcs = [":other_beam"],
)

filegroup(
name = "srcs",
srcs = [
"src/horus.app.src",
"src/horus.erl",
"src/horus_cover.erl",
"src/horus_utils.erl",
],
)

filegroup(
name = "private_hdrs",
srcs = [
"src/horus_error.hrl",
"src/horus_fun.hrl",
],
)

filegroup(
name = "public_hdrs",
srcs = [
"include/horus.hrl",
],
)

filegroup(
name = "priv",
srcs = [
"priv/horus_cover_helper.erl",
],
)

filegroup(
name = "license_files",
srcs = [
"LICENSE-Apache-2.0",
"LICENSE-MPL-2.0",
],
)

filegroup(
name = "public_and_private_hdrs",
srcs = [
":private_hdrs",
":public_hdrs",
],
)

filegroup(
name = "all_srcs",
srcs = [
":public_and_private_hdrs",
":srcs",
],
)

erlang_app(
name = "erlang_app",
srcs = [":all_srcs"],
hdrs = [":public_hdrs"],
app_name = "horus",
beam_files = [":beam_files"],
extra_apps = [
"compiler",
"tools",
],
license_files = [":license_files"],
priv = [":priv"],
)

alias(
name = "horus",
actual = ":erlang_app",
visibility = ["//visibility:public"],
)
Loading