[202412][docker-ptf] chore: pin ptf_nn_agent.py to use nnpy and Pin thrift to 0.22.0 to fix build issue.#2365
Open
sdszhang wants to merge 2 commits into
Open
[202412][docker-ptf] chore: pin ptf_nn_agent.py to use nnpy and Pin thrift to 0.22.0 to fix build issue.#2365sdszhang wants to merge 2 commits into
sdszhang wants to merge 2 commits into
Conversation
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 <austinpham@microsoft.com>
…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`
<!-- GitOpsUserAgent=GitOps.Apps.Server.pullrequestcopilot -->
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
to fix build issue.
cherry-pick sonic-net/sonic-buildimage#26912 and internal PR to pin thrift.
How I did it
cherry-pick both changes.
How to verify it
PR pipeline.
Which release branch to backport (provide reason below if selected)
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)