small python ray
This commit is contained in:
commit
e02e80708a
15 changed files with 1261 additions and 0 deletions
18
proto/BUILD
Normal file
18
proto/BUILD
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load("@rules_proto_grpc//python:defs.bzl", "python_grpc_compile")
|
||||
|
||||
proto_library(
|
||||
name = "task_proto",
|
||||
srcs = [
|
||||
"task.proto",
|
||||
],
|
||||
deps = [
|
||||
"@com_google_protobuf//:any_proto",
|
||||
],
|
||||
)
|
||||
|
||||
python_grpc_compile(
|
||||
name = "task_proto_grpc_py",
|
||||
deps = [":task_proto"],
|
||||
)
|
||||
56
proto/task.proto
Normal file
56
proto/task.proto
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
syntax = "proto3";
|
||||
|
||||
enum Type {
|
||||
DEFAULT = 0;
|
||||
}
|
||||
|
||||
message Arg {
|
||||
enum Locality {
|
||||
INTERNED = 0;
|
||||
REFERENCE = 1;
|
||||
}
|
||||
Locality local = 1;
|
||||
bytes reference_id = 2;
|
||||
bytes data = 3;
|
||||
Type type = 4;
|
||||
}
|
||||
|
||||
message Task {
|
||||
// Optionally Provided Task Name
|
||||
string name = 1;
|
||||
bytes payload_id = 2;
|
||||
repeated Arg args = 3;
|
||||
}
|
||||
|
||||
message TaskTicket {
|
||||
bytes return_id = 1;
|
||||
}
|
||||
|
||||
message PutRequest {
|
||||
bytes data = 1;
|
||||
}
|
||||
|
||||
message PutResponse {
|
||||
bytes id = 1;
|
||||
}
|
||||
|
||||
message GetRequest {
|
||||
bytes id = 1;
|
||||
}
|
||||
|
||||
message GetResponse {
|
||||
bool valid = 1;
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
service TaskServer {
|
||||
rpc GetObject(GetRequest) returns (GetResponse) {}
|
||||
rpc PutObject(PutRequest) returns (PutResponse) {}
|
||||
rpc Schedule(Task) returns (TaskTicket) {}
|
||||
}
|
||||
|
||||
service WorkServer {
|
||||
rpc GetObject(GetRequest) returns (GetResponse) {}
|
||||
rpc PutObject(PutRequest) returns (PutResponse) {}
|
||||
rpc Execute(stream TaskTicket) returns (stream Task) {}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue