feat: improve copy-bfb-to-dpu-rshim flow#920
Conversation
Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
🔐 TruffleHog Secret Scan✅ No secrets or credentials found! Your code has been scanned for 700+ types of secrets and credentials. All clear! 🎉 🕐 Last updated: 2026-04-13 18:21:33 UTC | Commit: e5ff17c |
| } | ||
|
|
||
| if let Some(host_ip) = host_bmc_ip { | ||
| { |
There was a problem hiding this comment.
I don't think I've seen this in rust before.
There was a problem hiding this comment.
It's just a way of creating a new scope so that all the variables inside it are freed after the block ends. Pretty much just a helper function for the host endpoint validation logic.
There was a problem hiding this comment.
yea, I know what it does, I've just never seen it used in rust ;)
Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
| .map_err(io_ssh_error)?; | ||
| std::fs::set_permissions(&askpass_path, std::fs::Permissions::from_mode(0o700)) | ||
| .map_err(io_ssh_error)?; | ||
| } |
There was a problem hiding this comment.
I don't know if writing a pw to a file is such a good idea. how does ssh console do it?
There was a problem hiding this comment.
The SSH console uses the russh library directly to create a client, so the password stays in memory. I need to supply the password somehow to the system scp call so I went with the SSH_ASKPASS tempfile as the simplest approach without changing the container build. Another way would be to install sshpass in the carbide-api container, but I didn't want to add that dependency.
preingestion.bfb already lives in the container with bf.cfg appended, which contains the BMC user/password and never gets cleaned up unlike the tempfile :(
Signed-off-by: Krish Dandiwala <kdandiwala@nvidia.com>
Description
This PR improves the
carbide-admin-cli site-explorer copy-bfb-to-dpu-rshimflow in preingestion by:host_bmc_iprequired to issue a platform powercycle after the BFB is successfully installed.--pre-copy-powercycleto optionally power-cycle the host before the copy to release rshim control to the DPU BMC.login:,Running bfb_post_install from bf.cfg,total 100% complete). Once detected, the post-install host power-cycle is triggered automatically.Type of Change
Related Issues (Optional)
Breaking Changes
Testing
Additional Notes