Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docs for detailed add new benchmark in vSwarm #611

Merged
merged 1 commit into from
Aug 23, 2023
Merged

Conversation

lrq619
Copy link
Contributor

@lrq619 lrq619 commented Jul 11, 2023

Compared with original add_benchmark.md, this is a step-by-step guideline on how to implement a new benchmark into vSwarm

@lrq619 lrq619 requested a review from dhschall July 11, 2023 01:54
Copy link
Contributor

@dhschall dhschall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all thank you very much for your help on improving the documentation! This is awesome!
I made some notes. Please feel free to include them.


Add a new folder to `proto/` named by your benchmark `{bench}`, add file `{bench}.proto` to this `proto/{bench}/` folder, which should define the protobuf of your benchmark.

In `{bench}.proto` file, always define your service as `Greeter` since this is the grpc service that will be invoked by the relay.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not have to be Greeter. I.e. most of the standalone benchmarks have custom protocols. (https://github.com/vhive-serverless/vSwarm-proto/blob/main/proto/aes/aes.proto). This is actualy the reason why we have the relay. Otherwise, the invoker can be used to invoke the function without the relay.

Suggested change
In `{bench}.proto` file, always define your service as `Greeter` since this is the grpc service that will be invoked by the relay.
In `{bench}.proto` file, define the needed grpc service. Note that invoker and most of vHive work with the simple [HelloWorld](https://grpc.io/docs/what-is-grpc/introduction/) service. However, you can implement arbitrary services for your function as the relay, sitting in between the invoker and your function, can be used to make translations. Refer to [aes.proto](https://github.com/vhive-serverless/vSwarm-proto/blob/main/proto/aes/aes.proto) and the corresponding [translation](https://github.com/vhive-serverless/vSwarm-proto/blob/main/grpcclient/aes_client.go) as an example of a custom service.

```
protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=paths=source_relative ./proto/bert/*.proto
```
This generates protobuf files for go
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This generates protobuf files for go
This generates protobuf files for go.
Alternatively, run `make proto-all` in the root of vSwarm-proto, which does both steps for all protocols automatically.

```
This generates protobuf files for go

Then, in `vSwarm-proto/grpcclient` foler, add a file named `{bench}_client.go`, this is the client that relay would return to the invoker. Please refer to other `*_client.go` on how to write this file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then, in `vSwarm-proto/grpcclient` foler, add a file named `{bench}_client.go`, this is the client that relay would return to the invoker. Please refer to other `*_client.go` on how to write this file.
Then, in `vSwarm-proto/grpcclient` folder, add a file named `{bench}_client.go`. This is the client that the relay will select to invoke your function. Each client must implement [GrpcClient](https://github.com/vhive-serverless/vSwarm-proto/blob/70781f2339083f8c6d298ce0be13e7b7869c1409/grpcclient/grpcclient.go#L79) interface.
`Init` and `Close` are used to set up and close the connection to the function.
`GetGenerator` will must return an generator for creating new input values for your function.
`Request` is the actual invocation of the function.
Refer to other `*_client.go` clients for more details about how to implement those functions.

@lrq619 lrq619 force-pushed the add-benchmark-doc branch 3 times, most recently from a47a43a to 233f2bd Compare August 14, 2023 07:06
@lrq619
Copy link
Contributor Author

lrq619 commented Aug 14, 2023

I've take all suggestions and fix some typos.

@lrq619 lrq619 requested a review from dhschall August 14, 2023 07:49
@ustiugov
Copy link
Member

@dhschall can we merge this one?

@dhschall dhschall enabled auto-merge (rebase) August 23, 2023 13:23
Copy link
Contributor

@dhschall dhschall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks and sorry for the delay

@dhschall dhschall merged commit b85906f into main Aug 23, 2023
28 checks passed
@dhschall dhschall deleted the add-benchmark-doc branch August 23, 2023 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants