profiler fix #2246

Merged
mfreeman451 merged 1 commit from refs/pull/2246/head into main 2025-09-28 22:32:01 +00:00
mfreeman451 commented 2025-09-28 22:31:06 +00:00 (Migrated from github.com)
Owner

Imported from GitHub pull request.

Original GitHub pull request: #1666
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1666
Original created: 2025-09-28T22:31:06Z
Original updated: 2025-12-08T06:55:34Z
Original head: carverauto/serviceradar:update/profiler_build_rpm_fix
Original base: main
Original merged: 2025-09-28T22:32:01Z by @mfreeman451

PR Type

Bug fix


Description

  • Install eBPF build dependencies (clang, llvm, libbpf)

  • Add bpf-linker cargo tool installation

  • Copy workspace cargo configuration for better builds


Diagram Walkthrough

flowchart LR
  A["Docker Build"] --> B["Install eBPF Dependencies"]
  B --> C["Install bpf-linker"]
  C --> D["Copy Cargo Config"]
  D --> E["Successful Profiler Build"]

File Walkthrough

Relevant files
Bug fix
Dockerfile.rpm.rust.profiler
Add eBPF dependencies and cargo config                                     

docker/rpm/Dockerfile.rpm.rust.profiler

  • Install eBPF build dependencies (clang, llvm, libbpf, kernel-headers)
  • Add bpf-linker cargo tool installation
  • Copy workspace cargo configuration directory
+8/-0     

Imported from GitHub pull request. Original GitHub pull request: #1666 Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/1666 Original created: 2025-09-28T22:31:06Z Original updated: 2025-12-08T06:55:34Z Original head: carverauto/serviceradar:update/profiler_build_rpm_fix Original base: main Original merged: 2025-09-28T22:32:01Z by @mfreeman451 --- ### **PR Type** Bug fix ___ ### **Description** - Install eBPF build dependencies (clang, llvm, libbpf) - Add bpf-linker cargo tool installation - Copy workspace cargo configuration for better builds ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Docker Build"] --> B["Install eBPF Dependencies"] B --> C["Install bpf-linker"] C --> D["Copy Cargo Config"] D --> E["Successful Profiler Build"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>Dockerfile.rpm.rust.profiler</strong><dd><code>Add eBPF dependencies and cargo config</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> docker/rpm/Dockerfile.rpm.rust.profiler <ul><li>Install eBPF build dependencies (clang, llvm, libbpf, kernel-headers)<br> <li> Add bpf-linker cargo tool installation<br> <li> Copy workspace cargo configuration directory</ul> </details> </td> <td><a href="https://github.com/carverauto/serviceradar/pull/1666/files#diff-781153f55084cf821b381a5d11ad04f4d5f8cd39ce82317db0f3d9ad91bbb498">+8/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
qodo-code-review[bot] commented 2025-09-28 22:31:24 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1666#issuecomment-3344343973
Original created: 2025-09-28T22:31:24Z

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵
🧪 No relevant tests
🔒 No security concerns identified
 Recommended focus areas for review

Reproducibility

Installing latest clang/llvm/libbpf from system repos without pinning versions can lead to non-reproducible builds; consider pinning versions or using a specific repo snapshot.

# Install system dependencies required for eBPF builds and linking utilities
RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \
    dnf clean all && \
    cargo install --locked bpf-linker
Cache Efficiency

Installing cargo tool 'bpf-linker' after system deps but before copying sources is good; however, consider moving it even earlier and using '--root /usr/local' and adding it to PATH explicitly to avoid layer invalidation; also evaluate using 'cargo binstall' or caching CARGO_HOME.

# Install system dependencies required for eBPF builds and linking utilities
RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \
    dnf clean all && \
    cargo install --locked bpf-linker
Missing Tools

eBPF builds may require 'bpftool' and kernel headers matching the image kernel; verify 'kernel-headers' is sufficient for build stage or add 'bpftool' if used by the build scripts.

