adding custom docker image stuff #2254
No reviewers
Labels
No labels
1week
2weeks
Failed compliance check
IP cameras
NATS
Possible security concern
Review effort 1/5
Review effort 2/5
Review effort 3/5
Review effort 4/5
Review effort 5/5
UI
aardvark
accessibility
amd64
api
arm64
auth
back-end
bgp
blog
bug
build
checkers
ci-cd
cleanup
cnpg
codex
core
dependencies
device-management
documentation
duplicate
dusk
ebpf
enhancement
eta 1d
eta 1hr
eta 3d
eta 3hr
feature
fieldsurvey
github_actions
go
good first issue
help wanted
invalid
javascript
k8s
log-collector
mapper
mtr
needs-triage
netflow
network-sweep
observability
oracle
otel
plug-in
proton
python
question
reddit
redhat
research
rperf
rperf-checker
rust
sdk
security
serviceradar-agent
serviceradar-agent-gateway
serviceradar-web
serviceradar-web-ng
siem
snmp
sysmon
topology
ubiquiti
wasm
wontfix
zen-engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
carverauto/serviceradar!2254
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refs/pull/2254/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from GitHub pull request.
Original GitHub pull request: #1675
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/pull/1675
Original created: 2025-09-30T03:31:28Z
Original updated: 2025-10-01T16:34:08Z
Original head: carverauto/serviceradar:bazel/custom_rbe_executor_image
Original base: main
Original merged: 2025-10-01T16:34:02Z by @mfreeman451
PR Type
Enhancement
Description
Add custom RBE executor Docker image with OCaml/opam
Configure Bazel remote build platform for custom image
Set up GitHub Actions workflow for image building
Update Bazel configuration to use custom platform
Diagram Walkthrough
File Walkthrough
.bazelrc
Configure Bazel for custom RBE platform.bazelrc
@buildbuddy_toolchain//:platformto//docker:rbe_platformbuild-rbe-image.yml
Add RBE image build workflow.github/workflows/build-rbe-image.yml
BUILD
Define custom RBE platform configurationdocker/BUILD
rbe_platformfor remote executionDockerfile.rbe
Add custom RBE Docker imagedocker/Dockerfile.rbe
5.2
Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1675#issuecomment-3349808742
Original created: 2025-09-30T03:32:08Z
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Supply chain and token scope:
The workflow logs into GHCR using GITHUB_TOKEN and pulls curl binaries over HTTPS. While acceptable, consider verifying downloads (checksum/signature) for the opam binary to prevent tampering, and ensure the GITHUB_TOKEN has least-privilege scopes for package write only.
Platform Consistency
Verify that the custom platform label
//docker:rbe_platformis published and available in all CI and developer environments using the remote config; otherwise remote builds may fail if the target does not exist or visibility is restricted.Exec Properties
Confirm that the
container-imageanddockerNetworkexec properties match the RBE executor’s expected property keys for your remote backend; mismatches are silently ignored, causing the default image/networking to be used.Determinism and Caching
The image uses
latestopam repo state and installs packages without pinning exact versions; this can cause non-reproducible builds and cache invalidations. Consider pinning commits or using lockfiles.Imported GitHub PR comment.
Original author: @qodo-code-review[bot]
Original URL: https://github.com/carverauto/serviceradar/pull/1675#issuecomment-3349810803
Original created: 2025-09-30T03:33:18Z
PR Code Suggestions ✨
Explore these optional code suggestions:
Use immutable tags for RBE image
The
docker/BUILDfile hardcodes the mutable:latesttag for the RBE containerimage, which harms build reproducibility. It is recommended to use an immutable
tag, like a git commit SHA, and automate the update of this tag in the build
configuration.
Examples:
docker/BUILD [14]
.github/workflows/build-rbe-image.yml [50]
Solution Walkthrough:
Before:
After:
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a critical design flaw where using the mutable
:latesttag for the RBE image indocker/BUILDundermines build reproducibility, a core principle for reliable build systems.Verify checksum of downloaded binary
Add a step to verify the checksum of the downloaded
opambinary to ensure itsintegrity and prevent potential execution of malicious code.
docker/Dockerfile.rbe [37-40]
Suggestion importance[1-10]: 9
__
Why: This suggestion addresses a significant security risk by recommending checksum verification for a downloaded executable, which is a critical practice to prevent supply chain attacks.
Improve Dockerfile for build reproducibility
To improve build reproducibility and error handling in the Dockerfile, pin the
opam-repositoryto a specific commit, remove the redundantopam update, and movethe
opam removecommand with|| trueto a separateRUNstep.docker/Dockerfile.rbe [48-52]
Suggestion importance[1-10]: 8
__
Why: The suggestion correctly identifies multiple issues that harm build reproducibility and mask potential errors, offering a robust solution that significantly improves the reliability of the Docker image build.
✅
Pin container image to an immutable tagSuggestion Impact:
The commit changed the container image from :latest to a specific version tag (v1.0.3), pinning the image instead of using latest.code diff:
Replace the
:latesttag for the RBE container image with an immutable tag, suchas one based on a Git commit SHA, to ensure build reproducibility.
docker/BUILD [14]
[Suggestion processed]Suggestion importance[1-10]: 7
__
Why: The suggestion correctly identifies that using the
:latesttag undermines build reproducibility, which is a critical best practice for the CI/CD infrastructure being introduced.