Repository navigation
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports syseepromd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/syseepromd is a port of sonic-syseepromd/scripts/syseepromd. It writes the same EEPROM_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-syseepromd-rs to the workspace's source package. - The Python syseepromd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), pcied (sonic-net#918), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of syseepromd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports pcied. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/pcied is a port of sonic-pcied/scripts/pcied. It writes the same PCIE_DEVICE and PCIE_DEVICES entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-pcied-rs to the workspace's source package. - The Python pcied is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of pcied. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
13ab9d6 to
b4fe91c
Compare
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports chassisd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/chassisd is a port of sonic-chassisd/scripts/chassisd. It writes the same CHASSIS_TABLE, CHASSIS_MODULE_TABLE and CHASSIS_MIDPLANE_TABLE entries, the ASIC tables and, on a SmartSwitch, DPU_STATE and the DPU reboot causes as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-chassisd-rs to the workspace's source package. - The Python chassisd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of chassisd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports stormond. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/stormond is a port of sonic-stormond/scripts/stormond. It writes the same STORAGE_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-stormond-rs to the workspace's source package. - The Python stormond is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of stormond. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768, which this PR depends on). This PR adds the Rust workspace, the code the Rust daemons share, and the first daemon. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/thermalctld is a port of sonic-thermalctld/scripts/thermalctld. It writes the same TEMPERATURE_INFO, FAN_INFO, FAN_DRAWER_INFO and PHYSICAL_ENTITY_INFO entries and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - crates/pmon-common holds what the Rust daemons share: the STATE_DB tables and their mock, Python str() formatting, the platform_env.conf readers, the poll cadence and logging. - Comments cite the Python code by symbol, for example thermalctld:TemperatureUpdater._collect_thermals. A pmon-common test fails if a cited symbol no longer exists or if a comment cites a line number. - debian/ builds the workspace as one source package. This PR adds its first binary package, sonic-thermalctld-rs. cargo test runs in the package build. - The workspace takes platform-api and platform-provider from sonic-platform-common, and swss-common from sonic-swss-common, as git dependencies, the way sonic-swss and sonic-dash-ha take swss-common. Cargo.lock pins the commits. sonic-buildimage builds against its own submodules instead: it gives debian/rules a cargo config whose [patch] entries point at them, so the PyO3 bridge matches the Python facade in the same image. - azure-pipelines.yml builds, lints and tests the Rust workspace with line coverage, so the diff coverage check counts the Rust code. - The Python thermalctld is unchanged. A platform picks one of the two in pmon_daemon_control.json. This is the first of six PRs. The other five each port one daemon on top of this one and do not depend on each other, so this PR merges first and they follow in any order: - sonic-net#916: psud - sonic-net#917: syseepromd - sonic-net#918: pcied - sonic-net#919: stormond - sonic-net#920: chassisd #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of thermalctld, and the crate the Rust pmon daemons share. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
b4fe91c to
e285151
Compare
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports stormond. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/stormond is a port of sonic-stormond/scripts/stormond. It writes the same STORAGE_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-stormond-rs to the workspace's source package. - The Python stormond is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of stormond. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports chassisd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/chassisd is a port of sonic-chassisd/scripts/chassisd. It writes the same CHASSIS_TABLE, CHASSIS_MODULE_TABLE and CHASSIS_MIDPLANE_TABLE entries, the ASIC tables and, on a SmartSwitch, DPU_STATE and the DPU reboot causes as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-chassisd-rs to the workspace's source package. - The Python chassisd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of chassisd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports pcied. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/pcied is a port of sonic-pcied/scripts/pcied. It writes the same PCIE_DEVICE and PCIE_DEVICES entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-pcied-rs to the workspace's source package. - The Python pcied is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of pcied. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports syseepromd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/syseepromd is a port of sonic-syseepromd/scripts/syseepromd. It writes the same EEPROM_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-syseepromd-rs to the workspace's source package. - The Python syseepromd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), pcied (sonic-net#918), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of syseepromd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
#### Why I did it The pmon daemons thermalctld, psud, chassisd, stormond, pcied and syseepromd move to Rust while they keep reaching the hardware through each vendor's Python platform API. That API returns platform objects and stores callbacks, so a Rust daemon would cross the language boundary once per attribute per device. sonic-platform-common now declares a flat facade and generates the Python facade, the Rust trait and the PyO3 bridge from it, so a row crosses once and the two sides cannot disagree. This PR builds the Rust daemons into the image and lets each platform switch to them. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - rules/sonic-pmon-daemons-rs.mk builds the Rust workspace in sonic-platform-daemons as one source package with six binary packages, sonic-<daemon>-rs, plus their dbgsym packages. rules/sonic-pmon-daemons-rs.dep tracks its inputs. - rules/docker-platform-monitor.mk installs them in the pmon container beside the Python daemons. - The daemons' workspace takes the platform API crates and swss-common from git, at the commits its Cargo.lock pins. rules/sonic-pmon-daemons-rs.cargo.toml points them at src/sonic-platform-common and src/sonic-swss-common instead, so the Rust daemons build from the same commits as the rest of the image. The .mk passes it to the package build. - docker-pmon.supervisord.conf.j2 starts the Rust binary for a daemon when the platform's pmon_daemon_control.json sets use_rust_<daemon>. platform_api_<daemon> chooses the platform API implementation, pyo3 by default, and is passed on the daemon's command line. - The Mellanox switch and BlueField platforms turn the Rust daemons on. Every other platform keeps the Python daemons. - The build needs src/sonic-platform-common and src/sonic-platform-daemons at commits that carry the facade and the Rust daemons. This PR does not move them; the submodule update follows once the PRs below merge. Submodule PRs, to merge first: - sonic-net/sonic-platform-common#768: the facade and its crates - sonic-net/sonic-platform-daemons#915: the Rust workspace, pmon-common and thermalctld - then, in any order, one daemon each: sonic-net/sonic-platform-daemons#916 (psud), sonic-net/sonic-platform-daemons#917 (syseepromd), sonic-net/sonic-platform-daemons#918 (pcied), sonic-net/sonic-platform-daemons#919 (stormond), sonic-net/sonic-platform-daemons#920 (chassisd) #### How to verify it Build the image and run the sonic-mgmt platform tests (tests/platform_tests) on a platform that turns the Rust daemons on. In the pmon container, supervisorctl status lists the daemons, and ps shows them running as /usr/bin/<daemon>-rs. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Run thermalctld, psud, chassisd, stormond, pcied and syseepromd in Rust on the platforms that turn them on. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports psud. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/psud is a port of sonic-psud/scripts/psud. It writes the same PSU_INFO, the PSU half of FAN_INFO, the PSU tray LEDs and, on a modular chassis, the power budget in CHASSIS_INFO as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-psud-rs to the workspace's source package. - The Python psud is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of psud. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
e285151 to
934a7c2
Compare
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports chassisd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/chassisd is a port of sonic-chassisd/scripts/chassisd. It writes the same CHASSIS_TABLE, CHASSIS_MODULE_TABLE and CHASSIS_MIDPLANE_TABLE entries, the ASIC tables and, on a SmartSwitch, DPU_STATE and the DPU reboot causes as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-chassisd-rs to the workspace's source package. - The Python chassisd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of chassisd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
yxieca
left a comment
There was a problem hiding this comment.
Reviewed this at 934a7c2e. One blocking item; the rest are non-blocking.
Scope note: this is based on #915, so I reviewed only the psud delta — crates/psud/src/*, the crate and workspace manifests, azure-pipelines.yml, debian/*, .gitignore. #915's content I reviewed separately.
Blocking — a transient read at start-up pins psu_num=0 for the life of the daemon.
publish_counts(&platform.get_psus().unwrap_or_default(), chassis_tbl.as_ref());That's the only production call site, and it runs once before the loop — run() calls cycles.next, one_pass, updater.clear, chassis_tbl.del, and one_pass never republishes the counts. So when get_psus() fails at boot, publish_counts computes count(PowerEntityKind::Psu) over an empty slice, writes ("psu_num", "0"), and nothing ever corrects it.
The daemon already rejects this interpretation one function away. On the same get_psus() failure, one_pass does:
pmon_common::fail_once_warn!(read, "Failed to update PSU data - {e}");
// Not treated as "every PSU vanished": that would blank PSU_INFO
// on a transient i2c failure and red every tray LED.
return;A failed read is explicitly not "no PSUs" in the loop, but is "zero PSUs" at start-up.
I checked the Python before raising this. psud defaults num_psus_chassis = 0 but guards only except NotImplementedError — a transient error isn't caught there, so it propagates, the daemon dies, supervisor restarts it, and the count gets republished correctly. unwrap_or_default() swallows every error class, so where Python fails loudly and self-corrects, this fails silently and permanently.
The consequence is the one your own doc names: "show platform psustatus iterates PSU 1..n, so a wrong number here hides a PSU that is otherwise being published correctly." And 0 is numeric, so the FRU MIB doesn't even fall back to None — consumers iterate 1..0 and see nothing while PSU_INFO fills in normally.
I'm aware the count API is deliberately absent from the facade — #768 omits all thirteen get_num_* variants with the reasoning that declaring both gives a platform two ways to disagree with itself, so deriving the count from get_psus() is right. But that's what makes this sharper rather than excusing it: in Python the count came from get_num_psus(), which is len(self._psu_list) and cannot fail transiently, while the port collapses it onto the hardware-touching enumeration. The count now inherits that call's failure modes, so a derived count must not be published from a failed read. On Err, leave the key untouched and retry on a later cycle (or exit with a load error) rather than writing a derived zero.
Non-blocking:
-
The same swallow disables the power budget permanently.
let is_modular = platform.get_chassis_info(CHASSIS_COLS).map(|c| c.is_modular_chassis).unwrap_or(false);thenlet budget = is_modular.then(PowerBudget::default);— decided once, moved into the loop, never revisited. One failed read at start-up and a modular chassis silently runs without a budget or a master PSU LED for the rest of the run. -
An unreachable arm.
} else if first_run && !present { log::error!("{name} is not present."); }can't fire:PsuStatus::default()haspresence: true, so on the only pass wherefirst_runholds,set_presence(false)always returnspresence_changed == trueand the earlier branch wins — which already logs the same line. -
PSU fan rows are frozen between presence transitions.
if presence_changed || first_run { publish_psu_fans(...) }meansspeed,directionandtimestampstay at their first-pass values until a PSU is pulled. That reads against the module doc, which justifies writing these rows at psud's three seconds precisely soshow platform psustatusandshow platform fandon't disagree for up to a minute. Both existing tests only exercise the first pass and a presence change, so neither would catch a stale speed. If the gate is deliberate, the file's own rule ("Where it departs from Python on purpose, a comment at that spot says so") asks for a note. -
Teardown leaks the fan rows.
Updater::cleardeletes thePSU_INFOandPHYSICAL_ENTITY_INFOkeys but never theFAN_INFOkeys this daemon wrote for PSU/PDB fans, so the rows from (3) outlive the daemon. -
Two timestamp formatters in one pass, unexplained.
refresh_oneends with("timestamp", fmt::epoch_timestamp())whilepublish_psu_fansends with("timestamp", fmt::timestamp()). Every other spelling divergence in this file carries a comment, so this reads as an oversight. -
A doc block is attached to the wrong constant. The paragraph describing the
FanInfocolumns (and theis_under_speed/Mellanox rationale) sits immediately aboveconst CHASSIS_COLS, so rustdoc renders PSU-fan prose on the chassis constant whileFAN_COLSfurther down has no doc at all. -
#[derive(Default)]onUpdateryieldsfirst_run: false, whichnew()has to patch — anUpdater::default()would skip every first-pass LED write.PowerBudgethand-writesDefaultfor exactly this reason, with the comment explaining why. -
Each cycle re-reads everything to use one field.
one_passdoes a fullget_psus()and a fullget_fans(FAN_COLS)for the LED refresh, butupdate_led_colorconsumes onlyrow.status_ledandfan.status_led. The doc notes Python's equivalent isget_status_led(), and theFAN_COLSprojection exists precisely to avoid reads Mellanox logs at ERR. -
.gitignoreaddstarget/under a comment saying "Not*/target/" — an unanchored pattern matches at any depth;/target/is the one that matches the comment. -
azure-pipelines.ymlleaks$CARGO_TARGET_DIRwhen the job fails —set -exaborts before the trailingrm -rf, under a comment about the agent's disk being nearly full. Atrap ... EXITwould honour the intent.
One question: psu_fans() filters on f.kind and f.parent_name, but FAN_COLS requests only DIRECTION, SPEED_PCT and STATUS_LED, and the parity test lists name/direction/speed/LED. Are kind and parent_name always-populated rather than projectable? If they're declinable, every PSU fan row would silently disappear.
AI-assisted review, reviewed by Ying Xie (@yxieca).
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
Thanks @yxieca. Addressed in 6e4fac7: Blocking: the counts are published from the first PSU read that succeeds, and again only if they change. They are never published from a failed read. (For the record, Python's count is
Q: |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports psud. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/psud is a port of sonic-psud/scripts/psud. It writes the same PSU_INFO, the PSU half of FAN_INFO, the PSU tray LEDs and, on a modular chassis, the power budget in CHASSIS_INFO as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-psud-rs to the workspace's source package. - The Python psud is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of psud. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports pcied. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/pcied is a port of sonic-pcied/scripts/pcied. It writes the same PCIE_DEVICE and PCIE_DEVICES entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-pcied-rs to the workspace's source package. - The Python pcied is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of pcied. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768, which this PR depends on). This PR adds the Rust workspace, the code the Rust daemons share, and the first daemon. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/thermalctld is a port of sonic-thermalctld/scripts/thermalctld. It writes the same TEMPERATURE_INFO, FAN_INFO, FAN_DRAWER_INFO and PHYSICAL_ENTITY_INFO entries and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - crates/pmon-common holds what the Rust daemons share: the STATE_DB tables and their mock, Python str() formatting, the platform_env.conf readers, the poll cadence and logging. - Comments cite the Python code by symbol, for example thermalctld:TemperatureUpdater._collect_thermals. A pmon-common test fails if a cited symbol no longer exists or if a comment cites a line number. - debian/ builds the workspace as one source package. This PR adds its first binary package, sonic-thermalctld-rs. cargo test runs in the package build. - The workspace takes platform-api and platform-provider from sonic-platform-common, and swss-common from sonic-swss-common, as git dependencies, the way sonic-swss and sonic-dash-ha take swss-common. Cargo.lock pins the commits. sonic-buildimage builds against its own submodules instead: it gives debian/rules a cargo config whose [patch] entries point at them, so the PyO3 bridge matches the Python facade in the same image. - azure-pipelines.yml builds, lints and tests the Rust workspace with line coverage, so the diff coverage check counts the Rust code. - The Python thermalctld is unchanged. A platform picks one of the two in pmon_daemon_control.json. This is the first of six PRs. The other five each port one daemon on top of this one and do not depend on each other, so this PR merges first and they follow in any order: - sonic-net#916: psud - sonic-net#917: syseepromd - sonic-net#918: pcied - sonic-net#919: stormond - sonic-net#920: chassisd #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of thermalctld, and the crate the Rust pmon daemons share. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
09758f8 to
2aef57b
Compare
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports syseepromd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/syseepromd is a port of sonic-syseepromd/scripts/syseepromd. It writes the same EEPROM_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-syseepromd-rs to the workspace's source package. - The Python syseepromd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), pcied (sonic-net#918), stormond (sonic-net#919), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of syseepromd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports stormond. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/stormond is a port of sonic-stormond/scripts/stormond. It writes the same STORAGE_INFO entries as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-stormond-rs to the workspace's source package. - The Python stormond is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), chassisd (sonic-net#920). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of stormond. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
#### Why I did it The pmon daemons move to Rust while they keep reaching the hardware through each vendor's Python platform API, over the facade that sonic-platform-common generates (sonic-net/sonic-platform-common#768). This PR ports chassisd. ##### Work item tracking - Microsoft ADO **(number only)**: #### How I did it - crates/chassisd is a port of sonic-chassisd/scripts/chassisd. It writes the same CHASSIS_TABLE, CHASSIS_MODULE_TABLE and CHASSIS_MIDPLANE_TABLE entries, the ASIC tables and, on a SmartSwitch, DPU_STATE and the DPU reboot causes as the Python daemon and logs the same messages. Where it departs from Python on purpose, a comment at that spot says so. - It builds on crates/pmon-common and adds the binary package sonic-chassisd-rs to the workspace's source package. - The Python chassisd is unchanged. A platform picks one of the two in pmon_daemon_control.json. It is based on sonic-net#915, which adds the Rust workspace, crates/pmon-common and thermalctld; until sonic-net#915 merges, this PR also shows that commit. It does not depend on the other daemons, which are ported in PRs of their own: psud (sonic-net#916), syseepromd (sonic-net#917), pcied (sonic-net#918), stormond (sonic-net#919). #### How to verify it Build an image whose pmon runs the Rust daemons and run the sonic-mgmt platform tests (tests/platform_tests) on it. #### Which release branch to backport (provide reason below if selected) - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO): Failure type: #### Tested branch - [x] master - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 - [ ] 202512 - [ ] 202605 - [ ] 202608 - [ ] N/A #### Test result master: the sonic-mgmt platform tests pass with the Rust pmon daemons running. #### Description for the changelog Add a Rust port of chassisd. #### Link to config_db schema for YANG module changes N/A #### A picture of a cute animal (not mandatory but encouraged) Signed-off-by: Geoffrey Lyu <glv@nvidia.com>
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Why I did it
The pmon daemons move to Rust while they keep reaching the hardware
through each vendor's Python platform API, over the facade that
sonic-platform-common generates (sonic-net/sonic-platform-common#768).
This PR ports psud.
Work item tracking
How I did it
PSU_INFO, the PSU half of FAN_INFO, the PSU tray LEDs and, on a
modular chassis, the power budget in CHASSIS_INFO as the Python daemon
and logs the same messages. Where it departs from Python on purpose, a
comment at that spot says so.
sonic-psud-rs to the workspace's source package.
pmon_daemon_control.json.
It is based on #915, which adds the Rust
workspace, crates/pmon-common and thermalctld; until #915 merges, this
PR also shows that commit. It does not depend on the other daemons,
which are ported in PRs of their own: syseepromd (#917), pcied (#918),
stormond (#919), chassisd (#920).
How to verify it
Build an image whose pmon runs the Rust daemons and run the sonic-mgmt
platform tests (tests/platform_tests) on it.
Which release branch to backport (provide reason below if selected)
Tracking issue/work item for backport/cherry-pick request (GitHub issue or Microsoft ADO):
Failure type:
Tested branch
Test result
master: the sonic-mgmt platform tests pass with the Rust pmon daemons
running.
Description for the changelog
Add a Rust port of psud.
Link to config_db schema for YANG module changes
N/A
A picture of a cute animal (not mandatory but encouraged)