forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker-ptf]: Changes to build Python 3 docker-ptf (sonic-net#18909)
Why I did it As Python 2 has reached EOL it is important to migrate all PTF tests to Python 3. The current docker-ptf image contains both Python 2 and Python 3. This PR adds configuration option to build docker-ptf image with its current contents of both Python 2 and 3 by setting SONIC_PTF_ENV_PY_VER to mixed (default value). Or building a Python 3 only image by setting SONIC_PTF_ENV_PY_VER to py3. Once all the tests are fully migrated to Python 3 the older docker-ptf container with Python 2 will only be used for older releases and newer releases can use Python 3 only PTF docker image. The main branch's setting can be updated to use py3 image. How I did it Add SONIC_PTF_ENV_PY_VER configuration variable with mixed and py3 values. platform/vs/docker-ptf.mk and slave.mk uses the configuration value to set dependencies and build the image make target/docker-ptf.gz builds a Python 2 and 3 or Python 3 only image based on the configuration value. How to verify it make USERNAME=admin SONIC_BUILD_JOBS=4 BUILD_MULTIASIC_KVM=y INCLUDE_DHCP_SERVER=y target/docker-ptf.gz Which release branch to backport (provide reason below if selected) Not applicable Tested branch (Please provide the tested image version) None. Individual PTF scripts that have been moved to Python 3 (from the main branch) will be tested. Description for the changelog [docker-ptf]: Changes to build Python 3 docker-ptf Adds SONIC_PTF_ENV_PY_VER to build current docker-ptf with Python 2 and 3 or just Python 3 Update dockers/docker-ptf/Dockerfile.j2 to install Python 3 only and required packages
- Loading branch information
Showing
5 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters