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

Update process-reboot-cause to save the reboot-cause to state-db #5562

Closed
wants to merge 92 commits into from
Closed

Update process-reboot-cause to save the reboot-cause to state-db #5562

wants to merge 92 commits into from

Conversation

sujinmkang
Copy link
Collaborator

@sujinmkang sujinmkang commented Oct 8, 2020

- Why I did it
To make the reboot cause history information available for telemetry service, during processing the reboot-cause on boot, the information is saved in state-db.
- How I did it
Split the process-reboot-cause service into two services: determine-reboot-cause and process-reboot-cause

  1. determine-reboot-cause :
    Determine the reboot-cause based on the hardware/software reboot-cause information and save it into a file with time stamp when it's determined.
  2. process-reboot-cause :
    Read the saved reboot-cause files up to 10 files (after time-sorted) from "/host/reboot-cause/history" directory and save them to state-db.
    - How to verify it
    Tested in DUT using Cli commands ( introduced and modified with this PR : Add show reboot-history sonic-utilities#1154) and check the state-db with redis-cli.

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

  • 201811
  • 201911
  • 202006

- Description for the changelog

HLD : sonic-net/SONiC#669

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

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

If we go with this approach, we might want to consider naming the first service "determine-reboot-cause" and the second service "process-reboot-cause", or similar. It's more meaningful than "post-process-reboot-cause".

Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

Now that there are two services, I suggest renaming the directory from files/image_config/process-reboot-cause to files/image_config/reboot-cause

@sujinmkang
Copy link
Collaborator Author

sujinmkang commented Oct 13, 2020

retest mellanox please!

@sujinmkang
Copy link
Collaborator Author

@jleveque Can you review this again?

files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
files/build_templates/sonic_debian_extension.j2 Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/determine-reboot-cause Outdated Show resolved Hide resolved
files/image_config/reboot-cause/process-reboot-cause Outdated Show resolved Hide resolved
Copy link
Contributor

@jleveque jleveque left a comment

Choose a reason for hiding this comment

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

Today I merged new changes to create two new packages, sonic-host-services and sonic-host-services-data

Can you please move the determine-reboot-cause and process-reboot-cause scripts into the former and move the service files into the latter?

See here: #5694

Note that you will also need to make sure the scripts are Python 3-compliant

@sujinmkang
Copy link
Collaborator Author

@jleveque I can open a new PR for the migration to sonic-host-service package after I submitting this PR.

@sujinmkang
Copy link
Collaborator Author

retest broadcom please

1 similar comment
@sujinmkang
Copy link
Collaborator Author

retest broadcom please

…5784)

- Convert docker-wait-any script to Python 3
- Install Python 3 Docker Engine API in host OS
@@ -0,0 +1,98 @@
#!/usr/bin/env python
Copy link
Contributor

Choose a reason for hiding this comment

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

Please change shebang to #!/usr/bin/env python3 and ensure script is Python 3-compliant.

@sujinmkang
Copy link
Collaborator Author

will open a new PR after rebase.

@sujinmkang sujinmkang closed this Nov 5, 2020
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.