Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: install latest grpc_health_probe #1269

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

c3y1huang
Copy link
Contributor

Which issue(s) this PR fixes:

Issue longhorn/longhorn#9714

What this PR does / why we need it:

Install the latest grpc_health_probe at build time.

Special notes for your reviewer:

None

Additional documentation or context

None

@c3y1huang c3y1huang self-assigned this Oct 28, 2024
Copy link

coderabbitai bot commented Oct 28, 2024

Walkthrough

The pull request modifies the Dockerfile to improve the build process by integrating the jq package into the installation commands for both the builder and release stages. It updates the method for downloading the grpc_health_probe to dynamically fetch the latest release URL using wget and jq, ensuring that the latest version is always retrieved based on the specified architecture. The overall structure of the Dockerfile remains unchanged, with no alterations to the cloning, building, or entry point commands.

Changes

File Change Summary
package/Dockerfile - Added jq to installation commands in builder and release stages.
- Updated grpc_health_probe download command to use dynamic URL retrieval with wget and jq.

Assessment against linked issues

Objective Addressed Explanation
Install the latest grpc_health_probe at build time (#9714)

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

longhorn/longhorn-9714

Signed-off-by: Chin-Ya Huang <chin-ya.huang@suse.com>
@c3y1huang c3y1huang force-pushed the 9714-build-grpc-health-probe branch from e0fa16b to 3566824 Compare October 28, 2024 04:27
@c3y1huang c3y1huang marked this pull request as ready for review October 28, 2024 04:43
@c3y1huang c3y1huang requested a review from a team October 28, 2024 04:43
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (1)
package/Dockerfile (1)

Line range hint 49-50: Remove unnecessary jq package from release stage.

The jq package is only needed during build time for parsing the GitHub API response. It's not required in the final image and should be removed to reduce image size.

 RUN zypper -n install nfs-client nfs4-acl-tools cifs-utils libaio1 sg3_utils \
-    iputils iproute2 qemu-tools e2fsprogs jq && \
+    iputils iproute2 qemu-tools e2fsprogs && \
     rm -rf /var/cache/zypp/*
🧰 Tools
🪛 GitHub Check: CodeFactor

[warning] 12-12: package/Dockerfile#L12
Specify version with zypper install -y <package>=<version>. (DL3037)


[warning] 12-12: package/Dockerfile#L12
zypper clean missing after zypper use. (DL3036)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between a95d166 and 3566824.

📒 Files selected for processing (1)
  • package/Dockerfile (2 hunks)
🧰 Additional context used
🪛 GitHub Check: CodeFactor
package/Dockerfile

[warning] 12-12: package/Dockerfile#L12
Specify version with zypper install -y <package>=<version>. (DL3037)


[warning] 12-12: package/Dockerfile#L12
zypper clean missing after zypper use. (DL3036)


[notice] 34-34: package/Dockerfile#L34
Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose). (DL3047)

🔇 Additional comments (1)
package/Dockerfile (1)

34-36: Verify architecture support.

Please ensure that the dynamic URL fetching works for all supported architectures.

✅ Verification successful

Let me try a different approach using curl instead of wget since it seems wget is not available in the sandbox environment.


Dynamic URL fetching works correctly for all architectures

The verification confirms that the latest grpc_health_probe release (v0.4.34) provides binaries for all common architectures:

  • linux-amd64
  • linux-arm64
  • linux-arm

The dynamic URL fetching approach in the Dockerfile will work reliably across different architectures as intended.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify grpc_health_probe availability for common architectures

ARCHS=("amd64" "arm64" "arm")
for arch in "${ARCHS[@]}"; do
    echo "Checking availability for arch: $arch"
    wget -qO- https://api.github.com/repos/grpc-ecosystem/grpc-health-probe/releases/latest | \
    jq -r --arg ARCH "$arch" '.assets[] | select(.name | test("linux.*" + $ARCH; "i")) | .browser_download_url'
done

Length of output: 1174


Script:

#!/bin/bash
# Description: Verify grpc_health_probe availability for common architectures using curl

ARCHS=("amd64" "arm64" "arm")
for arch in "${ARCHS[@]}"; do
    echo "Checking availability for arch: $arch"
    curl -s https://api.github.com/repos/grpc-ecosystem/grpc-health-probe/releases/latest | \
    jq -r --arg ARCH "$arch" '.assets[] | select(.name | test("linux.*" + $ARCH; "i")) | .browser_download_url'
done

Length of output: 1382

🧰 Tools
🪛 GitHub Check: CodeFactor

[notice] 34-34: package/Dockerfile#L34
Avoid use of wget without progress bar. Use wget --progress=dot:giga <url>. Or consider using -q or -nv (shorthands for --quiet or --no-verbose). (DL3047)

package/Dockerfile Show resolved Hide resolved
package/Dockerfile Show resolved Hide resolved
@innobead innobead merged commit 7865cdc into longhorn:master Oct 28, 2024
9 checks passed
@c3y1huang c3y1huang deleted the 9714-build-grpc-health-probe branch October 28, 2024 05:03
@c3y1huang
Copy link
Contributor Author

@mergify backport v1.7.x v1.6.x

Copy link

mergify bot commented Oct 28, 2024

backport v1.7.x v1.6.x

✅ Backports have been created

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.

2 participants