1 Star 0 Fork 0

zhenghuanhuan/ray

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.bazel 46.66 KB
一键复制 编辑 原始数据 按行查看 历史
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967
# Bazel build
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html
load("@rules_python//python:defs.bzl", "py_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
load("@com_github_grpc_grpc//bazel:cython_library.bzl", "pyx_library")
load("@com_github_google_flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
load("//bazel:ray.bzl", "COPTS", "PYX_COPTS", "PYX_SRCS", "copy_to_workspace")
config_setting(
name = "msvc-cl",
flag_values = {"@bazel_tools//tools/cpp:compiler": "msvc-cl"},
)
config_setting(
name = "clang-cl",
flag_values = {"@bazel_tools//tools/cpp:compiler": "clang-cl"},
)
config_setting(
name = "opt",
values = {"compilation_mode": "opt"},
)
# === Begin of rpc definitions ===
# GRPC common lib.
cc_library(
name = "grpc_common_lib",
srcs = glob([
"src/ray/rpc/*.cc",
]),
hdrs = glob([
"src/ray/rpc/*.h",
"src/ray/raylet_client/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
"@com_google_protobuf//:protobuf",
],
)
# Node manager gRPC lib.
cc_grpc_library(
name = "node_manager_cc_grpc",
srcs = ["//src/ray/protobuf:node_manager_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:node_manager_cc_proto"],
)
# Node manager server and client.
cc_library(
name = "node_manager_rpc",
srcs = glob([
"src/ray/rpc/node_manager/*.cc",
]),
hdrs = glob([
"src/ray/rpc/node_manager/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":grpc_common_lib",
":node_manager_cc_grpc",
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
],
)
# gcs_service gRPC lib.
cc_grpc_library(
name = "gcs_service_cc_grpc",
srcs = ["//src/ray/protobuf:gcs_service_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:gcs_service_cc_proto"],
)
# gcs rpc server and client.
cc_library(
name = "gcs_service_rpc",
hdrs = glob([
"src/ray/rpc/gcs_server/gcs_rpc_server.h",
"src/ray/rpc/gcs_server/gcs_rpc_client.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs_service_cc_grpc",
":grpc_common_lib",
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
],
)
# Object manager gRPC lib.
cc_grpc_library(
name = "object_manager_cc_grpc",
srcs = ["//src/ray/protobuf:object_manager_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:object_manager_cc_proto"],
)
# Object manager rpc server and client.
cc_library(
name = "object_manager_rpc",
hdrs = glob([
"src/ray/rpc/object_manager/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":grpc_common_lib",
":object_manager_cc_grpc",
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
],
)
# Worker gRPC lib.
cc_grpc_library(
name = "worker_cc_grpc",
srcs = ["//src/ray/protobuf:core_worker_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:worker_cc_proto"],
)
# worker server and client.
cc_library(
name = "worker_rpc",
srcs = glob([
"src/ray/rpc/worker/*.cc",
]),
hdrs = glob([
"src/ray/rpc/worker/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":grpc_common_lib",
":ray_common",
":worker_cc_grpc",
"@boost//:asio",
"@boost//:thread",
"@com_github_grpc_grpc//:grpc++",
],
)
# Metrics Agent gRPC lib.
cc_grpc_library(
name = "reporter_cc_grpc",
srcs = ["//src/ray/protobuf:reporter_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:reporter_cc_proto"],
)
# Metrics Agent client.
cc_library(
name = "reporter_rpc",
hdrs = glob([
"src/ray/rpc/metrics_agent_client.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":grpc_common_lib",
":ray_common",
":reporter_cc_grpc",
"@boost//:asio",
"@boost//:thread",
"@com_github_grpc_grpc//:grpc++",
],
)
# Agent manager.
cc_grpc_library(
name = "agent_manager_cc_grpc",
srcs = ["//src/ray/protobuf:agent_manager_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:agent_manager_cc_proto"],
)
cc_library(
name = "agent_manager_rpc",
hdrs = glob([
"src/ray/rpc/agent_manager/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":agent_manager_cc_grpc",
":grpc_common_lib",
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
],
)
# === End of rpc definitions ===
# === Begin of plasma definitions ===
# TODO(mehrdadn): (How to) support dynamic linking?
PROPAGATED_WINDOWS_DEFINES = ["ARROW_STATIC"]
PLASMA_COPTS = COPTS + select({
"@bazel_tools//src/conditions:windows": [
] + ["-D" + define for define in PROPAGATED_WINDOWS_DEFINES],
"//conditions:default": [
"-DARROW_USE_GLOG",
],
})
PLASMA_LINKOPTS = [] + select({
"@bazel_tools//src/conditions:windows": [
"-DefaultLib:" + "ws2_32.lib",
],
"//conditions:default": [
],
})
cc_library(
name = "plasma_client",
srcs = [
"src/ray/object_manager/plasma/client.cc",
"src/ray/object_manager/plasma/connection.cc",
"src/ray/object_manager/plasma/malloc.cc",
"src/ray/object_manager/plasma/plasma.cc",
"src/ray/object_manager/plasma/protocol.cc",
"src/ray/object_manager/plasma/shared_memory.cc",
] + select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"src/ray/object_manager/plasma/fling.cc",
],
}),
hdrs = [
"src/ray/object_manager/plasma/client.h",
"src/ray/object_manager/plasma/common.h",
"src/ray/object_manager/plasma/compat.h",
"src/ray/object_manager/plasma/connection.h",
"src/ray/object_manager/plasma/malloc.h",
"src/ray/object_manager/plasma/plasma.h",
"src/ray/object_manager/plasma/plasma_generated.h",
"src/ray/object_manager/plasma/protocol.h",
"src/ray/object_manager/plasma/shared_memory.h",
] + select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"src/ray/object_manager/plasma/fling.h",
],
}),
copts = PLASMA_COPTS,
defines = select({
"@bazel_tools//src/conditions:windows": PROPAGATED_WINDOWS_DEFINES,
"//conditions:default": [],
}),
linkopts = PLASMA_LINKOPTS,
strip_include_prefix = "src",
deps = [
":plasma_fbs",
":ray_common",
":ray_util",
"//src/ray/protobuf:common_cc_proto",
"@com_github_google_glog//:glog",
"@msgpack",
],
)
cc_library(
name = "plasma_store_server_lib",
srcs = [
"src/ray/object_manager/plasma/create_request_queue.cc",
"src/ray/object_manager/plasma/dlmalloc.cc",
"src/ray/object_manager/plasma/eviction_policy.cc",
"src/ray/object_manager/plasma/plasma_allocator.cc",
"src/ray/object_manager/plasma/quota_aware_policy.cc",
"src/ray/object_manager/plasma/store.cc",
"src/ray/object_manager/plasma/store_runner.cc",
],
hdrs = [
"src/ray/object_manager/common.h",
"src/ray/object_manager/plasma/create_request_queue.h",
"src/ray/object_manager/plasma/eviction_policy.h",
"src/ray/object_manager/plasma/plasma_allocator.h",
"src/ray/object_manager/plasma/quota_aware_policy.h",
"src/ray/object_manager/plasma/store.h",
"src/ray/object_manager/plasma/store_runner.h",
"src/ray/thirdparty/dlmalloc.c",
],
copts = PLASMA_COPTS,
linkopts = PLASMA_LINKOPTS,
strip_include_prefix = "src",
deps = [
":plasma_client",
"@com_github_google_glog//:glog",
],
)
FLATC_ARGS = [
"--gen-object-api",
"--gen-mutable",
"--scoped-enums",
]
flatbuffer_cc_library(
name = "plasma_fbs",
srcs = ["src/ray/object_manager/plasma/plasma.fbs"],
flatc_args = FLATC_ARGS,
out_prefix = "src/ray/object_manager/plasma/",
)
# === End of plasma definitions ===
cc_library(
name = "ray_common",
srcs = glob(
[
"src/ray/common/**/*.cc",
],
exclude = [
"src/ray/common/**/*_test.cc",
],
),
hdrs = glob(
[
"src/ray/common/**/*.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":node_manager_fbs",
":ray_util",
"//src/ray/protobuf:common_cc_proto",
"//src/ray/protobuf:gcs_cc_proto",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest",
"@msgpack",
],
)
# This header is used to warp some streaming code so we can reduce suspicious
# symbols export.
cc_library(
name = "exported_streaming_internal",
srcs = glob(
[
"src/ray/streaming/streaming.cc",
],
),
hdrs = glob(
[
"src/ray/streaming/streaming.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":core_worker_lib",
],
alwayslink = 1,
)
cc_binary(
name = "raylet",
srcs = ["src/ray/raylet/main.cc"],
copts = COPTS,
visibility = ["//java:__subpackages__"],
deps = [
":ray_util",
":raylet_lib",
"@com_github_gflags_gflags//:gflags",
],
)
cc_library(
name = "gcs_pub_sub_lib",
srcs = glob(
[
"src/ray/gcs/pubsub/gcs_pub_sub.cc",
],
),
hdrs = glob(
[
"src/ray/gcs/pubsub/gcs_pub_sub.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":ray_common",
":redis_client",
],
)
cc_test(
name = "gcs_pub_sub_test",
srcs = ["src/ray/gcs/pubsub/test/gcs_pub_sub_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs_pub_sub_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs_server_lib",
srcs = glob(
[
"src/ray/gcs/gcs_server/*.cc",
],
exclude = [
"src/ray/gcs/gcs_server/gcs_server_main.cc",
"src/ray/gcs/gcs_server/test/*.cc",
],
),
hdrs = glob(
[
"src/ray/gcs/gcs_server/*.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":agent_manager_rpc",
":gcs",
":gcs_pub_sub_lib",
":gcs_service_rpc",
":gcs_table_storage_lib",
":node_manager_rpc",
":raylet_client_lib",
":worker_rpc",
],
)
cc_binary(
name = "gcs_server",
srcs = [
"src/ray/gcs/gcs_server/gcs_server_main.cc",
],
copts = COPTS,
visibility = ["//java:__subpackages__"],
deps = [
":gcs_server_lib",
":stats_lib",
"@com_github_gflags_gflags//:gflags",
],
)
# Ray native pubsub module.
cc_library(
name = "pubsub_lib",
srcs = glob([
"src/ray/pubsub/*.cc",
]),
hdrs = glob([
"src/ray/pubsub/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":ray_common",
":worker_rpc",
"//src/ray/protobuf:common_cc_proto",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/synchronization",
],
)
cc_library(
name = "stats_lib",
srcs = glob(
[
"src/ray/stats/*.cc",
],
exclude = [
"src/ray/stats/*_test.cc",
],
),
hdrs = glob(
[
"src/ray/stats/*.h",
],
),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
deps = [
":ray_util",
":reporter_rpc",
"@com_github_jupp0r_prometheus_cpp//pull",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest",
"@io_opencensus_cpp//opencensus/exporters/stats/prometheus:prometheus_exporter",
"@io_opencensus_cpp//opencensus/exporters/stats/stdout:stdout_exporter",
"@io_opencensus_cpp//opencensus/stats",
"@io_opencensus_cpp//opencensus/tags",
],
)
cc_library(
name = "raylet_lib",
srcs = glob(
[
"src/ray/raylet/**/*.cc",
],
exclude = [
"src/ray/raylet/**/*_test.cc",
"src/ray/raylet/main.cc",
],
),
hdrs = glob(
[
"src/ray/raylet/**/*.h",
"src/ray/core_worker/common.h",
],
),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//streaming:__subpackages__"],
deps = [
":agent_manager_rpc",
":gcs",
":node_manager_fbs",
":node_manager_rpc",
":object_manager",
":plasma_client",
":pubsub_lib",
":ray_common",
":ray_util",
":service_based_gcs_client_lib",
":stats_lib",
":worker_rpc",
"//src/ray/protobuf:common_cc_proto",
"@boost//:asio",
"@boost//:filesystem",
"@boost//:system",
"@com_github_jupp0r_prometheus_cpp//pull",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/memory",
"@com_google_absl//absl/strings",
"@com_google_googletest//:gtest",
"@io_opencensus_cpp//opencensus/exporters/stats/prometheus:prometheus_exporter",
"@io_opencensus_cpp//opencensus/stats",
"@io_opencensus_cpp//opencensus/tags",
],
)
cc_library(
name = "raylet_client_lib",
srcs = glob([
"src/ray/raylet_client/*.cc",
]),
hdrs = glob([
"src/ray/raylet_client/*.h",
]),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//streaming:__subpackages__"],
deps = [
":agent_manager_rpc",
":node_manager_fbs",
":node_manager_rpc",
":ray_common",
":ray_util",
"//src/ray/protobuf:gcs_cc_proto",
"@boost//:asio",
],
)
cc_library(
name = "core_worker_lib",
srcs = glob(
[
"src/ray/core_worker/*.cc",
"src/ray/core_worker/store_provider/*.cc",
"src/ray/core_worker/store_provider/memory_store/*.cc",
"src/ray/core_worker/pubsub/*.cc",
"src/ray/core_worker/transport/*.cc",
"src/ray/rpc/worker/*.cc",
],
exclude = [
"src/ray/core_worker/**/*_test.cc",
"src/ray/core_worker/mock_worker.cc",
],
),
hdrs = glob([
"src/ray/core_worker/*.h",
"src/ray/core_worker/store_provider/*.h",
"src/ray/core_worker/store_provider/memory_store/*.h",
"src/ray/core_worker/pubsub/*.h",
"src/ray/core_worker/transport/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":gcs",
":plasma_client",
":pubsub_lib",
":ray_common",
":ray_util",
":raylet_client_lib",
":service_based_gcs_client_lib",
":stats_lib",
":worker_rpc",
"//src/ray/protobuf:worker_cc_proto",
"@boost//:fiber",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
],
)
cc_library(
name = "mock_worker_lib",
srcs = ["src/ray/core_worker/test/mock_worker.cc"],
hdrs = glob([
"src/ray/core_worker/test/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":core_worker_lib",
],
)
cc_binary(
name = "mock_worker",
copts = COPTS,
deps = [
":mock_worker_lib",
],
)
cc_test(
name = "core_worker_test",
srcs = ["src/ray/core_worker/test/core_worker_test.cc"],
args = [
"$(location raylet)",
"$(location mock_worker)",
"$(location gcs_server)",
"$(location redis-cli)",
"$(location redis-server)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:gcs_server",
"//:libray_redis_module.so",
"//:mock_worker",
"//:raylet",
"//:redis-cli",
"//:redis-server",
],
deps = [
":core_worker_lib",
":gcs",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "memory_store_test",
srcs = ["src/ray/core_worker/test/memory_store_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "direct_actor_transport_test",
srcs = ["src/ray/core_worker/test/direct_actor_transport_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "direct_task_transport_test",
srcs = ["src/ray/core_worker/test/direct_task_transport_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "reference_count_test",
srcs = ["src/ray/core_worker/reference_count_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "object_recovery_manager_test",
srcs = ["src/ray/core_worker/test/object_recovery_manager_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "scheduling_queue_test",
srcs = ["src/ray/core_worker/test/scheduling_queue_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "task_manager_test",
srcs = ["src/ray/core_worker/test/task_manager_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "actor_manager_test",
srcs = ["src/ray/core_worker/test/actor_manager_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "lease_policy_test",
srcs = ["src/ray/core_worker/test/lease_policy_test.cc"],
copts = COPTS,
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_resource_scheduler_test",
srcs = [
"src/ray/raylet/scheduling/cluster_resource_scheduler_test.cc",
],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "scheduling_policy_test",
srcs = [
"src/ray/raylet/scheduling/scheduling_policy_test.cc",
],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_task_manager_test",
srcs = [
"src/ray/raylet/scheduling/cluster_task_manager_test.cc",
],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "local_object_manager_test",
srcs = [
"src/ray/raylet/test/local_object_manager_test.cc",
],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "pull_manager_test",
srcs = [
"src/ray/object_manager/test/pull_manager_test.cc",
],
copts = COPTS,
deps = [
":object_manager",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "push_manager_test",
srcs = [
"src/ray/object_manager/test/push_manager_test.cc",
],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "create_request_queue_test",
srcs = [
"src/ray/object_manager/test/create_request_queue_test.cc",
],
copts = COPTS,
deps = [
":plasma_store_server_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "worker_pool_test",
srcs = ["src/ray/raylet/worker_pool_test.cc"],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "placement_group_resource_manager_test",
srcs = ["src/ray/raylet/placement_group_resource_manager_test.cc"],
copts = COPTS,
deps = [
"gcs_test_util_lib",
"ray_common",
"raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "id_test",
srcs = ["src/ray/common/id_test.cc"],
copts = COPTS,
deps = [
"ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "logging_test",
srcs = ["src/ray/util/logging_test.cc"],
args = ["--gtest_filter=PrintLogTest*"],
copts = COPTS,
deps = [
":ray_util",
"@boost//:asio",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "event_test",
srcs = ["src/ray/util/event_test.cc"],
copts = COPTS,
deps = [
":ray_util",
"@boost//:filesystem",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "filesystem_test",
srcs = ["src/ray/util/filesystem_test.cc"],
copts = COPTS,
deps = [
":ray_util",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "util_test",
srcs = ["src/ray/util/util_test.cc"],
copts = COPTS,
deps = [
":ray_util",
"@boost//:asio",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "sample_test",
srcs = ["src/ray/util/sample_test.cc"],
copts = COPTS,
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "dependency_manager_test",
srcs = ["src/ray/raylet/dependency_manager_test.cc"],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "client_connection_test",
srcs = ["src/ray/common/test/client_connection_test.cc"],
copts = COPTS,
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "publisher_test",
srcs = ["src/ray/pubsub/test/publisher_test.cc"],
copts = COPTS,
deps = [
":pubsub_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "subscriber_test",
srcs = [
"src/ray/pubsub/test/subscriber_test.cc",
],
copts = COPTS,
deps = [
":pubsub_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "signal_test",
srcs = ["src/ray/util/signal_test.cc"],
copts = COPTS,
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "sequencer_test",
srcs = ["src/ray/util/sequencer_test.cc"],
copts = COPTS,
deps = [
":ray_util",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "stats_test",
srcs = ["src/ray/stats/stats_test.cc"],
copts = COPTS,
tags = ["stats"],
deps = [
":stats_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "metric_exporter_client_test",
srcs = ["src/ray/stats/metric_exporter_client_test.cc"],
copts = COPTS,
tags = ["stats"],
deps = [
":stats_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs_test_util_lib",
hdrs = [
"src/ray/gcs/test/gcs_test_util.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":gcs_service_rpc",
],
)
cc_test(
name = "gcs_server_rpc_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_server_rpc_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs_server_test_util",
hdrs = [
"src/ray/gcs/gcs_server/test/gcs_server_test_util.h",
],
copts = COPTS,
strip_include_prefix = "src",
)
cc_test(
name = "gcs_node_manager_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_placement_group_manager_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_placement_group_scheduler_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_actor_scheduler_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_actor_manager_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs_table_storage_lib",
srcs = glob(
[
"src/ray/gcs/gcs_server/gcs_table_storage.cc",
],
),
hdrs = glob(
[
"src/ray/gcs/gcs_server/gcs_table_storage.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":gcs_in_memory_store_client",
":ray_common",
":redis_store_client",
],
)
cc_library(
name = "gcs_table_storage_test_lib",
hdrs = [
"src/ray/gcs/gcs_server/test/gcs_table_storage_test_base.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
"redis_store_client",
],
)
cc_test(
name = "redis_gcs_table_storage_test",
srcs = [
"src/ray/gcs/gcs_server/test/redis_gcs_table_storage_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs_table_storage_lib",
":gcs_table_storage_test_lib",
":gcs_test_util_lib",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "in_memory_gcs_table_storage_test",
srcs = [
"src/ray/gcs/gcs_server/test/in_memory_gcs_table_storage_test.cc",
],
copts = COPTS,
deps = [
":gcs_table_storage_lib",
":gcs_table_storage_test_lib",
":gcs_test_util_lib",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_resource_manager_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_resource_manager_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_resource_scheduler_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_resource_scheduler_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_resource_report_poller_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_resource_report_poller_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "service_based_gcs_client_lib",
srcs = glob(
[
"src/ray/gcs/gcs_client/service_based_*.cc",
],
),
hdrs = glob(
[
"src/ray/gcs/gcs_client/service_based_*.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":gcs_pub_sub_lib",
":gcs_service_rpc",
":redis_store_client",
],
)
cc_library(
name = "global_state_accessor_lib",
srcs = glob(
[
"src/ray/gcs/gcs_client/global_state_accessor.cc",
],
),
hdrs = glob(
[
"src/ray/gcs/gcs_client/global_state_accessor.h",
],
),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":service_based_gcs_client_lib",
],
)
cc_test(
name = "global_state_accessor_test",
srcs = [
"src/ray/gcs/gcs_client/test/global_state_accessor_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
":global_state_accessor_lib",
":service_based_gcs_client_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_server_test",
srcs = [
"src/ray/gcs/gcs_client/test/service_based_gcs_client_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
":service_based_gcs_client_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_object_manager_test",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_object_manager_test.cc",
],
copts = COPTS,
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "object_manager",
srcs = glob([
"src/ray/object_manager/*.cc",
"src/ray/object_manager/notification/*.cc",
]),
hdrs = glob([
"src/ray/object_manager/*.h",
"src/ray/object_manager/notification/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":core_worker_lib",
":gcs",
":object_manager_rpc",
":plasma_store_server_lib",
":ray_common",
":ray_util",
"@boost//:asio",
],
)
cc_library(
name = "platform_shims",
srcs = [] + select({
"@bazel_tools//src/conditions:windows": glob([
"src/shims/windows/**/*.c",
"src/shims/windows/**/*.cc",
"src/shims/windows/**/*.h",
]),
"//conditions:default": [],
}),
hdrs = [] + select({
"@bazel_tools//src/conditions:windows": glob([
"src/shims/windows/**/*.h",
]),
"//conditions:default": [],
}),
copts = COPTS,
strip_include_prefix = select({
"@bazel_tools//src/conditions:windows": "src/shims/windows",
"//conditions:default": "",
}),
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,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":aligned_alloc",
":sha256",
"//src/ray/protobuf:event_cc_proto",
"@boost//:asio",
"@boost//:property_tree",
"@com_github_google_glog//:glog",
"@com_github_spdlog//:spdlog",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)
filegroup(
name = "iwyu_sh",
srcs = ["ci/travis/iwyu.sh"],
)
filegroup(
name = "extra_actions_base_proto",
srcs = [
# TODO: Replace our file with the built-in copy once this issue is resolved:
# https://github.com/bazelbuild/bazel/issues/8738
"thirdparty/protobuf/extra_actions_base.proto",
#"@bazel_tools//src/main/protobuf:extra_actions_base.proto",
],
)
action_listener(
name = "iwyu_cpp",
extra_actions = [":iwyu_action"],
mnemonics = ["CppCompile"],
)
extra_action(
name = "iwyu_action",
cmd = "$(location :iwyu_sh) postbuild $(location @com_google_protobuf//:protoc) $(location :extra_actions_base_proto) --extra_action_file=$(EXTRA_ACTION_FILE) > $(output $(ACTION_ID).iwyu.txt)",
out_templates = [
"$(ACTION_ID).iwyu.txt",
],
tools = [
":extra_actions_base_proto",
":iwyu_sh",
"@com_google_protobuf//:protoc",
],
)
cc_library(
name = "sha256",
srcs = [
"src/ray/thirdparty/sha256.c",
],
hdrs = [
"src/ray/thirdparty/sha256.h",
],
copts = COPTS,
strip_include_prefix = "src",
)
cc_library(
name = "aligned_alloc",
srcs = [
"src/ray/thirdparty/aligned_alloc.c",
],
hdrs = [
"src/ray/thirdparty/aligned_alloc.h",
],
copts = COPTS,
strip_include_prefix = "src",
)
alias(
name = "hiredis",
actual = "@com_github_redis_hiredis//:hiredis",
)
cc_library(
name = "redis_client",
srcs = [
"src/ray/gcs/asio.cc",
"src/ray/gcs/redis_async_context.cc",
"src/ray/gcs/redis_client.cc",
"src/ray/gcs/redis_context.cc",
],
hdrs = [
"src/ray/gcs/asio.h",
"src/ray/gcs/redis_async_context.h",
"src/ray/gcs/redis_client.h",
"src/ray/gcs/redis_context.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":hiredis",
":ray_common",
":ray_util",
":stats_lib",
"@boost//:asio",
],
)
cc_library(
name = "redis_store_client",
srcs = [
"src/ray/gcs/store_client/redis_store_client.cc",
],
hdrs = [
"src/ray/gcs/callback.h",
"src/ray/gcs/store_client/redis_store_client.h",
"src/ray/gcs/store_client/store_client.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
"redis_client",
],
)
cc_library(
name = "gcs_in_memory_store_client",
srcs = [
"src/ray/gcs/store_client/in_memory_store_client.cc",
],
hdrs = [
"src/ray/gcs/callback.h",
"src/ray/gcs/store_client/in_memory_store_client.h",
"src/ray/gcs/store_client/store_client.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":ray_common",
":ray_util",
],
)
cc_library(
name = "store_client_test_lib",
hdrs = [
"src/ray/gcs/store_client/test/store_client_test_base.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
"redis_store_client",
],
)
cc_test(
name = "redis_store_client_test",
srcs = ["src/ray/gcs/store_client/test/redis_store_client_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":redis_store_client",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "in_memory_store_client_test",
srcs = ["src/ray/gcs/store_client/test/in_memory_store_client_test.cc"],
copts = COPTS,
deps = [
":gcs_in_memory_store_client",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs",
srcs = glob(
[
"src/ray/gcs/*.cc",
],
exclude = [
"src/ray/gcs/*_test.cc",
],
),
hdrs = glob([
"src/ray/gcs/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":agent_manager_rpc",
":hiredis",
":node_manager_fbs",
":node_manager_rpc",
":ray_common",
":ray_util",
":stats_lib",
"//src/ray/protobuf:gcs_cc_proto",
"@boost//:asio",
],
)
cc_test(
name = "asio_test",
srcs = ["src/ray/gcs/test/asio_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
"$(location libray_redis_module.so)",
],
copts = COPTS,
data = [
"//:libray_redis_module.so",
"//:redis-cli",
"//:redis-server",
],
deps = [
":gcs",
":ray_util",
"@com_google_googletest//:gtest_main",
],
)
flatbuffer_cc_library(
name = "node_manager_fbs",
srcs = ["src/ray/raylet/format/node_manager.fbs"],
flatc_args = FLATC_ARGS,
out_prefix = "ray/raylet/format/",
)
pyx_library(
name = "_raylet",
srcs = glob([
"python/ray/__init__.py",
"python/ray/_raylet.pxd",
"python/ray/_raylet.pyx",
"python/ray/includes/*.pxd",
"python/ray/includes/*.pxi",
]),
# Export ray ABI symbols, which can then be used by _streaming.so.
# We need to dlopen this lib with RTLD_GLOBAL to use ABI in this
# shared lib, see python/ray/__init__.py.
cc_kwargs = dict(
srcs = PYX_SRCS,
copts = COPTS + PYX_COPTS,
# see https://github.com/tensorflow/tensorflow/blob/r2.1/tensorflow/lite/BUILD#L444
linkopts = select({
"@bazel_tools//src/conditions:darwin": [
"-Wl,-exported_symbols_list,$(location //:src/ray/ray_exported_symbols.lds)",
],
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-Wl,--version-script,$(location //:src/ray/ray_version_script.lds)",
],
}),
linkstatic = 1,
),
deps = [
"//:core_worker_lib",
"//:exported_streaming_internal",
"//:global_state_accessor_lib",
"//:ray_util",
"//:raylet_lib",
"//:src/ray/ray_exported_symbols.lds",
"//:src/ray/ray_version_script.lds",
"//:stats_lib",
"//src/ray/protobuf:serialization_cc_proto",
],
)
pyx_library(
name = "_streaming",
srcs = glob([
"python/ray/streaming/_streaming.pyx",
"python/ray/__init__.py",
"python/ray/_raylet.pxd",
"python/ray/includes/*.pxd",
"python/ray/includes/*.pxi",
"python/ray/streaming/__init__.pxd",
"python/ray/streaming/includes/*.pxd",
"python/ray/streaming/includes/*.pxi",
]),
cc_kwargs = dict(
srcs = PYX_SRCS,
copts = COPTS + PYX_COPTS,
),
deps = [
"//streaming:streaming_lib",
],
)
cc_binary(
name = "libcore_worker_library_java.so",
srcs = glob([
"src/ray/core_worker/lib/java/*.h",
"src/ray/core_worker/lib/java/*.cc",
]),
copts = COPTS,
# Export ray ABI symbols, which can then be used by libstreaming_java.so. see `//:_raylet`
linkopts = select({
"@bazel_tools//src/conditions:darwin": [
"-Wl,-exported_symbols_list,$(location //:src/ray/ray_exported_symbols.lds)",
],
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-Wl,--version-script,$(location //:src/ray/ray_version_script.lds)",
],
}),
linkshared = 1,
linkstatic = 1,
visibility = ["//java:__subpackages__"],
deps = [
"//:core_worker_lib",
"//:exported_streaming_internal",
"//:global_state_accessor_lib",
"//:src/ray/ray_exported_symbols.lds",
"//:src/ray/ray_version_script.lds",
"//:stats_lib",
"@bazel_tools//tools/jdk:jni",
],
)
filegroup(
name = "python_sources",
srcs = glob([
"python/ray/*.py",
"python/ray/autoscaler/*.py",
"python/ray/autoscaler/_private/*.py",
"python/ray/autoscaler/_private/azure/*.json",
"python/ray/autoscaler/aws/defaults.yaml",
"python/ray/autoscaler/azure/defaults.yaml",
"python/ray/autoscaler/gcp/defaults.yaml",
"python/ray/autoscaler/local/defaults.yaml",
"python/ray/cloudpickle/*.py",
"python/ray/core/__init__.py",
"python/ray/core/generated/__init__.py",
"python/ray/core/generated/ray/__init__.py",
"python/ray/core/generated/ray/protocol/__init__.py",
"python/ray/new_dashboard/**/*.py",
"python/ray/experimental/*.py",
"python/ray/util/*.py",
"python/ray/internal/*.py",
"python/ray/workers/default_worker.py",
]),
)
alias(
name = "redis-server",
actual = select({
"@bazel_tools//src/conditions:windows": "@com_github_tporadowski_redis_bin//:redis-server.exe",
"//conditions:default": "@com_github_antirez_redis//:redis-server",
}),
visibility = ["//visibility:public"],
)
alias(
name = "redis-cli",
actual = select({
"@bazel_tools//src/conditions:windows": "@com_github_tporadowski_redis_bin//:redis-cli.exe",
"//conditions:default": "@com_github_antirez_redis//:redis-cli",
}),
visibility = ["//visibility:public"],
)
cc_library(
name = "ray_redis_module",
hdrs = [
"src/ray/gcs/redis_module/redis_string.h",
"src/ray/gcs/redis_module/redismodule.h",
],
copts = COPTS,
strip_include_prefix = "src",
)
cc_binary(
name = "libray_redis_module.so",
srcs = [
"src/ray/gcs/redis_module/ray_redis_module.cc",
],
copts = COPTS,
linkshared = 1,
linkstatic = 1,
visibility = ["//java:__subpackages__"],
deps = [
":ray_common",
":ray_redis_module",
"//src/ray/protobuf:gcs_cc_proto",
],
)
filegroup(
name = "all_py_proto",
srcs = [
"//src/ray/protobuf:agent_manager_py_proto",
"//src/ray/protobuf:common_py_proto",
"//src/ray/protobuf:core_worker_py_proto",
"//src/ray/protobuf:gcs_py_proto",
"//src/ray/protobuf:gcs_service_py_proto",
"//src/ray/protobuf:node_manager_py_proto",
"//src/ray/protobuf:ray_client_py_proto",
"//src/ray/protobuf:reporter_py_proto",
],
)
# This is a dummy test dependency that causes the python tests to be
# re-run if any of these files changes.
py_library(
name = "ray_lib",
srcs = glob(
["python/ray/**/*.py"],
exclude = ["python/ray/tests/*.py"],
),
visibility = ["__subpackages__"],
)
copy_to_workspace(
name = "cp_raylet_so",
srcs = ["python/ray/_raylet.so"],
dstdir = "python/ray",
)
copy_to_workspace(
name = "cp_streaming",
srcs = ["python/ray/streaming/_streaming.so"],
dstdir = "python/ray/streaming",
)
copy_to_workspace(
name = "cp_all_py_proto",
srcs = [":all_py_proto"],
dstdir = "python/ray/core/generated",
)
copy_to_workspace(
name = "cp_redis",
srcs = [
":redis-cli",
":redis-server",
],
dstdir = "python/ray/core/src/ray/thirdparty/redis/src",
)
copy_to_workspace(
name = "cp_libray_redis_module",
srcs = [":libray_redis_module.so"],
dstdir = "python/ray/core/src/ray/gcs/redis_module",
)
copy_to_workspace(
name = "cp_raylet",
srcs = [":raylet"],
dstdir = "python/ray/core/src/ray/raylet",
)
copy_to_workspace(
name = "cp_gcs_server",
srcs = [":gcs_server"],
dstdir = "python/ray/core/src/ray/gcs",
)
genrule(
name = "install_py_proto",
srcs = [
":cp_all_py_proto",
"//streaming:copy_streaming_py_proto",
],
outs = ["install_py_proto.out"],
cmd = """
# NOTE(hchen): Protobuf doesn't allow specifying Python package name. So we use this `sed`
# command to change the import path in the generated file.
# shellcheck disable=SC2006
files=(`ls python/ray/core/generated/*_pb2*.py`)
sed -i -E 's/from src.ray.protobuf/from ./' "$${files[@]}"
sed -i -E 's/from opencensus.proto.metrics.v1 import/from . import/' "$${files[@]}"
sed -i -E 's/from opencensus.proto.resource.v1 import/from . import/' "$${files[@]}"
echo "$${PWD}" > $@
""",
local = 1,
)
genrule(
name = "ray_pkg",
srcs = [
":cp_raylet_so",
":cp_streaming",
":python_sources",
":install_py_proto",
":cp_redis",
":cp_libray_redis_module",
":cp_raylet",
":cp_gcs_server",
],
outs = ["ray_pkg.out"],
cmd = """
if [ "$${OSTYPE-}" = "msys" ]; then
ln -P -f -- python/ray/_raylet.so python/ray/_raylet.pyd
fi
echo "$${PWD}" > $@
""",
local = 1,
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Tinrry/ray.git
git@gitee.com:Tinrry/ray.git
Tinrry
ray
ray
master

搜索帮助