-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
There was a problem hiding this 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.
docs/adding_new_benchmark.md
Outdated
|
||
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. |
There was a problem hiding this comment.
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.
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. |
docs/adding_new_benchmark.md
Outdated
``` | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
docs/adding_new_benchmark.md
Outdated
``` | ||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
a47a43a
to
233f2bd
Compare
Signed-off-by: lrq619 <[email protected]>
233f2bd
to
2919fd0
Compare
I've take all suggestions and fix some typos. |
@dhschall can we merge this one? |
There was a problem hiding this 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
Compared with original add_benchmark.md, this is a step-by-step guideline on how to implement a new benchmark into vSwarm