Skip to content

Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04#21045

Merged
StormLiangMS merged 17 commits intosonic-net:masterfrom
wangxin:fork-docker-sonic-mgmt-24
Nov 5, 2025
Merged

Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04#21045
StormLiangMS merged 17 commits intosonic-net:masterfrom
wangxin:fork-docker-sonic-mgmt-24

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Oct 21, 2025

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

Approach

What is the motivation for this PR?

This PR is to continue the effort made by @yutongzhang-microsoft in #18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?

  • Fix the snmp code caused by pysnmp upgrade.
  • Fix json dump of ansible result caused by pytest-ansible upgrade.

How did you verify/test it?

Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in #20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin closed this Oct 22, 2025
@wangxin wangxin reopened this Oct 22, 2025
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wangxin wangxin changed the title [DO NOT MERGE] Verify docker-sonic-mgmt 24.04 code change on legacy docker Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04 Oct 22, 2025
@wangxin wangxin force-pushed the fork-docker-sonic-mgmt-24 branch from 136db23 to 1e64b51 Compare October 22, 2025 07:49
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@wangxin wangxin marked this pull request as ready for review October 22, 2025 07:50
@wangxin wangxin requested review from a team and yxieca as code owners October 22, 2025 07:50
@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

A docker-sonic-mgmt based on Ubuntu 24.04 was built and pushed to sonicdev-microsoft.azurecr.io:443/docker-sonic-mgmt:24.04.0

This PR is to take advantange of the PR testing infrastructure to run all tests on KVM testbed using this new docker-sonic-mgmt to find out all incompability issues.

The setup-container.sh tool was updated to use this new docker-sonic-mgmt.

The PR test template was updated to continue PR testing when there is failure. So that all failures can be found out in one attempt.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Nov 11, 2025
PR sonic-net#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Nov 11, 2025
…c-net#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in sonic-net#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in sonic-net#20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Nov 11, 2025
PR sonic-net#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Nov 11, 2025
…c-net#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in sonic-net#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in sonic-net#20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit to wangxin/sonic-mgmt that referenced this pull request Nov 11, 2025
PR sonic-net#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt.msft that referenced this pull request Nov 11, 2025
PR sonic-net/sonic-mgmt#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt.msft that referenced this pull request Nov 11, 2025
PR sonic-net/sonic-mgmt#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt.msft that referenced this pull request Nov 11, 2025
PR sonic-net/sonic-mgmt#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt.msft that referenced this pull request Nov 11, 2025
PR sonic-net/sonic-mgmt#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to wangxin/sonic-mgmt.msft that referenced this pull request Nov 11, 2025
PR sonic-net/sonic-mgmt#21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
…c-net#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in sonic-net#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in sonic-net#20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.
dcaugher pushed a commit to dcaugher/sonic-mgmt that referenced this pull request Nov 12, 2025
…c-net#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in sonic-net#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in sonic-net#20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.
StormLiangMS pushed a commit that referenced this pull request Nov 13, 2025
….04 (#21045) (#21271) (#21289)

* Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04 (#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in #18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in #20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.

* Filter out unnecessary dataplane logs

PR #21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>

---------

Signed-off-by: Xin Wang <[email protected]>
r12f pushed a commit to Azure/sonic-mgmt.msft that referenced this pull request Nov 16, 2025
….04 (#21045) (#812)

This is to cherry-pick
sonic-net/sonic-mgmt#21045

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in
#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is
end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the
base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of
most packages are upgraded too. The upgrade introduced lots of
compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both
current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade. How
did you verify/test it?
Take advantage of the current sonic-mgmt PR testing. Verified that the
code change works with new docker-sonic-mgmt in #20851 Verified that the
code change works with the current docker-sonic-mgmt in this PR.

---------

Signed-off-by: Xin Wang <[email protected]>
StormLiangMS pushed a commit that referenced this pull request Nov 17, 2025
….04 (#21045) (#21271) (#21285)

* Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04 (#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in #18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in #20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.

* Filter out unnecessary dataplane logs

PR #21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>

* Remove unused import

---------

Signed-off-by: Xin Wang <[email protected]>
wangxin added a commit to Azure/sonic-mgmt.msft that referenced this pull request Nov 19, 2025
….04 (#21045) (#809)

This is to cherry-pick
sonic-net/sonic-mgmt#21045

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in
#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is
end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the
base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of
most packages are upgraded too. The upgrade introduced lots of
compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both
current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade. How
did you verify/test it?
Take advantage of the current sonic-mgmt PR testing. Verified that the
code change works with new docker-sonic-mgmt in #20851 Verified that the
code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit to Azure/sonic-mgmt.msft that referenced this pull request Nov 19, 2025
….04 (#21045) (#811)

This is to cherry-pick
sonic-net/sonic-mgmt#21045

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in
#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is
end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the
base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of
most packages are upgraded too. The upgrade introduced lots of
compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both
current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade. How
did you verify/test it?
Take advantage of the current sonic-mgmt PR testing. Verified that the
code change works with new docker-sonic-mgmt in #20851 Verified that the
code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit to Azure/sonic-mgmt.msft that referenced this pull request Nov 19, 2025
….04 (#21045) (#813)

This is to cherry-pick
sonic-net/sonic-mgmt#21045

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in
#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is
end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the
base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of
most packages are upgraded too. The upgrade introduced lots of
compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both
current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade. How
did you verify/test it?
Take advantage of the current sonic-mgmt PR testing. Verified that the
code change works with new docker-sonic-mgmt in #20851 Verified that the
code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit to Azure/sonic-mgmt.msft that referenced this pull request Nov 19, 2025
….04 (#21045) (#810)

This is to cherry-pick
sonic-net/sonic-mgmt#21045
What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in
#18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is
end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the
base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of
most packages are upgraded too. The upgrade introduced lots of
compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both
current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade. How
did you verify/test it?
Take advantage of the current sonic-mgmt PR testing. Verified that the
code change works with new docker-sonic-mgmt in #20851 Verified that the
code change works with the current docker-sonic-mgmt in this PR.
wangxin added a commit that referenced this pull request Nov 19, 2025
….04 (#21045) (#21271) (#21288)

* Compatibility fixes for docker-sonic-mgmt based on Ubuntu 24.04 (#21045)

What is the motivation for this PR?
This PR is to continue the effort made by @yutongzhang-microsoft in #18339

The current docker-sonic-mgmt image is based on Ubuntu 20.04 which is end of support now. PR sonic-net/sonic-buildimage#24306 upgraded the base image of docker-sonic-mgmt to Ubuntu 24.04. Together, version of most packages are upgraded too. The upgrade introduced lots of compatibility issues. This PR is to fix all the compatibility issues.

All the fixes are backward compatible. The code change woks with both current and new docker-sonic-mgmt.

How did you do it?
Fix the snmp code caused by pysnmp upgrade.
Fix json dump of ansible result caused by pytest-ansible upgrade.
How did you verify/test it?
Take advantage of the current sonic-mgmt PR testing.
Verified that the code change works with new docker-sonic-mgmt in #20851
Verified that the code change works with the current docker-sonic-mgmt in this PR.

* Filter out unnecessary dataplane logs

PR #21045 for fixing compatibility issues of docker-sonic-mgmt upgrade removed the hook for setting log levels of couple of loggers.

The code for setting log level of ansible loggers is no longer needed after previous ansible upgrade a few years ago.

However, setting log level for the 'dataplane' logger is still necessary.

This change added back the code to set log level for the 'dataplane' logger to avoid unnessary logs when 'ptfadapter' is used in test script.

Signed-off-by: Xin Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment