This PR fixes both the unclear docstrings in the client API and the simulation mode error ambiguity in the client and server.
model (str): Path to Onnx model file.
tensor_inputs (Union[Tuple[List[int], ModelDatumType], List[Tuple[List[int], ModelDatumType]]): The list of input fact and datum types for each input grouped together in lists, describing the different inputs of the model.
tensor_outputs (Union[ModelDatumType, List[ModelDatumType]): The list of datum types describing the different output types of the model. Defaults to ModelDatumType.F32
shape (Tuple, optional): The shape of the model input. Defaults to None.
dtype (ModelDatumType, optional): The type of the model input data (f32 by default). Defaults to ModelDatumType.F32.
dtype_out (ModelDatumType, optional): The type of the model output data (f32 by default). Defaults to ModelDatumType.F32.
sign (bool, optional): Get signed responses from the server or not. Defaults to False.
model_name (Optional[str], optional): Name of the model.
For the simulation mode error when building the end-to-end tests, we replace UNIMPLEMENTED error code with FAILED_PRECONDITION in both the server and the client.
elif rpc_error.code() == grpc.StatusCode.UNAVAILABLE:
return f"Failed to connect to GRPC server: code={rpc_error.code()} message={rpc_error.details()}"
elif rpc_error.code() == grpc.StatusCode.UNIMPLEMENTED:
return f"Incompatible client/server versions, code={rpc_error.code()} message={rpc_error.details()}"
elif rpc_error.code() == grpc.StatusCode.FAILED_PRECONDITION:
return f"Attestation is not available. Running in Simulation Mode, code={rpc_error.code()} message={rpc_error.details()}"
else:
return (
f"Received RPC error: code={rpc_error.code()} message={rpc_error.details()}"
)
- On the server side:
```rust
if cfg!(SGX_MODE = "SW") {
return Err(Status::failed_precondition(
"Attestation is not available. Running in Simulation Mode",
));
}
Related Issue
This project accepts pull requests related to open issues. If suggesting a new feature or change, please discuss it in an issue first.
If fixing a bug, there should be an issue describing it with steps to reproduce.
Please link to the issue here.
Type of change
The types of changes must be deduced from the labels of the related issues. Please consider providing these further details.
[x] This change requires a documentation update
[x] This change affects the client
[x] This change affects the server
[ ] This change affects the API
[ ] This change only concerns the documentation
How Has This Been Tested?
All the client unit tests work perfectly, and the end-to-end tests, also work.
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[ ] I have updated the documentation according to my changes
Description
This PR fixes both the unclear docstrings in the client API and the simulation mode error ambiguity in the client and server.
UNIMPLEMENTED
error code withFAILED_PRECONDITION
in both the server and the client.def check_rpc_exception(rpc_error): if rpc_error.code() == grpc.StatusCode.CANCELLED: return f"Cancelled GRPC call: code={rpc_error.code()} message={rpc_error.details()}"
Related Issue
This project accepts pull requests related to open issues. If suggesting a new feature or change, please discuss it in an issue first. If fixing a bug, there should be an issue describing it with steps to reproduce. Please link to the issue here.
Type of change
The types of changes must be deduced from the labels of the related issues. Please consider providing these further details.
How Has This Been Tested?
All the client unit tests work perfectly, and the end-to-end tests, also work.
Checklist: