Skip to content

[DO NOT MERGE] Verify docker-sonic-mgmt based on Ubuntu 24.04#20851

Closed
wangxin wants to merge 14 commits intosonic-net:masterfrom
wangxin:docker-sonic-mgmt-24
Closed

[DO NOT MERGE] Verify docker-sonic-mgmt based on Ubuntu 24.04#20851
wangxin wants to merge 14 commits intosonic-net:masterfrom
wangxin:docker-sonic-mgmt-24

Conversation

@wangxin
Copy link
Copy Markdown
Collaborator

@wangxin wangxin commented Sep 29, 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 draft PR is to continue the effort made by yutongzhang-microsoft in #18339

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 advantage of the PR testing infrastructure to run all tests on KVM testbed using this new docker-sonic-mgmt to find out all incompatibility issues.

How did you do it?

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.

How did you verify/test it?

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

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

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

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

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

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]>
* Latest pytest_ansible does not work with ansible-core 2.19. Built new docker-sonic-mgmt  with ansible-core 2.18. Updated setup-container.sh to use new docker-sonic-mgmt with tag 24.04.1
* Fix issue of json encoding ansible result
* Fix issue of init plugin loader in new ansible
* Do not use variable in task name
@wangxin wangxin force-pushed the docker-sonic-mgmt-24 branch from 83d4c92 to 00756eb Compare October 16, 2025 00:49
@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).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

NavdhaJindal pushed a commit to NavdhaJindal/sonic-buildimage that referenced this pull request Dec 2, 2025
Why I did it
The base image Ubuntu 20.04 of docker-sonic-mgmt is end of support now. Need to upgrade the base image and the dependent packages to address potential vulnerability issues.

DO NOT MERGE until sonic-net/sonic-mgmt#21045 is merged and cherry-picked to all current active branches.

Work item tracking
Microsoft ADO (number only):
How I did it
Upgraded base image of docker-sonic-mgmt to Ubuntu 24.04.
Upgraded the build environment to bookworm.
Removed the logic of building flag LEGACY_SONIC_MGMT_DOCKER. All the sonic-mgmt branches are using python3 now. It's not necessary to build docker-sonic-mgmt to support python2. And python2 is end of support too.
Version of python packages are not pinned down. This change has pros and cons.
Pros: Keep the docker-sonic-mgmt up to date to avoid future big version leap which could be difficult to handle.
Cons: Community package upgrade could have issue and cause regression.
Version of ansible is pinned to 11.10.0. It's because pytest-ansible does not support the latest ansible due to pytest-ansible's stdout_callback fails on Ansible 2.19 ansible/pytest-ansible#489
Python packages are installed to /opt/venv by following the recommendation of Ubuntu 24.04.
The dash-api package is reverted to install from source code. The dash-api debian package built in bookworm cannot be installed in Ubuntu 24.04 due to dependency issues.
Default user "ubuntu" of Ubuntu 24.04 is removed from the image to avoid potential issues. For details, please refer to Improve setup-container.sh for Ubuntu 24.04 based docker-sonic-mgmt sonic-mgmt#20761. Skipped adding regular user. With this change, the image will only have root user. The setup-container.sh tool in the sonic-mgmt repository can add regular user. Recommend to use the setup-container.sh tool to create sonic-mgmt container.
Improved the code for installing docker and azure-cli.
Remove the build dependency of the ptf debian package. It's because the ptf package is installed by python pip.
How to verify it
After the upgrade, there are some compatibility issues. The compatibility issues are fixed in sonic-net/sonic-mgmt#21045.
I am using that PR to verify that all PR test scripts can pass by using the upgraded docker-sonic-mgmt.

The fix in sonic-net/sonic-mgmt#21045 is backward compatible. Backward compatibility is verified by PR testing of sonic-net/sonic-mgmt#20851

Signed-off-by: Navdha Jindal <[email protected]>
albertovillarreal-keys pushed a commit to albertovillarreal-keys/sonic-mgmt that referenced this pull request Dec 2, 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.

Signed-off-by: Alberto Villarreal <[email protected]>
mssonicbld added a commit to mssonicbld/sonic-buildimage that referenced this pull request Dec 3, 2025
<!--
     Please make sure you've read and understood our contributing guidelines:
     https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

     ** Make sure all your commits include a signature generated with `git commit -s` **

     If this is a bug fix, make sure your description includes "fixes #xxxx", or
     "closes #xxxx" or "resolves #xxxx"

     Please provide the following information:
