-
Notifications
You must be signed in to change notification settings - Fork 162
feat(site-explorer): pair BF4 DPUs by chassis serial #2906
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,8 +18,9 @@ | |
| use std::borrow::Cow; | ||
| use std::sync::Arc; | ||
|
|
||
| use carbide_utils::arch::CpuArchitecture; | ||
| use mac_address::MacAddress; | ||
| use rpc::machine_discovery::DiscoveryInfo; | ||
| use rpc::machine_discovery::{DiscoveryInfo, DmiData, DpuData}; | ||
| use serde_json::json; | ||
|
|
||
| use crate::{Callbacks, LogService, LogServices, hw, redfish}; | ||
|
|
@@ -122,7 +123,9 @@ impl Bluefield4<'_> { | |
| .build(), | ||
| ), | ||
| log_services: Some(Arc::new(Bf4LogServices { | ||
| event_log: DpuEventLog { entries: vec![] }, | ||
| event_log: DpuEventLog { | ||
| entries: vec!["DPU Warm Reset".to_string()], | ||
| }, | ||
| })), | ||
| storage: Some(vec![]), | ||
| processors: Some(vec![]), | ||
|
|
@@ -170,7 +173,28 @@ impl Bluefield4<'_> { | |
| } | ||
|
|
||
| pub fn discovery_info(&self) -> DiscoveryInfo { | ||
| DiscoveryInfo::default() | ||
| DiscoveryInfo { | ||
| machine_type: CpuArchitecture::Aarch64.to_string(), | ||
| machine_arch: Some(rpc::utils::cpu_architecture_to_rpc( | ||
| CpuArchitecture::Aarch64, | ||
| )), | ||
| dmi_data: Some(DmiData { | ||
| board_name: "BlueField-4 DPU".into(), | ||
| product_serial: self.product_serial_number.to_string(), | ||
| board_serial: carbide_utils::DEFAULT_DPU_DMI_BOARD_SERIAL_NUMBER.into(), | ||
| chassis_serial: carbide_utils::DEFAULT_DPU_DMI_CHASSIS_SERIAL_NUMBER.into(), | ||
| product_name: "BlueField-4 DPU".into(), | ||
| sys_vendor: "Nvidia".into(), | ||
| ..Default::default() | ||
| }), | ||
| dpu_info: Some(DpuData { | ||
| part_number: self.part_number().into(), | ||
| part_description: format!("NVIDIA BlueField-4 {}", self.part_number()), | ||
| factory_mac_address: self.host_mac_address.to_string(), | ||
| ..Default::default() | ||
| }), | ||
| ..Default::default() | ||
| } | ||
|
Comment on lines
+176
to
+197
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
fd -e rs . crates | xargs rg -n "Bluefield4::discovery_info|discovery_info\(|DmiData|DpuData|900-9D4B4|BlueField-4 DPU"Repository: NVIDIA/infra-controller Length of output: 13149 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== outline: crates/bmc-mock/src/hw/bluefield4.rs =="
ast-grep outline crates/bmc-mock/src/hw/bluefield4.rs --view expanded || true
echo
echo "== outline: crates/bmc-mock/src/machine_info.rs =="
ast-grep outline crates/bmc-mock/src/machine_info.rs --view expanded | sed -n '1,220p' || true
echo
echo "== search for Bluefield4 discovery tests =="
rg -n "bluefield4\\(|Bluefield4|discovery_info\\(" crates/bmc-mock/src crates/bmc-mock/tests crates/site-explorer/tests crates/host-support/src | sed -n '1,240p'Repository: NVIDIA/infra-controller Length of output: 11305 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "== bluefield4.rs relevant slice =="
sed -n '160,225p' crates/bmc-mock/src/hw/bluefield4.rs | cat -n
echo
echo "== machine_info.rs around Bluefield4 and tests =="
sed -n '130,230p' crates/bmc-mock/src/machine_info.rs | cat -n
echo
echo "== machine_info.rs test slice around BF4 usage =="
sed -n '460,540p' crates/bmc-mock/src/machine_info.rs | cat -n
echo
echo "== search for discovery_info assertions in bmc-mock tests/modules =="
rg -n "discovery_info\\(\\)|machine_arch|part_description|factory_mac_address|board_name|BlueField-4 DPU" crates/bmc-mock/src crates/bmc-mock/tests crates/site-explorer/tests | sed -n '1,220p'Repository: NVIDIA/infra-controller Length of output: 15257 Add direct coverage for 🤖 Prompt for AI AgentsSources: Coding guidelines, Path instructions |
||
| } | ||
|
|
||
| fn part_number(&self) -> &'static str { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be a const, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should but it follows pattern of surroundings. All other part numbers prefixes are defined in corresponding functions. So this refactoring waits its hero.