[docker-ptf] create symlinks for py3-only image#19813
Merged
wangxin merged 6 commits intosonic-net:masterfrom Aug 23, 2024
Merged
[docker-ptf] create symlinks for py3-only image#19813wangxin merged 6 commits intosonic-net:masterfrom
wangxin merged 6 commits intosonic-net:masterfrom
Conversation
Sflow requires autoconf 2.71 or higher; Bullseye is at 2.69.
* symlink ptf binary in py3 only config * Add retry for failed apt downloads
8 tasks
wangxin
reviewed
Aug 15, 2024
dockers/docker-ptf/Dockerfile.j2
Outdated
| RUN mkdir -p /root/env-python3/bin | ||
| RUN ln -s /usr/bin/python /root/env-python3/bin/python3 | ||
| RUN ln -s /usr/bin/python /root/env-python3/bin/python | ||
| RUN ln -s /usr/local/bin/ptf /root/env-python3/bin/ptf |
Contributor
There was a problem hiding this comment.
Is it possible to combine these steps into a single RUN to avoid extra docker layers?
Contributor
Author
There was a problem hiding this comment.
I have updated them to run under single RUN command.
wangxin
approved these changes
Aug 16, 2024
Contributor
Author
|
/azp run |
|
Commenter does not have sufficient privileges for PR 19813 in repo sonic-net/sonic-buildimage |
Contributor
Author
|
/ms_checker |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
The mix of docker-ptf with Python 2 + Python 3 (in virtual-env) and Python 3 images only across branches (with possibly some test scripts in
sonic-mgmtnot migrated to Python 3 in older branches) causes different path references to Python and PTF binaries. This can cause backporting a hassle. To prevent this the PR creates virtual environment (/root/env-python3) path to the real python 3 and PTF binaries. This keeps the paths same across docker-ptf images.Work item tracking
How I did it
Created symlinks for python and PTF from /root/env-python3/bin to /usr/bin.
How to verify it
Image built successfully and manually verified the existence of the links.
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Not applicable
Description for the changelog
[docker-ptf] create virtual-env symlinks for py3-only image
Link to config_db schema for YANG module changes
Not applicable
A picture of a cute animal (not mandatory but encouraged)
Not applicable