# Install system dependencies required for eBPF builds and linking utilities
RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \
    dnf clean all && \
    cargo install --locked bpf-linker
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/1666#issuecomment-3344343973 Original created: 2025-09-28T22:31:24Z --- ## PR Reviewer Guide 🔍 Here are some key observations to aid the review process: <table> <tr><td>⏱️&nbsp;<strong>Estimated effort to review</strong>: 2 🔵🔵⚪⚪⚪</td></tr> <tr><td>🧪&nbsp;<strong>No relevant tests</strong></td></tr> <tr><td>🔒&nbsp;<strong>No security concerns identified</strong></td></tr> <tr><td>⚡&nbsp;<strong>Recommended focus areas for review</strong><br><br> <details><summary><a href='https://github.com/carverauto/serviceradar/pull/1666/files#diff-781153f55084cf821b381a5d11ad04f4d5f8cd39ce82317db0f3d9ad91bbb498R22-R25'><strong>Reproducibility</strong></a> Installing latest clang/llvm/libbpf from system repos without pinning versions can lead to non-reproducible builds; consider pinning versions or using a specific repo snapshot. </summary> ```txt # Install system dependencies required for eBPF builds and linking utilities RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \ dnf clean all && \ cargo install --locked bpf-linker ``` </details> <details><summary><a href='https://github.com/carverauto/serviceradar/pull/1666/files#diff-781153f55084cf821b381a5d11ad04f4d5f8cd39ce82317db0f3d9ad91bbb498R22-R25'><strong>Cache Efficiency</strong></a> Installing cargo tool 'bpf-linker' after system deps but before copying sources is good; however, consider moving it even earlier and using '--root /usr/local' and adding it to PATH explicitly to avoid layer invalidation; also evaluate using 'cargo binstall' or caching CARGO_HOME. </summary> ```txt # Install system dependencies required for eBPF builds and linking utilities RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \ dnf clean all && \ cargo install --locked bpf-linker ``` </details> <details><summary><a href='https://github.com/carverauto/serviceradar/pull/1666/files#diff-781153f55084cf821b381a5d11ad04f4d5f8cd39ce82317db0f3d9ad91bbb498R22-R25'><strong>Missing Tools</strong></a> eBPF builds may require 'bpftool' and kernel headers matching the image kernel; verify 'kernel-headers' is sufficient for build stage or add 'bpftool' if used by the build scripts. </summary> ```txt # Install system dependencies required for eBPF builds and linking utilities RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \ dnf clean all && \ cargo install --locked bpf-linker ``` </details> </td></tr> </table>
qodo-code-review[bot] commented 2025-09-28 22:32:09 +00:00 (Migrated from github.com)
Author
Owner

Imported GitHub PR comment.

Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1666#issuecomment-3344345749
Original created: 2025-09-28T22:32:09Z

PR Code Suggestions

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Separate RUN commands for better caching

Separate the dnf package installation and the cargo install command into two
distinct RUN instructions. This will improve Docker's layer caching and lead to
faster build times.

docker/rpm/Dockerfile.rpm.rust.profiler [23-25]

 RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \
-    dnf clean all && \
-    cargo install --locked bpf-linker
+    dnf clean all
 
+RUN cargo install --locked bpf-linker
+
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly applies a Docker best practice to improve layer caching, which will optimize future build times by separating commands with different change frequencies.

Low
  • More
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/1666#issuecomment-3344345749 Original created: 2025-09-28T22:32:09Z --- ## PR Code Suggestions ✨ <!-- 0fa5a52 --> Explore these optional code suggestions: <table><thead><tr><td><strong>Category</strong></td><td align=left><strong>Suggestion&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </strong></td><td align=center><strong>Impact</strong></td></tr><tbody><tr><td rowspan=1>General</td> <td> <details><summary>Separate RUN commands for better caching</summary> ___ **Separate the <code>dnf</code> package installation and the <code>cargo install</code> command into two <br>distinct <code>RUN</code> instructions. This will improve Docker's layer caching and lead to <br>faster build times.** [docker/rpm/Dockerfile.rpm.rust.profiler [23-25]](https://github.com/carverauto/serviceradar/pull/1666/files#diff-781153f55084cf821b381a5d11ad04f4d5f8cd39ce82317db0f3d9ad91bbb498R23-R25) ```diff RUN dnf install -y clang llvm llvm-devel llvm-libs libbpf libbpf-devel kernel-headers pkgconf-pkg-config gcc make && \ - dnf clean all && \ - cargo install --locked bpf-linker + dnf clean all +RUN cargo install --locked bpf-linker + ``` - [ ] **Apply / Chat** <!-- /improve --apply_suggestion=0 --> <details><summary>Suggestion importance[1-10]: 6</summary> __ Why: The suggestion correctly applies a Docker best practice to improve layer caching, which will optimize future build times by separating commands with different change frequencies. </details></details></td><td align=center>Low </td></tr> <tr><td align="center" colspan="2"> - [ ] More <!-- /improve --more_suggestions=true --> </td><td></td></tr></tbody></table>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar!2246
No description provided.