Skip to content

Commit

Permalink
Merge pull request #21494 from dotnwat/bazel
Browse files Browse the repository at this point in the history
build: add support for cloud_storage_clients
  • Loading branch information
dotnwat authored Jul 18, 2024
2 parents e160f62 + 272fe1a commit 64ad865
Show file tree
Hide file tree
Showing 5 changed files with 302 additions and 8 deletions.
93 changes: 85 additions & 8 deletions src/v/cloud_roles/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,85 @@
load("//bazel:build.bzl", "redpanda_cc_library")

package(default_visibility = ["//visibility:public"])
package(default_visibility = ["//src/v/cloud_roles:__subpackages__"])

redpanda_cc_library(
name = "logger",
hdrs = [
"include/cloud_roles/logger.h",
],
strip_include_prefix = "include",
deps = [
"//src/v/base",
"@seastar",
],
)

redpanda_cc_library(
name = "types",
srcs = [
"types.cc",
],
hdrs = [
"include/cloud_roles/types.h",
],
strip_include_prefix = "include",
deps = [
"//src/v/base",
"//src/v/bytes:iobuf",
"//src/v/utils:named_type",
"@boost//:beast",
"@seastar",
],
)

redpanda_cc_library(
name = "request_response_helpers",
srcs = [
"request_response_helpers.cc",
],
hdrs = [
"request_response_helpers.h",
],
include_prefix = "cloud_roles",
deps = [
":logger",
":types",
"//src/v/bytes:iostream",
"//src/v/bytes:streambuf",
"//src/v/config",
"//src/v/http",
"//src/v/json",
"@rapidjson",
],
)

redpanda_cc_library(
name = "signature",
srcs = [
"signature.cc",
],
hdrs = [
"signature.h",
],
include_prefix = "cloud_roles",
deps = [
":logger",
":request_response_helpers",
":types",
"//src/v/base",
"//src/v/bytes",
"//src/v/config",
"//src/v/hashing:secure",
"//src/v/http",
"//src/v/ssx:sformat",
"//src/v/utils:base64",
"//src/v/utils:named_type",
"@abseil-cpp//absl/strings",
"@boost//:algorithm",
"@fmt",
"@seastar",
],
)

