Skip to content

Commit 26908e9

Browse files
Lakshmandhschall
authored andcommitted
Added all proto files for the video-processing benchmark.
Signed-off-by: Lakshman <Lakshman@localhost>
1 parent d40c15b commit 26908e9

File tree

7 files changed

+564
-0
lines changed

7 files changed

+564
-0
lines changed

grpcclient/getclient.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ func FindServiceName(functionName string) string {
1818
return "gptj"
1919
case "image-rotate-python", "image-rotate-nodejs", "image-rotate-go", "image-rotate-cython":
2020
return "image-rotate"
21+
case "video-processing-python":
22+
return "video-processing"
2123
case "spright-parking-python":
2224
return "spright-parking"
2325
default:
@@ -50,6 +52,9 @@ func FindGrpcClient(service_name string) GrpcClient {
5052
case "image-rotate":
5153
log.Debug("Found image rotate client")
5254
return new(ImageRotateClient)
55+
case "video-processing":
56+
log.Debug("Found video processing client")
57+
return new(VideoProcessingClient)
5358

5459
// Hotel reservation ---
5560
case "Geo", "geo":
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package grpcclient
2+
3+
import (
4+
"context"
5+
6+
pb "github.com/vhive-serverless/vSwarm-proto/proto/video_processing"
7+
)
8+
9+
type VideoProcessingGenerator struct {
10+
GeneratorBase
11+
}
12+
13+
func (g *VideoProcessingGenerator) Next() Input {
14+
var pkt = g.defaultInput
15+
return pkt
16+
}
17+
18+
func (c *VideoProcessingClient) GetGenerator() Generator {
19+
return new(VideoProcessingGenerator)
20+
}
21+
22+
type VideoProcessingClient struct {
23+
ClientBase
24+
client pb.VideoProcessingClient
25+
}
26+
27+
func (c *VideoProcessingClient) Init(ctx context.Context, ip, port string) error {
28+
err := c.Connect(ctx, ip, port)
29+
if err != nil {
30+
return err
31+
}
32+
c.client = pb.NewVideoProcessingClient(c.conn)
33+
return nil
34+
}
35+
36+
func (c *VideoProcessingClient) Request(ctx context.Context, req Input) (string, error) {
37+
r, err := c.client.ConvertToGrayscale(ctx, &pb.SendVideo{Name: req.Value})
38+
if err != nil {
39+
return "", err
40+
}
41+
return r.GetMessage(), nil
42+
}

proto/video_processing/video_processing.pb.go

Lines changed: 243 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// MIT License
2+
3+
// Copyright (c) 2024 EASE Lab
4+
5+
// Permission is hereby granted, free of charge, to any person obtaining a copy
6+
// of this software and associated documentation files (the "Software"), to deal
7+
// in the Software without restriction, including without limitation the rights
8+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
// copies of the Software, and to permit persons to whom the Software is
10+
// furnished to do so, subject to the following conditions:
11+
12+
// The above copyright notice and this permission notice shall be included in all
13+
// copies or substantial portions of the Software.
14+
15+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
// SOFTWARE.
22+
23+
24+
syntax = "proto3";
25+
26+
option go_package = "github.com/vhive-serverless/vSwarm-proto/proto/video_processing";
27+
28+
package video_processing;
29+
30+
// The greeting service definition.
31+
service VideoProcessing {
32+
rpc ConvertToGrayscale (SendVideo) returns (GetGrayscaleVideo) {}
33+
}
34+
35+
// The request message containing the user's name.
36+
message SendVideo {
37+
string name = 1;
38+
}
39+
40+
// The response message containing the greetings
41+
message GetGrayscaleVideo {
42+
string message = 1;
43+
}

0 commit comments

Comments
 (0)