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 #44

Closed
wants to merge 2 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

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

{% endif %}

{% if not skip_xcvrd %}
[program:xcvrd]
{% if delay_xcvrd %}
command=bash -c "sleep 30 && /usr/local/bin/xcvrd"
command=bash -c "sleep 30 && {% if API_VERSION == 3 and 'xcvrd' in python3_daemons %}python3 {% else %} python2 {% endif %}/usr/local/bin/xcvrd"
Copy link

Choose a reason for hiding this comment

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

I believe there is no need for this python3_daemons variable. I think it is enough to check if API_VERSION == 3. What do we gain from python3_daemons? I feel like it is redundant and it will result in extra cleanup once we completely remove Python 2.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I understand your concern. In Mellanox platform, some sfp related API depend on a python lib provided by SDK. That lib only supports python2 now (There is plan to migrate it to python3). In that case, xcvrd needs to be run as python2 for now on Mellanox platform. That's the reason I added python3_daemons here.

Choose a reason for hiding this comment

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

I see. I would like to prevent the need for all vendors to temporarily add this info, as Python 3 will be the default moving forward. Maybe it would be better to name the variable python2_daemons and invert the check here (e.g., and 'xcvrd' not in python2_daemons)? This way it is less work to switch to Python 3?

@jleveque
Copy link

jleveque commented Dec 9, 2020

This PR is opened against your personal fork. Is there a reason, or was this an accident?

@Junchao-Mellanox
Copy link
Owner Author

Junchao-Mellanox commented Dec 10, 2020

Hi @jleveque , I opened it in my personal repo due to the build issue we discussed before. As we talked, there is a unit test issue on xcvrd when build python3 version wheel. I plan to fix it by skipping the ImportError.

The work around could be change the following code in y_cable.py from:

try:
    import struct

    import sonic_platform.platform
    from sonic_py_common import logger

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

to

try:
    import struct

    import sonic_platform.platform
    from sonic_py_common import logger

except ImportError as e:
    pass

@Junchao-Mellanox
Copy link
Owner Author

sonic-net#6176

Junchao-Mellanox pushed a commit that referenced this pull request Apr 8, 2022
…onic-net#10406)

#### Why I did it
To take the following into sonic-buildimage
36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587)

[sonic-swss-common](https://github.com/Azure/sonic-swss-common)
```
36e1f61 API endpoints to ConfigDBConnector to support pre-loading data without blackout (sonic-net#587)
556f4ad Add SAI copy action to ACL schema (sonic-net#591)
db18c3a Fix bitwidth of mac address in SAI ACL schema (sonic-net#590)
e9442bb [ConfigDBPipeConnector]: Added set_entry API (sonic-net#586)
6c007c0 Update README for gmock (sonic-net#562)
```

[sonic-linkmgrd](https://github.com/Azure/sonic-linkmgrd)
```
83dfc99 Enforce uniform file/class naming convention (#52)
83004bf Shutdown ICMP heartbeats when default route state is missing and ToR is in `auto` mode (#44)
b81ea31 Add `LinkProberStateMachineActiveActive`  (#47)
c43cf7a Decrease link probing interval after switchover to better determine the overhead of a toggle (#43)
2239fbe Enhance clang format (#46)
```
#### How I did it
* Advanced submodules pointers

#### How to verify it
1. make configure PLATFORM=mellanox
2. make target/sonic-mellanox.bin
Junchao-Mellanox pushed a commit that referenced this pull request May 6, 2022
[sonic-linkmgrd][202012] submodule update

3523738 Jing Zhang      Sun Apr 3 20:54:40 2022 -0700   Reset link prober state when default route is back #56
8282e78 Jing Zhang      Fri Apr 15 15:59:34 2022 -0700  Keep incrementing sequence number when link prober is suspended and shutdown #55 (#65)
8246eb8 Jing Zhang      Thu Apr 14 18:49:36 2022 -0700  Shutdown ICMP heartbeats when default route state is missing and ToR is in auto mode #44 (#59)

sign-off: Jing Zhang zhangjing@microsoft.com
Junchao-Mellanox pushed a commit that referenced this pull request Aug 10, 2022
#### Why I did it

Submodule update for sonic-dbsyncd with following change:
```
0d67faf 2022-07-28 | Replace pyswsssdk with sonic-py-common (#45) [Hua Liu]
265c833 2022-01-11 | Updated the Azure pipeline for Code Coverage (#44) [abdosi]
6548116 2021-04-04 | [ci]: add proper azp [Guohan Lu]
43b9dab 2021-04-04 | [pytest]: add pytest.ini [Guohan Lu]
```

#### How I did it

#### How to verify it

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

<!--
- Note we only backport fixes to a release branch, *not* features!
- Please also provide a reason for the backporting below.
- e.g.
- [x] 202006
-->

- [ ] 201811
- [ ] 201911
- [ ] 202006
- [ ] 202012
- [ ] 202106

#### Description for the changelog
Submodule update for sonic-dbsyncd with following change:
```
0d67faf 2022-07-28 | Replace pyswsssdk with sonic-py-common (#45) [Hua Liu]
265c833 2022-01-11 | Updated the Azure pipeline for Code Coverage (#44) [abdosi]
6548116 2021-04-04 | [ci]: add proper azp [Guohan Lu]
43b9dab 2021-04-04 | [pytest]: add pytest.ini [Guohan Lu]
```

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

Co-authored-by: liuh-80 <azureuser@liuh-dev-vm-02.5fg3zjdzj2xezlx1yazx5oxkzd.hx.internal.cloudapp.net>
Junchao-Mellanox pushed a commit that referenced this pull request Oct 18, 2022
… URL support "not to use cac (sonic-net#12394)

he" (#45)
* 4f45e3a Update gnmi_cli (#5) (#44)
Junchao-Mellanox pushed a commit that referenced this pull request Nov 21, 2023
…ly (sonic-net#17140)

#### Why I did it
src/dhcprelay
```
* 40c6877 - (HEAD -> master, origin/master, origin/HEAD) [CodeQL] fix unmet dependency for `build-swss-common` (#44) (30 hours ago) [Jing Zhang]
```
#### How I did it
#### How to verify it
#### Description for the changelog
Junchao-Mellanox pushed a commit that referenced this pull request Jul 29, 2024
sonic-dhcp-relay
5ae186f Yaqiang Zhu Tue Dec 19 12:05:15 2023 -0500 [counter] Clear counter table when init (#45)
40c6877 Jing Zhang Fri Nov 10 12:41:23 2023 -0800 [CodeQL] fix unmet dependency for build-swss-common (#44)

sonic-dhcpmon
7c55e50 StormLiangMS Thu Sep 14 09:57:06 2023 +0800 Merge pull request #13 from jcaiMR/dev/jcai_master_interface_counter
085a087 jcaiMR Mon Sep 11 09:17:03 2023 +0000 refine counting logic
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.

4 participants