oak: Aggregator example should not create new nodes from existing nodes

https://github.com/project-oak/oak/blob/dc23f27ad67f1707a8d92fb126fed932a80f4599/examples/aggregator/module/rust/src/lib.rs#L108-L111

Once we start labelling created nodes with more sensible labels, the main programming pattern will be for all nodes and channels to be created directly by the initial node of an application, while “worker” nodes just receive handles to pre-existing objects.

For the aggregator example, this means creating the gRPC client pseudo-node as part of the oak_main entrypoint:

https://github.com/project-oak/oak/blob/dc23f27ad67f1707a8d92fb126fed932a80f4599/examples/aggregator/module/rust/src/lib.rs#L166-L182

and then pass its handle to the gRPC worker.

The complication is that the gRPC worker currently only accepts gRPC invocation messages as input, so it needs to be modified so that it can accept a new type of message which is essentially an enum of either an “init” message (containing the initial handles and any other configuration), or the actual gRPC message to process.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

And started receiving the following errors:

error[E0277]: the trait bound `proto::oak::encap::GrpcResponse: handle::HandleVisit` is not satisfied
  --> /opt/my-project/sdk/target/debug/build/oak-c66b74b6dc5405b8/out/oak.invocation.rs:6:5
   |
6  |     pub response_sender: ::core::option::Option<crate::io::Sender<super::encap::GrpcResponse>>,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `handle::HandleVisit` is not implemented for `proto::oak::encap::GrpcResponse`
   | 
  ::: rust/oak/src/io/sender.rs:30:22
   |
30 | pub struct Sender<T: Encodable> {
   |                      --------- required by this bound in `io::sender::Sender`
   |
   = note: required because of the requirements on the impl of `io::encodable::Encodable` for `proto::oak::encap::GrpcResponse`

Looks like I need to update the generator code.