Skip to content

Download and enable grpcurl in ptf docker.#24587

Merged
yxieca merged 3 commits intosonic-net:masterfrom
ryanzhu706:grpcurl_in_ptf
Dec 5, 2025
Merged

Download and enable grpcurl in ptf docker.#24587
yxieca merged 3 commits intosonic-net:masterfrom
ryanzhu706:grpcurl_in_ptf

Conversation

@ryanzhu706
Copy link
Contributor

@ryanzhu706 ryanzhu706 commented Nov 20, 2025

Why I did it

Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.

Background:

  • SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
  • Current test framework lacks unified gRPC testing capabilities
  • grpcurl provides a simple, dependency-free solution for gRPC operations
  • Eliminates need for protocol buffer compilation in test environments
Work item tracking
  • Microsoft ADO (number only):

How I did it

Download and enable grpcurl in ptf docker

Why I did it

Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

  • SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
  • Current test framework lacks unified gRPC testing capabilities
  • grpcurl provides a simple, dependency-free solution for gRPC operations
  • Eliminates need for protocol buffer compilation in test environments

How I did it

  • Added grpcurl v1.9.1 installation to PTF Dockerfile during build process
  • Implemented multi-architecture support (armhf, arm64, x86_64)
  • Downloads official release binary from GitHub releases
  • Installs to standard location /usr/local/bin/grpcurl
  • Properly sets executable permissions
    Technical Details:
  • Uses conditional architecture detection via CONFIGURED_ARCH
  • Downloads from https://github.com/fullstorydev/grpcurl/releases
  • Cleans up temporary files to minimize image size
  • Version 1.9.1 chosen for stability and feature completeness

How to verify it

  1. Build PTF container with changes
  2. Verify grpcurl is installed:
    docker exec ptf-container which grpcurl
    # Should return: /usr/local/bin/grpcurl
  3. Test grpcurl functionality:
    docker exec ptf-container grpcurl -version
    # Should return: grpcurl v1.9.1
  4. Test against live gRPC endpoint (if available):
    docker exec ptf-container grpcurl -plaintext <dut-ip>:8080 list
    # Should list available gRPC services

Description for the changelog

Add grpcurl v1.9.1 to PTF Docker container for gRPC testing support

Dependencies/Related Work

  • Supports upcoming gNOI client library implementation in sonic-mgmt
  • Enables gRPC-based test cases without complex proto compilation
  • Foundation for unified gNMI/gNOI/gNSI testing infrastructure

Additional Notes

  • No impact on existing PTF functionality
  • Minimal size increase (~24MB for grpcurl binary)
  • No runtime dependencies added
  • Compatible with all supported SONiC architectures%

How to verify it

Download and enable grpcurl in ptf docker

Why I did it

Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

  • SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
  • Current test framework lacks unified gRPC testing capabilities
  • grpcurl provides a simple, dependency-free solution for gRPC operations
  • Eliminates need for protocol buffer compilation in test environments

How I did it

  • Added grpcurl v1.9.1 installation to PTF Dockerfile during build process
  • Implemented multi-architecture support (armhf, arm64, x86_64)
  • Downloads official release binary from GitHub releases
  • Installs to standard location /usr/local/bin/grpcurl
  • Properly sets executable permissions
    Technical Details:
  • Uses conditional architecture detection via CONFIGURED_ARCH
  • Downloads from https://github.com/fullstorydev/grpcurl/releases
  • Cleans up temporary files to minimize image size
  • Version 1.9.1 chosen for stability and feature completeness

How to verify it

  1. Build PTF container with changes
  2. Verify grpcurl is installed:
    docker exec ptf-container which grpcurl
    # Should return: /usr/local/bin/grpcurl
  3. Test grpcurl functionality:
    docker exec ptf-container grpcurl -version
    # Should return: grpcurl v1.9.1
  4. Test against live gRPC endpoint (if available):
    docker exec ptf-container grpcurl -plaintext <dut-ip>:8080 list
    # Should list available gRPC services

Description for the changelog

Add grpcurl v1.9.1 to PTF Docker container for gRPC testing support

Dependencies/Related Work

  • Supports upcoming gNOI client library implementation in sonic-mgmt
  • Enables gRPC-based test cases without complex proto compilation
  • Foundation for unified gNMI/gNOI/gNSI testing infrastructure

Additional Notes

  • No impact on existing PTF functionality
  • Minimal size increase (~24MB for grpcurl binary)
  • No runtime dependencies added
  • Compatible with all supported SONiC architectures%

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

  • 202205
  • 202211
  • 202305
  • 202311
  • 202405
  • 202411
  • 202505

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)

