Skip to content

chore(docker): include grpcurl in provider image#405

Open
neyy91 wants to merge 2 commits into
akash-network:mainfrom
neyy91:chore/include-grpcurl
Open

chore(docker): include grpcurl in provider image#405
neyy91 wants to merge 2 commits into
akash-network:mainfrom
neyy91:chore/include-grpcurl

Conversation

@neyy91

@neyy91 neyy91 commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Resolves akash-network/support#317.

The inventory operator exposes a gRPC API (akash.inventory.v1.ClusterRPC). Bundling grpcurl in the provider image makes it possible to probe that API from inside the container - for example, a liveness probe that restarts the pod when allocated resources exceed allocatable.

Change

grpcurl is not available via apt, so the Dockerfile installs a pinned release:

  • Pinned to v1.9.3.
  • Works for both amd64 and arm64 (the image is built for both), selecting the right asset via dpkg --print-architecture.
  • The downloaded tarball is sha256-verified against the published checksum before extraction.
  • Only the grpcurl binary is installed; the tarball is removed afterwards.
  • grpcurl -version runs at the end so the build fails fast if anything is wrong.

Testing

Built the image locally (amd64) and confirmed the install step downloads, passes the checksum check, extracts the binary, and grpcurl -version reports v1.9.3. The arm64 asset uses the official published checksum.

refs: akash-network/support#317

The inventory operator exposes a gRPC API; bundling grpcurl allows probing
it from inside the container, e.g. a liveness probe that restarts the pod
when allocated resources exceed capacity.

Install a pinned, checksum-verified release for both amd64 and arm64, since
grpcurl is not available via apt.

refs: akash-network/support#317
@neyy91 neyy91 requested a review from a team as a code owner June 17, 2026 16:18
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dcb5867e-e6d5-4aa1-978e-e15b31441b34

📥 Commits

Reviewing files that changed from the base of the PR and between 3877d2b and ddf8b5d.

📒 Files selected for processing (1)
  • Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • Dockerfile

Walkthrough

The Dockerfile gains an ARG GRPCURL_VERSION=1.9.3 declaration and a new RUN step that detects the build architecture (amd64 or arm64), downloads the matching grpcurl release tarball from GitHub, verifies it against a hardcoded SHA-256 hash, extracts the binary to /usr/bin, and prints grpcurl -version.

Changes

grpcurl installation in Docker image

Layer / File(s) Summary
grpcurl version parameter and install RUN step
Dockerfile
Adds ARG GRPCURL_VERSION=1.9.3 with build-time documentation and a RUN block that resolves the architecture-specific download URL and SHA-256 hash, fetches the tarball from GitHub, verifies the checksum with sha256sum, extracts grpcurl into /usr/bin, and logs grpcurl -version.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

Poem

🐇 Hop, hop, I fetched a tool,
grpcurl now lives in the image, cool!
A checksum checked, the hash aligned,
For amd64 and arm too — double-signed.
The provider pod now speaks gRPC with ease,
This bunny ships binaries sure to please! 🌟

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'chore(docker): include grpcurl in provider image' accurately and concisely describes the main change: adding grpcurl to the Docker image.
Description check ✅ Passed The description clearly explains the motivation, implementation approach, and testing performed; it directly relates to adding grpcurl to the provider image.
Linked Issues check ✅ Passed The PR fully addresses the requirements from issue #317 by installing grpcurl in the provider image to enable gRPC API testing and pod automation.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue #317; the Dockerfile modification solely installs grpcurl with no extraneous alterations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
Dockerfile (1)

32-33: ⚡ Quick win

Harden the download step against transient network failures.

curl -fsSL can fail builds on temporary GitHub/DNS/network hiccups. Add retry and timeout flags to make image builds more reliable.

Suggested patch
-    curl -fsSL -o /tmp/grpcurl.tar.gz \
+    curl -fL --retry 5 --retry-delay 2 --retry-connrefused --connect-timeout 10 --max-time 120 -o /tmp/grpcurl.tar.gz \
       "https://github.com/fullstorydev/grpcurl/releases/download/v${GRPCURL_VERSION}/grpcurl_${GRPCURL_VERSION}_linux_${arch}.tar.gz"; \
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@Dockerfile` around lines 32 - 33, The curl command used to download the
grpcurl tarball in the Dockerfile lacks resilience against transient network
failures. Add retry and timeout flags to the curl command that downloads grpcurl
to make the build process more robust. Specifically, add the `--retry` flag to
automatically retry failed downloads on transient failures, and add
timeout-related flags such as `--connect-timeout` and `--max-time` to prevent
indefinite hangs. These flags should be added to the curl command parameters
alongside the existing `-fsSL` flags in the grpcurl download step.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@Dockerfile`:
- Around line 32-33: The curl command used to download the grpcurl tarball in
the Dockerfile lacks resilience against transient network failures. Add retry
and timeout flags to the curl command that downloads grpcurl to make the build
process more robust. Specifically, add the `--retry` flag to automatically retry
failed downloads on transient failures, and add timeout-related flags such as
`--connect-timeout` and `--max-time` to prevent indefinite hangs. These flags
should be added to the curl command parameters alongside the existing `-fsSL`
flags in the grpcurl download step.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 758bb450-7cb4-47dc-a82a-384f5c185467

📥 Commits

Reviewing files that changed from the base of the PR and between 0e0fd8a and 3877d2b.

📒 Files selected for processing (1)
  • Dockerfile

chalabi2
chalabi2 previously approved these changes Jun 18, 2026

@chalabi2 chalabi2 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.

lgtm

Comment thread Dockerfile Outdated

# grpcurl is used to probe the inventory operator's gRPC API (e.g. from a
# liveness probe). It is not packaged in apt, so install a pinned release.
ENV GRPCURL_VERSION=1.9.3

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ARG GRPCURL_VERSION=1.9.3

Comment thread Dockerfile
# liveness probe). It is not packaged in apt, so install a pinned release.
ENV GRPCURL_VERSION=1.9.3
RUN set -eux; \
case "$(dpkg --print-architecture)" in \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lets hardcode checksums into RUN, there is no need to split them as well, sha256sum supports checksums format from github releases

@neyy91 neyy91 Jun 22, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

switched GRPCURL_VERSION to ARG (build-time only). On the checksums - to make sure I match what you have in mind: do you mean fetching grpcurl's upstream checksums.txt and verifying the downloaded archive against it, or just hardcoding the two lines verbatim and letting sha256sum -c match by filename? Dockerfile RUN can't use a shell heredoc, so I'd do it via printf. Any option works for me-just let me know which one you prefer.

Per review: GRPCURL_VERSION is only needed at build time, so make it an
ARG rather than baking it into the image environment with ENV.
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.

Include grpcurl in Provider Image

3 participants