-
Notifications
You must be signed in to change notification settings - Fork 15
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
Tweaked invoker and added tests #540
base: main
Are you sure you want to change the base?
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.
Split it into two files: gprc_invoker and grpc_vswarm_invoker. Also there is a weird indentation going on, please run through gofmt.
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.
There are still issues with indentations. There is an additional space on each line. Please run it through gofmt.
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.
I think there is no point in touching this file at all. You swapped a couple of lines and renamed one of the imports, nothing substantial.
newinvoker := CreateInvoker(cfgSwarm, nil, nil) | ||
|
||
start = time.Now() | ||
success, record = newinvoker.Invoke(&testFunction, &testRuntimeSpecs) |
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 should fail. We deploy the same gRPC server as runs in the invitro images. It should fail to correctly respond to vSwarm invoker.
I don't see the tests for the driver/clients actually running in the CI. Can you please check the workflow? Also, there is a linter error, please fix. |
Please squash your commits, sign off, and rebase the branch on current main. |
pkg/driver/clients/invoker.go
Outdated
@@ -18,7 +18,12 @@ func CreateInvoker(cfg *config.LoaderConfiguration, announceDoneExe *sync.WaitGr | |||
return newAWSLambdaInvoker(announceDoneExe) | |||
case "Dirigent", "Dirigent-RPS": | |||
if cfg.InvokeProtocol == "grpc" { | |||
return newGRPCInvoker(cfg) | |||
if !cfg.VSwarm { |
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.
You put it into Dirigent mode, the intended place should be knative.
39cdf02
to
4c372fb
Compare
Hi, I've rebased on main and squashed and signed off my commits. I've also fixed the Dirigent mode to Knative mode. Please check |
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.
Please rebase and fix the indentation in pkg/driver/clients/grpc_client.go
server/trace-func-go/trace_func.go
Outdated
@@ -62,5 +62,5 @@ func main() { | |||
log.Infof("Function type: EMPTY\n") | |||
} | |||
|
|||
standard.StartGRPCServer("", serverPort, functionType, *zipkin) | |||
standard.StartGRPCServer("", serverPort, functionType, *zipkin, false) |
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.
Can you extract the vSwarm from here? I don't like that we are introducing this vSwarm greeter into our Invitro workload. Since we are creating it just for testing, we don't need to reuse all of the features of the workload that we have (tracing, handling SIGTERM); you can just put this mock server into test file instead. Or if you can, you can try to reuse the relay server from vSwarm, not to duplicate the code.
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.
Fixed this, fixed the formatting as well and rebased on main. Please review again.
Thanks
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.
I don't think you did what I was asking for.
Since we use StartVSwarmGRPCServer
only in tests, we don't need anything from it except the ability to accept and respond with VSwarm protobufs. So, you can significantly slim it down by removing everything unnecessary for the simplest gRPC server (signal handling, TraceFunctionExecution
, tracing).
197fbbc
to
af79127
Compare
af79127
to
df997aa
Compare
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.
Please fix the failing linter test and look at the comment about test VSwarm server once again.
pkg/driver/clients/grpc_client.go
Outdated
if strings.Contains(strings.ToLower(i.cfg.Platform), "dirigent") { | ||
dialOptions = append(dialOptions, grpc.WithAuthority(function.Name)) // Dirigent specific | ||
} |
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.
Why did you remove that?
I don't see a reason to change this file at all. Can you clarify why do you need that?
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.
Seems like this is a bad merge. Added the lines again.
} | ||
func TestVSwarmClientWithServerBatchWorkload(t *testing.T) { | ||
logrus.SetLevel(logrus.TraceLevel) | ||
err := os.Setenv("ITERATIONS_MULTIPLIER", "225") |
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.
I don't think this is needed for any VSwarm functions.
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.
Removed this test
server/trace-func-go/trace_func.go
Outdated
@@ -62,5 +62,5 @@ func main() { | |||
log.Infof("Function type: EMPTY\n") | |||
} | |||
|
|||
standard.StartGRPCServer("", serverPort, functionType, *zipkin) | |||
standard.StartGRPCServer("", serverPort, functionType, *zipkin, false) |
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.
I don't think you did what I was asking for.
Since we use StartVSwarmGRPCServer
only in tests, we don't need anything from it except the ability to accept and respond with VSwarm protobufs. So, you can significantly slim it down by removing everything unnecessary for the simplest gRPC server (signal handling, TraceFunctionExecution
, tracing).
c447b94
to
46a4c3b
Compare
Signed-off-by: aryans1204 <[email protected]> Add VHIVE_REPO and LOADER_REPO to setup script config Signed-off-by: Mohsen Ghasemi <[email protected]> Added tests and created new vSwarm invoker Fixed linting Fixed VSwarm Invoker for Knative mode Committer: aryans1204 [email protected] Fixed VSwarm Invoker for Knative mode Added new invoker for vSwarm functions and added tests Signed-off-by: aryans1204 <[email protected]> Fixed formatting under grpc_client.go Signed-off-by: aryans1204 <[email protected]> Fixed driver tests Signed-off-by: aryans1204 <[email protected]> Fixed linting and slimmed VSwarm tests Signed-off-by: aryans1204 <[email protected]> Fixed linting errors Signed-off-by: aryans1204 <[email protected]>
46a4c3b
to
f3b274d
Compare
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.
I think there is no point in touching this file at all. You swapped a couple of lines and renamed one of the imports, nothing substantial.
type vSwarmServer struct { | ||
helloworld.UnimplementedGreeterServer | ||
} | ||
func (s *vSwarmServer) SayHello(_ context.Context, req *helloworld.HelloRequest) (*helloworld.HelloReply, error) { |
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 is used only for tests. Please remove everything except the return statement in the body and move this together with StartVSwarmGRPCServer to the respective test file.
Please re-read previous comments, I've mentioned slimming down this part and moving to the test file several times already.
record.Instance = extractInstanceName(response.GetMessage()) | ||
if strings.HasPrefix(response.GetMessage(), "FAILURE - mem_alloc") { | ||
record.MemoryAllocationTimeout = true | ||
} else { | ||
record.ActualMemoryUsage = common.Kib2Mib(0) | ||
} |
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.
Does this make sense with the messages that the relay sends? Here, we rely on our workload to fill the message with instance ID or failure message. Does the relay do the same? I doubt that
|
||
} | ||
func TestVSwarmClientUnreachable(t *testing.T) { |
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.
The blank line should be between the closing brace and new function, not inside the previous function. Please format carefully and look at all of your changes for similar inconsistent formatting.
Summary
A small summary of the requirements (in one/two sentences).
Implementation Notes ⚒️
External Dependencies 🍀
Breaking API Changes⚠️
Simply specify none (N/A) if not applicable.