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

[chassisd] Add script to initialize chassis info in STATE_DB #183

Merged
merged 3 commits into from
May 18, 2021

Conversation

alexrallen
Copy link
Contributor

@alexrallen alexrallen commented May 12, 2021

Description

I added a new script chassis_db_init that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table.

Motivation and Context

I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.

How Has This Been Tested?

Unit tests were added and was deployed and tested on Mellanox platform MSN2700.

@lgtm-com
Copy link

lgtm-com bot commented May 12, 2021

This pull request introduces 1 alert when merging e7601d8 into d0be634 - view on LGTM.com

new alerts:

  • 1 for Syntax error

@jleveque
Copy link
Contributor

Also please update PR description, as it references chassisshow, which is not part of this PR.

@alexrallen alexrallen requested a review from jleveque May 12, 2021 20:08
@jleveque
Copy link
Contributor

Just curious why a separate script is necessary for this. Why can we not simply add this logic to chassisd when it starts up?

@alexrallen
Copy link
Contributor Author

We decided on a separate script because chassisd is primarily for handling modular chassis management (and thus is only run on modular chassis platforms), a separate task from uploading basic information such as serial, model, and hardware revision that is applicable to all platforms and also one-shot.

@jleveque
Copy link
Contributor

Since this script is a one-shot script, and not a daemon per se, I have reservations about adding it in this repo. We could simply add it in the buildimage repo as part of sonic-net/sonic-buildimage#7596. However, it would not be built into a package, so we would not be able to run unit tests against it. I'm on the fence, but I guess I can live with having it as part of the chassisd package.

@alexrallen
Copy link
Contributor Author

I would argue that while the name sonic-platform-daemons does indicate a one-shot task wouldn't belong, architecturally it does belong here as it performs the same fundamental task as the chassisd daemon (uploading chassis information to the redis db). As such anyone looking for this code would likely expect to find it here and I think that is valuable.

If there exists now or in the future a collection of one-shot tasks for the purpose of provisioning redis then I would argue this should be refactored at that point.

@jleveque
Copy link
Contributor

architecturally it does belong here as it performs the same fundamental task as the chassisd daemon (uploading chassis information to the redis db).

I agree with this, which is why I am on the fence.

If there exists now or in the future a collection of one-shot tasks for the purpose of provisioning redis then I would argue this should be refactored at that point.

Agreed. We can proceed with this PR.

@jleveque jleveque merged commit 1adf47b into sonic-net:master May 18, 2021
jleveque pushed a commit to sonic-net/sonic-buildimage that referenced this pull request May 28, 2021
…asks (#7596)

I added `chassis_db_init` to the startup tasks for the `docker-platform-monitor` docker so that the script is run on startup of the switch and the chassis info is correctly provisioned to STATE_DB.

Depends on sonic-net/sonic-platform-daemons#183
jleveque pushed a commit to sonic-net/sonic-utilities that referenced this pull request Jun 4, 2021
… and version (#1624)

#### What I did
I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

#### How I did it
I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. 

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
gitsabari pushed a commit to gitsabari/sonic-utilities that referenced this pull request Jun 15, 2021
… and version (sonic-net#1624)

#### What I did
I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

#### How I did it
I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. 

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
andywongarista pushed a commit to andywongarista/sonic-platform-daemons that referenced this pull request Jun 30, 2021
…et#183)

#### Description
I added a new script `chassis_db_init` that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table. 

#### Motivation and Context
I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.
carl-nokia pushed a commit to carl-nokia/sonic-buildimage that referenced this pull request Aug 7, 2021
…asks (sonic-net#7596)

I added `chassis_db_init` to the startup tasks for the `docker-platform-monitor` docker so that the script is run on startup of the switch and the chassis info is correctly provisioned to STATE_DB.

Depends on sonic-net/sonic-platform-daemons#183
raphaelt-nvidia pushed a commit to raphaelt-nvidia/sonic-utilities that referenced this pull request Aug 10, 2021
… and version (sonic-net#1624)

#### What I did
I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

#### How I did it
I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. 

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
alexrallen added a commit to alexrallen/sonic-utilities that referenced this pull request Jul 6, 2022
… and version (sonic-net#1624)

I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script.

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
qiluo-msft pushed a commit that referenced this pull request Jul 20, 2022
#### Description
I added a new script `chassis_db_init` that uploads chassis hardware information such as serial number, model number and hardware revision to the STATE_DB under the CHASSIS_INFO table. 

#### Motivation and Context
I made this change in order to expose the chassis hardware information to SONiC user space and allow CLI utilities to access it in order to expose it to the user.
dprital added a commit to dprital/sonic-buildimage that referenced this pull request Jul 20, 2022
Update sonic-platform-daemons submodule pointer to include the following:
* [chassisd] Add script to initialize chassis info in STATE_DB ([sonic-net#183](sonic-net/sonic-platform-daemons#183))

Signed-off-by: dprital <[email protected]>
yxieca pushed a commit to sonic-net/sonic-buildimage that referenced this pull request Jul 28, 2022
Update sonic-platform-daemons submodule pointer to include the following:
* [chassisd] Add script to initialize chassis info in STATE_DB ([#183](sonic-net/sonic-platform-daemons#183))

Signed-off-by: dprital <[email protected]>
malletvapid23 added a commit to malletvapid23/Sonic-Utility that referenced this pull request Aug 3, 2023
… and version (#1624)

#### What I did
I added chassis model number, serial number, and hardware revision to the commands `show platform summary` and `show version`

#### How I did it
I refactored and modified the existing `get_hw_info_dict()` function to make calls to STATE_DB and get the chassis information populated by sonic-net/sonic-platform-daemons#183 script. 

The new refactored versions of `get_hw_info_dict()` are added here sonic-net/sonic-buildimage#7652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants