From e1e52ed6bd82aee0cc8c46475c48662a536b21a8 Mon Sep 17 00:00:00 2001 From: "Austin (Thang Pham)" Date: Wed, 22 Apr 2026 11:09:06 +1000 Subject: [PATCH 1/2] chore: pin ptf_nn_agent.py to use nnpy (#26912) Why I did it With this commit here, PTF replace nnpy with pynng p4lang/ptf However, we don't have pynng. To unblock us now, I'll pin ptf_nn_agent.py to a previous version that doesn't require pynng Signed-off-by: Austin Pham --- dockers/docker-ptf/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index ceb8542801..4f54c8a11d 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -169,7 +169,7 @@ RUN rm -rf /debs \ {% endif %} && mkdir -p /opt \ && cd /opt \ - && wget https://raw.githubusercontent.com/p4lang/ptf/master/ptf_nn/ptf_nn_agent.py + && wget https://raw.githubusercontent.com/p4lang/ptf/23ebe7237f3c284032bda02fbd1f4a98f1bc12f4/ptf_nn/ptf_nn_agent.py {% if PTF_ENV_PY_VER == "mixed" %} RUN python3 -m venv --system-site-packages env-python3 From de3d84cdf68e5ed98ad62593123243555b70d99a Mon Sep 17 00:00:00 2001 From: Riff Jiang Date: Thu, 28 May 2026 05:31:49 +0000 Subject: [PATCH 2/2] Merged PR 15849724: [internal-202412][docker-ptf] Pin thrift to 0.22.0 to fix build break ## Summary Pin `thrift` to `0.22.0` in `dockers/docker-ptf/Dockerfile.j2` to fix the `internal-202412` build break. ## Root cause `thrift 0.23.0` was published on PyPI on **2026-05-14** and uses a modern PEP 517 build backend that is incompatible with `pip 18.1` shipped in the bullseye-based `docker-ptf` image on this branch. Builds fail with: ``` ERROR: Could not install packages due to an OSError: [Errno 2] No such file or directory: '/tmp/tmpXXX/output.json' The command '/bin/sh -c pip3 install setuptools && ... && pip3 install thrift' returned a non-zero code: 1 make: *** [slave.mk:1158: target/docker-ptf.gz] Error 1 ``` This breaks `target/docker-ptf.gz` and the whole pipeline for `vs`, `broadcom`, and (indirectly) `mellanox`. Example failed build: [165233201](https://msazure.visualstudio.com/One/_build/results?buildId=165233201). ## Why only 202412 is affected `internal-202511` and `internal` already moved the PTF image to **bookworm + modern pip + `install_offending_packages` macro** via upstream PRs `sonic-net/sonic-buildimage#24323` (bookworm migration) and `#24691` (un-pin + isolated installs). Neither has been backported to `202412`, and the community `202412` branch has no commits to this file either. ## Fix Minimal, lowest-risk change: pin `thrift==0.22.0` (last release before 0.23.0, published 2025-05-23). No other behavior change. ## Test PR build will exercise the docker-ptf build end-to-end. ---- #### AI description (iteration 1) #### PR Classification Bug fix to resolve a Docker image build break by pinning a dependency version. #### PR Summary Pins the Python `thrift` package to a specific version in the docker-ptf image build to ensure reproducible, non-breaking installs. - `dockers/docker-ptf/Dockerfile.j2`: Change `pip3 install thrift` to `pip3 install thrift==0.22.0` --- dockers/docker-ptf/Dockerfile.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockers/docker-ptf/Dockerfile.j2 b/dockers/docker-ptf/Dockerfile.j2 index 4f54c8a11d..82ad840ca5 100644 --- a/dockers/docker-ptf/Dockerfile.j2 +++ b/dockers/docker-ptf/Dockerfile.j2 @@ -214,7 +214,7 @@ RUN pip3 install setuptools \ && pip3 install retrying \ && pip3 install jinja2 \ && pip3 install scapy==2.5.0 \ - && pip3 install thrift + && pip3 install thrift==0.22.0 {% if docker_ptf_whls.strip() -%} # Copy locally-built Python wheel dependencies