project-oak / oak

Meaningful control of data in distributed systems.
Apache License 2.0
1.32k stars 113 forks source link

Separate out generation of protobuf messages and gRPC services #1093

Closed daviddrysdale closed 4 years ago

daviddrysdale commented 4 years ago

We currently generate two different things from our .proto files:

For protobufs used in communication with the Runtime, the message definitions are effectively part of the Oak ABI, and so belong in the oak_abi crate.

However, the generated service code is not part of the ABI; it belongs in the SDK and can't be part of oak_abi (because it would induce a dependency cycle oak_abi -> oak -> oak_abi).

So these two types of generated code should be separate. A large fraction of this is covered by #1086, which allows the generation of just the message definitions in a .proto file.

However, it would be nice to tidy up and complete the process – for example, after #1086 the message definitions for the Roughtime service are in two places:

Ideally the latter would just have the gRPC service code, and would import the message definitions from the former.

daviddrysdale commented 4 years ago

One further thing: we actually generate three different chunks of Rust code from our .proto files:

The last of these is needed for clients of Oak Applications that are written in Rust. That certainly includes the trusted_information_retrieval Rust client, but after #1038 will also include all of the integration tests for example applications.

daviddrysdale commented 4 years ago

I think this is now done (with #1108 and friends)