Skip to content

[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
Azure:202412from
sdszhang:ptf_fix_202412
Open

[202412][docker-ptf] chore: pin ptf_nn_agent.py to use nnpy and Pin thrift to 0.22.0 to fix build issue.#2365
sdszhang wants to merge 2 commits into
Azure:202412from
sdszhang:ptf_fix_202412

Conversation

@sdszhang
Copy link
Copy Markdown

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

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)

auspham and others added 2 commits May 28, 2026 13:31
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 -->
@sdszhang sdszhang requested a review from lguohan as a code owner May 28, 2026 13:37
@sdszhang sdszhang requested a review from r12f May 28, 2026 13:37
@sdszhang
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants