diff --git a/grpcclient/getclient.go b/grpcclient/getclient.go index 0e875b7..b9e8e38 100644 --- a/grpcclient/getclient.go +++ b/grpcclient/getclient.go @@ -18,6 +18,8 @@ func FindServiceName(functionName string) string { return "gptj" case "image-rotate-python", "image-rotate-nodejs", "image-rotate-go", "image-rotate-cython": return "image-rotate" + case "video-processing-python": + return "video-processing" case "spright-parking-python": return "spright-parking" default: @@ -50,6 +52,9 @@ func FindGrpcClient(service_name string) GrpcClient { case "image-rotate": log.Debug("Found image rotate client") return new(ImageRotateClient) + case "video-processing": + log.Debug("Found video processing client") + return new(VideoProcessingClient) // Hotel reservation --- case "Geo", "geo": diff --git a/grpcclient/video_processing_client.go b/grpcclient/video_processing_client.go new file mode 100644 index 0000000..c069f01 --- /dev/null +++ b/grpcclient/video_processing_client.go @@ -0,0 +1,42 @@ +package grpcclient + +import ( + "context" + + pb "github.com/vhive-serverless/vSwarm-proto/proto/video_processing" +) + +type VideoProcessingGenerator struct { + GeneratorBase +} + +func (g *VideoProcessingGenerator) Next() Input { + var pkt = g.defaultInput + return pkt +} + +func (c *VideoProcessingClient) GetGenerator() Generator { + return new(VideoProcessingGenerator) +} + +type VideoProcessingClient struct { + ClientBase + client pb.VideoProcessingClient +} + +func (c *VideoProcessingClient) Init(ctx context.Context, ip, port string) error { + err := c.Connect(ctx, ip, port) + if err != nil { + return err + } + c.client = pb.NewVideoProcessingClient(c.conn) + return nil +} + +func (c *VideoProcessingClient) Request(ctx context.Context, req Input) (string, error) { + r, err := c.client.ConvertToGrayscale(ctx, &pb.SendVideo{Name: req.Value}) + if err != nil { + return "", err + } + return r.GetMessage(), nil +} diff --git a/proto/video_processing/video_processing.pb.go b/proto/video_processing/video_processing.pb.go new file mode 100644 index 0000000..0e59c04 --- /dev/null +++ b/proto/video_processing/video_processing.pb.go @@ -0,0 +1,243 @@ +// 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. DO NOT EDIT. +// versions: +// protoc-gen-go v1.31.0 +// protoc v4.25.0 +// source: proto/video_processing/video_processing.proto + +package video_processing + +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 SendVideo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *SendVideo) Reset() { + *x = SendVideo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_video_processing_video_processing_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendVideo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendVideo) ProtoMessage() {} + +func (x *SendVideo) ProtoReflect() protoreflect.Message { + mi := &file_proto_video_processing_video_processing_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 SendVideo.ProtoReflect.Descriptor instead. +func (*SendVideo) Descriptor() ([]byte, []int) { + return file_proto_video_processing_video_processing_proto_rawDescGZIP(), []int{0} +} + +func (x *SendVideo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +// The response message containing the greetings +type GetGrayscaleVideo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *GetGrayscaleVideo) Reset() { + *x = GetGrayscaleVideo{} + if protoimpl.UnsafeEnabled { + mi := &file_proto_video_processing_video_processing_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *GetGrayscaleVideo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*GetGrayscaleVideo) ProtoMessage() {} + +func (x *GetGrayscaleVideo) ProtoReflect() protoreflect.Message { + mi := &file_proto_video_processing_video_processing_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 GetGrayscaleVideo.ProtoReflect.Descriptor instead. +func (*GetGrayscaleVideo) Descriptor() ([]byte, []int) { + return file_proto_video_processing_video_processing_proto_rawDescGZIP(), []int{1} +} + +func (x *GetGrayscaleVideo) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + +var File_proto_video_processing_video_processing_proto protoreflect.FileDescriptor + +var file_proto_video_processing_video_processing_proto_rawDesc = []byte{ + 0x0a, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x70, 0x72, + 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x70, + 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x10, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x22, 0x1f, 0x0a, 0x09, 0x53, 0x65, 0x6e, 0x64, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x12, 0x12, + 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, + 0x6d, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x47, 0x72, 0x61, 0x79, 0x73, 0x63, 0x61, + 0x6c, 0x65, 0x56, 0x69, 0x64, 0x65, 0x6f, 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, 0x6b, 0x0a, 0x0f, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, + 0x73, 0x69, 0x6e, 0x67, 0x12, 0x58, 0x0a, 0x12, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, + 0x6f, 0x47, 0x72, 0x61, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x12, 0x1b, 0x2e, 0x76, 0x69, 0x64, + 0x65, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x65, + 0x6e, 0x64, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x1a, 0x23, 0x2e, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, + 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, + 0x61, 0x79, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x22, 0x00, 0x42, 0x41, + 0x5a, 0x3f, 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, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x69, 0x6e, + 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_proto_video_processing_video_processing_proto_rawDescOnce sync.Once + file_proto_video_processing_video_processing_proto_rawDescData = file_proto_video_processing_video_processing_proto_rawDesc +) + +func file_proto_video_processing_video_processing_proto_rawDescGZIP() []byte { + file_proto_video_processing_video_processing_proto_rawDescOnce.Do(func() { + file_proto_video_processing_video_processing_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_video_processing_video_processing_proto_rawDescData) + }) + return file_proto_video_processing_video_processing_proto_rawDescData +} + +var file_proto_video_processing_video_processing_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_proto_video_processing_video_processing_proto_goTypes = []interface{}{ + (*SendVideo)(nil), // 0: video_processing.SendVideo + (*GetGrayscaleVideo)(nil), // 1: video_processing.GetGrayscaleVideo +} +var file_proto_video_processing_video_processing_proto_depIdxs = []int32{ + 0, // 0: video_processing.VideoProcessing.ConvertToGrayscale:input_type -> video_processing.SendVideo + 1, // 1: video_processing.VideoProcessing.ConvertToGrayscale:output_type -> video_processing.GetGrayscaleVideo + 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_processing_video_processing_proto_init() } +func file_proto_video_processing_video_processing_proto_init() { + if File_proto_video_processing_video_processing_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_proto_video_processing_video_processing_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_processing_video_processing_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*GetGrayscaleVideo); 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_processing_video_processing_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_proto_video_processing_video_processing_proto_goTypes, + DependencyIndexes: file_proto_video_processing_video_processing_proto_depIdxs, + MessageInfos: file_proto_video_processing_video_processing_proto_msgTypes, + }.Build() + File_proto_video_processing_video_processing_proto = out.File + file_proto_video_processing_video_processing_proto_rawDesc = nil + file_proto_video_processing_video_processing_proto_goTypes = nil + file_proto_video_processing_video_processing_proto_depIdxs = nil +} diff --git a/proto/video_processing/video_processing.proto b/proto/video_processing/video_processing.proto new file mode 100644 index 0000000..0f6cabc --- /dev/null +++ b/proto/video_processing/video_processing.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_processing"; + +package video_processing; + +// The greeting service definition. +service VideoProcessing { + rpc ConvertToGrayscale (SendVideo) returns (GetGrayscaleVideo) {} +} + +// The request message containing the user's name. +message SendVideo { + string name = 1; +} + +// The response message containing the greetings +message GetGrayscaleVideo { + string message = 1; +} \ No newline at end of file diff --git a/proto/video_processing/video_processing_grpc.pb.go b/proto/video_processing/video_processing_grpc.pb.go new file mode 100644 index 0000000..bb4b48b --- /dev/null +++ b/proto/video_processing/video_processing_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_processing/video_processing.proto + +package video_processing + +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 ( + VideoProcessing_ConvertToGrayscale_FullMethodName = "/video_processing.VideoProcessing/ConvertToGrayscale" +) + +// VideoProcessingClient is the client API for VideoProcessing 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 VideoProcessingClient interface { + ConvertToGrayscale(ctx context.Context, in *SendVideo, opts ...grpc.CallOption) (*GetGrayscaleVideo, error) +} + +type videoProcessingClient struct { + cc grpc.ClientConnInterface +} + +func NewVideoProcessingClient(cc grpc.ClientConnInterface) VideoProcessingClient { + return &videoProcessingClient{cc} +} + +func (c *videoProcessingClient) ConvertToGrayscale(ctx context.Context, in *SendVideo, opts ...grpc.CallOption) (*GetGrayscaleVideo, error) { + out := new(GetGrayscaleVideo) + err := c.cc.Invoke(ctx, VideoProcessing_ConvertToGrayscale_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VideoProcessingServer is the server API for VideoProcessing service. +// All implementations must embed UnimplementedVideoProcessingServer +// for forward compatibility +type VideoProcessingServer interface { + ConvertToGrayscale(context.Context, *SendVideo) (*GetGrayscaleVideo, error) + mustEmbedUnimplementedVideoProcessingServer() +} + +// UnimplementedVideoProcessingServer must be embedded to have forward compatible implementations. +type UnimplementedVideoProcessingServer struct { +} + +func (UnimplementedVideoProcessingServer) ConvertToGrayscale(context.Context, *SendVideo) (*GetGrayscaleVideo, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConvertToGrayscale not implemented") +} +func (UnimplementedVideoProcessingServer) mustEmbedUnimplementedVideoProcessingServer() {} + +// UnsafeVideoProcessingServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VideoProcessingServer will +// result in compilation errors. +type UnsafeVideoProcessingServer interface { + mustEmbedUnimplementedVideoProcessingServer() +} + +func RegisterVideoProcessingServer(s grpc.ServiceRegistrar, srv VideoProcessingServer) { + s.RegisterService(&VideoProcessing_ServiceDesc, srv) +} + +func _VideoProcessing_ConvertToGrayscale_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.(VideoProcessingServer).ConvertToGrayscale(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: VideoProcessing_ConvertToGrayscale_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VideoProcessingServer).ConvertToGrayscale(ctx, req.(*SendVideo)) + } + return interceptor(ctx, in, info, handler) +} + +// VideoProcessing_ServiceDesc is the grpc.ServiceDesc for VideoProcessing service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var VideoProcessing_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "video_processing.VideoProcessing", + HandlerType: (*VideoProcessingServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConvertToGrayscale", + Handler: _VideoProcessing_ConvertToGrayscale_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "proto/video_processing/video_processing.proto", +} diff --git a/proto/video_processing/video_processing_pb2.py b/proto/video_processing/video_processing_pb2.py new file mode 100644 index 0000000..04f6c3c --- /dev/null +++ b/proto/video_processing/video_processing_pb2.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: proto/video_processing/video_processing.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/video_processing/video_processing.proto\x12\x10video_processing\"\x19\n\tSendVideo\x12\x0c\n\x04name\x18\x01 \x01(\t\"$\n\x11GetGrayscaleVideo\x12\x0f\n\x07message\x18\x01 \x01(\t2k\n\x0fVideoProcessing\x12X\n\x12\x43onvertToGrayscale\x12\x1b.video_processing.SendVideo\x1a#.video_processing.GetGrayscaleVideo\"\x00\x42\x41Z?github.com/vhive-serverless/vSwarm-proto/proto/video_processingb\x06proto3') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'proto.video_processing.video_processing_pb2', _globals) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'Z?github.com/vhive-serverless/vSwarm-proto/proto/video_processing' + _globals['_SENDVIDEO']._serialized_start=67 + _globals['_SENDVIDEO']._serialized_end=92 + _globals['_GETGRAYSCALEVIDEO']._serialized_start=94 + _globals['_GETGRAYSCALEVIDEO']._serialized_end=130 + _globals['_VIDEOPROCESSING']._serialized_start=132 + _globals['_VIDEOPROCESSING']._serialized_end=239 +# @@protoc_insertion_point(module_scope) diff --git a/proto/video_processing/video_processing_pb2_grpc.py b/proto/video_processing/video_processing_pb2_grpc.py new file mode 100644 index 0000000..5c704d7 --- /dev/null +++ b/proto/video_processing/video_processing_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_processing import video_processing_pb2 as proto_dot_video__processing_dot_video__processing__pb2 + + +class VideoProcessingStub(object): + """The greeting service definition. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.ConvertToGrayscale = channel.unary_unary( + '/video_processing.VideoProcessing/ConvertToGrayscale', + request_serializer=proto_dot_video__processing_dot_video__processing__pb2.SendVideo.SerializeToString, + response_deserializer=proto_dot_video__processing_dot_video__processing__pb2.GetGrayscaleVideo.FromString, + ) + + +class VideoProcessingServicer(object): + """The greeting service definition. + """ + + def ConvertToGrayscale(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_VideoProcessingServicer_to_server(servicer, server): + rpc_method_handlers = { + 'ConvertToGrayscale': grpc.unary_unary_rpc_method_handler( + servicer.ConvertToGrayscale, + request_deserializer=proto_dot_video__processing_dot_video__processing__pb2.SendVideo.FromString, + response_serializer=proto_dot_video__processing_dot_video__processing__pb2.GetGrayscaleVideo.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'video_processing.VideoProcessing', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class VideoProcessing(object): + """The greeting service definition. + """ + + @staticmethod + def ConvertToGrayscale(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_processing.VideoProcessing/ConvertToGrayscale', + proto_dot_video__processing_dot_video__processing__pb2.SendVideo.SerializeToString, + proto_dot_video__processing_dot_video__processing__pb2.GetGrayscaleVideo.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata)