Skip to content

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

Closed
Junchao-Mellanox wants to merge 11 commits intomasterfrom
pmon-py3
Closed

[python3] Support python3 for mellanox sonic platform API and pmon related makefiles#42
Junchao-Mellanox wants to merge 11 commits intomasterfrom
pmon-py3

Conversation

@Junchao-Mellanox
Copy link
Copy Markdown
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)

{% 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
Copy Markdown
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
Copy Markdown
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.


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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Junchao-Mellanox pushed a commit that referenced this pull request Mar 7, 2025
…lly (sonic-net#701)

#### Why I did it
src/sonic-swss
```
* bdc4fe0 - (HEAD -> 202412, origin/202412) Merge pull request #42 from r12f/code-sync-202412 (9 hours ago) [Riff]
|\ 
| failure_prs.log skip_prs.log 054f912 - Merge remote-tracking branch 'base/202411' into code-sync-202412 (18 hours ago) [r12f]
| failure_prs.log skip_prs.log e21b5a5 - Link orchagent against jemalloc (sonic-net#3530) (2 days ago) [mssonicbld]
| failure_prs.log skip_prs.log aac84b5 - Merge pull request sonic-net#3531 from mssonicbld/cherry/202411/3426 (2 days ago) [Kumaresh Perumal]
| |\ 
| | failure_prs.log skip_prs.log 272f45a - vlanmgrd not to throw exception for Portchannel ip link add because of race condition with PortChannel removal. (2 days ago) [Sonic Build Admin]
| |/ 
| failure_prs.log skip_prs.log 16f5331 - [vlanmgrd]: Fixing an issue causing mismatch between MAC and link-local IPv6 addresses of VLAN and Bridge interfaces (sonic-net#3527) (5 days ago) [mssonicbld]
| failure_prs.log skip_prs.log 4d3bae4 - Avoid removing a VRF routing table when there are pending creation entries in gRouteBulker (sonic-net#3526) (6 days ago) [mssonicbld]
| failure_prs.log skip_prs.log 9875694 - Added change not to create ECMP Group in SAI and program the route if none of ECMP members are active/link-up (sonic-net#3522) (7 days ago) [mssonicbld]
| failure_prs.log skip_prs.log 60fd735 - [BufferOrch] Use SAI bulk API to configure port, PG and queue (sonic-net#3523) (7 days ago) [mssonicbld]
| failure_prs.log skip_prs.log 5071bec - Merge pull request sonic-net#3519 from stepanblyschak/202411-fc-after-apply-view (7 days ago) [Kumaresh Perumal]
| |\ 
| | failure_prs.log skip_prs.log c3437bd - [202411][FC] process FC after apply view (9 days ago) [Stepan Blyschak]
| |/ 
| failure_prs.log skip_prs.log 5031aad - Capability query for MACSEC ACL attribute (sonic-net#3511) (2 weeks ago) [mssonicbld]
| failure_prs.log skip_prs.log 4b357e5 - Fix VRF update handling for loopback interfaces in IntfsOrch (sonic-net#3512) (2 weeks ago) [mssonicbld]
| failure_prs.log skip_prs.log fe98176 - Add a delay between killing teamd processes (sonic-net#3510) (2 weeks ago) [mssonicbld]
| failure_prs.log skip_prs.log e967711 - Remove RIF from m_rifsToAdd before deleting it (sonic-net#3499) (3 weeks ago) [mssonicbld]
| failure_prs.log skip_prs.log 337c9a1 - Optimize counter polling interval by making it more accurate (sonic-net#3500) (3 weeks ago) [mssonicbld]
* b9b4108 - Merge pull request #41 from Azure/revert-40-cherry/msft-202412/3481 (10 hours ago) [Riff]
* 824d021 - (origin/revert-40-cherry/msft-202412/3481) Revert "[hash] add SAI_NATIVE_HASH_FIELD_IPV6_FLOW_LABEL to hash-field map fo…" (30 hours ago) [Riff]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Junchao-Mellanox pushed a commit that referenced this pull request May 9, 2025
…D automatically (sonic-net#1001)

#### Why I did it
src/sonic-sairedis
```
* 2b51106 - (HEAD -> 202412, origin/HEAD, origin/202412) Fix invalid polling of port counters (#42) (3 hours ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Junchao-Mellanox pushed a commit that referenced this pull request May 9, 2025
…HEAD automatically (sonic-net#1024)

#### Why I did it
src/sonic-swss-common
```
* 0daf1e5 - (HEAD -> 202412, origin/HEAD, origin/202412) [schema] add SRv6 counters tables (#42) (5 hours ago) [mssonicbld]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Junchao-Mellanox pushed a commit that referenced this pull request Mar 31, 2026
How I did it
562f89b (HEAD -> main, origin/main, origin/HEAD) [H6-128] Change HWSKU name and remove port I2C clock setting (#44)
1babc9b [H6-64] Update thermal algo, FW upgrade, PSU modules (#43)
d742aeb [H6-128] Add support for H6-128 Platform (#42)
f2dbdd7 Fix the UnboundLocalError to address thermalctld stacktrace
54e453a Add _cpm_firmware_upgrade_reboot_IMMs method
908d62a Fix the Unable_to_reach_CPM reboot-cause show issue

Signed-off-by: y7zhou <[email protected]>
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