[gnoi-shutdown]: Use host GnoiClient for DPU shutdown - #427
Conversation
|
/azp run |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Hi, there are workflow run(s) waiting for approval, you may be first-time contributor. I will notify maintainers to help approve once PR is approved. Thanks! ---Powered by SONiC BuildBot
|
138c4a6 to
52a0259
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Call DPUs directly from gnoi-shutdown using the shared GnoiClient from sonic-py-common instead of docker exec through the gnmi container. Use TLS with the DPU's ephemeral certificate, probe the configured port, 8080, and 50052 with System.Time, send one Reboot HALT request, and poll RebootStatus on the selected port. Remove the gnmi.service dependency and keep gnoi-shutdown enabled by multi-user.target without tying it to sonic.target. Signed-off-by: Dennis Lanov <dennis.lanov@gmail.com>
52a0259 to
b8ccb51
Compare
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
hdwhdw
left a comment
There was a problem hiding this comment.
The direct host-client and systemd direction is correct. However, the current Transport Layer Security (TLS) implementation cannot connect to a data processing unit (DPU) that uses the default SONiC ephemeral certificate. Please resolve both blocking TLS issues below.
Can you run an end-to-end test between a SmartSwitch network processing unit (NPU) and a DPU using the default ephemeral TLS configuration?
- Run it immediately after DPU telemetry starts.
- Repeat it after telemetry has run for more than one hour.
- Verify
System.Time, oneReboot(HALT),RebootStatus, and halt-flag clearing. - Verify that the workflow succeeds while
gnmi.serviceis stopped.
The checked-in tests mock TLS credential and channel creation. Passing continuous integration does not validate the production TLS handshake.
|
Thanks, It's confirmed. We reproduced both TLS failures with real gNOI/TLS handshakes:
Before changing #427 again, would you prefer that we pursue:
|
|
These options address different layers. Matching Go’s sonic-py-common could centralize DPU endpoint configuration, leaf certificate retrieval, and credential creation. However, standard grpc-python verification still checks SANs and expiration. The sonic-gnmi I recommend fixing the server contract rather than adding a generic verification-bypass API:
This removes the production dependency on a test certificate. It preserves encrypted host-to-DPU gNOI without introducing a broad verification-bypass API. I am happy to review the sonic-gnmi and sonic-buildimage follow-up PRs. |
|
Thanks, understood. This appears to require prerequisite changes in sonic-gnmi and sonic-buildimage. Are those changes already planned or owned by someone, and should #427 remain on hold until they are available? |
|
@dlanov, do you mind owning the prerequisite changes in sonic-gnmi and sonic-buildimage? This work has no current owner. Scope:
I can review both prerequisite PRs. |
|
By the way, I opened the two prerequisite PRs for this approach:
All required checks pass. @dlanov, please take a look when you have time. If the direction looks right, I would appreciate your approval. These changes let #427 use standard grpc-python verification without the generic skip-verify path. |
|
I verified the non-destructive path:
This test covered TLS setup and the direct |
|
Thanks for opening and validating these. I don’t have maintainer approval rights in these repositories, but I can review the changes from the #427 integration perspective and leave feedback. Formal approval will still need to come from a repository maintainer. |
Why I did it
Fixes sonic-net/sonic-buildimage#29188
gnoi-shutdowncurrently shells into thegnmicontainer to rungnoi_clientfor DPU shutdown. This couples the host shutdown daemon tognmi.serviceand can leave the DPU graceful-shutdown path unavailable whengnmiis stopped or unavailable during service lifecycle operations such asconfig reload.How I did it
Use the shared gNOI client and System stubs from
sonic-py-commondirectly on the host:GnoiClientandsystem_pb2fromsonic_grpc.gnoi.ssl.get_server_certificate()and pin it asroot_certificatesfor the secure gRPC channel.8080, and50052in order withSystem.Time, without probing duplicates.System.Timeto one 10-second budget per candidate port.System.Rebootrequest withHALTon the selected port.System.RebootStatuson the same port, bounded by the configured DPU halt timeout. Treatactive=falsewith either no status field orSTATUS_SUCCESSas complete.gnmi.servicefromWants=andAfter=ingnoi-shutdown.service.Requires=database.service,pmon.serviceordering, andWantedBy=multi-user.target; do not tie the daemon tosonic.target.How to verify it
On a SmartSwitch NPU:
gnoi-shutdownremains available independently ofgnmi.service.Local verification
git diff --checkpasses.python3 -m py_compilepasses for the daemon and its test file.systemd-analyze verifypasses against the modified unit with dependency stubs.systemctl enablevalidation createsmulti-user.target.wants/gnoi-shutdown.service.GnoiClientwith a real TLS gRPC fake server covers TLS certificate pinning, port fallback, oneReboot(HALT), RebootStatus handling, and deadline-bounded polling.Description for the changelog
Call DPU gNOI directly from the host shutdown daemon and remove its dependency on
gnmi.service.