redpanda_cc_library(
name = "cloud_roles",
Expand All @@ -26,23 +105,21 @@ redpanda_cc_library(
"gcp_refresh_impl.h",
"probe.cc",
"refresh_credentials.cc",
"request_response_helpers.cc",
"request_response_helpers.h",
"signature.cc",
"signature.h",
"types.cc",
],
hdrs = [
"include/cloud_roles/apply_credentials.h",
"include/cloud_roles/logger.h",
"include/cloud_roles/probe.h",
"include/cloud_roles/refresh_credentials.h",
"include/cloud_roles/types.h",
],
# for ada
exclude_layering_check = True,
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
":logger",
":request_response_helpers",
":signature",
":types",
"//src/v/base",
"//src/v/bytes",
"//src/v/bytes:iobuf",
Expand Down
32 changes: 32 additions & 0 deletions src/v/cloud_roles/tests/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
load("//bazel:test.bzl", "redpanda_cc_btest")

redpanda_cc_btest(
name = "signature_test",
timeout = "short",
srcs = [
"signature_test.cc",
],
deps = [
"//src/v/cloud_roles:signature",
"//src/v/http",
"//src/v/test_utils:seastar_boost",
"@abseil-cpp//absl/strings",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "schema_parsing_test",
timeout = "short",
srcs = [
"schema_parsing_tests.cc",
],
deps = [
"//src/v/bytes:streambuf",
"//src/v/cloud_roles:request_response_helpers",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
],
)
63 changes: 63 additions & 0 deletions src/v/cloud_storage_clients/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
load("//bazel:build.bzl", "redpanda_cc_library")

redpanda_cc_library(
name = "cloud_storage_clients",
srcs = [
"abs_client.cc",
"abs_error.cc",
"client_pool.cc",
"client_probe.cc",
"configuration.cc",
"s3_client.cc",
"s3_error.cc",
"util.cc",
"xml_sax_parser.cc",
],
hdrs = [
"abs_client.h",
"abs_error.h",
"client.h",
"client_pool.h",
"client_probe.h",
"configuration.h",
"logger.h",
"s3_client.h",
"s3_error.h",
"types.h",
"util.h",
"xml_sax_parser.h",
],
# for libxml2
exclude_layering_check = True,
include_prefix = "cloud_storage_clients",
visibility = ["//visibility:public"],
deps = [
"//src/v/base",
"//src/v/bytes",
"//src/v/bytes:iobuf",
"//src/v/bytes:iostream",
"//src/v/bytes:streambuf",
"//src/v/cloud_roles",
"//src/v/config",
"//src/v/container:intrusive",
"//src/v/hashing:secure",
"//src/v/http",
"//src/v/json",
"//src/v/metrics",
"//src/v/model",
"//src/v/net",
"//src/v/ssx:future_util",
"//src/v/ssx:sformat",
"//src/v/strings:string_switch",
"//src/v/utils:base64",
"//src/v/utils:functional",
"//src/v/utils:log_hist",
"//src/v/utils:named_type",
"//src/v/utils:stop_signal",
"@boost//:beast",
"@boost//:lexical_cast",
"@boost//:property_tree",
"@libxml2",
"@seastar",
],
)
110 changes: 110 additions & 0 deletions src/v/cloud_storage_clients/tests/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
load("//bazel:test.bzl", "redpanda_cc_btest", "redpanda_cc_gtest")

redpanda_cc_btest(
name = "backend_detection_test",
timeout = "short",
srcs = [
"backend_detection_test.cc",
],
deps = [
"//src/v/cloud_storage_clients",
"//src/v/config",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
],
)

redpanda_cc_btest(
name = "client_pool_test",
timeout = "short",
srcs = [
"client_pool_test.cc",
],
deps = [
"//src/v/base",
"//src/v/cloud_storage_clients",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "s3_client_test",
timeout = "short",
srcs = [
"s3_client_test.cc",
],
deps = [
"//src/v/base",
"//src/v/bytes:iobuf",
"//src/v/bytes:iobuf_parser",
"//src/v/bytes:iostream",
"//src/v/cloud_storage_clients",
"//src/v/hashing:secure",
"//src/v/net",
"//src/v/test_utils:seastar_boost",
"//src/v/utils:base64",
"//src/v/utils:unresolved_address",
"@boost//:algorithm",
"@boost//:beast",
"@boost//:property_tree",
"@boost//:test",
"@seastar",
"@seastar//:testing",
],
)

redpanda_cc_btest(
name = "xml_sax_parser_test",
timeout = "short",
srcs = [
"xml_sax_parser_test.cc",
],
deps = [
"//src/v/cloud_storage_clients",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
],
)

redpanda_cc_btest(
name = "exception_test",
timeout = "short",
srcs = [
"exception_test.cc",
],
deps = [
"//src/v/cloud_storage_clients",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
"@seastar",
],
)

redpanda_cc_btest(
name = "util_test",
timeout = "short",
srcs = [
"util_test.cc",
],
deps = [
"//src/v/cloud_storage_clients",
"//src/v/test_utils:seastar_boost",
"@boost//:test",
],
)

redpanda_cc_gtest(
name = "types_test",
timeout = "short",
srcs = [
"types_test.cc",
],
deps = [
"//src/v/cloud_storage_clients",
"//src/v/config",
"//src/v/test_utils:gtest",
],
)
12 changes: 12 additions & 0 deletions src/v/utils/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ redpanda_cc_library(
],
)

redpanda_cc_library(
name = "stop_signal",
hdrs = [
"stop_signal.h",
],
include_prefix = "utils",
deps = [
"//src/v/base",
"@seastar",
],
)

redpanda_cc_library(
name = "rwlock",
hdrs = [
Expand Down

0 comments on commit 64ad865

Please sign in to comment.