-->

#### Why I did it
The base image Ubuntu 20.04 of docker-sonic-mgmt is end of support now. Need to upgrade the base image and the dependent packages to address potential vulnerability issues.

DO NOT MERGE until sonic-net/sonic-mgmt#21045 is merged and cherry-picked to all current active branches.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
* Upgraded base image of docker-sonic-mgmt to Ubuntu 24.04.
* Upgraded the build environment to bookworm.
* Removed the logic of building flag `LEGACY_SONIC_MGMT_DOCKER`. All the sonic-mgmt branches are using python3 now. It's not necessary to build docker-sonic-mgmt to support python2. And python2 is end of support too.
* Version of python packages are not pinned down. This change has pros and cons.
  * Pros: Keep the docker-sonic-mgmt up to date to avoid future big version leap which could be difficult to handle.
  * Cons: Community package upgrade could have issue and cause regression.
* Version of ansible is pinned to 11.10.0. It's because pytest-ansible does not support the latest ansible due to ansible/pytest-ansible#489
* Python packages are installed to /opt/venv by following the recommendation of Ubuntu 24.04.
* The dash-api package is reverted to install from source code. The dash-api debian package built in bookworm cannot be installed in Ubuntu 24.04 due to dependency issues.
* Default user "ubuntu" of Ubuntu 24.04 is removed from the image to avoid potential issues. For details, please refer to sonic-net/sonic-mgmt#20761. Skipped adding regular user. With this change, the image will only have root user. The `setup-container.sh` tool in the sonic-mgmt repository can add regular user. Recommend to use the `setup-container.sh` tool to create sonic-mgmt container.
* Improved the code for installing docker and azure-cli.
* Remove the build dependency of the `ptf` debian package. It's because the `ptf` package is installed by python pip.

#### How to verify it
After the upgrade, there are some compatibility issues. The compatibility issues are fixed in sonic-net/sonic-mgmt#21045.
I am using that PR to verify that all PR test scripts can pass by using the upgraded docker-sonic-mgmt.

The fix in sonic-net/sonic-mgmt#21045 is backward compatible. Backward compatibility is verified by PR testing of sonic-net/sonic-mgmt#20851

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Dec 4, 2025
Why I did it
The base image Ubuntu 20.04 of docker-sonic-mgmt is end of support now. Need to upgrade the base image and the dependent packages to address potential vulnerability issues.

DO NOT MERGE until sonic-net/sonic-mgmt#21045 is merged and cherry-picked to all current active branches.

Work item tracking
Microsoft ADO (number only):
How I did it
Upgraded base image of docker-sonic-mgmt to Ubuntu 24.04.
Upgraded the build environment to bookworm.
Removed the logic of building flag LEGACY_SONIC_MGMT_DOCKER. All the sonic-mgmt branches are using python3 now. It's not necessary to build docker-sonic-mgmt to support python2. And python2 is end of support too.
Version of python packages are not pinned down. This change has pros and cons.
Pros: Keep the docker-sonic-mgmt up to date to avoid future big version leap which could be difficult to handle.
Cons: Community package upgrade could have issue and cause regression.
Version of ansible is pinned to 11.10.0. It's because pytest-ansible does not support the latest ansible due to pytest-ansible's stdout_callback fails on Ansible 2.19 ansible/pytest-ansible#489
Python packages are installed to /opt/venv by following the recommendation of Ubuntu 24.04.
The dash-api package is reverted to install from source code. The dash-api debian package built in bookworm cannot be installed in Ubuntu 24.04 due to dependency issues.
Default user "ubuntu" of Ubuntu 24.04 is removed from the image to avoid potential issues. For details, please refer to Improve setup-container.sh for Ubuntu 24.04 based docker-sonic-mgmt sonic-mgmt#20761. Skipped adding regular user. With this change, the image will only have root user. The setup-container.sh tool in the sonic-mgmt repository can add regular user. Recommend to use the setup-container.sh tool to create sonic-mgmt container.
Improved the code for installing docker and azure-cli.
Remove the build dependency of the ptf debian package. It's because the ptf package is installed by python pip.
How to verify it
After the upgrade, there are some compatibility issues. The compatibility issues are fixed in sonic-net/sonic-mgmt#21045.
I am using that PR to verify that all PR test scripts can pass by using the upgraded docker-sonic-mgmt.

