Skip to content

[asic_sensors] Generate the asic_sensors polling configuration based on the platform.json#20826

Merged
rlhui merged 10 commits intosonic-net:masterfrom
mlok-nokia:asic_sensor_pulling_config
Dec 24, 2024
Merged

[asic_sensors] Generate the asic_sensors polling configuration based on the platform.json#20826
rlhui merged 10 commits intosonic-net:masterfrom
mlok-nokia:asic_sensor_pulling_config

Conversation

@mlok-nokia
Copy link
Copy Markdown
Contributor

@mlok-nokia mlok-nokia commented Nov 15, 2024

Why I did it

For any platform which supports the asic_sensors pulling, it requires the configuration files (config_db#.json) contain the following configuration to trigger the system to poll the ASIC sensors temperature. Fixes https://github.com/Nokia-ION/ndk/issues/48
Adding Yang model support to fixes #20633

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Add new module src/sonic-config-engine/asic_sensors_config.py with function get_asic_sensors_config(). This function checks if device data platform.json contains the following configuration, it will generate the asic_sensors pulling configuration.
$ cat platform.json
{
...
...
...
   "asic_sensors": {
        "poll_interval": "10",
        "poll_admin_status": "enable"
    }
}
  • Modify the script sonic-cfggen platform option "-H" to call the function get_asic_sensor_config() to generate the asic_sensors pulling configuration.
  • Added new UT test_asic_sensors_config() to test_cfggen.py to test related the implementation.

Notice: For all platforms which support the asic_sensors polling requires to add the following definition to the device data platform.json file

$ cat platform.json
{
...
...
...
   "asic_sensors": {
        "poll_interval": "10",
        "poll_admin_status": "enable"
    }
}

Also add Yang Model support the ASIC_SENSORS configuration. INcluding YangModel UT.

How to verify it

  1. Running the new image on the platform which supports the ASIC_SENSORS
  2. Execute the CLI command "sonic-cfggen -H --print-data", the following code will be generated
{
   "ASIC_SENSORS": {
        "ASIC_SENSORS_POLLER_INTERVAL": {
            "interval": "10"
        },
        "ASIC_SENSORS_POLLER_STATUS": {
            "admin_status": "enable"
        }
    }
}

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305
  • 202405
  • 202411

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mlok-nokia mlok-nokia marked this pull request as ready for review November 15, 2024 22:44
@mlok-nokia mlok-nokia force-pushed the asic_sensor_pulling_config branch 2 times, most recently from fba67c0 to b26025d Compare November 18, 2024 19:05
@mlok-nokia mlok-nokia changed the title [asic_sensors] Generate the aisc_sensors pulling configuration based on the platform.json [asic_sensors] Generate the asic_sensors polling configuration based on the platform.json Nov 18, 2024
@mlok-nokia
Copy link
Copy Markdown
Contributor Author

@judyjoseph Please review this asic-sensors PR. Thanks

@rlhui rlhui requested a review from judyjoseph November 20, 2024 18:15
@mlok-nokia mlok-nokia changed the title [asic_sensors] Generate the asic_sensors polling configuration based on the platform.json [asic_sensors] Generate the asic_sensors polling configuration based on the platform.json and Yang Model supports Nov 21, 2024
@mlok-nokia mlok-nokia force-pushed the asic_sensor_pulling_config branch 2 times, most recently from 7c56970 to f991ffc Compare November 21, 2024 22:10
@mlok-nokia
Copy link
Copy Markdown
Contributor Author

@arlakshm This Includes the Yang Model for ASIC_SENSORS configuration. Please review it

@judyjoseph
Copy link
Copy Markdown
Contributor

Minor comments LGTM

@judyjoseph
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Copy Markdown
Contributor

/Azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Copy Markdown
Contributor

@mlok-nokia, can you divide this PR in two, one for the config_db related change and one for the platform related change

@mlok-nokia
Copy link
Copy Markdown
Contributor Author

mlok-nokia commented Dec 1, 2024

@mlok-nokia, can you divide this PR in two, one for the config_db related change and one for the platform related change
Platform related change is moved to PR - #20979. Please review it

@arlakshm
Copy link
Copy Markdown
Contributor

arlakshm commented Dec 2, 2024

/Azp run Azure.sonic-buildimage

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

judyjoseph
judyjoseph previously approved these changes Dec 2, 2024
@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to msft-202405: Azure/sonic-buildimage-msft#500

@mlok-nokia
Copy link
Copy Markdown
Contributor Author

@arlakshm This PR needs to be merged to 202405 branch. Please cherry-pick it to the branch 202405. Thanks

@rlhui
Copy link
Copy Markdown
Contributor

rlhui commented Jan 17, 2025

@arlakshm This PR needs to be merged to 202405 branch. Please cherry-pick it to the branch 202405. Thanks

@mlok-nokia what's the reason?

VladimirKuk pushed a commit to Marvell-switching/sonic-buildimage that referenced this pull request Jan 21, 2025
…on the platform.json (sonic-net#20826)

For any platform which supports the asic_sensors pulling, it requires the configuration files (config_db#.json) contain the following configuration to trigger the system to poll the ASIC sensors temperature. Fixes Nokia-ION/ndk#48
Adding Yang model support to fixes sonic-net#20633

---------

Signed-off-by: mlok <[email protected]>
@mlok-nokia
Copy link
Copy Markdown
Contributor Author

mlok-nokia commented Jan 21, 2025

@arlakshm This PR needs to be merged to 202405 branch. Please cherry-pick it to the branch 202405. Thanks

@mlok-nokia what's the reason?

The following Nokia pizza boxes support the asic_sensors. I was told that they require this PR also.
x86_64-nokia_ixr7220_h4_32d-r0
arm64-nokia_ixs7215_52xb-r0
x86_64-nokia_ixr7220_h4-r0
x86_64-nokia_ixr7220_h5_64d-r0

@rlhui
Copy link
Copy Markdown
Contributor

rlhui commented Jan 21, 2025

could it go to 202411 only? Adding @bingwang-ms to assess this for 202405 cherry-pick request

@mlok-nokia
Copy link
Copy Markdown
Contributor Author

could it go to 202411 only? Adding @bingwang-ms to assess this for 202405 cherry-pick request

It could go into branch 202411. Also this PR on 202411 requires the YangModel PR #21579

arlakshm added a commit to Azure/sonic-buildimage-msft that referenced this pull request Apr 21, 2025
…on the platform.json (#20826) (#1023)

Why I did it
For any platform which supports the asic_sensors pulling, it requires the configuration files (config_db#.json) contain the following configuration to trigger the system to poll the ASIC sensors temperature. Fixes Nokia-ION/ndk#48 Adding Yang model support to fixes #20633

Work item tracking
Microsoft ADO 32401949:
Port sonic-net/sonic-buildimage#20826 to 202503 branch
MichaelZaidman added a commit to MichaelZaidman/sonic-buildimage that referenced this pull request Jul 3, 2025
With the enhancement introduced in PR sonic-net#20826 -
"[asic_sensors] Generate the ASIC sensor polling configuration
based on the platform.json" - we can now define ASIC sensor polling
settings directly in platform.json.

This change removes the need for a custom.json override and simplifies
platform-specific configuration by centralizing the polling interval
and status settings under platform.json.

Signed-off-by: Michael Zaidman <[email protected]>
vmittal-msft pushed a commit to vmittal-msft/sonic-buildimage that referenced this pull request Oct 20, 2025
…on the platform.json (sonic-net#20826)

For any platform which supports the asic_sensors pulling, it requires the configuration files (config_db#.json) contain the following configuration to trigger the system to poll the ASIC sensors temperature. Fixes Nokia-ION/ndk#48
Adding Yang model support to fixes sonic-net#20633

---------

Signed-off-by: mlok <[email protected]>
@mlok-nokia mlok-nokia deleted the asic_sensor_pulling_config branch March 25, 2026 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Need YANG model for ASIC_SENSORS