1 Star 0 Fork 11

天龙/Ray

forked from Gitee 极速下载/Ray 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
BUILD.bazel 70.91 KB
一键复制 编辑 原始数据 按行查看 历史
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019
# 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",
],
)
# This header is used to warp some internal code so we can reduce suspicious
# symbols export.
cc_library(
name = "exported_internal",
srcs = glob(
[
"src/ray/internal/internal.cc",
],
),
hdrs = glob(
[
"src/ray/internal/internal.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 = [
"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",
],
)
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 = "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",
"//:exported_internal",
"//: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",
"//:exported_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/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: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/zjl_666/Ray.git
git@gitee.com:zjl_666/Ray.git
zjl_666
Ray
Ray
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385