Skip to content
This repository has been archived by the owner on Mar 13, 2021. It is now read-only.

Initial gRPC implementation and samples #35

Closed
wants to merge 7 commits into from
Closed

Initial gRPC implementation and samples #35

wants to merge 7 commits into from

Conversation

dturanski
Copy link

@dturanski dturanski commented Oct 11, 2017

Resolves #32

/**
* The gRPC server port.
*/
private int port=10382;
Copy link
Author

Choose a reason for hiding this comment

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

Apparently gRPC has no default port. This one is 'gR' decoded.

>>> "%d%d"%(ord('g'),ord('R'))
'10382'

Copy link
Contributor

@ericbottard ericbottard left a comment

Choose a reason for hiding this comment

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

Still need to actually run this, but here is a first review pass

</plugin>
</plugins>
</build>
</project>
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing newline

Copy link
Author

Choose a reason for hiding this comment

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

I have newline in my local. I'm not sure what's going on.

}

/*
* TODO: Reply can be Empty for sink behavior. Maybe move this can be a separate RPC.
Copy link
Contributor

Choose a reason for hiding this comment

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

The "Maybe move..." sentence does not make sense


service StringFunction {
rpc Call(fntypes.Request) returns (fntypes.Reply) {}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Newline

Copy link
Author

Choose a reason for hiding this comment

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

I'm not able to fix this for some reason

public class GrpcIntegrationTests {
@Autowired Dispatcher dispatcher;

@Ignore
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, this doesn't test much, does it ? :)

public void start() throws IOException {
server.start();

Runtime.getRuntime().addShutdownHook(new Thread() {
Copy link
Contributor

Choose a reason for hiding this comment

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

This feels a bit dirty. Can't cleanup be managed at the test level, rather than the whole JVM's?

Copy link
Author

Choose a reason for hiding this comment

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

Not sure. I took this from sample code on the gRPC developers guide

@@ -0,0 +1,2 @@
proto/
proto/
Copy link
Contributor

Choose a reason for hiding this comment

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

Double entry

@ericbottard
Copy link
Contributor

ericbottard commented Oct 12, 2017

I think there is something phony going on with the doubly nested @Configuration classes.
This is what I see in the sidecar log for the echo function (not even involving gRPC normally). The pod does not start correctly.

2017-10-12 09:13:42.101  INFO 1 --- [           main] i.s.sidecar.FunctionSidecarApplication   : The following profiles are active: stdio
2017-10-12 09:13:42.153  INFO 1 --- [           main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@6477463f: startup date [Thu Oct 12 09:13:42 GMT 2017]; root of context hierarchy
2017-10-12 09:13:42.770  INFO 1 --- [           main] o.s.b.f.s.DefaultListableBeanFactory     : Overriding bean definition for bean 'dispatcher' with a different definition: replacing [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=dispatcherConfiguration.GrpcDispatcherConfig.BlockingStubConfiguration; factoryMethodName=dispatcher; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [io/sk8s/sidecar/DispatcherConfiguration$GrpcDispatcherConfig$BlockingStubConfiguration.class]] with [Root bean: class [null]; scope=; abstract=false; lazyInit=false; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=io.sk8s.sidecar.DispatcherConfiguration$StdioDispatcherConfig; factoryMethodName=dispatcher; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [io/sk8s/sidecar/DispatcherConfiguration$StdioDispatcherConfig.class]]

Wondering if the level 2 inner class should not bear @Profile as well


=== Build the gRPC sample image
```
samples/grpc/dockerize
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd centralize the (non-maven) dockerizations in the dockerize script at the root of the project

Copy link
Author

Choose a reason for hiding this comment

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

So far the main dockerize script is for required components. This one is only required for the grpc sample.

<properties>
<java.version>1.8</java.version>
<protobuf.version>3.3.0</protobuf.version>
<grpc.version>1.4.0</grpc.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

<artifactId>protobuf-maven-plugin</artifactId>
<version>${protobuf.plugin.version}</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.3.0:exe:${os.detected.classifier}</protocArtifact>
Copy link
Contributor

Choose a reason for hiding this comment

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

Version numbers in here should use properties defined above

@dturanski
Copy link
Author

Closing - will create a new PR to merge with master

@dturanski dturanski closed this Oct 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants