Skip to content
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

Server-streaming support in gRPC server pseudo-Node #1117

Merged
merged 6 commits into from
Jun 10, 2020
Merged

Server-streaming support in gRPC server pseudo-Node #1117

merged 6 commits into from
Jun 10, 2020

Conversation

daviddrysdale
Copy link
Contributor

Checklist

  • Pull request affects core Oak functionality (e.g. runtime, SDK, ABI)
    • I have written tests that cover the code changes.
    • I have checked that these tests are run by
      Cloudbuild
    • I have updated documentation accordingly.
    • I have raised an issue to
      cover any TODOs and/or unfinished work.
  • Pull request includes prototype/experimental work that is under
    construction.

@daviddrysdale daviddrysdale added the WIP Work in progress label Jun 9, 2020
@daviddrysdale daviddrysdale removed the WIP Work in progress label Jun 9, 2020
@daviddrysdale daviddrysdale marked this pull request as ready for review June 9, 2020 17:29
@daviddrysdale daviddrysdale requested a review from ipetr0v June 9, 2020 17:32
Commit 95ecef4 ("examples: get C++ hello_world module working")
updated the manual encoding of a GrpcResponse protobuf to allow for
the removal of the Any type, but forgot to update the enclosing length.

This means that the last=true flag was not being picked up.
In preparation for adding server-streaming method support in future,
reorganize the invocation processing to put all per-response code in
a (single-shot) loop.

Convert read_grpc_response() into an Iterator to feed this loop.

Also, put the closing of the response channel into a manual Drop
implementation for the Iterator, to ensure it always gets done
automatically.
Transform the iterator over encapsulated gRPC responses into one over
tonic responses, then convert that iterator into a futures stream.

Make the GrpcResponseIterator responsible for updating relevant metrics,
and make sure it pays attention to the rsp.last flag when available.
@daviddrysdale daviddrysdale merged commit 0f088a7 into project-oak:master Jun 10, 2020
@daviddrysdale daviddrysdale deleted the sstream branch June 10, 2020 08:50
@github-actions
Copy link

Reproducibility Index:

ecea68e5de2d6863b68e9e74cadc655234581ec072aa229a5b817ce3d47c8df0  ./examples/target/wasm32-unknown-unknown/release/abitest_0_frontend.wasm
4ae04aa804f678fbf3b2cf1a0a89b6c99a238b92be65c0ac3d495327d1528535  ./examples/target/wasm32-unknown-unknown/release/abitest_1_backend.wasm
9b36e5dd48247ab45c55524910cb5372f4f23953c8d7cdea5e5aab60fc4f5d1d  ./examples/target/wasm32-unknown-unknown/release/aggregator.wasm
d6a1b0eda0dcece7dbe8a4cd20e02210f48a81a8c4d0e74d76f33e6bd0149a4a  ./examples/target/wasm32-unknown-unknown/release/chat.wasm
7f984c597596b0b2e9784b9c6138a7421a647914d813edccd5eb18bea0542be0  ./examples/target/wasm32-unknown-unknown/release/hello_world.wasm
b5a880ab6b42ef642ca99aed36985bbcea1907487c882ca6d54d1570d94ff615  ./examples/target/wasm32-unknown-unknown/release/machine_learning.wasm
f8b4bd6f86cb8d4bbd10919b66057388f2d6a32cbd06c1581f716f7bf35877f5  ./examples/target/wasm32-unknown-unknown/release/private_set_intersection.wasm
6bbb55c5423a78ddb4fa3916769cc2b815fc73e1be03436d5a9c50090f3a8c62  ./examples/target/wasm32-unknown-unknown/release/running_average.wasm
54a8fb024f3900baabb992cadf9e0faf7e3106113e5c161bab183dcd02fabee1  ./examples/target/wasm32-unknown-unknown/release/translator.wasm
63008f43c845ce5f8e9d5d3b149bee3b6b118904f16083098c7467b50e971de4  ./examples/target/wasm32-unknown-unknown/release/trusted_information_retrieval.wasm
1fff88460ba69b3e24830d7336f7c1f017dec8905509542390f4a42496019afa  ./target/x86_64-unknown-linux-musl/release/oak_loader

Reproducibility Index diff:

diff --git a/reproducibility_index b/reproducibility_index
index 796c9b1..bd43e30 100644
--- a/reproducibility_index
+++ b/reproducibility_index
@@ -8,4 +8,4 @@ f8b4bd6f86cb8d4bbd10919b66057388f2d6a32cbd06c1581f716f7bf35877f5  ./examples/tar
 6bbb55c5423a78ddb4fa3916769cc2b815fc73e1be03436d5a9c50090f3a8c62  ./examples/target/wasm32-unknown-unknown/release/running_average.wasm
 54a8fb024f3900baabb992cadf9e0faf7e3106113e5c161bab183dcd02fabee1  ./examples/target/wasm32-unknown-unknown/release/translator.wasm
 63008f43c845ce5f8e9d5d3b149bee3b6b118904f16083098c7467b50e971de4  ./examples/target/wasm32-unknown-unknown/release/trusted_information_retrieval.wasm
-312000d647ef51e8ace08611af2224c1a03968d9738885e33d4c841e7dce730f  ./target/x86_64-unknown-linux-musl/release/oak_loader
+1fff88460ba69b3e24830d7336f7c1f017dec8905509542390f4a42496019afa  ./target/x86_64-unknown-linux-musl/release/oak_loader

daviddrysdale added a commit that referenced this pull request Jun 15, 2020
@daviddrysdale daviddrysdale mentioned this pull request Jul 16, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants