Skip to content

Commit

Permalink
[core][devex] Move ray/util build targets to separate build files (#…
Browse files Browse the repository at this point in the history
…36598)

Signed-off-by: vitsai <victoria@anyscale.com>
  • Loading branch information
vitsai authored Jun 21, 2023
1 parent 4d9e6ba commit 7f6fbf0
Show file tree
Hide file tree
Showing 17 changed files with 216 additions and 209 deletions.
4 changes: 2 additions & 2 deletions .buildkite/pipeline.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
- unset CC CXX && bazel test --config=ci --config=ubsan $(./ci/run/bazel_export_options)
--build_tests_only
--jobs=2
-- //:all -//:core_worker_test -//:logging_test -//:ray_syncer_test
-- //:all -//:core_worker_test -//src/ray/util/tests:logging_test -//:ray_syncer_test

- label: ":cpp: Tests (TSAN)"
conditions: [ "RAY_CI_CORE_CPP_AFFECTED" ]
Expand All @@ -146,7 +146,7 @@
- bazel test --config=ci --config=tsan-clang $(./ci/run/bazel_export_options)
--build_tests_only
--jobs=2
-- //:all -//:core_worker_test -//:event_test -//:gcs_actor_manager_test
-- //:all -//:core_worker_test -//src/ray/util/tests:event_test -//:gcs_actor_manager_test
-//:gcs_placement_group_manager_test -//:gcs_placement_group_scheduler_test
-//:gcs_server_rpc_test -//:gcs_client_test -//:metric_exporter_client_test
-//:stats_test -//:worker_pool_test -//:ray_syncer_test
Expand Down
223 changes: 20 additions & 203 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Bazel build
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html

# ************************** IMPORTANT ***********************
# If a target or file is not found here, then please try searching in /src
# We are in the middle of transitioning to a tree of build files.
# If you would like to help with the move in your PR, please use `git mv` so that the history of the file is retained.

