Skip to content

[docker-ptf] Upgrade docker-ptf from bookworm to trixie#27889

Open
yijingyan2 wants to merge 3 commits into
sonic-net:masterfrom
yijingyan2:docker-ptf-trixie
Open

[docker-ptf] Upgrade docker-ptf from bookworm to trixie#27889
yijingyan2 wants to merge 3 commits into
sonic-net:masterfrom
yijingyan2:docker-ptf-trixie

Conversation

@yijingyan2

Copy link
Copy Markdown
Contributor

Why I did it

docker-ptf still used Debian bookworm specific package names and Python paths.
To align with current distro direction, docker-ptf is migrated to trixie.

Work item tracking
  • Microsoft ADO (number only):

How I did it

  • Switched docker-ptf base image from bookworm to trixie
  • Updated trixie package names and versions
  • Updated Python site-packages wiring from Python 3.11 to Python 3.13 paths
  • Updated rules .mk file, moved docker registration from SONIC_BOOKWORM_DOCKERS to SONIC_TRIXIE_DOCKERS.

How to verify it

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

  • 202305
  • 202311
  • 202405
  • 202411
  • 202505
  • 202511
  • 202605

Tested branch (Please provide the tested image version)

Description for the changelog

Link to config_db schema for YANG module changes

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

Signed-off-by: Yijing Yan <yijingyan@microsoft.com>
@yijingyan2 yijingyan2 requested a review from lguohan as a code owner June 14, 2026 23:59
Copilot AI review requested due to automatic review settings June 14, 2026 23:59
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates the docker-ptf image (used by the VS platform for PTF-based testing) from Debian bookworm to Debian trixie, aligning the container with the newer build environment and updated Python runtime expectations.

Changes:

  • Switch docker-ptf base image from debian:bookworm to debian:trixie and update a few distro-specific packages.
  • Update Python path wiring inside the container from Python 3.11 to 3.13.
  • Register docker-ptf under SONIC_TRIXIE_DOCKERS instead of SONIC_BOOKWORM_DOCKERS.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
platform/vs/docker-ptf.mk Moves docker-ptf image registration to the trixie docker set for VS builds.
dockers/docker-ptf/Dockerfile.j2 Updates base OS to trixie and adjusts package list + Python path wiring accordingly.

{% if PTF_ENV_PY_VER == "py3" %}
# Install the python-saithrift into the virtual environment
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.11.egg" >> /root/env-python3/lib/python3.11/site-packages/easy-install.pth
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.13.egg" >> /root/env-python3/lib/python3.13/site-packages/easy-install.pth
Comment on lines +467 to +471
RUN mkdir -p /usr/lib/python3.13/dist-packages; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3/dist-packages/virtualenv.pth; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3.13/dist-packages/virtualenv.pth

RUN echo "PYTHONPATH=/root/env-python3/lib/python3.11/site-packages" >> /etc/environment
RUN echo "PYTHONPATH=/root/env-python3/lib/python3.13/site-packages" >> /etc/environment
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI review requested due to automatic review settings June 15, 2026 05:13
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

Comment thread platform/vs/docker-ptf.mk
endif
SONIC_DOCKER_IMAGES += $(DOCKER_PTF)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_PTF)
SONIC_TRIXIE_DOCKERS += $(DOCKER_PTF)
Comment on lines 435 to 438
{% if PTF_ENV_PY_VER == "py3" %}
# Install the python-saithrift into the virtual environment
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.11.egg" >> /root/env-python3/lib/python3.11/site-packages/easy-install.pth
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.13.egg" >> /root/env-python3/lib/python3.13/site-packages/easy-install.pth
{% endif %}
Comment on lines +467 to +471
RUN mkdir -p /usr/lib/python3.13/dist-packages; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3/dist-packages/virtualenv.pth; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3.13/dist-packages/virtualenv.pth

RUN echo "PYTHONPATH=/root/env-python3/lib/python3.11/site-packages" >> /etc/environment
RUN echo "PYTHONPATH=/root/env-python3/lib/python3.13/site-packages" >> /etc/environment
Comment on lines 13 to 16
paths:
include:
- dockers/docker-ptf
- dockers/docker-ptf/**

@yijingyan2

Copy link
Copy Markdown
Contributor Author

/azp run Azure.docker-ptf

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@yijingyan2

Copy link
Copy Markdown
Contributor Author

/azp run Azure.docker-ptf

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@yijingyan2

Copy link
Copy Markdown
Contributor Author

/azp run Azure.docker-ptf

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Signed-off-by: Yijing Yan <yijingyan@microsoft.com>
Copilot AI review requested due to automatic review settings June 15, 2026 09:45
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread platform/vs/docker-ptf.mk
Comment on lines 12 to +13
SONIC_DOCKER_IMAGES += $(DOCKER_PTF)
SONIC_BOOKWORM_DOCKERS += $(DOCKER_PTF)
SONIC_TRIXIE_DOCKERS += $(DOCKER_PTF)
Comment on lines 435 to 438
{% if PTF_ENV_PY_VER == "py3" %}
# Install the python-saithrift into the virtual environment
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.11.egg" >> /root/env-python3/lib/python3.11/site-packages/easy-install.pth
RUN echo "/usr/lib/python3/dist-packages/saithrift-0.9-py3.13.egg" >> /root/env-python3/lib/python3.13/site-packages/easy-install.pth
{% endif %}
Comment on lines +467 to +471
RUN mkdir -p /usr/lib/python3.13/dist-packages; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3/dist-packages/virtualenv.pth; \
echo "/root/env-python3/lib/python3.13/site-packages" > /usr/lib/python3.13/dist-packages/virtualenv.pth

RUN echo "PYTHONPATH=/root/env-python3/lib/python3.11/site-packages" >> /etc/environment
RUN echo "PYTHONPATH=/root/env-python3/lib/python3.13/site-packages" >> /etc/environment
@mssonicbld

Copy link
Copy Markdown
Collaborator

This PR has backport request for branch(es): 202605.
Added label(s) for branch(es) 202605.

---Powered by SONiC BuildBot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants