Summary
The gnoi_shutdown_daemon currently makes gNOI System RPCs (Reboot HALT and RebootStatus) by shelling out to docker exec gnmi gnoi_client .... This creates an unnecessary dependency on the gnmi container being healthy, adds subprocess overhead, and relies on fragile stdout parsing.
Proposal
Replace the subprocess-based gnoi_client invocations with direct Python gRPC calls using generated protobuf stubs for the OpenConfig gNOI System service.
Key changes:
- Vendor gNOI System proto stubs (
system_pb2.py, system_pb2_grpc.py)
- Add a lightweight
GnoiClient wrapper for Reboot and RebootStatus RPCs
- Refactor
GnoiRebootHandler to use native gRPC instead of docker exec
- Remove
execute_command() subprocess helper (no longer needed)
- Update tests to mock at the gRPC stub level
Benefits:
- No dependency on gnmi container being running
- Structured error handling via gRPC status codes
- No subprocess overhead or stdout parsing
- Smaller attack surface (no shell-out through Docker CLI)
Design Doc
See doc/gnoi-native-grpc-design.md in this repository for the full design.
Implementation Plan
Single PR covering all phases — proto stubs, client wrapper, daemon refactor, and test updates.
Summary
The
gnoi_shutdown_daemoncurrently makes gNOI System RPCs (Reboot HALT and RebootStatus) by shelling out todocker exec gnmi gnoi_client .... This creates an unnecessary dependency on the gnmi container being healthy, adds subprocess overhead, and relies on fragile stdout parsing.Proposal
Replace the subprocess-based
gnoi_clientinvocations with direct Python gRPC calls using generated protobuf stubs for the OpenConfig gNOI System service.Key changes:
system_pb2.py,system_pb2_grpc.py)GnoiClientwrapper forRebootandRebootStatusRPCsGnoiRebootHandlerto use native gRPC instead ofdocker execexecute_command()subprocess helper (no longer needed)Benefits:
Design Doc
See
doc/gnoi-native-grpc-design.mdin this repository for the full design.Implementation Plan
Single PR covering all phases — proto stubs, client wrapper, daemon refactor, and test updates.