load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_python//python:defs.bzl", "py_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_proto_library", "cc_test")
Expand Down Expand Up @@ -382,7 +387,7 @@ cc_library(
deps = [
":plasma_fbs",
":ray_common",
":ray_util",
"//src/ray/util:util",
"//src/ray/protobuf:common_cc_proto",
"@msgpack",
],
Expand Down Expand Up @@ -487,7 +492,7 @@ cc_library(
deps = [
":node_manager_fbs",
":ray_syncer_cc_grpc",
":ray_util",
"//src/ray/util:util",
":stats_metric",
"//src/ray/protobuf:common_cc_proto",
"//src/ray/protobuf:gcs_cc_proto",
Expand All @@ -511,7 +516,7 @@ cc_binary(
copts = COPTS,
visibility = ["//java:__subpackages__"],
deps = [
":ray_util",
"//src/ray/util:util",
":raylet_lib",
"@com_github_gflags_gflags//:gflags",
],
Expand Down Expand Up @@ -625,7 +630,7 @@ cc_library(
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":ray_util",
"//src/ray/util:util",
"@com_github_jupp0r_prometheus_cpp//pull",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -697,7 +702,7 @@ cc_library(
deps = [
":gcs_client_lib",
":ray_common",
":ray_util",
"//src/ray/util:util",
":stats_lib",
"//src/ray/protobuf:common_cc_proto",
"@boost//:asio",
Expand Down Expand Up @@ -757,7 +762,7 @@ cc_library(
":plasma_client",
":pubsub_lib",
":ray_common",
":ray_util",
"//src/ray/util:util",
":runtime_env_rpc",
":scheduler",
":stats_lib",
Expand Down Expand Up @@ -800,7 +805,7 @@ cc_library(
":node_manager_fbs",
":node_manager_rpc",
":ray_common",
":ray_util",
"//src/ray/util:util",
"//src/ray/protobuf:gcs_cc_proto",
"@boost//:asio",
],
Expand Down Expand Up @@ -834,7 +839,7 @@ cc_library(
":gcs_client_lib",
":plasma_client",
":ray_common",
":ray_util",
"//src/ray/util:util",
":raylet_client_lib",
":stats_lib",
":worker_rpc",
Expand Down Expand Up @@ -1504,128 +1509,6 @@ cc_test(
],
)

cc_test(
name = "logging_test",
size = "small",
srcs = ["src/ray/util/logging_test.cc"],
args = [
"--gtest_filter=PrintLogTest*",
# Disable so we can test terminate handler.
"--gtest_catch_exceptions=0",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@boost//:asio",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "event_test",
size = "small",
srcs = ["src/ray/util/event_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@boost//:range",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "counter_test",
size = "small",
srcs = ["src/ray/util/counter_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "filesystem_test",
size = "small",
srcs = ["src/ray/util/filesystem_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
":ray_util",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "container_util_test",
size = "small",
srcs = ["src/ray/util/container_util_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "util_test",
size = "small",
srcs = ["src/ray/util/util_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@boost//:asio",
"@boost//:process",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "throttler_test",
size = "small",
srcs = ["src/ray/util/throttler_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "exponential_backoff_test",
size = "small",
srcs = ["src/ray/util/exponential_backoff_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "sample_test",
size = "small",
srcs = ["src/ray/util/sample_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "dependency_manager_test",
size = "small",
Expand Down Expand Up @@ -1782,30 +1665,6 @@ cc_test(
],
)

cc_test(
name = "signal_test",
size = "small",
srcs = ["src/ray/util/signal_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "sequencer_test",
size = "small",
srcs = ["src/ray/util/sequencer_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_util",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "stats_test",
size = "small",
Expand Down Expand Up @@ -2409,7 +2268,7 @@ cc_library(
":object_manager_rpc",
":plasma_store_server_lib",
":ray_common",
":ray_util",
"//src/ray/util:util",
"@boost//:asio",
],
)
Expand Down Expand Up @@ -2438,48 +2297,6 @@ cc_library(
visibility = ["//visibility:public"],
)

cc_library(
name = "ray_util",
srcs = glob(
[
"src/ray/util/*.cc",
],
exclude = [
"src/ray/util/*_test.cc",
],
),
hdrs = glob([
"src/ray/util/*.h",
]),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":aligned_alloc",
":sha256",
"//src/ray/protobuf:event_cc_proto",
"@boost//:asio",
"@com_github_spdlog//:spdlog",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/debugging:failure_signal_handler",
"@com_google_absl//absl/debugging:stacktrace",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/random",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
"@nlohmann_json",
],
)

filegroup(
name = "extra_actions_base_proto",
srcs = [
Expand Down Expand Up @@ -2569,7 +2386,7 @@ cc_library(
deps = [
":hiredis",
":ray_common",
":ray_util",
"//src/ray/util:util",
":stats_lib",
"@boost//:asio",
],
Expand Down Expand Up @@ -2608,7 +2425,7 @@ cc_library(
strip_include_prefix = "src",
deps = [
":ray_common",
":ray_util",
"//src/ray/util:util",
],
)

Expand All @@ -2626,7 +2443,7 @@ cc_library(
strip_include_prefix = "src",
deps = [
":ray_common",
":ray_util",
"//src/ray/util:util",
],
)

Expand Down Expand Up @@ -2736,7 +2553,7 @@ cc_library(
":node_manager_fbs",
":node_manager_rpc",
":ray_common",
":ray_util",
"//src/ray/util:util",
":stats_lib",
"//src/ray/protobuf:gcs_cc_proto",
"//src/ray/protobuf:gcs_service_cc_proto",
Expand Down Expand Up @@ -2818,7 +2635,7 @@ cc_test(
tags = ["team:core"],
deps = [
":gcs",
":ray_util",
"//src/ray/util:util",
"@com_google_googletest//:gtest_main",
],
)
Expand Down Expand Up @@ -2861,13 +2678,13 @@ pyx_library(
deps = [
"//:core_worker_lib",
"//:global_state_accessor_lib",
"//:ray_util",
"//:raylet_lib",
"//:redis_client",
"//:src/ray/ray_exported_symbols.lds",
"//:src/ray/ray_version_script.lds",
"//:stats_lib",
"//src/ray/protobuf:serialization_cc_proto",
"//src/ray/util:util",
],
)

Expand Down
2 changes: 1 addition & 1 deletion ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ test_core() {
msys)
args+=(
-//:core_worker_test
-//:event_test
-//src/ray/util/tests:event_test
-//:gcs_server_rpc_test
-//:ray_syncer_test # TODO (iycheng): it's flaky on windows. Add it back once we figure out the cause
-//:gcs_health_check_manager_test
Expand Down
2 changes: 1 addition & 1 deletion cpp/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ cc_library(
"//:core_worker_lib",
"//:global_state_accessor_lib",
"//:ray_common",
"//:ray_util",
"//src/ray/util:util",
"@boost//:callable_traits",
"@boost//:dll",
"@com_google_absl//absl/flags:flag",
Expand Down
Loading

0 comments on commit 7f6fbf0

Please sign in to comment.