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

[python3] Support python3 for mellanox sonic platform API and pmon related makefiles #42

Closed
wants to merge 11 commits into from

Conversation

Junchao-Mellanox
Copy link
Owner

- 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
  3. Mellanox SONiC platform API python3 support

- 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
  4. Change Mellanox SONiC platform API code to python2 and python3 compatible

- 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)

{% endif %}

{% if not skip_syseepromd %}
[program:syseepromd]
command=/usr/local/bin/syseepromd
command={% if API_VERSION == 3 and 'syseepromd' in python3_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/syseepromd
Copy link
Owner Author

Choose a reason for hiding this comment

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

what if python3_daemons is not defined?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Did a test. If python3_daemons is not defined, the code 'syseepromd' in python3_daemons returns False. So it works as expect.


except ImportError as e:
raise ImportError (str(e) + "- required module not found")

try:
# python_sdk_api does not support python3 for now, for python3, catch the ImportError
# and ignore it here. Meanwhile, we have to trigger xcvrd using python2 now.
Copy link
Owner Author

Choose a reason for hiding this comment

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

Add comment: daemons such as thermalctld will also import this file, so need to catch the ImportError here.

$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_PSUD_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_SYSEEPROMD_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_THERMALCTLD_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_XCVRD_PY2)
Copy link
Owner Author

Choose a reason for hiding this comment

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

What if SONIC_XCVRD_PY2 is not provided?

@Junchao-Mellanox
Copy link
Owner Author

Seperate this PR into two PRs:
#43
#44

@Junchao-Mellanox Junchao-Mellanox deleted the pmon-py3 branch February 4, 2021 08:24
Junchao-Mellanox pushed a commit that referenced this pull request Jan 14, 2022
457e94d51 [macsec_linux]: Fixbug cannot dump the PN due to type error (#42)
f7c073323 Disable P2P module (#41)
7b3b777e2 [ci]: use native arm64 and armhf build pool (#40)
d4e91d66c [sonic_operator]: Increase wait timeout (#39)
43611ef88e [sonic_operators]: Add log in sonic operators (#43)

Signed-off-by: Ze Gan <[email protected]>
Junchao-Mellanox pushed a commit that referenced this pull request Jul 25, 2023
…face (sonic-net#15881)

sonic-build image side change to fix source interface selection in dual tor scenario.
dhcprelay related PR:
[master]fix dhcpv6 relay dual tor source interface selection issue sonic-dhcp-relay#42

Announce dhcprelay submodule to 6a6ce24 to include PR #42
Junchao-Mellanox pushed a commit that referenced this pull request Mar 13, 2024
…ly (sonic-net#18097)

#### Why I did it
src/sonic-ztp
```
* 56cebae - (HEAD -> master, origin/master, origin/HEAD) Enhancements to allow custom umask usage while executing plugins (#42) (2 hours ago) [rajendra-dendukuri]
```
#### How I did it
#### How to verify it
#### Description for the changelog
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.

1 participant