@ryanzhu706 ryanzhu706 requested a review from lguohan as a code owner November 20, 2025 19:22
Copilot AI review requested due to automatic review settings November 20, 2025 19:22
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

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 adds the grpcurl tool (version 1.9.1) to the PTF (Packet Test Framework) Docker image. The tool is downloaded as a pre-compiled binary from GitHub releases and installed to /usr/local/bin/grpcurl. This enables gRPC testing capabilities within the PTF environment.

Key changes:

  • Downloads and installs grpcurl 1.9.1 binary from GitHub releases
  • Integrates the installation into the existing apt-get RUN command chain
  • Cleans up temporary files after installation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings November 20, 2025 23:42
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

Copilot AI left a comment

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 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +110 to +115
-o /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
cd /tmp && \
tar xvf grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
mv grpcurl /usr/local/bin/grpcurl && \
chmod +x /usr/local/bin/grpcurl && \
rm -f /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
Copy link

Copilot AI Nov 20, 2025

Choose a reason for hiding this comment

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

The grpcurl download lacks checksum verification, which poses a security risk. Consider adding SHA256 checksum verification after downloading to ensure the integrity and authenticity of the downloaded binary. This prevents potential security vulnerabilities from compromised or tampered packages.

Suggested change
-o /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
cd /tmp && \
tar xvf grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
mv grpcurl /usr/local/bin/grpcurl && \
chmod +x /usr/local/bin/grpcurl && \
rm -f /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
-o /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
curl -L "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/checksums.txt" \
-o /tmp/grpcurl_${GRPCURL_VERSION}_checksums.txt && \
cd /tmp && \
grep "grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz" grpcurl_${GRPCURL_VERSION}_checksums.txt > grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.sha256 && \
sha256sum -c grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.sha256 && \
tar xvf grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
mv grpcurl /usr/local/bin/grpcurl && \
chmod +x /usr/local/bin/grpcurl && \
rm -f /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.tar.gz && \
rm -f /tmp/grpcurl_${GRPCURL_VERSION}_checksums.txt && \
rm -f /tmp/grpcurl_${GRPCURL_VERSION}_${GRPCURL_ARCH}.sha256 && \

Copilot uses AI. Check for mistakes.
@vaibhavhd vaibhavhd requested a review from hdwhdw December 2, 2025 20:11
@hdwhdw
Copy link
Contributor

hdwhdw commented Dec 3, 2025

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 24587 in repo sonic-net/sonic-buildimage

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@yxieca yxieca merged commit 9f5a96e into sonic-net:master Dec 5, 2025
22 of 23 checks passed
kewei-arista pushed a commit to kewei-arista/sonic-buildimage that referenced this pull request Dec 8, 2025
Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
Current test framework lacks unified gRPC testing capabilities
grpcurl provides a simple, dependency-free solution for gRPC operations
Eliminates need for protocol buffer compilation in test environments


Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
hdwhdw pushed a commit to hdwhdw/sonic-buildimage that referenced this pull request Dec 18, 2025
Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
Current test framework lacks unified gRPC testing capabilities
grpcurl provides a simple, dependency-free solution for gRPC operations
Eliminates need for protocol buffer compilation in test environments

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
Signed-off-by: Dawei Huang <daweihuang@microsoft.com>
xwjiang-ms pushed a commit to xwjiang-ms/sonic-buildimage that referenced this pull request Dec 22, 2025
Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
Current test framework lacks unified gRPC testing capabilities
grpcurl provides a simple, dependency-free solution for gRPC operations
Eliminates need for protocol buffer compilation in test environments

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
Signed-off-by: xiaweijiang <xiaweijiang@microsoft.com>
jasonbridges pushed a commit to jasonbridges/sonic-buildimage that referenced this pull request Jan 22, 2026
Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
Current test framework lacks unified gRPC testing capabilities
grpcurl provides a simple, dependency-free solution for gRPC operations
Eliminates need for protocol buffer compilation in test environments


Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
FengPan-Frank pushed a commit to FengPan-Frank/sonic-buildimage that referenced this pull request Mar 6, 2026
Added grpcurl binary to PTF Docker containers to enable gRPC testing capabilities for SONiC test framework. This supports upcoming gNOI (gRPC Network Operations Interface) testing infrastructure that requires a lightweight gRPC client tool.
Background:

SONiC is moving towards gRPC-based management interfaces (gNMI, gNOI, gNSI)
Current test framework lacks unified gRPC testing capabilities
grpcurl provides a simple, dependency-free solution for gRPC operations
Eliminates need for protocol buffer compilation in test environments

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ying Xie <yxieca@users.noreply.github.com>
Signed-off-by: Feng Pan <fenpan@microsoft.com>
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.

5 participants