The fix in sonic-net/sonic-mgmt#21045 is backward compatible. Backward compatibility is verified by PR testing of sonic-net/sonic-mgmt#20851

Signed-off-by: Feng Pan <[email protected]>
opcoder0 pushed a commit to opcoder0/sonic-mgmt that referenced this pull request Dec 8, 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.

Signed-off-by: opcoder0 <[email protected]>
selldinesh pushed a commit to selldinesh/sonic-mgmt that referenced this pull request Dec 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.

Signed-off-by: selldinesh <[email protected]>
echuawu pushed a commit to echuawu/sonic-mgmt that referenced this pull request Dec 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.
mssonicbld added a commit to sonic-net/sonic-buildimage that referenced this pull request Dec 14, 2025
<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "fixes #xxxx", or
 "closes #xxxx" or "resolves #xxxx"

 Please provide the following information:
-->

#### Why I did it
The base image Ubuntu 20.04 of docker-sonic-mgmt is end of support now. Need to upgrade the base image and the dependent packages to address potential vulnerability issues.

DO NOT MERGE until sonic-net/sonic-mgmt#21045 is merged and cherry-picked to all current active branches.

##### Work item tracking
- Microsoft ADO **(number only)**:

#### How I did it
* Upgraded base image of docker-sonic-mgmt to Ubuntu 24.04.
* Upgraded the build environment to bookworm.
* Removed the logic of building flag `LEGACY_SONIC_MGMT_DOCKER`. All the sonic-mgmt branches are using python3 now. It's not necessary to build docker-sonic-mgmt to support python2. And python2 is end of support too.
* Version of python packages are not pinned down. This change has pros and cons.
 failure_prs.log Pros: Keep the docker-sonic-mgmt up to date to avoid future big version leap which could be difficult to handle.
 failure_prs.log Cons: Community package upgrade could have issue and cause regression.
* Version of ansible is pinned to 11.10.0. It's because pytest-ansible does not support the latest ansible due to ansible/pytest-ansible#489
* Python packages are installed to /opt/venv by following the recommendation of Ubuntu 24.04.
* The dash-api package is reverted to install from source code. The dash-api debian package built in bookworm cannot be installed in Ubuntu 24.04 due to dependency issues.
* Default user "ubuntu" of Ubuntu 24.04 is removed from the image to avoid potential issues. For details, please refer to sonic-net/sonic-mgmt#20761. Skipped adding regular user. With this change, the image will only have root user. The `setup-container.sh` tool in the sonic-mgmt repository can add regular user. Recommend to use the `setup-container.sh` tool to create sonic-mgmt container.
* Improved the code for installing docker and azure-cli.
* Remove the build dependency of the `ptf` debian package. It's because the `ptf` package is installed by python pip.

#### How to verify it
After the upgrade, there are some compatibility issues. The compatibility issues are fixed in sonic-net/sonic-mgmt#21045.
I am using that PR to verify that all PR test scripts can pass by using the upgraded docker-sonic-mgmt.

The fix in sonic-net/sonic-mgmt#21045 is backward compatible. Backward compatibility is verified by PR testing of sonic-net/sonic-mgmt#20851

<!--
If PR needs to be backported, then the PR must be tested against the base branch and the earliest backport release branch and provide tested image version on these two branches. For example, if the PR is requested for master, 202211 and 202012, then the requester needs to provide test results on master and 202012.
-->

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

- [ ] 202205
- [ ] 202211
- [ ] 202305
- [ ] 202311
- [ ] 202405
- [ ] 202411
- [ ] 202505

#### Tested branch (Please provide the tested image version)

<!--
- Please provide tested image version
- e.g.
- [x] 20201231.100
-->

- [ ] <!-- image version 1 -->
- [ ] <!-- image version 2 -->

#### Description for the changelog
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->

<!--
 Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.
-->

#### Link to config_db schema for YANG module changes
<!--
Provide a link to config_db schema for the table for which YANG model
is defined
Link should point to correct section on https://github.com/Azure/sonic-buildimage/blob/master/src/sonic-yang-models/doc/Configuration.md
-->

