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

Create DaemonBase class for all daemons #2570

Merged
merged 1 commit into from
Mar 6, 2019

Conversation

kevinwangsk
Copy link
Contributor

@kevinwangsk kevinwangsk commented Feb 15, 2019

This new python wheel is to wrap the common function of daemons,
such as logging, signal handling, load specific platform plugins.

Signed-off-by: Kevin Wang kevinw@mellanox.com

- What I did
Create a new python wheel named SONIC_DAEMON_COMMON_PY2 to wrap the common functions/macros for daemons.
- How I did it

- How to verify it
Change the daemons(ledd,xcvrd,psud) to import and use this common wheel. The daemons should work normally.
- Description for the changelog

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

@kevinwangsk kevinwangsk reopened this Feb 15, 2019
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.

File "rules/sonic-platform-daemons.mk" should be renamed "rules/sonic-daemon-common.mk"

@kevinwangsk
Copy link
Contributor Author

.

Done.

@kevinwangsk kevinwangsk reopened this Feb 15, 2019
@lguohan
Copy link
Collaborator

lguohan commented Feb 16, 2019

if this one is used by platform daemons, why cannot them be put into https://github.com/Azure/sonic-platform-daemons?

@jleveque
Copy link
Contributor

@lguohan: It was my suggestion to add this to sonic-buildimage because these are functions I have written in many daemons both in the base image and in Docker containers. I think this library should be available system-wide to allow for code reuse.

@lguohan
Copy link
Collaborator

lguohan commented Feb 16, 2019

is this code here duplicated somewhere else? if yes, then we need also remove them.

@jleveque
Copy link
Contributor

It is used in many daemons. Once this is merged, we can go through all the daemons and change them to import this library instead.

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.

One further suggestion I have here is that this should probably become a base class that all daemons can extend. And in this class's constructor, it can set up the syslog, signal handlers, etc.

@kevinwangsk
Copy link
Contributor Author

One further suggestion I have here is that this should probably become a base class that all daemons can extend. And in this class's constructor, it can set up the syslog, signal handlers, etc.

Done. Wrap the common functions to a base class named daemon_util.

@kevinwangsk kevinwangsk changed the title Create a common python wheel for daemons Create DaemonBase class for all daemons Feb 27, 2019
DaemonBase is to wrap the common function of daemons, such as logging,
signal handling, db connector, load specific platform plugins.

Signed-off-by: Kevin Wang <kevinw@mellanox.com>
@liat-grozovik liat-grozovik merged commit fa84c42 into sonic-net:master Mar 6, 2019
liat-grozovik pushed a commit that referenced this pull request Jan 1, 2023
Update sonic-utilities submodule pointer to include the following:

3bc2bc6 [Mellanox][202205] Change severity to NOTICE in Mellanox buffer migrator when unable to fetch DEVICE_METADATA due to empty CONFIG_DB during initialization (#2570)
e1c8243 [202205][generate_dump] Fix for a deletion flow for all secret files in the techsupport dump (#2572)
9f2984a [202205] Fix issue: unconfigured PGs are displayed in watermarkstat (#2568)
f7988b0 [202205] [timer.unit.j2] use wanted-by in timer unit (#2561)
f45dcfb [generate_dump] Optimize the execution time of 'show techsupport' CLI by paraller function execution (#2565)
67cbb15 [202205]Fixes 12170: Delete subinterface and recreate the subinterface in default-vrf (#2564)
93172c4 [202205] [generate_dump] Optimize the execution time of the 'show techsupport' script to 5-10% by reducing calls to the 'tar append' operation (#2562)

Signed-off-by: dprital <drorp@nvidia.com>
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.

5 participants