1 Star 0 Fork 11

sunfangyi/Ray

forked from Gitee 极速下载/Ray 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.bazel 71.06 KB
一键复制 编辑 原始数据 按行查看 历史
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021
# Bazel build
# C/C++ documentation: https://docs.bazel.build/versions/master/be/c-cpp.html
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")
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")
package(
default_visibility = ["//visibility:public"],
)
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",
":stats_metric",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
"@com_github_grpc_grpc//:grpc++_reflection",
"@com_github_grpc_grpc//:grpcpp_admin",
"@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_service gRPC lib.
cc_grpc_library(
name = "test_service_cc_grpc",
srcs = ["//src/ray/protobuf:test_service_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:test_service_cc_proto"],
)
# gcs rpc server and client.
cc_library(
name = "gcs_service_rpc",
hdrs = [
"src/ray/rpc/gcs_server/gcs_rpc_client.h",
"src/ray/rpc/gcs_server/gcs_rpc_server.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs_service_cc_grpc",
":grpc_common_lib",
":pubsub_lib",
":ray_common",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
"@com_google_absl//absl/container:btree",
],
)
# 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",
":pubsub_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++",
],
)
# runtime env.
cc_grpc_library(
name = "runtime_env_cc_grpc",
srcs = ["//src/ray/protobuf:runtime_env_agent_proto"],
grpc_only = True,
deps = [
"//src/ray/protobuf:agent_manager_cc_proto",
"//src/ray/protobuf:common_cc_proto",
"//src/ray/protobuf:runtime_env_agent_cc_proto",
],
)
cc_library(
name = "runtime_env_rpc",
hdrs = glob([
"src/ray/rpc/runtime_env/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
deps = [
":grpc_common_lib",
":ray_common",
":runtime_env_cc_grpc",
"@boost//:asio",
"@com_github_grpc_grpc//:grpc++",
],
)
# pubsub.
cc_grpc_library(
name = "pubsub_cc_grpc",
srcs = ["//src/ray/protobuf:pubsub_proto"],
grpc_only = True,
deps = [
"//src/ray/protobuf:common_cc_proto",
"//src/ray/protobuf:gcs_cc_proto",
"//src/ray/protobuf:pubsub_cc_proto",
],
)
cc_library(
name = "pubsub_rpc",
copts = COPTS,
deps = [
"pubsub_cc_grpc",
":grpc_common_lib",
":ray_common",
],
)
# monitor/autoscaler service
cc_grpc_library(
name = "monitor_cc_grpc",
srcs = ["//src/ray/protobuf:monitor_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:monitor_cc_proto"],
)
cc_library(
name = "monitor_rpc",
copts = COPTS,
visibility = ["//visibility:public"],
deps = [
":monitor_cc_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/common.h",
"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",
"@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/get_request_queue.cc",
"src/ray/object_manager/plasma/object_lifecycle_manager.cc",
"src/ray/object_manager/plasma/object_store.cc",
"src/ray/object_manager/plasma/plasma_allocator.cc",
"src/ray/object_manager/plasma/stats_collector.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/allocator.h",
"src/ray/object_manager/plasma/create_request_queue.h",
"src/ray/object_manager/plasma/eviction_policy.h",
"src/ray/object_manager/plasma/get_request_queue.h",
"src/ray/object_manager/plasma/object_lifecycle_manager.h",
"src/ray/object_manager/plasma/object_store.h",
"src/ray/object_manager/plasma/plasma_allocator.h",
"src/ray/object_manager/plasma/stats_collector.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",
":stats_lib",
],
)
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_mock",
hdrs = glob(
["src/mock/**/*.h"],
),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
)
cc_grpc_library(
name = "ray_syncer_cc_grpc",
srcs = ["//src/ray/protobuf:ray_syncer_proto"],
grpc_only = True,
deps = ["//src/ray/protobuf:ray_syncer_cc_proto"],
)
cc_library(
name = "ray_common",
srcs = glob(
[
"src/ray/common/**/*.cc",
],
exclude = [
"src/ray/common/**/*_test.cc",
],
) + [
"src/ray/raylet/scheduling/cluster_resource_data.cc",
"src/ray/raylet/scheduling/fixed_point.cc",
"src/ray/raylet/scheduling/scheduling_ids.cc",
],
hdrs = glob(
[
"src/ray/common/*.h",
"src/ray/common/**/*.h",
],
) + [
"src/ray/raylet/scheduling/cluster_resource_data.h",
"src/ray/raylet/scheduling/fixed_point.h",
"src/ray/raylet/scheduling/scheduling_ids.h",
],
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":node_manager_fbs",
":ray_syncer_cc_grpc",
":ray_util",
":stats_metric",
"//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/random",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest",
"@msgpack",
"@nlohmann_json",
],
)
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 = [
"src/ray/gcs/pubsub/gcs_pub_sub.cc",
],
hdrs = [
"src/ray/gcs/pubsub/gcs_pub_sub.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":gcs_service_rpc",
":pubsub_lib",
":ray_common",
":redis_client",
],
)
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_cc_grpc",
":gcs_service_rpc",
":gcs_table_storage_lib",
":monitor_rpc",
":node_manager_rpc",
":observable_store_client",
":pubsub_lib",
":raylet_client_lib",
":scheduler",
":worker_rpc",
"@boost//:bimap",
"@com_github_grpc_grpc//src/proto/grpc/health/v1:health_proto",
"@com_google_absl//absl/container:btree",
],
)
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 = [
":pubsub_rpc",
"@boost//:any",
"@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_metric",
srcs = [
"src/ray/stats/metric.cc",
"src/ray/stats/metric_defs.cc",
"src/ray/stats/tag_defs.cc",
],
hdrs = [
"src/ray/stats/metric.h",
"src/ray/stats/metric_defs.h",
"src/ray/stats/tag_defs.h",
],
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":ray_util",
"@com_github_jupp0r_prometheus_cpp//pull",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
"@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 = "stats_lib",
srcs = [
"src/ray/stats/metric_exporter.cc",
"src/ray/stats/metric_exporter_client.cc",
],
hdrs = [
"src/ray/stats/metric.h",
"src/ray/stats/metric_exporter.h",
"src/ray/stats/metric_exporter_client.h",
"src/ray/stats/stats.h",
"src/ray/stats/tag_defs.h",
],
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":reporter_rpc",
":stats_metric",
],
)
cc_library(
name = "scheduler",
srcs = glob(
[
"src/ray/raylet/scheduling/**/*.cc",
],
exclude = [
"src/ray/raylet/scheduling/**/*_test.cc",
],
),
hdrs = glob(
[
"src/ray/raylet/scheduling/**/*.h",
"src/ray/core_worker/common.h",
],
),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":gcs_client_lib",
":ray_common",
":ray_util",
":stats_lib",
"//src/ray/protobuf:common_cc_proto",
"@boost//:asio",
"@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/random",
"@com_google_absl//absl/random:bit_gen_ref",
"@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_lib",
srcs = glob(
[
"src/ray/raylet/**/*.cc",
],
exclude = [
"src/ray/raylet/**/*_test.cc",
"src/ray/raylet/scheduling/**/*.cc",
"src/ray/raylet/main.cc",
],
),
hdrs = glob(
[
"src/ray/raylet/**/*.h",
],
exclude = [
"src/ray/raylet/scheduling/**/*.h",
"src/ray/raylet/main.cc",
],
),
copts = COPTS,
linkopts = select({
"@bazel_tools//src/conditions:windows": [
],
"//conditions:default": [
"-lpthread",
],
}),
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":agent_manager_rpc",
":gcs",
":gcs_client_lib",
":node_manager_fbs",
":node_manager_rpc",
":object_manager",
":plasma_client",
":pubsub_lib",
":ray_common",
":ray_util",
":runtime_env_rpc",
":scheduler",
":stats_lib",
":worker_rpc",
"//src/ray/protobuf:common_cc_proto",
"@boost//:asio",
"@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 = ["//visibility:public"],
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/transport/*.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/transport/*.h",
]),
copts = COPTS,
strip_include_prefix = "src",
visibility = ["//visibility:public"],
deps = [
":gcs",
":gcs_client_lib",
":plasma_client",
":ray_common",
":ray_util",
":raylet_client_lib",
":stats_lib",
":worker_rpc",
"//src/ray/protobuf:worker_cc_proto",
"@boost//:circular_buffer",
"@boost//:fiber",
"@com_google_absl//absl/container:btree",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@nlohmann_json",
],
)
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",
size = "small",
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)",
],
copts = COPTS,
data = [
"//:gcs_server",
"//:mock_worker",
"//:raylet",
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":core_worker_lib",
":gcs",
"//src/ray/protobuf:runtime_env_common_cc_proto",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_googletest//:gtest",
],
)
cc_test(
name = "core_worker_resubmit_queue_test",
size = "small",
srcs = ["src/ray/core_worker/test/core_worker_resubmit_queue_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "memory_store_test",
size = "small",
srcs = ["src/ray/core_worker/test/memory_store_test.cc"],
copts = COPTS,
tags = ["team:core"],
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,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "direct_actor_transport_mock_test",
srcs = ["src/ray/core_worker/test/direct_actor_transport_mock_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_function_manager_test",
srcs = ["src/ray/gcs/gcs_server/test/gcs_function_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "dependency_resolver_test",
size = "small",
srcs = ["src/ray/core_worker/test/dependency_resolver_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "direct_task_transport_test",
size = "small",
srcs = ["src/ray/core_worker/test/direct_task_transport_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "direct_task_transport_mock_test",
size = "small",
srcs = ["src/ray/core_worker/test/direct_task_transport_mock_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "reference_count_test",
size = "small",
srcs = ["src/ray/core_worker/test/reference_count_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "object_recovery_manager_test",
size = "small",
srcs = ["src/ray/core_worker/test/object_recovery_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
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,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "concurrency_group_manager_test",
srcs = ["src/ray/core_worker/test/concurrency_group_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "actor_submit_queue_test",
size = "small",
srcs = ["src/ray/core_worker/test/actor_submit_queue_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "task_manager_test",
size = "small",
srcs = ["src/ray/core_worker/test/task_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "task_event_buffer_test",
size = "small",
srcs = ["src/ray/core_worker/test/task_event_buffer_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "actor_creator_test",
size = "small",
srcs = ["src/ray/core_worker/test/actor_creator_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
":gcs_client_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "actor_manager_test",
size = "small",
srcs = ["src/ray/core_worker/test/actor_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "lease_policy_test",
size = "small",
srcs = ["src/ray/core_worker/test/lease_policy_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":core_worker_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "resource_request_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/resource_request_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":scheduler",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_resource_scheduler_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/cluster_resource_scheduler_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_mock",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "local_resource_manager_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/local_resource_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_mock",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_resource_scheduler_2_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/cluster_resource_scheduler_2_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "scheduling_policy_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/policy/scheduling_policy_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "hybrid_scheduling_policy_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/policy/hybrid_scheduling_policy_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":scheduler",
"@com_google_absl//absl/random:mock_distributions",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_task_manager_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/cluster_task_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_mock",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "cluster_resource_manager_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/cluster_resource_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "scheduling_ids_test",
size = "small",
srcs = [
"src/ray/raylet/scheduling/scheduling_ids_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "local_object_manager_test",
size = "small",
srcs = [
"src/ray/raylet/test/local_object_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "pull_manager_test",
size = "small",
srcs = [
"src/ray/object_manager/test/pull_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":object_manager",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "object_buffer_pool_test",
size = "small",
srcs = [
"src/ray/object_manager/test/object_buffer_pool_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":object_manager",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "ownership_based_object_directory_test",
size = "small",
srcs = [
"src/ray/object_manager/test/ownership_based_object_directory_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":object_manager",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "push_manager_test",
size = "small",
srcs = [
"src/ray/object_manager/test/push_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "spilled_object_test",
size = "small",
srcs = [
"src/ray/object_manager/test/spilled_object_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@boost//:endian",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "fallback_allocator_test",
srcs = [
"src/ray/object_manager/plasma/test/fallback_allocator_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "object_store_test",
srcs = [
"src/ray/object_manager/plasma/test/object_store_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_absl//absl/random",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "object_lifecycle_manager_test",
srcs = [
"src/ray/object_manager/plasma/test/object_lifecycle_manager_test.cc",
"src/ray/object_manager/plasma/test/stats_collector_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_absl//absl/random",
"@com_google_absl//absl/strings:str_format",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "eviction_policy_test",
srcs = [
"src/ray/object_manager/plasma/test/eviction_policy_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "create_request_queue_test",
size = "small",
srcs = [
"src/ray/object_manager/test/create_request_queue_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "get_request_queue_test",
size = "small",
srcs = [
"src/ray/object_manager/test/get_request_queue_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":plasma_store_server_lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "worker_pool_test",
size = "small",
srcs = ["src/ray/raylet/worker_pool_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_placement_group_manager_mock_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_placement_group_manager_mock_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "placement_group_resource_manager_test",
size = "small",
srcs = ["src/ray/raylet/placement_group_resource_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
"gcs_test_util_lib",
"ray_common",
"raylet_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "asio_defer_test",
size = "small",
srcs = ["src/ray/common/test/asio_defer_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
"ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "ray_config_test",
size = "small",
srcs = ["src/ray/common/test/ray_config_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
"ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "id_test",
size = "small",
srcs = ["src/ray/common/id_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
"ray_common",
"@com_google_googletest//:gtest_main",
],
)
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",
srcs = ["src/ray/raylet/dependency_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "wait_manager_test",
size = "small",
srcs = ["src/ray/raylet/wait_manager_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "client_connection_test",
size = "small",
srcs = ["src/ray/common/test/client_connection_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "status_test",
size = "small",
srcs = [
"src/ray/common/test/status_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "memory_monitor_test",
size = "small",
srcs = [
"src/ray/common/test/memory_monitor_test.cc",
],
copts = COPTS,
tags = ["team:core"],
target_compatible_with = [
"@platforms//os:linux",
],
deps = [
":ray_common",
"@boost//:filesystem",
"@boost//:thread",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "worker_killing_policy_test",
size = "small",
srcs = [
"src/ray/raylet/worker_killing_policy_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "worker_killing_policy_group_by_owner_test",
size = "small",
srcs = [
"src/ray/raylet/worker_killing_policy_group_by_owner_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "worker_killing_policy_retriable_fifo_test",
size = "small",
srcs = [
"src/ray/raylet/worker_killing_policy_retriable_fifo_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
":raylet_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "pubsub_integration_test",
size = "small",
srcs = ["src/ray/pubsub/test/integration_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":pubsub_cc_grpc",
":pubsub_lib",
"//src/ray/protobuf:pubsub_cc_proto",
"@com_google_absl//absl/synchronization",
"@com_google_absl//absl/time",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "publisher_test",
size = "small",
srcs = ["src/ray/pubsub/test/publisher_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":pubsub_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "subscriber_test",
size = "small",
srcs = [
"src/ray/pubsub/test/subscriber_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":pubsub_lib",
"@com_google_googletest//:gtest_main",
],
)
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",
srcs = ["src/ray/stats/stats_test.cc"],
copts = COPTS,
tags = [
"stats",
"team:core",
],
deps = [
":stats_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "metric_exporter_client_test",
size = "small",
srcs = ["src/ray/stats/metric_exporter_client_test.cc"],
copts = COPTS,
tags = [
"stats",
"team:core",
],
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 = "grpc_server_client_test",
size = "small",
srcs = [
"src/ray/rpc/test/grpc_server_client_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":grpc_common_lib",
":test_service_cc_grpc",
],
)
cc_test(
name = "gcs_server_rpc_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_server_rpc_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_kv_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_kv_manager_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
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",
deps = [
":gcs_client_lib",
],
)
cc_test(
name = "gcs_health_check_manager_test",
size = "medium",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_health_check_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_node_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_node_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_job_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_job_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_task_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_task_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_placement_group_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_placement_group_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_placement_group_scheduler_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_placement_group_scheduler_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_actor_scheduler_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_scheduler_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_actor_scheduler_mock_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_scheduler_mock_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_actor_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_actor_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_worker_manager_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_worker_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_monitor_server_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_monitor_server_test.cc",
],
copts = COPTS,
tags = ["team:serverless"],
deps = [
":gcs_server_lib",
":gcs_server_test_util",
":gcs_test_util_lib",
":ray_mock",
"@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",
":observable_store_client",
":pubsub_lib",
":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",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/redis_gcs_table_storage_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
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",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/in_memory_gcs_table_storage_test.cc",
],
copts = COPTS,
tags = ["team:core"],
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",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_resource_manager_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_resource_report_poller_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/gcs_resource_report_poller_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "grpc_based_resource_broadcaster_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_server/test/grpc_based_resource_broadcaster_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_library(
name = "gcs_client_lib",
srcs = [
"src/ray/gcs/gcs_client/accessor.cc",
"src/ray/gcs/gcs_client/gcs_client.cc",
"src/ray/gcs/gcs_client/usage_stats_client.cc",
],
hdrs = [
"src/ray/gcs/gcs_client/accessor.h",
"src/ray/gcs/gcs_client/gcs_client.h",
"src/ray/gcs/gcs_client/usage_stats_client.h",
],
copts = COPTS,
strip_include_prefix = "src",
deps = [
":gcs",
":gcs_pub_sub_lib",
":gcs_service_rpc",
":pubsub_lib",
":ray_common",
":redis_store_client",
"//src/ray/protobuf:usage_cc_proto",
],
)
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",
visibility = ["//visibility:public"],
deps = [
":gcs_client_lib",
],
)
cc_test(
name = "accessor_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_client/test/accessor_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "global_state_accessor_test",
size = "small",
srcs = [
"src/ray/gcs/gcs_client/test/global_state_accessor_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_server_lib",
":gcs_test_util_lib",
":global_state_accessor_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_client_test",
size = "medium",
srcs = [
"src/ray/gcs/gcs_client/test/gcs_client_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "gcs_client_reconnection_test",
srcs = [
"src/ray/gcs/gcs_client/test/gcs_client_reconnection_test.cc",
],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_server_lib",
":gcs_test_util_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "usage_stats_client_test",
srcs = [
"src/ray/gcs/gcs_client/test/usage_stats_client_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_client_lib",
":gcs_server_lib",
":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,
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 = [
"thirdparty/protobuf/extra_actions_base.proto",
],
)
proto_library(
name = "extra_actions_base_proto_lib",
srcs = ["thirdparty/protobuf/extra_actions_base.proto"],
)
cc_proto_library(
name = "extra_actions_cc_proto_lib",
deps = [":extra_actions_base_proto_lib"],
)
filegroup(
name = "iwyu_sh",
srcs = ["ci/run/iwyu.sh"],
)
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",
"@com_google_absl//absl/strings:str_format",
"@com_google_absl//absl/synchronization",
],
)
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 = "observable_store_client",
srcs = [
"src/ray/gcs/store_client/observable_store_client.cc",
],
hdrs = [
"src/ray/gcs/callback.h",
"src/ray/gcs/store_client/observable_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",
size = "small",
srcs = ["src/ray/gcs/store_client/test/redis_store_client_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
deps = [
":redis_store_client",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "chaos_redis_store_client_test",
size = "small",
srcs = ["src/ray/gcs/store_client/test/redis_store_client_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
env = {"REDIS_CHAOS": "1"},
tags = ["team:core"],
target_compatible_with = [
"@platforms//os:linux",
],
deps = [
":redis_store_client",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "in_memory_store_client_test",
size = "small",
srcs = ["src/ray/gcs/store_client/test/in_memory_store_client_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_in_memory_store_client",
":store_client_test_lib",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "observable_store_client_test",
size = "small",
srcs = ["src/ray/gcs/store_client/test/in_memory_store_client_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs_in_memory_store_client",
":observable_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",
"//src/ray/protobuf:gcs_service_cc_proto",
"@boost//:asio",
],
)
cc_binary(
name = "syncer_service_e2e_test",
srcs = ["src/ray/common/test/syncer_service_e2e_test.cc"],
copts = COPTS,
deps = [
":ray_common",
],
)
cc_test(
name = "ray_syncer_test",
srcs = ["src/ray/common/test/ray_syncer_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":grpc_common_lib",
":ray_common",
":ray_mock",
"@com_google_googletest//:gtest",
],
)
cc_test(
name = "task_spec_test",
srcs = ["src/ray/common/test/task_spec_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
"@com_google_googletest//:gtest",
],
)
cc_test(
name = "bundle_location_index_test",
srcs = [
"src/ray/common/test/bundle_location_index_test.cc",
],
copts = COPTS,
tags = ["team:core"],
deps = [
":ray_common",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "callback_reply_test",
size = "small",
srcs = ["src/ray/gcs/test/callback_reply_test.cc"],
copts = COPTS,
tags = ["team:core"],
deps = [
":gcs",
"@com_google_googletest//:gtest_main",
],
)
cc_test(
name = "asio_test",
size = "small",
srcs = ["src/ray/gcs/test/asio_test.cc"],
args = [
"$(location redis-server)",
"$(location redis-cli)",
],
copts = COPTS,
data = [
"//:redis-cli",
"//:redis-server",
],
tags = ["team:core"],
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",
"//: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",
],
)
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",
"//: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/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"],
)
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:event_py_proto",
"//src/ray/protobuf:gcs_py_proto",
"//src/ray/protobuf:gcs_service_py_proto",
"//src/ray/protobuf:instance_manager_py_proto",
"//src/ray/protobuf:job_agent_py_proto",
"//src/ray/protobuf:monitor_py_proto",
"//src/ray/protobuf:node_manager_py_proto",
"//src/ray/protobuf:ray_client_py_proto",
"//src/ray/protobuf:reporter_py_proto",
"//src/ray/protobuf:runtime_env_agent_py_proto",
"//src/ray/protobuf:runtime_env_common_py_proto",
"//src/ray/protobuf:usage_py_proto",
],
)
filegroup(
name = "serve_py_proto",
srcs = [
"//src/ray/protobuf:serve_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_all_py_proto",
srcs = [":all_py_proto"],
dstdir = "python/ray/core/generated",
)
copy_to_workspace(
name = "cp_serve_py_proto",
srcs = [":serve_py_proto"],
dstdir = "python/ray/serve/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_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",
":cp_serve_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` `ls python/ray/serve/generated/*_pb2*.py`)
sed -i -E 's/from src.ray.protobuf/from ./' "$${files[@]}"
# TODO(sang): Build our own proto instead of creating a new proto for opencensus separately.
# https://github.com/ray-project/ray/issues/31358
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",
":python_sources",
":install_py_proto",
":cp_redis",
":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,
)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/sunfangyi/Ray.git
git@gitee.com:sunfangyi/Ray.git
sunfangyi
Ray
Ray
master

搜索帮助