#### A picture of a cute animal (not mandatory but encouraged)
saravanan-nexthop pushed a commit to saravanan-nexthop/sonic-mgmt that referenced this pull request Dec 15, 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.

Signed-off-by: Saravanan <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 16, 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.

Signed-off-by: Guy Shemesh <[email protected]>
AharonMalkin pushed a commit to AharonMalkin/sonic-mgmt that referenced this pull request Dec 16, 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.

Signed-off-by: Aharon Malkin <[email protected]>
deerao02 pushed a commit to deerao02/sonic-mgmt that referenced this pull request Dec 18, 2025
….04 (sonic-net#21045) (sonic-net#812)

This is to cherry-pick
sonic-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.

---------

Signed-off-by: Xin Wang <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Dec 21, 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.

Signed-off-by: Guy Shemesh <[email protected]>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
Why I did it
The base image Ubuntu 20.04 of docker-sonic-mgmt is end of support now. Need to upgrade the base image and the dependent packages to address potential vulnerability issues.

DO NOT MERGE until sonic-net/sonic-mgmt#21045 is merged and cherry-picked to all current active branches.

Work item tracking
Microsoft ADO (number only):
How I did it
Upgraded base image of docker-sonic-mgmt to Ubuntu 24.04.
Upgraded the build environment to bookworm.
Removed the logic of building flag LEGACY_SONIC_MGMT_DOCKER. All the sonic-mgmt branches are using python3 now. It's not necessary to build docker-sonic-mgmt to support python2. And python2 is end of support too.
Version of python packages are not pinned down. This change has pros and cons.
Pros: Keep the docker-sonic-mgmt up to date to avoid future big version leap which could be difficult to handle.
Cons: Community package upgrade could have issue and cause regression.
Version of ansible is pinned to 11.10.0. It's because pytest-ansible does not support the latest ansible due to pytest-ansible's stdout_callback fails on Ansible 2.19 ansible/pytest-ansible#489
Python packages are installed to /opt/venv by following the recommendation of Ubuntu 24.04.
The dash-api package is reverted to install from source code. The dash-api debian package built in bookworm cannot be installed in Ubuntu 24.04 due to dependency issues.
Default user "ubuntu" of Ubuntu 24.04 is removed from the image to avoid potential issues. For details, please refer to Improve setup-container.sh for Ubuntu 24.04 based docker-sonic-mgmt sonic-mgmt#20761. Skipped adding regular user. With this change, the image will only have root user. The setup-container.sh tool in the sonic-mgmt repository can add regular user. Recommend to use the setup-container.sh tool to create sonic-mgmt container.
Improved the code for installing docker and azure-cli.
Remove the build dependency of the ptf debian package. It's because the ptf package is installed by python pip.
How to verify it
After the upgrade, there are some compatibility issues. The compatibility issues are fixed in sonic-net/sonic-mgmt#21045.
I am using that PR to verify that all PR test scripts can pass by using the upgraded docker-sonic-mgmt.

The fix in sonic-net/sonic-mgmt#21045 is backward compatible. Backward compatibility is verified by PR testing of sonic-net/sonic-mgmt#20851

Signed-off-by: xiaweijiang <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Jan 13, 2026
…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.
yifan-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Jan 14, 2026
…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.

Signed-off-by: YiFan Wang <[email protected]>
gshemesh2 pushed a commit to gshemesh2/sonic-mgmt that referenced this pull request Jan 26, 2026
…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.

Signed-off-by: Guy Shemesh <[email protected]>
lakshmi-nexthop pushed a commit to lakshmi-nexthop/sonic-mgmt that referenced this pull request Jan 28, 2026
…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.

Signed-off-by: Lakshmi Yarramaneni <[email protected]>
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Jan 29, 2026
…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.
ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
…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.

Signed-off-by: Yael Tzur <[email protected]>
auspham pushed a commit to auspham/sonic-mgmt that referenced this pull request Feb 3, 2026
…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.
auspham pushed a commit to auspham/sonic-mgmt that referenced this pull request Feb 3, 2026
….04 (sonic-net#21045) (sonic-net#811)

This is to cherry-pick
sonic-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.
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Feb 6, 2026
…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.
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Feb 13, 2026
…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.

Signed-off-by: Raghavendran Ramanathan <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
…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.
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.

2 participants