-
Notifications
You must be signed in to change notification settings - Fork 113
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
gRPC server pseudo-node in Rust Oak Runtime #751
Comments
TLS credentials are not implemented because Rust Oak Runtime does not have a gRPC server pseudo-node for receiving messages from clients yet. Before Split gRPC (#627) is implemented we could have a gRPC server pseudo-node implemented as a Tonic server (related to #695) that encapsulates client requests in a generic Protobuf message: oak/oak/proto/grpc_encap.proto Lines 30 to 34 in 09c7d6d
and passes it to the initial Oak node, specified in the config: oak/examples/hello_world/config/config.textproto Lines 12 to 13 in 09c7d6d
|
The C++ implementation of the gRPC pseudo-node uses the grpc::AsyncGenericService, that accepts all gRPC calls and does not implement any particular Protobuf schema: oak/oak/server/oak_grpc_node.cc Lines 43 to 45 in 09c7d6d
Have you seen a similar service for Tonic? oak/examples/hello_world/proto/hello_world.proto Lines 30 to 35 in 09c7d6d
oak/experimental/split_grpc/server/src/main.rs Lines 84 to 88 in 09c7d6d
|
The approach I was considering was to create a new generic service (see #695 (comment)). The service would need to implement a This service would look similar to some of the code generated by Tonic for a proto file (eg https://github.com/project-oak/oak/pull/647/files#diff-6116dfd8bdebbd1ea4776bec4c89ecccR65) Initially, we can test using only a unary service and later figure out how to handle client streaming or bidirectional streaming services in a generic way. This service could then be added using |
In order to be able to use impl<T: HelloWorld> tonic::transport::NamedService for HelloWorldServer<T> {
const NAME: &'static str = "oak.examples.hello_world.HelloWorld";
} And it requires to set a service name (e.g. Is it enough to just set an empty string as a service name? Because it looks like upon receiving a message from a client Tonic searches for a corresponding service based on its name. |
Looking at the Tonic code, it seems that the routing just checks that the request URI starts with I would think that an empty string would work, although it feels like it might be brittle if the logic changes in future. For initial testing it should be OK, but it might be better in the long term to use hyper directly, rather than Tonic, as we are not currently relying on any real gRPC functionality in the gRPC pseudo node. The code could look very similar to the hyper web API example: |
Yes, my suggestion is to aim directly for a Hyper service, and not involve Tonic at all, if possible. |
Tonic provides a nice mechanism for configuring TLS. When using Hyper directly, it would need code similar to the following: |
Have Log and Wasm nodes implement it. Ref project-oak#603 project-oak#751
Have Log and Wasm nodes implement it. Add a simple test for the Wasm node. Ref project-oak#603 project-oak#751
Have Log and Wasm nodes implement it. Add a simple test for the Wasm node. Ref project-oak#603 project-oak#751
Have Log and Wasm nodes implement it. Add a simple test for the Wasm node. Ref project-oak#603 project-oak#751
Have Log and Wasm nodes implement it. Add a simple test for the Wasm node. Ref project-oak#603 project-oak#751
Have Log and Wasm nodes implement it. Add a simple test for the Wasm node. Ref project-oak#603 project-oak#751
Since Hyper requires the function that creates and starts a server to be Do we need to consider making oak/oak/server/rust/oak_runtime/src/runtime/mod.rs Lines 626 to 633 in 589b2d2
But I think this may require rewriting a lot of internal Runtime code in |
This change adds a Rust gRPC server pseudo-node. Fixes #751
Currently Rust Oak Runtime doesn't support TLS gRPC credentials that is supported by the C++ version:
oak/oak/server/dev/dev_oak_loader.h
Lines 33 to 34 in 09c7d6d
Necessary, since we are moving towards using a Rust Oak Loader binary in the future #749.
The text was updated successfully, but these errors were encountered: