Skip to content

[pmon] Port psud to Rust - #916

Open
ganglyu wants to merge 3 commits into
sonic-net:masterfrom
ganglyu:glv/pmon-rs-psud
Open

ganglyu wants to merge 3 commits into
sonic-net:masterfrom
ganglyu:glv/pmon-rs-psud

Conversation

@ganglyu

@ganglyu ganglyu commented Sep 30, 2026 •

Copy link
Copy Markdown

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 #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)

  • 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

  • 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)

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

ganglyu added a commit to ganglyu/sonic-buildimage that referenced this pull request Sep 30, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Sep 30, 2026
#### 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>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@yxieca yxieca left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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); then let 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.

  2. An unreachable arm. } else if first_run && !present { log::error!("{name} is not present."); } can't fire: PsuStatus::default() has presence: true, so on the only pass where first_run holds, set_presence(false) always returns presence_changed == true and the earlier branch wins — which already logs the same line.

  3. PSU fan rows are frozen between presence transitions. if presence_changed || first_run { publish_psu_fans(...) } means speed, direction and timestamp stay 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 so show platform psustatus and show platform fan don'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.

  4. Teardown leaks the fan rows. Updater::clear deletes the PSU_INFO and PHYSICAL_ENTITY_INFO keys but never the FAN_INFO keys this daemon wrote for PSU/PDB fans, so the rows from (3) outlive the daemon.

  5. Two timestamp formatters in one pass, unexplained. refresh_one ends with ("timestamp", fmt::epoch_timestamp()) while publish_psu_fans ends with ("timestamp", fmt::timestamp()). Every other spelling divergence in this file carries a comment, so this reads as an oversight.

  6. A doc block is attached to the wrong constant. The paragraph describing the FanInfo columns (and the is_under_speed/Mellanox rationale) sits immediately above const CHASSIS_COLS, so rustdoc renders PSU-fan prose on the chassis constant while FAN_COLS further down has no doc at all.

  7. #[derive(Default)] on Updater yields first_run: false, which new() has to patch — an Updater::default() would skip every first-pass LED write. PowerBudget hand-writes Default for exactly this reason, with the comment explaining why.

  8. Each cycle re-reads everything to use one field. one_pass does a full get_psus() and a full get_fans(FAN_COLS) for the LED refresh, but update_led_color consumes only row.status_led and fan.status_led. The doc notes Python's equivalent is get_status_led(), and the FAN_COLS projection exists precisely to avoid reads Mellanox logs at ERR.

  9. .gitignore adds target/ under a comment saying "Not */target/" — an unanchored pattern matches at any depth; /target/ is the one that matches the comment.

  10. azure-pipelines.yml leaks $CARGO_TARGET_DIR when the job fails — set -ex aborts before the trailing rm -rf, under a comment about the agent's disk being nearly full. A trap ... EXIT would 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).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@ganglyu

ganglyu commented Oct 9, 2026

Copy link
Copy Markdown
Author

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 len(self._psu_list), which reads no hardware, so it never had this failure mode.)

  1. Whether the chassis is modular is asked every pass, as in Python. The budget is built on first need and kept.
  2. Removed.
  3. Same gate as Python (if presence_changed or self.first_run in update_psu_data). thermalctld refreshes speed and direction every cycle.
  4. Matches Python: psud's __del__ never touches FAN_INFO. thermalctld owns those rows; deleting them from psud would blank thermalctld's columns whenever only psud restarts.
  5. Both formats are Python's: epoch float for PSU_INFO, %Y%m%d %H:%M:%S for FAN_INFO. Comments added.
    6, 7. Fixed.
  6. A pass reads again only after it wrote an LED, and the fan read asks for the LED column only.
  7. /target/ (in [pmon] Run thermalctld in Rust over the generated platform API #915).
  8. The target dir is under Agent.TempDirectory, which the agent cleans after each job.

Q: kind and parent_name are Parent() fields. They have no column bit and are always populated.

@ganglyu
ganglyu requested a review from yxieca October 9, 2026 02:43
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Oct 13, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Oct 13, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Oct 13, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Oct 13, 2026
#### 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>
ganglyu added a commit to ganglyu/sonic-platform-daemons that referenced this pull request Oct 13, 2026
#### 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>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants