adding missing files #2234

Merged
mfreeman451 merged 1 commit from refs/pull/2234/head into main 2025-09-23 16:20:17 +00:00
mfreeman451 commented 2025-09-23 16:20:09 +00:00 (Migrated from github.com)
Owner

Imported from GitHub pull request.

Original GitHub pull request: #1654
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1654
Original created: 2025-09-23T16:20:09Z
Original updated: 2025-09-23T16:21:27Z
Original head: carverauto/serviceradar:updates/bazel_worksapces
Original base: main
Original merged: 2025-09-23T16:20:17Z by @mfreeman451

PR Type

Other


Description

  • Add Bazel platform definitions for multi-arch builds

  • Create WORKSPACE files for third-party dependencies

  • Configure remote execution platforms for BuildBuddy


Diagram Walkthrough

flowchart LR
  A["Platform Definitions"] --> B["Linux AMD64/ARM64"]
  A --> C["Darwin AMD64/ARM64"]
  A --> D["Remote Execution Platforms"]
  E["WORKSPACE Files"] --> F["cwalk dependency"]
  E --> G["tools_opam dependency"]

File Walkthrough

Relevant files
Configuration changes
BUILD.bazel
Multi-arch platform definitions for Bazel builds                 

platforms/BUILD.bazel

  • Define platform configurations for Linux and Darwin on AMD64/ARM64
  • Add remote execution platforms for BuildBuddy with container settings
  • Configure constraint values and execution properties for each platform
+73/-0   
Dependencies
WORKSPACE
Empty WORKSPACE for cwalk dependency                                         

third_party/cwalk/WORKSPACE

  • Add empty WORKSPACE file for Bazel local_path_override compatibility
+2/-0     
WORKSPACE
Empty WORKSPACE for tools_opam dependency                               

third_party/vendor/tools_opam/WORKSPACE

  • Add empty WORKSPACE file for Bazel local_path_override compatibility
+2/-0     

Imported from GitHub pull request. Original GitHub pull request: #1654 Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/pull/1654 Original created: 2025-09-23T16:20:09Z Original updated: 2025-09-23T16:21:27Z Original head: carverauto/serviceradar:updates/bazel_worksapces Original base: main Original merged: 2025-09-23T16:20:17Z by @mfreeman451 --- ### **PR Type** Other ___ ### **Description** - Add Bazel platform definitions for multi-arch builds - Create WORKSPACE files for third-party dependencies - Configure remote execution platforms for BuildBuddy ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Platform Definitions"] --> B["Linux AMD64/ARM64"] A --> C["Darwin AMD64/ARM64"] A --> D["Remote Execution Platforms"] E["WORKSPACE Files"] --> F["cwalk dependency"] E --> G["tools_opam dependency"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>BUILD.bazel</strong><dd><code>Multi-arch platform definitions for Bazel builds</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> platforms/BUILD.bazel <ul><li>Define platform configurations for Linux and Darwin on AMD64/ARM64<br> <li> Add remote execution platforms for BuildBuddy with container settings<br> <li> Configure constraint values and execution properties for each platform</ul> </details> </td> <td><a href="https://github.com/carverauto/serviceradar/pull/1654/files#diff-e7aed8c1f0aa84f04005b98a61f13eae1bad9bfc0f13dc02afde9f62961193e2">+73/-0</a>&nbsp; &nbsp; </td> </tr> </table></td></tr><tr><td><strong>Dependencies</strong></td><td><table> <tr> <td> <details> <summary><strong>WORKSPACE</strong><dd><code>Empty WORKSPACE for cwalk dependency</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> third_party/cwalk/WORKSPACE <ul><li>Add empty WORKSPACE file for Bazel local_path_override compatibility</ul> </details> </td> <td><a href="https://github.com/carverauto/serviceradar/pull/1654/files#diff-663d1fb60d6cecf259d7339747439c1168055f4651b2ec44188ec3184a6f59ad">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> <tr> <td> <details> <summary><strong>WORKSPACE</strong><dd><code>Empty WORKSPACE for tools_opam dependency</code>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </dd></summary> <hr> third_party/vendor/tools_opam/WORKSPACE <ul><li>Add empty WORKSPACE file for Bazel local_path_override compatibility</ul> </details> </td> <td><a href="https://github.com/carverauto/serviceradar/pull/1654/files#diff-5d92faa40bfff9c267294489a4d6a82af3c7edb8546095560587761e0ff04846">+2/-0</a>&nbsp; &nbsp; &nbsp; </td> </tr> </table></td></tr></tr></tbody></table> </details> ___
qodo-code-review[bot] commented 2025-09-23 16:20:29 +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/1654#issuecomment-3324716914
Original created: 2025-09-23T16:20:29Z

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

Config Consistency

Verify the constraint values and naming align with your toolchains and transition settings (e.g., that targets/toolchains are actually registered against these cpu/os constraints and remote exec platforms), to avoid platform mismatch errors during builds.

platform(
    name = "linux_amd64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:x86_64",
    ],
    visibility = ["//visibility:public"],
)

platform(
    name = "linux_arm64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:aarch64",
    ],
    visibility = ["//visibility:public"],
)

platform(
    name = "darwin_amd64",
    constraint_values = [
        "@platforms//os:macos",
        "@platforms//cpu:x86_64",
    ],
    visibility = ["//visibility:public"],
)

platform(
    name = "darwin_arm64",
    constraint_values = [
        "@platforms//os:macos",
        "@platforms//cpu:aarch64",
    ],
    visibility = ["//visibility:public"],
)
Exec Properties

Confirm the BuildBuddy execution properties keys and values match your RBE instance (container image, OSFamily/Arch naming, dockerNetwork/Pool). Mismatched keys may be ignored or cause scheduling issues.

# Remote execution platforms for BuildBuddy
platform(
    name = "rbe_linux_amd64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:x86_64",
    ],
    exec_properties = {
        "container-image": "gcr.io/buildbuddy-io/executor:latest",
        "OSFamily": "linux",
        "Arch": "amd64",
        "dockerNetwork": "off",
        "Pool": "default",
    },
    visibility = ["//visibility:public"],
)

platform(
    name = "rbe_linux_arm64",
    constraint_values = [
        "@platforms//os:linux",
        "@platforms//cpu:aarch64",
    ],
    exec_properties = {
        "container-image": "gcr.io/buildbuddy-io/executor:latest",
        "OSFamily": "linux",
        "Arch": "arm64",
        "dockerNetwork": "off",
        "Pool": "default",
    },
    visibility = ["//visibility:public"],
)
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/1654#issuecomment-3324716914 Original created: 2025-09-23T16:20:29Z --- ## 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/1654/files#diff-e7aed8c1f0aa84f04005b98a61f13eae1bad9bfc0f13dc02afde9f62961193e2R6-R40'><strong>Config Consistency</strong></a> Verify the constraint values and naming align with your toolchains and transition settings (e.g., that targets/toolchains are actually registered against these cpu/os constraints and remote exec platforms), to avoid platform mismatch errors during builds. </summary> ```txt platform( name = "linux_amd64", constraint_values = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], visibility = ["//visibility:public"], ) platform( name = "linux_arm64", constraint_values = [ "@platforms//os:linux", "@platforms//cpu:aarch64", ], visibility = ["//visibility:public"], ) platform( name = "darwin_amd64", constraint_values = [ "@platforms//os:macos", "@platforms//cpu:x86_64", ], visibility = ["//visibility:public"], ) platform( name = "darwin_arm64", constraint_values = [ "@platforms//os:macos", "@platforms//cpu:aarch64", ], visibility = ["//visibility:public"], ) ``` </details> <details><summary><a href='https://github.com/carverauto/serviceradar/pull/1654/files#diff-e7aed8c1f0aa84f04005b98a61f13eae1bad9bfc0f13dc02afde9f62961193e2R42-R73'><strong>Exec Properties</strong></a> Confirm the BuildBuddy execution properties keys and values match your RBE instance (container image, OSFamily/Arch naming, dockerNetwork/Pool). Mismatched keys may be ignored or cause scheduling issues. </summary> ```txt # Remote execution platforms for BuildBuddy platform( name = "rbe_linux_amd64", constraint_values = [ "@platforms//os:linux", "@platforms//cpu:x86_64", ], exec_properties = { "container-image": "gcr.io/buildbuddy-io/executor:latest", "OSFamily": "linux", "Arch": "amd64", "dockerNetwork": "off", "Pool": "default", }, visibility = ["//visibility:public"], ) platform( name = "rbe_linux_arm64", constraint_values = [ "@platforms//os:linux", "@platforms//cpu:aarch64", ], exec_properties = { "container-image": "gcr.io/buildbuddy-io/executor:latest", "OSFamily": "linux", "Arch": "arm64", "dockerNetwork": "off", "Pool": "default", }, visibility = ["//visibility:public"], ) ``` </details> </td></tr> </table>
qodo-code-review[bot] commented 2025-09-23 16:21:27 +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/1654#issuecomment-3324722032
Original created: 2025-09-23T16:21:27Z

PR Code Suggestions

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Pin container image for reproducible builds

Pin the container-image to a specific version or digest instead of using the
:latest tag in the exec_properties for both rbe_linux_amd64 and rbe_linux_arm64
platforms to ensure reproducible builds.

platforms/BUILD.bazel [49-71]

         exec_properties = {
-        "container-image": "gcr.io/buildbuddy-io/executor:latest",
+        "container-image": "gcr.io/buildbuddy-io/executor:v4.2.3",  # Or preferably a digest like @sha256:...
         "OSFamily": "linux",
         "Arch": "amd64",
         "dockerNetwork": "off",
         "Pool": "default",
     },
 ...
     exec_properties = {
-        "container-image": "gcr.io/buildbuddy-io/executor:latest",
+        "container-image": "gcr.io/buildbuddy-io/executor:v4.2.3",  # Or preferably a digest like @sha256:...
         "OSFamily": "linux",
         "Arch": "arm64",
         "dockerNetwork": "off",
         "Pool": "default",
     },

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that using the :latest tag for the container-image undermines build reproducibility, which is a critical concern for build systems like Bazel. Pinning the image to a specific version or digest is a best practice that significantly improves build stability.

Medium
  • More
Imported GitHub PR comment. Original author: @qodo-code-review[bot] Original URL: https://github.com/carverauto/serviceradar/pull/1654#issuecomment-3324722032 Original created: 2025-09-23T16:21:27Z --- ## PR Code Suggestions ✨ <!-- 692c256 --> 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>Possible issue</td> <td> <details><summary>Pin container image for reproducible builds</summary> ___ **Pin the <code>container-image</code> to a specific version or digest instead of using the <br><code>:latest</code> tag in the <code>exec_properties</code> for both <code>rbe_linux_amd64</code> and <code>rbe_linux_arm64</code> <br>platforms to ensure reproducible builds.** [platforms/BUILD.bazel [49-71]](https://github.com/carverauto/serviceradar/pull/1654/files#diff-e7aed8c1f0aa84f04005b98a61f13eae1bad9bfc0f13dc02afde9f62961193e2R49-R71) ```diff exec_properties = { - "container-image": "gcr.io/buildbuddy-io/executor:latest", + "container-image": "gcr.io/buildbuddy-io/executor:v4.2.3", # Or preferably a digest like @sha256:... "OSFamily": "linux", "Arch": "amd64", "dockerNetwork": "off", "Pool": "default", }, ... exec_properties = { - "container-image": "gcr.io/buildbuddy-io/executor:latest", + "container-image": "gcr.io/buildbuddy-io/executor:v4.2.3", # Or preferably a digest like @sha256:... "OSFamily": "linux", "Arch": "arm64", "dockerNetwork": "off", "Pool": "default", }, ``` `[To ensure code accuracy, apply this suggestion manually]` <details><summary>Suggestion importance[1-10]: 8</summary> __ Why: The suggestion correctly identifies that using the `:latest` tag for the `container-image` undermines build reproducibility, which is a critical concern for build systems like Bazel. Pinning the image to a specific version or digest is a best practice that significantly improves build stability. </details></details></td><td align=center>Medium </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!2234
No description provided.