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

[generate_dump] allow to extend dump with plugin scripts. #1335

Merged
merged 3 commits into from
Feb 25, 2021

Conversation

stepanblyschak
Copy link
Contributor

@stepanblyschak stepanblyschak commented Dec 28, 2020

Plugins scripts are placed at /usr/local/bin/debug-dump/ and
the output of these scripts will be gzipped and placed
under dump archive in dump/.gz

Signed-off-by: Stepan Blyshchak [email protected]

- What I did

Added support for tech support extension scripts.

- How I did it

It looks at /usr/bin/debug-dump for scripts, if it finds one it will execute them and save the output to dump/ folder.

- How to verify it

Write a simple scripts that outputs something and place it under /usr/bin/debug-dump/

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

Plugins scripts are placed at /usr/bin/debug-dump/ and
the output of these scripts will be gzipped and placed
under dump archive in dump/<script-name>.gz

Signed-off-by: Stepan Blyshchak <[email protected]>
@stepanblyschak
Copy link
Contributor Author

retest this please

Copy link

@bandaru-viswanath bandaru-viswanath left a comment

Choose a reason for hiding this comment

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

Looks good to me. It would be great to explicitly call out these 'plugins' as 'dump plugins' or equivalent.

@sujinmkang
Copy link
Collaborator

@stepanblyschak what information does this dump plugin try to collect?

@stepanblyschak
Copy link
Contributor Author

@sujinmkang This mechanism is going to be used by Application Extension infrastructure - https://github.com/stepanblyschak/SONiC/blob/sonic-app-ext-3/doc/sonic-application-extention/sonic-application-extention-hld.md.

This Infra allows to install/upgrade/remove dockers at runtime without image rebuild.
As part of that, those dockers which need to collect additional data during dump generation they would use this mechanism to extend "show techsupport"

@sujinmkang
Copy link
Collaborator

PR description says "Plugins scripts are placed at /usr/bin/debug-dump/ and". Isn't it "/usr/local/bin/debug-dump/"?

@sujinmkang
Copy link
Collaborator

One more question, even with this dump plugin, I think any new package installed to SONiC can also use the syslog service and write the messages to /var/log/<package_name> directory then 'show tech' can collect that log while it's generating the dump file. What is the purpose of this dump plug for?

@stepanblyschak
Copy link
Contributor Author

@sujinmkang
Yes, I changed it in PR description.

Logging and dump generation are different things. For my application I generate a dump by executing a command inside docker (lets say this command takes 10 sec). Now, if I don't have this proposed mechanism to extend dump generation I have to continuously print my dump to syslog which has the following issues:

  1. I do not know at which point user wants to generate a dump so even if my app continuously prints dump information to syslog I might not catch the right point of time or my daemon can crash and I will lose that information.
  2. I produce a lot of load on syslog and on my app causing it to execute a debug dump command all the time
  3. Syslog will be bloated with extensions debug output and will distract user from analyzing logs.

@liat-grozovik
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liat-grozovik liat-grozovik merged commit 0430083 into sonic-net:master Feb 25, 2021
anand-kumar-subramanian pushed a commit to anand-kumar-subramanian/sonic-utilities that referenced this pull request Mar 2, 2021
…1335)

- What I did
Added support for tech support extension scripts.

- How I did it
It looks at /usr/bin/debug-dump for scripts, if it finds one it will execute them and save the output to dump/ folder.

- How to verify it
Write a simple scripts that outputs something and place it under /usr/bin/debug-dump/

Signed-off-by: Stepan Blyshchak <[email protected]>
qiluo-msft pushed a commit that referenced this pull request Dec 9, 2021
)

#### What I did
Added support for tech support extension scripts,
by cherry-picking of #1335 to branch 202012

The purpose is to have dumps of extensions in SONiC techsupport, even without App Extension infrastructure.
The new application will write a file that contains the dump command into /usr/bin/debug-dump folder, and it will appear in the output of `show techsupport` command.
#### How I did it
It looks at /usr/bin/debug-dump for scripts, if it finds one it will execute them and save the output to dump/ folder.

#### How to verify it
Write a simple scripts that outputs something and place it under /usr/bin/debug-dump/
liat-grozovik pushed a commit that referenced this pull request Jul 18, 2022
)

- What I did
Added support for tech support extension scripts,
by cherry-picking of #1335 to 202012 branch.

The purpose is to have dumps of extensions in SONiC techsupport, even without App Extension infrastructure.
The new application will write a file that contains the dump command into /usr/bin/debug-dump folder, and it will appear in the output of show techsupport command.

- How I did it
It looks at /usr/bin/debug-dump for scripts, if it finds one it will execute them and save the output to dump/ folder.

- How to verify it
Write a simple scripts with an output and place it under /usr/bin/debug-dump/
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.

4 participants