From fa376bd7e5fa857a3f7ef0d8ea35d10c9ee442fd Mon Sep 17 00:00:00 2001 From: Lakshman Date: Wed, 24 Jul 2024 02:32:00 -0600 Subject: [PATCH] Added proto files for rnn-serving and video-analytics-standalone. Updated protos for all benchmarks. Signed-off-by: L Lakshmanan --- go.mod | 2 + grpcclient/getclient.go | 10 + grpcclient/rnn_serving_client.go | 74 +++ .../video_analytics_standalone_client.go | 42 ++ proto/aes/aes_pb2.py | 37 +- proto/auth/auth_pb2.py | 37 +- proto/fibonacci/fibonacci_pb2.py | 37 +- proto/gptj/gptj_pb2.py | 19 +- proto/gptj/gptj_pb2_grpc.py | 14 +- proto/helloworld/helloworld_pb2.py | 37 +- proto/hipstershop/demo_pb2.py | 437 ++++-------------- proto/image_rotate/image_rotate.pb.go | 2 +- proto/image_rotate/image_rotate_grpc.pb.go | 2 +- proto/rnn_serving/rnn_serving.pb.go | 250 ++++++++++ proto/rnn_serving/rnn_serving.proto | 44 ++ proto/rnn_serving/rnn_serving_grpc.pb.go | 131 ++++++ proto/rnn_serving/rnn_serving_pb2.py | 31 ++ proto/rnn_serving/rnn_serving_pb2_grpc.py | 69 +++ .../video_analytics_standalone.pb.go | 246 ++++++++++ .../video_analytics_standalone.proto | 43 ++ .../video_analytics_standalone_grpc.pb.go | 131 ++++++ .../video_analytics_standalone_pb2.py | 31 ++ .../video_analytics_standalone_pb2_grpc.py | 69 +++ 23 files changed, 1318 insertions(+), 477 deletions(-) create mode 100644 grpcclient/rnn_serving_client.go create mode 100644 grpcclient/video_analytics_standalone_client.go create mode 100644 proto/rnn_serving/rnn_serving.pb.go create mode 100644 proto/rnn_serving/rnn_serving.proto create mode 100644 proto/rnn_serving/rnn_serving_grpc.pb.go create mode 100644 proto/rnn_serving/rnn_serving_pb2.py create mode 100644 proto/rnn_serving/rnn_serving_pb2_grpc.py create mode 100644 proto/video_analytics_standalone/video_analytics_standalone.pb.go create mode 100644 proto/video_analytics_standalone/video_analytics_standalone.proto create mode 100644 proto/video_analytics_standalone/video_analytics_standalone_grpc.pb.go create mode 100644 proto/video_analytics_standalone/video_analytics_standalone_pb2.py create mode 100644 proto/video_analytics_standalone/video_analytics_standalone_pb2_grpc.py diff --git a/go.mod b/go.mod index 848bfde..6654121 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,8 @@ replace ( github.com/vhive-serverless/vSwarm-proto/proto/hotel_reserv => ./proto/hotel_reserv github.com/vhive-serverless/vSwarm-proto/proto/image_rotate => ./proto/image_rotate github.com/vhive-serverless/vSwarm-proto/proto/video_processing => ./proto/video_processing + github.com/vhive-serverless/vSwarm-proto/proto/rnn_serving => ./proto/rnn_serving + github.com/vhive-serverless/vSwarm-proto/proto/video_analytics_standalone => ./proto/video_analytics_standalone ) require ( diff --git a/grpcclient/getclient.go b/grpcclient/getclient.go index b9e8e38..df900e5 100644 --- a/grpcclient/getclient.go +++ b/grpcclient/getclient.go @@ -20,6 +20,10 @@ func FindServiceName(functionName string) string { return "image-rotate" case "video-processing-python": return "video-processing" + case "rnn-serving-python": + return "rnn-serving" + case "video-analytics-standalone-python": + return "video-analytics-standalone" case "spright-parking-python": return "spright-parking" default: @@ -55,6 +59,12 @@ func FindGrpcClient(service_name string) GrpcClient { case "video-processing": log.Debug("Found video processing client") return new(VideoProcessingClient) + case "rnn-serving": + log.Debug("Found rnn serving client") + return new(RNNServingClient) + case "video-analytics-standalone": + log.Debug("Found video analytics standalone client") + return new(VideoAnalyticsClient) // Hotel reservation --- case "Geo", "geo": diff --git a/grpcclient/rnn_serving_client.go b/grpcclient/rnn_serving_client.go new file mode 100644 index 0000000..613be78 --- /dev/null +++ b/grpcclient/rnn_serving_client.go @@ -0,0 +1,74 @@ +package grpcclient + +import ( + "context" + "math/rand" + "strconv" + "strings" + + pb "github.com/vhive-serverless/vSwarm-proto/proto/rnn_serving" +) + +type RNNServingGenerator struct { + GeneratorBase +} + +func (g *RNNServingGenerator) Next() Input { + + countries := []string{ + "French", "Czech", "Dutch", "Polish", "Scottish", "Chinese", + "English", "Italian", "Portuguese", "Japanese", "German", + "Russian", "Korean", "Arabic", "Greek", "Vietnamese", "Spanish", "Irish", + } + + var pkt = g.defaultInput + + switch g.GeneratorBase.generator { + case Unique: + country := "English" + numSamples := 1 + pkt.Value = country + " " + strconv.Itoa(numSamples) + + case Random: + randomCountry := countries[rand.Intn(len(countries))] + var numSamples int + if g.lowerBound == g.upperBound { + numSamples = g.lowerBound + } else { + numSamples = g.lowerBound + rand.Intn(g.upperBound-g.lowerBound) + } + pkt.Value = randomCountry + " " + strconv.Itoa(numSamples) + } + return pkt +} + +func (c *RNNServingClient) GetGenerator() Generator { + return new(RNNServingGenerator) +} + +type RNNServingClient struct { + ClientBase + client pb.RNNServingClient +} + +func (c *RNNServingClient) Init(ctx context.Context, ip, port string) error { + err := c.Connect(ctx, ip, port) + if err != nil { + return err + } + c.client = pb.NewRNNServingClient(c.conn) + return nil +} + +func (c *RNNServingClient) Request(ctx context.Context, req Input) (string, error) { + + inputs = strings.Split(req.Value, " ") + language := inputs[0] + numSamples, _ := strconv.ParseInt(inputs[1], 10, 32) + + r, err := c.client.GenerateString(ctx, &pb.SendLanguage{Language: string(language), NumSamples: int32(numSamples)}) + if err != nil { + return "", err + } + return r.GetMessage(), nil +} diff --git a/grpcclient/video_analytics_standalone_client.go b/grpcclient/video_analytics_standalone_client.go new file mode 100644 index 0000000..9987adf --- /dev/null +++ b/grpcclient/video_analytics_standalone_client.go @@ -0,0 +1,42 @@ +package grpcclient + +import ( + "context" + + pb "github.com/vhive-serverless/vSwarm-proto/proto/video_analytics_standalone" +) + +type VideoAnalyticsGenerator struct { + GeneratorBase +} + +func (g *VideoAnalyticsGenerator) Next() Input { + var pkt = g.defaultInput + return pkt +} + +func (c *VideoAnalyticsClient) GetGenerator() Generator { + return new(VideoAnalyticsGenerator) +} + +type VideoAnalyticsClient struct { + ClientBase + client pb.VideoAnalyticsClient +} + +func (c *VideoAnalyticsClient) Init(ctx context.Context, ip, port string) error { + err := c.Connect(ctx, ip, port) + if err != nil { + return err + } + c.client = pb.NewVideoAnalyticsClient(c.conn) + return nil +} + +func (c *VideoAnalyticsClient) Request(ctx context.Context, req Input) (string, error) { + r, err := c.client.ObjectDetection(ctx, &pb.SendVideo{Name: req.Value}) + if err != nil { + return "", err + } + return r.GetMessage(), nil +} \ No newline at end of file diff --git a/proto/aes/aes_pb2.py b/proto/aes/aes_pb2.py index ee1754e..2a3d3ae 100644 --- a/proto/aes/aes_pb2.py +++ b/proto/aes/aes_pb2.py @@ -4,9 +4,8 @@ """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,33 +15,17 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x13proto/aes/aes.proto\x12\x03\x61\x65s\"-\n\x10PlainTextMessage\x12\x19\n\x11plaintext_message\x18\x01 \x01(\t\"/\n\x14ReturnEncryptionInfo\x12\x17\n\x0f\x65ncryption_info\x18\x01 \x01(\t2K\n\x03\x41\x65s\x12\x44\n\x0eShowEncryption\x12\x15.aes.PlainTextMessage\x1a\x19.aes.ReturnEncryptionInfo\"\x00\x42\x34Z2github.com/vhive-serverless/vSwarm-proto/proto/aesb\x06proto3') - - -_PLAINTEXTMESSAGE = DESCRIPTOR.message_types_by_name['PlainTextMessage'] -_RETURNENCRYPTIONINFO = DESCRIPTOR.message_types_by_name['ReturnEncryptionInfo'] -PlainTextMessage = _reflection.GeneratedProtocolMessageType('PlainTextMessage', (_message.Message,), { - 'DESCRIPTOR' : _PLAINTEXTMESSAGE, - '__module__' : 'proto.aes.aes_pb2' - # @@protoc_insertion_point(class_scope:aes.PlainTextMessage) - }) -_sym_db.RegisterMessage(PlainTextMessage) - -ReturnEncryptionInfo = _reflection.GeneratedProtocolMessageType('ReturnEncryptionInfo', (_message.Message,), { - 'DESCRIPTOR' : _RETURNENCRYPTIONINFO, - '__module__' : 'proto.aes.aes_pb2' - # @@protoc_insertion_point(class_scope:aes.ReturnEncryptionInfo) - }) -_sym_db.RegisterMessage(ReturnEncryptionInfo) - -_AES = DESCRIPTOR.services_by_name['Aes'] +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.aes.aes_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z2github.com/vhive-serverless/vSwarm-proto/proto/aes' - _PLAINTEXTMESSAGE._serialized_start=28 - _PLAINTEXTMESSAGE._serialized_end=73 - _RETURNENCRYPTIONINFO._serialized_start=75 - _RETURNENCRYPTIONINFO._serialized_end=122 - _AES._serialized_start=124 - _AES._serialized_end=199 + _globals['_PLAINTEXTMESSAGE']._serialized_start=28 + _globals['_PLAINTEXTMESSAGE']._serialized_end=73 + _globals['_RETURNENCRYPTIONINFO']._serialized_start=75 + _globals['_RETURNENCRYPTIONINFO']._serialized_end=122 + _globals['_AES']._serialized_start=124 + _globals['_AES']._serialized_end=199 # @@protoc_insertion_point(module_scope) diff --git a/proto/auth/auth_pb2.py b/proto/auth/auth_pb2.py index 390a0bd..a0073d3 100644 --- a/proto/auth/auth_pb2.py +++ b/proto/auth/auth_pb2.py @@ -4,9 +4,8 @@ """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,33 +15,17 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15proto/auth/auth.proto\x12\x04\x61uth\"\x1c\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t2=\n\x07Greeter\x12\x32\n\x08SayHello\x12\x12.auth.HelloRequest\x1a\x10.auth.HelloReply\"\x00\x42\x35Z3github.com/vhive-serverless/vSwarm-proto/proto/authb\x06proto3') - - -_HELLOREQUEST = DESCRIPTOR.message_types_by_name['HelloRequest'] -_HELLOREPLY = DESCRIPTOR.message_types_by_name['HelloReply'] -HelloRequest = _reflection.GeneratedProtocolMessageType('HelloRequest', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREQUEST, - '__module__' : 'proto.auth.auth_pb2' - # @@protoc_insertion_point(class_scope:auth.HelloRequest) - }) -_sym_db.RegisterMessage(HelloRequest) - -HelloReply = _reflection.GeneratedProtocolMessageType('HelloReply', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREPLY, - '__module__' : 'proto.auth.auth_pb2' - # @@protoc_insertion_point(class_scope:auth.HelloReply) - }) -_sym_db.RegisterMessage(HelloReply) - -_GREETER = DESCRIPTOR.services_by_name['Greeter'] +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.auth.auth_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z3github.com/vhive-serverless/vSwarm-proto/proto/auth' - _HELLOREQUEST._serialized_start=31 - _HELLOREQUEST._serialized_end=59 - _HELLOREPLY._serialized_start=61 - _HELLOREPLY._serialized_end=90 - _GREETER._serialized_start=92 - _GREETER._serialized_end=153 + _globals['_HELLOREQUEST']._serialized_start=31 + _globals['_HELLOREQUEST']._serialized_end=59 + _globals['_HELLOREPLY']._serialized_start=61 + _globals['_HELLOREPLY']._serialized_end=90 + _globals['_GREETER']._serialized_start=92 + _globals['_GREETER']._serialized_end=153 # @@protoc_insertion_point(module_scope) diff --git a/proto/fibonacci/fibonacci_pb2.py b/proto/fibonacci/fibonacci_pb2.py index 87aa44b..d7ecd7c 100644 --- a/proto/fibonacci/fibonacci_pb2.py +++ b/proto/fibonacci/fibonacci_pb2.py @@ -4,9 +4,8 @@ """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,33 +15,17 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1fproto/fibonacci/fibonacci.proto\x12\tfibonacci\"\x1c\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t2G\n\x07Greeter\x12<\n\x08SayHello\x12\x17.fibonacci.HelloRequest\x1a\x15.fibonacci.HelloReply\"\x00\x42:Z8github.com/vhive-serverless/vSwarm-proto/proto/fibonaccib\x06proto3') - - -_HELLOREQUEST = DESCRIPTOR.message_types_by_name['HelloRequest'] -_HELLOREPLY = DESCRIPTOR.message_types_by_name['HelloReply'] -HelloRequest = _reflection.GeneratedProtocolMessageType('HelloRequest', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREQUEST, - '__module__' : 'proto.fibonacci.fibonacci_pb2' - # @@protoc_insertion_point(class_scope:fibonacci.HelloRequest) - }) -_sym_db.RegisterMessage(HelloRequest) - -HelloReply = _reflection.GeneratedProtocolMessageType('HelloReply', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREPLY, - '__module__' : 'proto.fibonacci.fibonacci_pb2' - # @@protoc_insertion_point(class_scope:fibonacci.HelloReply) - }) -_sym_db.RegisterMessage(HelloReply) - -_GREETER = DESCRIPTOR.services_by_name['Greeter'] +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.fibonacci.fibonacci_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z8github.com/vhive-serverless/vSwarm-proto/proto/fibonacci' - _HELLOREQUEST._serialized_start=46 - _HELLOREQUEST._serialized_end=74 - _HELLOREPLY._serialized_start=76 - _HELLOREPLY._serialized_end=105 - _GREETER._serialized_start=107 - _GREETER._serialized_end=178 + _globals['_HELLOREQUEST']._serialized_start=46 + _globals['_HELLOREQUEST']._serialized_end=74 + _globals['_HELLOREPLY']._serialized_start=76 + _globals['_HELLOREPLY']._serialized_end=105 + _globals['_GREETER']._serialized_start=107 + _globals['_GREETER']._serialized_end=178 # @@protoc_insertion_point(module_scope) diff --git a/proto/gptj/gptj_pb2.py b/proto/gptj/gptj_pb2.py index ded43b7..514dc2f 100644 --- a/proto/gptj/gptj_pb2.py +++ b/proto/gptj/gptj_pb2.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: gptj.proto +# source: proto/gptj/gptj.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -13,18 +13,19 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\ngptj.proto\x12\x04gptj\"*\n\x14GptJBenchmarkRequest\x12\x12\n\nregenerate\x18\x01 \x01(\t\"*\n\x12GptJBenchmarkReply\x12\x14\n\x0clatency_info\x18\x01 \x01(\t2W\n\rGptJBenchmark\x12\x46\n\x0cGetBenchmark\x12\x1a.gptj.GptJBenchmarkRequest\x1a\x18.gptj.GptJBenchmarkReply\"\x00\x42\x35Z3github.com/vhive-serverless/vSwarm-proto/proto/gptjb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15proto/gptj/gptj.proto\x12\x04gptj\"*\n\x14GptJBenchmarkRequest\x12\x12\n\nregenerate\x18\x01 \x01(\t\"*\n\x12GptJBenchmarkReply\x12\x14\n\x0clatency_info\x18\x01 \x01(\t2W\n\rGptJBenchmark\x12\x46\n\x0cGetBenchmark\x12\x1a.gptj.GptJBenchmarkRequest\x1a\x18.gptj.GptJBenchmarkReply\"\x00\x42\x35Z3github.com/vhive-serverless/vSwarm-proto/proto/gptjb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'gptj_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.gptj.gptj_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: + DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z3github.com/vhive-serverless/vSwarm-proto/proto/gptj' - _globals['_GPTJBENCHMARKREQUEST']._serialized_start=20 - _globals['_GPTJBENCHMARKREQUEST']._serialized_end=62 - _globals['_GPTJBENCHMARKREPLY']._serialized_start=64 - _globals['_GPTJBENCHMARKREPLY']._serialized_end=106 - _globals['_GPTJBENCHMARK']._serialized_start=108 - _globals['_GPTJBENCHMARK']._serialized_end=195 + _globals['_GPTJBENCHMARKREQUEST']._serialized_start=31 + _globals['_GPTJBENCHMARKREQUEST']._serialized_end=73 + _globals['_GPTJBENCHMARKREPLY']._serialized_start=75 + _globals['_GPTJBENCHMARKREPLY']._serialized_end=117 + _globals['_GPTJBENCHMARK']._serialized_start=119 + _globals['_GPTJBENCHMARK']._serialized_end=206 # @@protoc_insertion_point(module_scope) diff --git a/proto/gptj/gptj_pb2_grpc.py b/proto/gptj/gptj_pb2_grpc.py index c31defe..1b67c1f 100644 --- a/proto/gptj/gptj_pb2_grpc.py +++ b/proto/gptj/gptj_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -import gptj_pb2 as gptj__pb2 +from proto.gptj import gptj_pb2 as proto_dot_gptj_dot_gptj__pb2 class GptJBenchmarkStub(object): @@ -16,8 +16,8 @@ def __init__(self, channel): """ self.GetBenchmark = channel.unary_unary( '/gptj.GptJBenchmark/GetBenchmark', - request_serializer=gptj__pb2.GptJBenchmarkRequest.SerializeToString, - response_deserializer=gptj__pb2.GptJBenchmarkReply.FromString, + request_serializer=proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkRequest.SerializeToString, + response_deserializer=proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkReply.FromString, ) @@ -35,8 +35,8 @@ def add_GptJBenchmarkServicer_to_server(servicer, server): rpc_method_handlers = { 'GetBenchmark': grpc.unary_unary_rpc_method_handler( servicer.GetBenchmark, - request_deserializer=gptj__pb2.GptJBenchmarkRequest.FromString, - response_serializer=gptj__pb2.GptJBenchmarkReply.SerializeToString, + request_deserializer=proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkRequest.FromString, + response_serializer=proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkReply.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -60,7 +60,7 @@ def GetBenchmark(request, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/gptj.GptJBenchmark/GetBenchmark', - gptj__pb2.GptJBenchmarkRequest.SerializeToString, - gptj__pb2.GptJBenchmarkReply.FromString, + proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkRequest.SerializeToString, + proto_dot_gptj_dot_gptj__pb2.GptJBenchmarkReply.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/proto/helloworld/helloworld_pb2.py b/proto/helloworld/helloworld_pb2.py index c9158dd..cb06c8f 100644 --- a/proto/helloworld/helloworld_pb2.py +++ b/proto/helloworld/helloworld_pb2.py @@ -4,9 +4,8 @@ """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,33 +15,17 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n!proto/helloworld/helloworld.proto\x12\nhelloworld\"3\n\x0cHelloRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\rvHiveMetadata\x18\x0f \x01(\x0c\"\x1d\n\nHelloReply\x12\x0f\n\x07message\x18\x01 \x01(\t2I\n\x07Greeter\x12>\n\x08SayHello\x12\x18.helloworld.HelloRequest\x1a\x16.helloworld.HelloReply\"\x00\x42;Z9github.com/vhive-serverless/vSwarm-proto/proto/helloworldb\x06proto3') - - -_HELLOREQUEST = DESCRIPTOR.message_types_by_name['HelloRequest'] -_HELLOREPLY = DESCRIPTOR.message_types_by_name['HelloReply'] -HelloRequest = _reflection.GeneratedProtocolMessageType('HelloRequest', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREQUEST, - '__module__' : 'proto.helloworld.helloworld_pb2' - # @@protoc_insertion_point(class_scope:helloworld.HelloRequest) - }) -_sym_db.RegisterMessage(HelloRequest) - -HelloReply = _reflection.GeneratedProtocolMessageType('HelloReply', (_message.Message,), { - 'DESCRIPTOR' : _HELLOREPLY, - '__module__' : 'proto.helloworld.helloworld_pb2' - # @@protoc_insertion_point(class_scope:helloworld.HelloReply) - }) -_sym_db.RegisterMessage(HelloReply) - -_GREETER = DESCRIPTOR.services_by_name['Greeter'] +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.helloworld.helloworld_pb2', _globals) if _descriptor._USE_C_DESCRIPTORS == False: DESCRIPTOR._options = None DESCRIPTOR._serialized_options = b'Z9github.com/vhive-serverless/vSwarm-proto/proto/helloworld' - _HELLOREQUEST._serialized_start=49 - _HELLOREQUEST._serialized_end=100 - _HELLOREPLY._serialized_start=102 - _HELLOREPLY._serialized_end=131 - _GREETER._serialized_start=133 - _GREETER._serialized_end=206 + _globals['_HELLOREQUEST']._serialized_start=49 + _globals['_HELLOREQUEST']._serialized_end=100 + _globals['_HELLOREPLY']._serialized_start=102 + _globals['_HELLOREPLY']._serialized_end=131 + _globals['_GREETER']._serialized_start=133 + _globals['_GREETER']._serialized_end=206 # @@protoc_insertion_point(module_scope) diff --git a/proto/hipstershop/demo_pb2.py b/proto/hipstershop/demo_pb2.py index 7761524..721d400 100644 --- a/proto/hipstershop/demo_pb2.py +++ b/proto/hipstershop/demo_pb2.py @@ -4,9 +4,8 @@ """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() @@ -16,357 +15,93 @@ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1cproto/hipstershop/demo.proto\x12\x0bhipstershop\"0\n\x08\x43\x61rtItem\x12\x12\n\nproduct_id\x18\x01 \x01(\t\x12\x10\n\x08quantity\x18\x02 \x01(\x05\"F\n\x0e\x41\x64\x64ItemRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12#\n\x04item\x18\x02 \x01(\x0b\x32\x15.hipstershop.CartItem\"#\n\x10\x45mptyCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"!\n\x0eGetCartRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\"=\n\x04\x43\x61rt\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"\x07\n\x05\x45mpty\"B\n\x1aListRecommendationsRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x13\n\x0bproduct_ids\x18\x02 \x03(\t\"2\n\x1bListRecommendationsResponse\x12\x13\n\x0bproduct_ids\x18\x01 \x03(\t\"\x84\x01\n\x07Product\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07picture\x18\x04 \x01(\t\x12%\n\tprice_usd\x18\x05 \x01(\x0b\x32\x12.hipstershop.Money\x12\x12\n\ncategories\x18\x06 \x03(\t\">\n\x14ListProductsResponse\x12&\n\x08products\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"\x1f\n\x11GetProductRequest\x12\n\n\x02id\x18\x01 \x01(\t\"&\n\x15SearchProductsRequest\x12\r\n\x05query\x18\x01 \x01(\t\"?\n\x16SearchProductsResponse\x12%\n\x07results\x18\x01 \x03(\x0b\x32\x14.hipstershop.Product\"^\n\x0fGetQuoteRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"8\n\x10GetQuoteResponse\x12$\n\x08\x63ost_usd\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\"_\n\x10ShipOrderRequest\x12%\n\x07\x61\x64\x64ress\x18\x01 \x01(\x0b\x32\x14.hipstershop.Address\x12$\n\x05items\x18\x02 \x03(\x0b\x32\x15.hipstershop.CartItem\"(\n\x11ShipOrderResponse\x12\x13\n\x0btracking_id\x18\x01 \x01(\t\"a\n\x07\x41\x64\x64ress\x12\x16\n\x0estreet_address\x18\x01 \x01(\t\x12\x0c\n\x04\x63ity\x18\x02 \x01(\t\x12\r\n\x05state\x18\x03 \x01(\t\x12\x0f\n\x07\x63ountry\x18\x04 \x01(\t\x12\x10\n\x08zip_code\x18\x05 \x01(\x05\"<\n\x05Money\x12\x15\n\rcurrency_code\x18\x01 \x01(\t\x12\r\n\x05units\x18\x02 \x01(\x03\x12\r\n\x05nanos\x18\x03 \x01(\x05\"8\n\x1eGetSupportedCurrenciesResponse\x12\x16\n\x0e\x63urrency_codes\x18\x01 \x03(\t\"N\n\x19\x43urrencyConversionRequest\x12 \n\x04\x66rom\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x0f\n\x07to_code\x18\x02 \x01(\t\"\x90\x01\n\x0e\x43reditCardInfo\x12\x1a\n\x12\x63redit_card_number\x18\x01 \x01(\t\x12\x17\n\x0f\x63redit_card_cvv\x18\x02 \x01(\x05\x12#\n\x1b\x63redit_card_expiration_year\x18\x03 \x01(\x05\x12$\n\x1c\x63redit_card_expiration_month\x18\x04 \x01(\x05\"e\n\rChargeRequest\x12\"\n\x06\x61mount\x18\x01 \x01(\x0b\x32\x12.hipstershop.Money\x12\x30\n\x0b\x63redit_card\x18\x02 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"(\n\x0e\x43hargeResponse\x12\x16\n\x0etransaction_id\x18\x01 \x01(\t\"R\n\tOrderItem\x12#\n\x04item\x18\x01 \x01(\x0b\x32\x15.hipstershop.CartItem\x12 \n\x04\x63ost\x18\x02 \x01(\x0b\x32\x12.hipstershop.Money\"\xbf\x01\n\x0bOrderResult\x12\x10\n\x08order_id\x18\x01 \x01(\t\x12\x1c\n\x14shipping_tracking_id\x18\x02 \x01(\t\x12)\n\rshipping_cost\x18\x03 \x01(\x0b\x32\x12.hipstershop.Money\x12.\n\x10shipping_address\x18\x04 \x01(\x0b\x32\x14.hipstershop.Address\x12%\n\x05items\x18\x05 \x03(\x0b\x32\x16.hipstershop.OrderItem\"V\n\x1cSendOrderConfirmationRequest\x12\r\n\x05\x65mail\x18\x01 \x01(\t\x12\'\n\x05order\x18\x02 \x01(\x0b\x32\x18.hipstershop.OrderResult\"\xa3\x01\n\x11PlaceOrderRequest\x12\x0f\n\x07user_id\x18\x01 \x01(\t\x12\x15\n\ruser_currency\x18\x02 \x01(\t\x12%\n\x07\x61\x64\x64ress\x18\x03 \x01(\x0b\x32\x14.hipstershop.Address\x12\r\n\x05\x65mail\x18\x05 \x01(\t\x12\x30\n\x0b\x63redit_card\x18\x06 \x01(\x0b\x32\x1b.hipstershop.CreditCardInfo\"=\n\x12PlaceOrderResponse\x12\'\n\x05order\x18\x01 \x01(\x0b\x32\x18.hipstershop.OrderResult\"!\n\tAdRequest\x12\x14\n\x0c\x63ontext_keys\x18\x01 \x03(\t\"*\n\nAdResponse\x12\x1c\n\x03\x61\x64s\x18\x01 \x03(\x0b\x32\x0f.hipstershop.Ad\"(\n\x02\x41\x64\x12\x14\n\x0credirect_url\x18\x01 \x01(\t\x12\x0c\n\x04text\x18\x02 \x01(\t2\xca\x01\n\x0b\x43\x61rtService\x12<\n\x07\x41\x64\x64Item\x12\x1b.hipstershop.AddItemRequest\x1a\x12.hipstershop.Empty\"\x00\x12;\n\x07GetCart\x12\x1b.hipstershop.GetCartRequest\x1a\x11.hipstershop.Cart\"\x00\x12@\n\tEmptyCart\x12\x1d.hipstershop.EmptyCartRequest\x1a\x12.hipstershop.Empty\"\x00\x32\x83\x01\n\x15RecommendationService\x12j\n\x13ListRecommendations\x12\'.hipstershop.ListRecommendationsRequest\x1a(.hipstershop.ListRecommendationsResponse\"\x00\x32\x83\x02\n\x15ProductCatalogService\x12G\n\x0cListProducts\x12\x12.hipstershop.Empty\x1a!.hipstershop.ListProductsResponse\"\x00\x12\x44\n\nGetProduct\x12\x1e.hipstershop.GetProductRequest\x1a\x14.hipstershop.Product\"\x00\x12[\n\x0eSearchProducts\x12\".hipstershop.SearchProductsRequest\x1a#.hipstershop.SearchProductsResponse\"\x00\x32\xaa\x01\n\x0fShippingService\x12I\n\x08GetQuote\x12\x1c.hipstershop.GetQuoteRequest\x1a\x1d.hipstershop.GetQuoteResponse\"\x00\x12L\n\tShipOrder\x12\x1d.hipstershop.ShipOrderRequest\x1a\x1e.hipstershop.ShipOrderResponse\"\x00\x32\xb7\x01\n\x0f\x43urrencyService\x12[\n\x16GetSupportedCurrencies\x12\x12.hipstershop.Empty\x1a+.hipstershop.GetSupportedCurrenciesResponse\"\x00\x12G\n\x07\x43onvert\x12&.hipstershop.CurrencyConversionRequest\x1a\x12.hipstershop.Money\"\x00\x32U\n\x0ePaymentService\x12\x43\n\x06\x43harge\x12\x1a.hipstershop.ChargeRequest\x1a\x1b.hipstershop.ChargeResponse\"\x00\x32h\n\x0c\x45mailService\x12X\n\x15SendOrderConfirmation\x12).hipstershop.SendOrderConfirmationRequest\x1a\x12.hipstershop.Empty\"\x00\x32\x62\n\x0f\x43heckoutService\x12O\n\nPlaceOrder\x12\x1e.hipstershop.PlaceOrderRequest\x1a\x1f.hipstershop.PlaceOrderResponse\"\x00\x32H\n\tAdService\x12;\n\x06GetAds\x12\x16.hipstershop.AdRequest\x1a\x17.hipstershop.AdResponse\"\x00\x42 rnn_serving.SendLanguage + 1, // 1: rnn_serving.RNNServing.GenerateString:output_type -> rnn_serving.GetString + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_rnn_serving_rnn_serving_proto_init() } +func file_proto_rnn_serving_rnn_serving_proto_init() { + if File_proto_rnn_serving_rnn_serving_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_rnn_serving_rnn_serving_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendLanguage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_rnn_serving_rnn_serving_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetString); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_rnn_serving_rnn_serving_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_rnn_serving_rnn_serving_proto_goTypes, + DependencyIndexes: file_proto_rnn_serving_rnn_serving_proto_depIdxs, + MessageInfos: file_proto_rnn_serving_rnn_serving_proto_msgTypes, + }.Build() + File_proto_rnn_serving_rnn_serving_proto = out.File + file_proto_rnn_serving_rnn_serving_proto_rawDesc = nil + file_proto_rnn_serving_rnn_serving_proto_goTypes = nil + file_proto_rnn_serving_rnn_serving_proto_depIdxs = nil +} diff --git a/proto/rnn_serving/rnn_serving.proto b/proto/rnn_serving/rnn_serving.proto new file mode 100644 index 0000000..8eb5d92 --- /dev/null +++ b/proto/rnn_serving/rnn_serving.proto @@ -0,0 +1,44 @@ +// MIT License + +// Copyright (c) 2024 EASE Lab + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +syntax = "proto3"; + +option go_package = "github.com/vhive-serverless/vSwarm-proto/proto/rnn_serving"; + +package rnn_serving; + +// The greeting service definition. +service RNNServing { + rpc GenerateString (SendLanguage) returns (GetString) {} +} + +// The request message containing the user's name. +message SendLanguage { + string language = 1; + int32 numSamples = 2; +} + +// The response message containing the greetings +message GetString { + string message = 1; +} \ No newline at end of file diff --git a/proto/rnn_serving/rnn_serving_grpc.pb.go b/proto/rnn_serving/rnn_serving_grpc.pb.go new file mode 100644 index 0000000..9cdd25a --- /dev/null +++ b/proto/rnn_serving/rnn_serving_grpc.pb.go @@ -0,0 +1,131 @@ +// MIT License + +// Copyright (c) 2024 EASE Lab + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.0 +// source: proto/rnn_serving/rnn_serving.proto + +package rnn_serving + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + RNNServing_GenerateString_FullMethodName = "/rnn_serving.RNNServing/GenerateString" +) + +// RNNServingClient is the client API for RNNServing service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type RNNServingClient interface { + GenerateString(ctx context.Context, in *SendLanguage, opts ...grpc.CallOption) (*GetString, error) +} + +type rNNServingClient struct { + cc grpc.ClientConnInterface +} + +func NewRNNServingClient(cc grpc.ClientConnInterface) RNNServingClient { + return &rNNServingClient{cc} +} + +func (c *rNNServingClient) GenerateString(ctx context.Context, in *SendLanguage, opts ...grpc.CallOption) (*GetString, error) { + out := new(GetString) + err := c.cc.Invoke(ctx, RNNServing_GenerateString_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RNNServingServer is the server API for RNNServing service. +// All implementations must embed UnimplementedRNNServingServer +// for forward compatibility +type RNNServingServer interface { + GenerateString(context.Context, *SendLanguage) (*GetString, error) + mustEmbedUnimplementedRNNServingServer() +} + +// UnimplementedRNNServingServer must be embedded to have forward compatible implementations. +type UnimplementedRNNServingServer struct { +} + +func (UnimplementedRNNServingServer) GenerateString(context.Context, *SendLanguage) (*GetString, error) { + return nil, status.Errorf(codes.Unimplemented, "method GenerateString not implemented") +} +func (UnimplementedRNNServingServer) mustEmbedUnimplementedRNNServingServer() {} + +// UnsafeRNNServingServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RNNServingServer will +// result in compilation errors. +type UnsafeRNNServingServer interface { + mustEmbedUnimplementedRNNServingServer() +} + +func RegisterRNNServingServer(s grpc.ServiceRegistrar, srv RNNServingServer) { + s.RegisterService(&RNNServing_ServiceDesc, srv) +} + +func _RNNServing_GenerateString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendLanguage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RNNServingServer).GenerateString(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: RNNServing_GenerateString_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RNNServingServer).GenerateString(ctx, req.(*SendLanguage)) + } + return interceptor(ctx, in, info, handler) +} + +// RNNServing_ServiceDesc is the grpc.ServiceDesc for RNNServing service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var RNNServing_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "rnn_serving.RNNServing", + HandlerType: (*RNNServingServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "GenerateString", + Handler: _RNNServing_GenerateString_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/rnn_serving/rnn_serving.proto", +} diff --git a/proto/rnn_serving/rnn_serving_pb2.py b/proto/rnn_serving/rnn_serving_pb2.py new file mode 100644 index 0000000..32bb2c4 --- /dev/null +++ b/proto/rnn_serving/rnn_serving_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/rnn_serving/rnn_serving.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n#proto/rnn_serving/rnn_serving.proto\x12\x0brnn_serving\"4\n\x0cSendLanguage\x12\x10\n\x08language\x18\x01 \x01(\t\x12\x12\n\nnumSamples\x18\x02 \x01(\x05\"\x1c\n\tGetString\x12\x0f\n\x07message\x18\x01 \x01(\t2S\n\nRNNServing\x12\x45\n\x0eGenerateString\x12\x19.rnn_serving.SendLanguage\x1a\x16.rnn_serving.GetString\"\x00\x42 video_analytics_standalone.SendVideo + 1, // 1: video_analytics_standalone.VideoAnalytics.ObjectDetection:output_type -> video_analytics_standalone.GetResult + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_proto_video_analytics_standalone_video_analytics_standalone_proto_init() } +func file_proto_video_analytics_standalone_video_analytics_standalone_proto_init() { + if File_proto_video_analytics_standalone_video_analytics_standalone_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_video_analytics_standalone_video_analytics_standalone_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendVideo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_video_analytics_standalone_video_analytics_standalone_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetResult); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_proto_video_analytics_standalone_video_analytics_standalone_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_video_analytics_standalone_video_analytics_standalone_proto_goTypes, + DependencyIndexes: file_proto_video_analytics_standalone_video_analytics_standalone_proto_depIdxs, + MessageInfos: file_proto_video_analytics_standalone_video_analytics_standalone_proto_msgTypes, + }.Build() + File_proto_video_analytics_standalone_video_analytics_standalone_proto = out.File + file_proto_video_analytics_standalone_video_analytics_standalone_proto_rawDesc = nil + file_proto_video_analytics_standalone_video_analytics_standalone_proto_goTypes = nil + file_proto_video_analytics_standalone_video_analytics_standalone_proto_depIdxs = nil +} diff --git a/proto/video_analytics_standalone/video_analytics_standalone.proto b/proto/video_analytics_standalone/video_analytics_standalone.proto new file mode 100644 index 0000000..a30f702 --- /dev/null +++ b/proto/video_analytics_standalone/video_analytics_standalone.proto @@ -0,0 +1,43 @@ +// MIT License + +// Copyright (c) 2024 EASE Lab + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + + +syntax = "proto3"; + +option go_package = "github.com/vhive-serverless/vSwarm-proto/proto/video_analytics_standalone"; + +package video_analytics_standalone; + +// The greeting service definition. +service VideoAnalytics { + rpc ObjectDetection (SendVideo) returns (GetResult) {} +} + +// The request message containing the user's name. +message SendVideo { + string name = 1; +} + +// The response message containing the greetings +message GetResult { + string message = 1; +} \ No newline at end of file diff --git a/proto/video_analytics_standalone/video_analytics_standalone_grpc.pb.go b/proto/video_analytics_standalone/video_analytics_standalone_grpc.pb.go new file mode 100644 index 0000000..f0233a9 --- /dev/null +++ b/proto/video_analytics_standalone/video_analytics_standalone_grpc.pb.go @@ -0,0 +1,131 @@ +// MIT License + +// Copyright (c) 2024 EASE Lab + +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: + +// The above copyright notice and this permission notice shall be included in all +// copies or substantial portions of the Software. + +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +// SOFTWARE. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.0 +// source: proto/video_analytics_standalone/video_analytics_standalone.proto + +package video_analytics_standalone + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + VideoAnalytics_ObjectDetection_FullMethodName = "/video_analytics_standalone.VideoAnalytics/ObjectDetection" +) + +// VideoAnalyticsClient is the client API for VideoAnalytics service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type VideoAnalyticsClient interface { + ObjectDetection(ctx context.Context, in *SendVideo, opts ...grpc.CallOption) (*GetResult, error) +} + +type videoAnalyticsClient struct { + cc grpc.ClientConnInterface +} + +func NewVideoAnalyticsClient(cc grpc.ClientConnInterface) VideoAnalyticsClient { + return &videoAnalyticsClient{cc} +} + +func (c *videoAnalyticsClient) ObjectDetection(ctx context.Context, in *SendVideo, opts ...grpc.CallOption) (*GetResult, error) { + out := new(GetResult) + err := c.cc.Invoke(ctx, VideoAnalytics_ObjectDetection_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VideoAnalyticsServer is the server API for VideoAnalytics service. +// All implementations must embed UnimplementedVideoAnalyticsServer +// for forward compatibility +type VideoAnalyticsServer interface { + ObjectDetection(context.Context, *SendVideo) (*GetResult, error) + mustEmbedUnimplementedVideoAnalyticsServer() +} + +// UnimplementedVideoAnalyticsServer must be embedded to have forward compatible implementations. +type UnimplementedVideoAnalyticsServer struct { +} + +func (UnimplementedVideoAnalyticsServer) ObjectDetection(context.Context, *SendVideo) (*GetResult, error) { + return nil, status.Errorf(codes.Unimplemented, "method ObjectDetection not implemented") +} +func (UnimplementedVideoAnalyticsServer) mustEmbedUnimplementedVideoAnalyticsServer() {} + +// UnsafeVideoAnalyticsServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VideoAnalyticsServer will +// result in compilation errors. +type UnsafeVideoAnalyticsServer interface { + mustEmbedUnimplementedVideoAnalyticsServer() +} + +func RegisterVideoAnalyticsServer(s grpc.ServiceRegistrar, srv VideoAnalyticsServer) { + s.RegisterService(&VideoAnalytics_ServiceDesc, srv) +} + +func _VideoAnalytics_ObjectDetection_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendVideo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VideoAnalyticsServer).ObjectDetection(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: VideoAnalytics_ObjectDetection_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VideoAnalyticsServer).ObjectDetection(ctx, req.(*SendVideo)) + } + return interceptor(ctx, in, info, handler) +} + +// VideoAnalytics_ServiceDesc is the grpc.ServiceDesc for VideoAnalytics service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var VideoAnalytics_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "video_analytics_standalone.VideoAnalytics", + HandlerType: (*VideoAnalyticsServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ObjectDetection", + Handler: _VideoAnalytics_ObjectDetection_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/video_analytics_standalone/video_analytics_standalone.proto", +} diff --git a/proto/video_analytics_standalone/video_analytics_standalone_pb2.py b/proto/video_analytics_standalone/video_analytics_standalone_pb2.py new file mode 100644 index 0000000..9edbbe8 --- /dev/null +++ b/proto/video_analytics_standalone/video_analytics_standalone_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/video_analytics_standalone/video_analytics_standalone.proto +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\nAproto/video_analytics_standalone/video_analytics_standalone.proto\x12\x1avideo_analytics_standalone\"\x19\n\tSendVideo\x12\x0c\n\x04name\x18\x01 \x01(\t\"\x1c\n\tGetResult\x12\x0f\n\x07message\x18\x01 \x01(\t2s\n\x0eVideoAnalytics\x12\x61\n\x0fObjectDetection\x12%.video_analytics_standalone.SendVideo\x1a%.video_analytics_standalone.GetResult\"\x00\x42KZIgithub.com/vhive-serverless/vSwarm-proto/proto/video_analytics_standaloneb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.video_analytics_standalone.video_analytics_standalone_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'ZIgithub.com/vhive-serverless/vSwarm-proto/proto/video_analytics_standalone' + _globals['_SENDVIDEO']._serialized_start=97 + _globals['_SENDVIDEO']._serialized_end=122 + _globals['_GETRESULT']._serialized_start=124 + _globals['_GETRESULT']._serialized_end=152 + _globals['_VIDEOANALYTICS']._serialized_start=154 + _globals['_VIDEOANALYTICS']._serialized_end=269 +# @@protoc_insertion_point(module_scope) diff --git a/proto/video_analytics_standalone/video_analytics_standalone_pb2_grpc.py b/proto/video_analytics_standalone/video_analytics_standalone_pb2_grpc.py new file mode 100644 index 0000000..fbc1d2d --- /dev/null +++ b/proto/video_analytics_standalone/video_analytics_standalone_pb2_grpc.py @@ -0,0 +1,69 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from proto.video_analytics_standalone import video_analytics_standalone_pb2 as proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2 + + +class VideoAnalyticsStub(object): + """The greeting service definition. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ObjectDetection = channel.unary_unary( + '/video_analytics_standalone.VideoAnalytics/ObjectDetection', + request_serializer=proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.SendVideo.SerializeToString, + response_deserializer=proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.GetResult.FromString, + ) + + +class VideoAnalyticsServicer(object): + """The greeting service definition. + """ + + def ObjectDetection(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_VideoAnalyticsServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ObjectDetection': grpc.unary_unary_rpc_method_handler( + servicer.ObjectDetection, + request_deserializer=proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.SendVideo.FromString, + response_serializer=proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.GetResult.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'video_analytics_standalone.VideoAnalytics', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class VideoAnalytics(object): + """The greeting service definition. + """ + + @staticmethod + def ObjectDetection(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/video_analytics_standalone.VideoAnalytics/ObjectDetection', + proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.SendVideo.SerializeToString, + proto_dot_video__analytics__standalone_dot_video__analytics__standalone__pb2.GetResult.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata)