From 5a708624ffbe46cb4b35d016cbbb36c5576492d8 Mon Sep 17 00:00:00 2001 From: Lakshman Date: Fri, 19 Jul 2024 01:50:27 -0600 Subject: [PATCH] Added all proto files for the image-rotate benchmark. Signed-off-by: Lakshman --- grpcclient/getclient.go | 5 + grpcclient/image_rotate_client.go | 42 ++++ proto/image_rotate/image_rotate.pb.go | 241 ++++++++++++++++++++ proto/image_rotate/image_rotate.proto | 43 ++++ proto/image_rotate/image_rotate_grpc.pb.go | 131 +++++++++++ proto/image_rotate/image_rotate_pb2.py | 31 +++ proto/image_rotate/image_rotate_pb2_grpc.py | 69 ++++++ 7 files changed, 562 insertions(+) create mode 100644 grpcclient/image_rotate_client.go create mode 100644 proto/image_rotate/image_rotate.pb.go create mode 100644 proto/image_rotate/image_rotate.proto create mode 100644 proto/image_rotate/image_rotate_grpc.pb.go create mode 100644 proto/image_rotate/image_rotate_pb2.py create mode 100644 proto/image_rotate/image_rotate_pb2_grpc.py diff --git a/grpcclient/getclient.go b/grpcclient/getclient.go index 618b7d5..0e875b7 100644 --- a/grpcclient/getclient.go +++ b/grpcclient/getclient.go @@ -16,6 +16,8 @@ func FindServiceName(functionName string) string { return "compression" case "gptj-python": return "gptj" + case "image-rotate-python", "image-rotate-nodejs", "image-rotate-go", "image-rotate-cython": + return "image-rotate" case "spright-parking-python": return "spright-parking" default: @@ -45,6 +47,9 @@ func FindGrpcClient(service_name string) GrpcClient { case "gptj": log.Debug("Found gptj client") return new(GptJClient) + case "image-rotate": + log.Debug("Found image rotate client") + return new(ImageRotateClient) // Hotel reservation --- case "Geo", "geo": diff --git a/grpcclient/image_rotate_client.go b/grpcclient/image_rotate_client.go new file mode 100644 index 0000000..65800be --- /dev/null +++ b/grpcclient/image_rotate_client.go @@ -0,0 +1,42 @@ +package grpcclient + +import ( + "context" + + pb "github.com/vhive-serverless/vSwarm-proto/proto/image_rotate" +) + +type ImageRotateGenerator struct { + GeneratorBase +} + +func (g *ImageRotateGenerator) Next() Input { + var pkt = g.defaultInput + return pkt +} + +func (c *ImageRotateClient) GetGenerator() Generator { + return new(ImageRotateGenerator) +} + +type ImageRotateClient struct { + ClientBase + client pb.ImageRotateClient +} + +func (c *ImageRotateClient) Init(ctx context.Context, ip, port string) error { + err := c.Connect(ctx, ip, port) + if err != nil { + return err + } + c.client = pb.NewImageRotateClient(c.conn) + return nil +} + +func (c *ImageRotateClient) Request(ctx context.Context, req Input) (string, error) { + r, err := c.client.RotateImage(ctx, &pb.SendImage{Name: req.Value}) + if err != nil { + return "", err + } + return r.GetMessage(), nil +} diff --git a/proto/image_rotate/image_rotate.pb.go b/proto/image_rotate/image_rotate.pb.go new file mode 100644 index 0000000..0290e20 --- /dev/null +++ b/proto/image_rotate/image_rotate.pb.go @@ -0,0 +1,241 @@ +// MIT License + +// Copyright (c) 2021 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. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.0 +// source: proto/image_rotate/image_rotate.proto + +package image_rotate + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// The request message containing the user's name. +type SendImage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *SendImage) Reset() { + *x = SendImage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_image_rotate_image_rotate_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendImage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendImage) ProtoMessage() {} + +func (x *SendImage) ProtoReflect() protoreflect.Message { + mi := &file_proto_image_rotate_image_rotate_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendImage.ProtoReflect.Descriptor instead. +func (*SendImage) Descriptor() ([]byte, []int) { + return file_proto_image_rotate_image_rotate_proto_rawDescGZIP(), []int{0} +} + +func (x *SendImage) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The response message containing the greetings +type GetRotatedImage struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *GetRotatedImage) Reset() { + *x = GetRotatedImage{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_image_rotate_image_rotate_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetRotatedImage) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetRotatedImage) ProtoMessage() {} + +func (x *GetRotatedImage) ProtoReflect() protoreflect.Message { + mi := &file_proto_image_rotate_image_rotate_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use GetRotatedImage.ProtoReflect.Descriptor instead. +func (*GetRotatedImage) Descriptor() ([]byte, []int) { + return file_proto_image_rotate_image_rotate_proto_rawDescGZIP(), []int{1} +} + +func (x *GetRotatedImage) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_proto_image_rotate_image_rotate_proto protoreflect.FileDescriptor + +var file_proto_image_rotate_image_rotate_proto_rawDesc = []byte{ + 0x0a, 0x25, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x6f, + 0x74, 0x61, 0x74, 0x65, 0x2f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x6f, 0x74, 0x61, 0x74, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x72, + 0x6f, 0x74, 0x61, 0x74, 0x65, 0x22, 0x1f, 0x0a, 0x09, 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6d, 0x61, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x2b, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x74, + 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, + 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x32, 0x56, 0x0a, 0x0b, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x52, 0x6f, 0x74, 0x61, + 0x74, 0x65, 0x12, 0x47, 0x0a, 0x0b, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x49, 0x6d, 0x61, 0x67, + 0x65, 0x12, 0x17, 0x2e, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, + 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x1a, 0x1d, 0x2e, 0x69, 0x6d, 0x61, + 0x67, 0x65, 0x5f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x74, + 0x61, 0x74, 0x65, 0x64, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x22, 0x00, 0x42, 0x3d, 0x5a, 0x3b, 0x67, + 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x68, 0x69, 0x76, 0x65, 0x2d, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x6c, 0x65, 0x73, 0x73, 0x2f, 0x76, 0x53, 0x77, 0x61, 0x72, + 0x6d, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, + 0x61, 0x67, 0x65, 0x5f, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, +} + +var ( + file_proto_image_rotate_image_rotate_proto_rawDescOnce sync.Once + file_proto_image_rotate_image_rotate_proto_rawDescData = file_proto_image_rotate_image_rotate_proto_rawDesc +) + +func file_proto_image_rotate_image_rotate_proto_rawDescGZIP() []byte { + file_proto_image_rotate_image_rotate_proto_rawDescOnce.Do(func() { + file_proto_image_rotate_image_rotate_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_image_rotate_image_rotate_proto_rawDescData) + }) + return file_proto_image_rotate_image_rotate_proto_rawDescData +} + +var file_proto_image_rotate_image_rotate_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_proto_image_rotate_image_rotate_proto_goTypes = []interface{}{ + (*SendImage)(nil), // 0: image_rotate.SendImage + (*GetRotatedImage)(nil), // 1: image_rotate.GetRotatedImage +} +var file_proto_image_rotate_image_rotate_proto_depIdxs = []int32{ + 0, // 0: image_rotate.ImageRotate.RotateImage:input_type -> image_rotate.SendImage + 1, // 1: image_rotate.ImageRotate.RotateImage:output_type -> image_rotate.GetRotatedImage + 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_image_rotate_image_rotate_proto_init() } +func file_proto_image_rotate_image_rotate_proto_init() { + if File_proto_image_rotate_image_rotate_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_image_rotate_image_rotate_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendImage); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_proto_image_rotate_image_rotate_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetRotatedImage); 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_image_rotate_image_rotate_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_image_rotate_image_rotate_proto_goTypes, + DependencyIndexes: file_proto_image_rotate_image_rotate_proto_depIdxs, + MessageInfos: file_proto_image_rotate_image_rotate_proto_msgTypes, + }.Build() + File_proto_image_rotate_image_rotate_proto = out.File + file_proto_image_rotate_image_rotate_proto_rawDesc = nil + file_proto_image_rotate_image_rotate_proto_goTypes = nil + file_proto_image_rotate_image_rotate_proto_depIdxs = nil +} diff --git a/proto/image_rotate/image_rotate.proto b/proto/image_rotate/image_rotate.proto new file mode 100644 index 0000000..1eea0d9 --- /dev/null +++ b/proto/image_rotate/image_rotate.proto @@ -0,0 +1,43 @@ +// MIT License + +// Copyright (c) 2021 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/image_rotate"; + +package image_rotate; + +// The greeting service definition. +service ImageRotate { + rpc RotateImage (SendImage) returns (GetRotatedImage) {} +} + +// The request message containing the user's name. +message SendImage { + string name = 1; +} + +// The response message containing the greetings +message GetRotatedImage { + string message = 1; +} diff --git a/proto/image_rotate/image_rotate_grpc.pb.go b/proto/image_rotate/image_rotate_grpc.pb.go new file mode 100644 index 0000000..723e791 --- /dev/null +++ b/proto/image_rotate/image_rotate_grpc.pb.go @@ -0,0 +1,131 @@ +// MIT License + +// Copyright (c) 2021 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/image_rotate/image_rotate.proto + +package image_rotate + +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 ( + ImageRotate_RotateImage_FullMethodName = "/image_rotate.ImageRotate/RotateImage" +) + +// ImageRotateClient is the client API for ImageRotate 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 ImageRotateClient interface { + RotateImage(ctx context.Context, in *SendImage, opts ...grpc.CallOption) (*GetRotatedImage, error) +} + +type imageRotateClient struct { + cc grpc.ClientConnInterface +} + +func NewImageRotateClient(cc grpc.ClientConnInterface) ImageRotateClient { + return &imageRotateClient{cc} +} + +func (c *imageRotateClient) RotateImage(ctx context.Context, in *SendImage, opts ...grpc.CallOption) (*GetRotatedImage, error) { + out := new(GetRotatedImage) + err := c.cc.Invoke(ctx, ImageRotate_RotateImage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// ImageRotateServer is the server API for ImageRotate service. +// All implementations must embed UnimplementedImageRotateServer +// for forward compatibility +type ImageRotateServer interface { + RotateImage(context.Context, *SendImage) (*GetRotatedImage, error) + mustEmbedUnimplementedImageRotateServer() +} + +// UnimplementedImageRotateServer must be embedded to have forward compatible implementations. +type UnimplementedImageRotateServer struct { +} + +func (UnimplementedImageRotateServer) RotateImage(context.Context, *SendImage) (*GetRotatedImage, error) { + return nil, status.Errorf(codes.Unimplemented, "method RotateImage not implemented") +} +func (UnimplementedImageRotateServer) mustEmbedUnimplementedImageRotateServer() {} + +// UnsafeImageRotateServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to ImageRotateServer will +// result in compilation errors. +type UnsafeImageRotateServer interface { + mustEmbedUnimplementedImageRotateServer() +} + +func RegisterImageRotateServer(s grpc.ServiceRegistrar, srv ImageRotateServer) { + s.RegisterService(&ImageRotate_ServiceDesc, srv) +} + +func _ImageRotate_RotateImage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendImage) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(ImageRotateServer).RotateImage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: ImageRotate_RotateImage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(ImageRotateServer).RotateImage(ctx, req.(*SendImage)) + } + return interceptor(ctx, in, info, handler) +} + +// ImageRotate_ServiceDesc is the grpc.ServiceDesc for ImageRotate service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var ImageRotate_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "image_rotate.ImageRotate", + HandlerType: (*ImageRotateServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "RotateImage", + Handler: _ImageRotate_RotateImage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/image_rotate/image_rotate.proto", +} diff --git a/proto/image_rotate/image_rotate_pb2.py b/proto/image_rotate/image_rotate_pb2.py new file mode 100644 index 0000000..92827af --- /dev/null +++ b/proto/image_rotate/image_rotate_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/image_rotate/image_rotate.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/image_rotate/image_rotate.proto\x12\x0cimage_rotate\"\x19\n\tSendImage\x12\x0c\n\x04name\x18\x01 \x01(\t\"\"\n\x0fGetRotatedImage\x12\x0f\n\x07message\x18\x01 \x01(\t2V\n\x0bImageRotate\x12G\n\x0bRotateImage\x12\x17.image_rotate.SendImage\x1a\x1d.image_rotate.GetRotatedImage\"\x00\x42=Z;github.com/vhive-serverless/vSwarm-proto/proto/image_rotateb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.image_rotate.image_rotate_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z;github.com/vhive-serverless/vSwarm-proto/proto/image_rotate' + _globals['_SENDIMAGE']._serialized_start=55 + _globals['_SENDIMAGE']._serialized_end=80 + _globals['_GETROTATEDIMAGE']._serialized_start=82 + _globals['_GETROTATEDIMAGE']._serialized_end=116 + _globals['_IMAGEROTATE']._serialized_start=118 + _globals['_IMAGEROTATE']._serialized_end=204 +# @@protoc_insertion_point(module_scope) diff --git a/proto/image_rotate/image_rotate_pb2_grpc.py b/proto/image_rotate/image_rotate_pb2_grpc.py new file mode 100644 index 0000000..b62b140 --- /dev/null +++ b/proto/image_rotate/image_rotate_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.image_rotate import image_rotate_pb2 as proto_dot_image__rotate_dot_image__rotate__pb2 + + +class ImageRotateStub(object): + """The greeting service definition. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.RotateImage = channel.unary_unary( + '/image_rotate.ImageRotate/RotateImage', + request_serializer=proto_dot_image__rotate_dot_image__rotate__pb2.SendImage.SerializeToString, + response_deserializer=proto_dot_image__rotate_dot_image__rotate__pb2.GetRotatedImage.FromString, + ) + + +class ImageRotateServicer(object): + """The greeting service definition. + """ + + def RotateImage(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_ImageRotateServicer_to_server(servicer, server): + rpc_method_handlers = { + 'RotateImage': grpc.unary_unary_rpc_method_handler( + servicer.RotateImage, + request_deserializer=proto_dot_image__rotate_dot_image__rotate__pb2.SendImage.FromString, + response_serializer=proto_dot_image__rotate_dot_image__rotate__pb2.GetRotatedImage.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'image_rotate.ImageRotate', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class ImageRotate(object): + """The greeting service definition. + """ + + @staticmethod + def RotateImage(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, '/image_rotate.ImageRotate/RotateImage', + proto_dot_image__rotate_dot_image__rotate__pb2.SendImage.SerializeToString, + proto_dot_image__rotate_dot_image__rotate__pb2.GetRotatedImage.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata)