Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[asic_sensors] Generate the asic_sensors polling configuration based on the platform.json and Yang Model supports #20826

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

mlok-nokia
Copy link
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

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
Contributor Author

@judyjoseph Please review this asic-sensors PR. Thanks

@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
…r Nokia platforms

Platforms:
   arm64-nokia_ixs7215_52xb-r0
   x86_64-nokia_ixr7220_h4-r0
   x86_64-nokia_ixr7220_h4_32d-r0
   x86_64-nokia_ixr7220_h5_64d-r0

Signed-off-by: mlok <[email protected]>
@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
Contributor Author

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

container ASIC_SENSORS_POLLER_STATUS {
leaf admin_status {
type poller_status;
default "enable";
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we keep the default as "enable" ?

@judyjoseph
Copy link
Contributor

Minor comments LGTM

@judyjoseph
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Contributor

/Azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@arlakshm
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Need YANG model for ASIC_SENSORS
4 participants