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

Add pmon daemons python3 build support #6176

Merged
merged 6 commits into from
Dec 28, 2020

Conversation

Junchao-Mellanox
Copy link
Collaborator

- Why I did it

python2 is end of life and SONiC is going to support python3. This PR is going to support:

  1. Build pmon daemons with python3
  2. Install and run python3 version pmon daemons

- How I did it

  1. Change pmon daemons make files to build bothe python2 and python3 whl
  2. Change docker-platform-monitor make files to install both python2 and python3 whl
  3. Change pmon docker startup files to start pmon daemons according to the supported platform API version

- How to verify it

  1. Manual test to make sure all daemons are up and no error in syslog
  2. Run platform regressions on a few platforms

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

  • 201811
  • 201911
  • 202006

- Description for the changelog

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

@Junchao-Mellanox
Copy link
Collaborator Author

The build issue will be fixed after merging sonic-net/sonic-platform-common#154 and moving submodule pointer.

jleveque
jleveque previously approved these changes Dec 11, 2020
@jleveque
Copy link
Contributor

@Junchao-Mellanox: Please fix new conflicts.

@Junchao-Mellanox
Copy link
Collaborator Author

@Junchao-Mellanox: Please fix new conflicts.

Done

@jleveque
Copy link
Contributor

Build failures in unit tests:

17:23:50  _____________________ ERROR collecting tests/test_xcvrd.py _____________________
17:23:50  tests/test_xcvrd.py:36: in <module>
17:23:50      class TestXcvrdScript(object):
17:23:50  tests/test_xcvrd.py:41: in TestXcvrdScript
17:23:50      @patch('xcvrd.xcvrd.logical_port_name_to_physical_port_list', MagicMock(return_value=[0]))
17:23:50  E   NameError: name 'patch' is not defined

Please check.

@Junchao-Mellanox
Copy link
Collaborator Author

Junchao-Mellanox commented Dec 18, 2020

17:23:50 _____________________ ERROR collecting tests/test_xcvrd.py _____________________
17:23:50 tests/test_xcvrd.py:36: in
17:23:50 class TestXcvrdScript(object):
17:23:50 tests/test_xcvrd.py:41: in TestXcvrdScript
17:23:50 @patch('xcvrd.xcvrd.logical_port_name_to_physical_port_list', MagicMock(return_value=[0]))
17:23:50 E NameError: name 'patch' is not defined

Hi @jleveque , this issue is introduced by commit:

commit b0be7ca52868064fb4e2b5ef9d44c774fdd87ade
Author: vdahiya12 <67608553+vdahiya12@users.noreply.github.com>
Date:   Tue Dec 15 04:10:34 2020 -0800

    [xcvrd] add unit test infrastructure and unit tests for xcvrd (#133)

    Summary:
    This PR provides the necessary infrastructure to add pytest support and integration in sonic-xcvrd submodule.
    This PR also adds unit tests for xcvrd daemon.
    What is the motivation for this PR?
    To add the pytest unittest support in sonic-platform-daemon, sonix-xcvrd daemon as well as add some unit tests
    Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>

The error is introduced by line https://github.com/Azure/sonic-platform-daemons/blob/b674dffb717968b306b2bb967b0cbce74661a45f/sonic-xcvrd/tests/test_xcvrd.py#L9 . In this line it should import the package patch like:

if sys.version_info >= (3, 3):
    from unittest.mock import MagicMock, patch

I have created a PR to fix this. See sonic-net/sonic-platform-daemons#135

@jleveque
Copy link
Contributor

jleveque commented Dec 18, 2020

@Junchao-Mellanox: Thank you for the fix! I merged it. Can you please update the submodule?

@Junchao-Mellanox
Copy link
Collaborator Author

Sure

@Junchao-Mellanox
Copy link
Collaborator Author

Hi @jleveque , please see #6247

@jleveque
Copy link
Contributor

Hi @jleveque , please see #6247

Merged. Thanks again!

@jleveque
Copy link
Contributor

Retest this please

Conflicts:
	dockers/docker-platform-monitor/start.sh
@jleveque jleveque merged commit 51f896b into sonic-net:master Dec 28, 2020
@Junchao-Mellanox Junchao-Mellanox deleted the pmon-py3-build-support branch February 4, 2021 08:24
andriyz-nv added a commit to andriyz-nv/sonic-mgmt that referenced this pull request Mar 19, 2021
The file path was changed in bellow pull request, but tests in
sonic-mgmt were not updated, after that PR was merged
sonic-net/sonic-buildimage#6176
wangxin pushed a commit to sonic-net/sonic-mgmt that referenced this pull request May 12, 2021
…latform test (#3178)

The file path was changed in bellow pull request, but tests in
sonic-mgmt were not updated, after that PR was merged
sonic-net/sonic-buildimage#6176
vmittal-msft pushed a commit to vmittal-msft/sonic-mgmt that referenced this pull request Sep 28, 2021
…latform test (sonic-net#3178)

The file path was changed in bellow pull request, but tests in
sonic-mgmt were not updated, after that PR was merged
sonic-net/sonic-buildimage#6176
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