From 5a36e8e3d83325a5fea6b61b1261f60b092fe846 Mon Sep 17 00:00:00 2001 From: banruo Date: Sun, 3 Dec 2023 04:45:09 +0000 Subject: [PATCH] fix scripts --- eval/policy/hello-acl-receiver/detach.toml | 2 +- experimental/mrpc/Cargo.lock | 34 ++ experimental/mrpc/Cargo.toml | 453 ++++++++++++++------- 3 files changed, 334 insertions(+), 155 deletions(-) diff --git a/eval/policy/hello-acl-receiver/detach.toml b/eval/policy/hello-acl-receiver/detach.toml index d77a7d9a..23f93a0e 100644 --- a/eval/policy/hello-acl-receiver/detach.toml +++ b/eval/policy/hello-acl-receiver/detach.toml @@ -1,4 +1,4 @@ addon_engine = "HelloAclReceiverEngine" tx_channels_replacements = [["MrpcEngine", "TcpRpcAdapterEngine", 0, 0]] -rx_channels_replacements = [] +rx_channels_replacements = [["TcpRpcAdapterEngine", "MrpcEngine", 0, 0]] op = "detach" diff --git a/experimental/mrpc/Cargo.lock b/experimental/mrpc/Cargo.lock index f862caf6..5db7a894 100644 --- a/experimental/mrpc/Cargo.lock +++ b/experimental/mrpc/Cargo.lock @@ -1694,6 +1694,16 @@ dependencies = [ "serde", ] +[[package]] +name = "phoenix-api-policy-genaclserver" +version = "0.1.0" +dependencies = [ + "itertools", + "phoenix-api", + "rand 0.8.5", + "serde", +] + [[package]] name = "phoenix-api-policy-hello-acl" version = "0.1.0" @@ -1975,6 +1985,30 @@ dependencies = [ "toml", ] +[[package]] +name = "phoenix-genaclserver" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "chrono", + "futures", + "itertools", + "minstant", + "mrpc-derive", + "mrpc-marshal", + "nix", + "phoenix-api", + "phoenix-api-policy-genaclserver", + "phoenix_common", + "rand 0.8.5", + "serde", + "serde_json", + "shm", + "thiserror", + "toml", +] + [[package]] name = "phoenix-hello-acl" version = "0.1.0" diff --git a/experimental/mrpc/Cargo.toml b/experimental/mrpc/Cargo.toml index 57904404..4b5a4d45 100644 --- a/experimental/mrpc/Cargo.toml +++ b/experimental/mrpc/Cargo.toml @@ -3,164 +3,167 @@ name = "mrpc" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [features] -timing = ["dep:minstant"] - -[dependencies] -phoenix-api-mrpc.workspace = true - -phoenix-api = { workspace = true, features = ["mrpc"] } -ipc = { workspace = true, features = ["customer"] } -shm = { workspace = true, features = ["mrpc"] } -mmap.workspace = true -phoenix-syscalls.workspace = true -shmalloc.workspace = true - -minstant = { workspace = true, optional = true } -thiserror.workspace = true -uuid.workspace = true -libc.workspace = true -fnv.workspace = true -memfd.workspace = true -lazy_static.workspace = true -tracing.workspace = true -dashmap.workspace = true -async-executor.workspace = true -arrayvec.workspace = true -async-trait.workspace = true -log.workspace = true -futures.workspace = true -serde_json.workspace = true -libnuma.workspace = true -slab.workspace = true -spin.workspace = true +timing = [ + "dep:minstant", +] + +[dependencies.phoenix-api-mrpc] +workspace = true + +[dependencies.phoenix-api] +workspace = true +features = [ + "mrpc", +] + +[dependencies.ipc] +workspace = true +features = [ + "customer", +] + +[dependencies.shm] +workspace = true +features = [ + "mrpc", +] + +[dependencies.mmap] +workspace = true + +[dependencies.phoenix-syscalls] +workspace = true + +[dependencies.shmalloc] +workspace = true + +[dependencies.minstant] +workspace = true +optional = true + +[dependencies.thiserror] +workspace = true + +[dependencies.uuid] +workspace = true + +[dependencies.libc] +workspace = true + +[dependencies.fnv] +workspace = true + +[dependencies.memfd] +workspace = true + +[dependencies.lazy_static] +workspace = true + +[dependencies.tracing] +workspace = true + +[dependencies.dashmap] +workspace = true + +[dependencies.async-executor] +workspace = true + +[dependencies.arrayvec] +workspace = true + +[dependencies.async-trait] +workspace = true + +[dependencies.log] +workspace = true + +[dependencies.futures] +workspace = true + +[dependencies.serde_json] +workspace = true + +[dependencies.libnuma] +workspace = true + +[dependencies.slab] +workspace = true + +[dependencies.spin] +workspace = true [workspace] members = [ - # mrpc user-land libraries - "mrpc-build", - "mrpc-derive", - "mrpc-marshal", - # extension to phoenix-api - "phoenix-api/mrpc", - "phoenix-api/mrpclb", - "phoenix-api/rpc_adapter", - "phoenix-api/tcp_rpc_adapter", - "phoenix-api/load_balancer", - "phoenix-api/policy/null", - "phoenix-api/policy/ratelimit", - "phoenix-api/policy/ratelimit-drop", - "phoenix-api/policy/qos", - "phoenix-api/policy/hotel-acl", - "phoenix-api/policy/logging", - "phoenix-api/policy/hello-acl-receiver", - "phoenix-api/policy/hello-acl-sender", - "phoenix-api/policy/hello-acl", - "phoenix-api/policy/nofile-logging", - "phoenix-api/policy/fault", - "phoenix-api/policy/fault2", - "phoenix-api/policy/delay", - "phoenix-api/policy/admission-control", - "phoenix-api/policy/metrics", - "phoenix-api/policy/mutation", - "phoenix-api/policy/fault-server", - "phoenix-api/policy/logging-server", - "phoenix-api/policy/metrics-server", - "phoenix-api/policy/mutation-server", - "phoenix-api/policy/ratelimit-drop-server", - # the phoenix plugins - "plugin/mrpc", - "plugin/mrpclb", - "plugin/rpc_adapter", - "plugin/tcp_rpc_adapter", - "plugin/load_balancer", - # TODO(cjr): Add them back - "plugin/policy/null", - "plugin/policy/ratelimit", - "plugin/policy/ratelimit-drop", - "plugin/policy/qos", - "plugin/policy/logging", - "plugin/policy/hotel-acl", - "plugin/policy/hello-acl-receiver", - "plugin/policy/hello-acl-sender", - "plugin/policy/hello-acl", - "plugin/policy/nofile-logging", - "plugin/policy/fault", - "plugin/policy/fault2", - "plugin/policy/delay", - "plugin/policy/admission-control", - "plugin/policy/metrics", - "plugin/policy/mutation", - "plugin/policy/fault-server", - "plugin/policy/logging-server", - "plugin/policy/metrics-server", - "plugin/policy/mutation-server", - "plugin/policy/ratelimit-drop-server", - # examples - "examples/rpc_echo", - "examples/rpc_bench", - "examples/rpc_bench_plus", - "examples/masstree_analytics", - "examples/hotel_reservation", - "examples/load_balancer", - # "examples/hotel_microservices", + "mrpc-build", + "mrpc-derive", + "mrpc-marshal", + "phoenix-api/mrpc", + "phoenix-api/mrpclb", + "phoenix-api/rpc_adapter", + "phoenix-api/tcp_rpc_adapter", + "phoenix-api/load_balancer", + "phoenix-api/policy/null", + "phoenix-api/policy/ratelimit", + "phoenix-api/policy/ratelimit-drop", + "phoenix-api/policy/qos", + "phoenix-api/policy/hotel-acl", + "phoenix-api/policy/logging", + "phoenix-api/policy/hello-acl-receiver", + "phoenix-api/policy/hello-acl-sender", + "phoenix-api/policy/hello-acl", + "phoenix-api/policy/nofile-logging", + "phoenix-api/policy/fault", + "phoenix-api/policy/fault2", + "phoenix-api/policy/delay", + "phoenix-api/policy/admission-control", + "phoenix-api/policy/metrics", + "phoenix-api/policy/mutation", + "phoenix-api/policy/fault-server", + "phoenix-api/policy/logging-server", + "phoenix-api/policy/metrics-server", + "phoenix-api/policy/mutation-server", + "phoenix-api/policy/ratelimit-drop-server", + "plugin/mrpc", + "plugin/mrpclb", + "plugin/rpc_adapter", + "plugin/tcp_rpc_adapter", + "plugin/load_balancer", + "plugin/policy/null", + "plugin/policy/ratelimit", + "plugin/policy/ratelimit-drop", + "plugin/policy/qos", + "plugin/policy/logging", + "plugin/policy/hotel-acl", + "plugin/policy/hello-acl-receiver", + "plugin/policy/hello-acl-sender", + "plugin/policy/hello-acl", + "plugin/policy/nofile-logging", + "plugin/policy/fault", + "plugin/policy/fault2", + "plugin/policy/delay", + "plugin/policy/admission-control", + "plugin/policy/metrics", + "plugin/policy/mutation", + "plugin/policy/fault-server", + "plugin/policy/logging-server", + "plugin/policy/metrics-server", + "plugin/policy/mutation-server", + "plugin/policy/ratelimit-drop-server", + "examples/rpc_echo", + "examples/rpc_bench", + "examples/rpc_bench_plus", + "examples/masstree_analytics", + "examples/hotel_reservation", + "examples/load_balancer", + "generated/api/genaclserver", + "generated/plugin/genaclserver", +] +exclude = [ + "3rdparty/prost", ] -exclude = ["3rdparty/prost"] - [workspace.dependencies] -mrpc = { path = "." } -phoenix-api-mrpc = { path = "phoenix-api/mrpc" } -phoenix-api-mrpclb = { path = "phoenix-api/mrpclb" } -phoenix-api-tcp-rpc-adapter = { path = "phoenix-api/tcp_rpc_adapter" } -phoenix-api-rpc-adapter = { path = "phoenix-api/rpc_adapter" } -phoenix-api-load-balancer = { path = "phoenix-api/load_balancer" } -phoenix-api-policy-null = { path = "phoenix-api/policy/null" } -phoenix-api-policy-ratelimit = { path = "phoenix-api/policy/ratelimit" } -phoenix-api-policy-ratelimit-drop = { path = "phoenix-api/policy/ratelimit-drop" } -phoenix-api-policy-qos = { path = "phoenix-api/policy/qos" } -phoenix-api-policy-hotel-acl = { path = "phoenix-api/policy/hotel-acl" } -phoenix-api-policy-logging = { path = "phoenix-api/policy/logging" } -phoenix-api-policy-hello-acl-receiver = { path = "phoenix-api/policy/hello-acl-receiver" } -phoenix-api-policy-hello-acl-sender = { path = "phoenix-api/policy/hello-acl-sender" } -phoenix-api-policy-hello-acl = { path = "phoenix-api/policy/hello-acl" } -phoenix-api-policy-nofile-logging = { path = "phoenix-api/policy/nofile-logging" } -phoenix-api-policy-fault = { path = "phoenix-api/policy/fault" } -phoenix-api-policy-fault2 = { path = "phoenix-api/policy/fault2" } -phoenix-api-policy-delay = { path = "phoenix-api/policy/delay" } -phoenix-api-policy-admission-control = { path = "phoenix-api/policy/admission-control" } -phoenix-api-policy-metrics = { path = "phoenix-api/policy/metrics" } -phoenix-api-policy-mutation = { path = "phoenix-api/policy/mutation" } -phoenix-api-policy-fault-server = { path = "phoenix-api/policy/fault-server" } -phoenix-api-policy-logging-server = { path = "phoenix-api/policy/logging-server" } -phoenix-api-policy-metrics-server = { path = "phoenix-api/policy/metrics-server" } -phoenix-api-policy-mutation-server = { path = "phoenix-api/policy/mutation-server" } -phoenix-api-policy-ratelimit-drop-server = { path = "phoenix-api/policy/ratelimit-drop-server" } - - -mrpc-build = { path = "mrpc-build" } -mrpc-derive = { path = "mrpc-derive" } -mrpc-marshal = { path = "mrpc-marshal" } -prost = { path = "3rdparty/prost" } -prost-build = { path = "3rdparty/prost/prost-build" } -phoenix-mrpc = { path = "plugin/mrpc" } -phoenix-mrpclb = { path = "plugin/mrpclb" } - -phoenix-syscalls = { path = "../../src/phoenix-syscalls" } -phoenix-api = { path = "../../src/phoenix-api" } -ipc = { path = "../../src/ipc" } -mmap = { path = "../../src/mmap" } -rdma = { path = "../../src/rdma" } -shm = { path = "../../src/shm" } -shmalloc = { path = "../../src/shm/shmalloc" } -phoenix_common = { path = "../../src/phoenix_common" } -transport-rdma = { path = "../../src/plugin/transport-rdma", package = "phoenix-transport-rdma" } -transport-tcp = { path = "../../src/plugin/transport-tcp", package = "phoenix-transport-tcp" } -phoenix-salloc = { path = "../../src/plugin/salloc", package = "phoenix-salloc" } -utils = { path = "../../src/utils" } - thiserror = "1.0.31" uuid = "0.8.2" libc = "0.2.103" @@ -181,7 +184,7 @@ futures = "0.3.23" libnuma = "0.0.4" spin = "0.9.3" static_assertions = "1.1.0" -tokio = "1.18.2" # only sync is enabled +tokio = "1.18.2" anyhow = "1.0.58" itertools = "0.10.3" crc32fast = "1.3.2" @@ -192,13 +195,11 @@ proc-macro2 = "1.0.40" md5 = "0.7.0" prettyplease = "0.1.15" toml = "0.5.8" - libloading = "0.7.3" bitvec = "1.0.1" bincode = "1.3.3" socket2 = "0.4.7" slab = "0.4.7" - smol = "1.2.5" structopt = "0.3.23" tracing-subscriber = "0.3" @@ -214,5 +215,149 @@ arc-swap = "1.5.0" crossbeam-utils = "0.8.12" rand = "0.8" +[workspace.dependencies.mrpc] +path = "." + +[workspace.dependencies.phoenix-api-mrpc] +path = "phoenix-api/mrpc" + +[workspace.dependencies.phoenix-api-mrpclb] +path = "phoenix-api/mrpclb" + +[workspace.dependencies.phoenix-api-tcp-rpc-adapter] +path = "phoenix-api/tcp_rpc_adapter" + +[workspace.dependencies.phoenix-api-rpc-adapter] +path = "phoenix-api/rpc_adapter" + +[workspace.dependencies.phoenix-api-load-balancer] +path = "phoenix-api/load_balancer" + +[workspace.dependencies.phoenix-api-policy-null] +path = "phoenix-api/policy/null" + +[workspace.dependencies.phoenix-api-policy-ratelimit] +path = "phoenix-api/policy/ratelimit" + +[workspace.dependencies.phoenix-api-policy-ratelimit-drop] +path = "phoenix-api/policy/ratelimit-drop" + +[workspace.dependencies.phoenix-api-policy-qos] +path = "phoenix-api/policy/qos" + +[workspace.dependencies.phoenix-api-policy-hotel-acl] +path = "phoenix-api/policy/hotel-acl" + +[workspace.dependencies.phoenix-api-policy-logging] +path = "phoenix-api/policy/logging" + +[workspace.dependencies.phoenix-api-policy-hello-acl-receiver] +path = "phoenix-api/policy/hello-acl-receiver" + +[workspace.dependencies.phoenix-api-policy-hello-acl-sender] +path = "phoenix-api/policy/hello-acl-sender" + +[workspace.dependencies.phoenix-api-policy-hello-acl] +path = "phoenix-api/policy/hello-acl" + +[workspace.dependencies.phoenix-api-policy-nofile-logging] +path = "phoenix-api/policy/nofile-logging" + +[workspace.dependencies.phoenix-api-policy-fault] +path = "phoenix-api/policy/fault" + +[workspace.dependencies.phoenix-api-policy-fault2] +path = "phoenix-api/policy/fault2" + +[workspace.dependencies.phoenix-api-policy-delay] +path = "phoenix-api/policy/delay" + +[workspace.dependencies.phoenix-api-policy-admission-control] +path = "phoenix-api/policy/admission-control" + +[workspace.dependencies.phoenix-api-policy-metrics] +path = "phoenix-api/policy/metrics" + +[workspace.dependencies.phoenix-api-policy-mutation] +path = "phoenix-api/policy/mutation" + +[workspace.dependencies.phoenix-api-policy-fault-server] +path = "phoenix-api/policy/fault-server" + +[workspace.dependencies.phoenix-api-policy-logging-server] +path = "phoenix-api/policy/logging-server" + +[workspace.dependencies.phoenix-api-policy-metrics-server] +path = "phoenix-api/policy/metrics-server" + +[workspace.dependencies.phoenix-api-policy-mutation-server] +path = "phoenix-api/policy/mutation-server" + +[workspace.dependencies.phoenix-api-policy-ratelimit-drop-server] +path = "phoenix-api/policy/ratelimit-drop-server" + +[workspace.dependencies.mrpc-build] +path = "mrpc-build" + +[workspace.dependencies.mrpc-derive] +path = "mrpc-derive" + +[workspace.dependencies.mrpc-marshal] +path = "mrpc-marshal" + +[workspace.dependencies.prost] +path = "3rdparty/prost" + +[workspace.dependencies.prost-build] +path = "3rdparty/prost/prost-build" + +[workspace.dependencies.phoenix-mrpc] +path = "plugin/mrpc" + +[workspace.dependencies.phoenix-mrpclb] +path = "plugin/mrpclb" + +[workspace.dependencies.phoenix-syscalls] +path = "../../src/phoenix-syscalls" + +[workspace.dependencies.phoenix-api] +path = "../../src/phoenix-api" + +[workspace.dependencies.ipc] +path = "../../src/ipc" + +[workspace.dependencies.mmap] +path = "../../src/mmap" + +[workspace.dependencies.rdma] +path = "../../src/rdma" + +[workspace.dependencies.shm] +path = "../../src/shm" + +[workspace.dependencies.shmalloc] +path = "../../src/shm/shmalloc" + +[workspace.dependencies.phoenix_common] +path = "../../src/phoenix_common" + +[workspace.dependencies.transport-rdma] +path = "../../src/plugin/transport-rdma" +package = "phoenix-transport-rdma" + +[workspace.dependencies.transport-tcp] +path = "../../src/plugin/transport-tcp" +package = "phoenix-transport-tcp" + +[workspace.dependencies.phoenix-salloc] +path = "../../src/plugin/salloc" +package = "phoenix-salloc" + +[workspace.dependencies.utils] +path = "../../src/utils" + +[workspace.dependencies.phoenix-api-policy-genaclserver] +path = "generated/api/genaclserver" + [profile.release] debug = true