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

Fix bgpmon.py packaging issue for console_scripts entry point #5436

Merged
merged 2 commits into from
Sep 23, 2020
Merged

Fix bgpmon.py packaging issue for console_scripts entry point #5436

merged 2 commits into from
Sep 23, 2020

Conversation

gechiang
Copy link
Collaborator

This is to fix "https://github.com/Azure/sonic-buildimage/pull/5329/files" where the bgpmon code itself was not properly packaged for the console_scripts entry point and causing the bgpmon daemon unable to start since bgpmon.py was not found.
it was not caught earlier due to the build was not cleaned up properly that installed the bgpmon.py via the scripts method.

Signed-off-by: Gen-Hwa Chiang [email protected]

- What I did

Created a new project directory and moved bgpmon.py into that directory for packaging purpose.
Change the setup.py file to indicate where to expect the bgpmon.py in the console_scripts specification.

- How to verify it

once the BGP docker is up and running, you can perform "show services" to see that this new daemon "bgpmon.py" is running under the BGP docker service similar to the following output:

...
bgp     docker
---------------------------
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.4  0.2  28328 22660 pts/0    Ss+  23:16   0:03 /usr/bin/python2 /usr/bin/supervisord
root        21  0.0  0.2  22664 16708 pts/0    S    23:16   0:00 python /usr/bin/supervisor-proc-exit-listener --container-name bgp
root        25  0.0  0.0 225856  3564 pts/0    Sl   23:16   0:00 /usr/sbin/rsyslogd -n -iNONE
frr         29  6.2  0.4 524052 35276 pts/0    Sl   23:16   0:50 /usr/lib/frr/zebra -A 127.0.0.1 -s 90000000 -M fpm -M snmp
frr         32  0.0  0.0  43308  6188 pts/0    S    23:16   0:00 /usr/lib/frr/staticd -A 127.0.0.1
frr         33  3.6  0.9 355520 80412 pts/0    Sl   23:16   0:29 /usr/lib/frr/bgpd -A 127.0.0.1 -M snmp
root        40  0.6  0.6  69192 55516 pts/0    S    23:16   0:05 /usr/bin/python /usr/local/bin/bgpcfgd
root        41  0.0  0.1  20960 15180 pts/0    S    23:16   0:00 /usr/bin/python /usr/local/bin/bgpmon
root        42  1.5  0.0  82080  6060 pts/0    Sl   23:16   0:12 fpmsyncd
...

@@ -12,7 +12,7 @@
scripts=['bgpcfgd'],
entry_points={
'console_scripts': [
'bgpmon = bgpmon:main',
'bgpmon = bgpmon_proj.bgpmon:main',
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggest naming the new directory bgpmon rather than bgpmon_proj. Then this line becomes 'bgpmon = bgpmon.bgpmon:main',.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jleveque Agreed.

@gechiang gechiang requested a review from jleveque September 23, 2020 02:59
@jleveque
Copy link
Contributor

Retest mellanox please

@gechiang
Copy link
Collaborator Author

retest vsimage please

@gechiang gechiang merged commit 04c709d into sonic-net:master Sep 23, 2020
santhosh-kt pushed a commit to santhosh-kt/sonic-buildimage that referenced this pull request Feb 25, 2021
…net#5436)

* Fix bgpmon.py packaging issue for console_scripts entry point

* renamed directory from bgpmon_proj to bgpmon
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.

2 participants