Repository navigation
build(anycable): install anycable-go only in the API images - #4083
Open
EmilyRagan wants to merge 3 commits into
Open
EmilyRagan wants to merge 3 commits into
EmilyRagan wants to merge 3 commits into
Conversation
Only cmd-tlm-api and script-runner-api run anycable-go, but openc3-ruby shipped both architecture binaries (~76 MB) to every derived image. Move the binaries to openc3-anycable/ and install the matching one via a bind-mounted build context in the two API Dockerfiles. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Without it a binary update leaves the API image hash unchanged and CI restores a stale cached image. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Move build-anycable.sh next to the binaries, update the update-anycable skill paths, and audit anycable-go against both API images since openc3-ruby no longer contains it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4083 +/- ##
==========================================
+ Coverage 80.49% 80.55% +0.05%
==========================================
Files 904 904
Lines 68992 68992
Branches 2681 2681
==========================================
+ Hits 55538 55575 +37
+ Misses 12792 12747 -45
- Partials 662 670 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What changed
Move the
anycable-gobinaries out ofopenc3-rubyand into a newopenc3-anycable/directory, and install them only in the two images that run them:openc3-cosmos-cmd-tlm-apiandopenc3-cosmos-script-runner-api.openc3-ruby/DockerfileandDockerfile-ubino longer copy or installanycable-go.RUN --mount=type=bind,from=anycable, so the unused architecture never lands in an image layer.anycablebuild context is passed incompose-build.yaml(additional_contexts),scripts/release/build_multi_arch.shandscripts/linux/openc3_build_ubi.sh.build-cosmosCI action hashesopenc3-anycableinto both API image cache keys, so a binary update rebuilds them.build-anycable.sh, theupdate-anycableskill and the package audit now point atopenc3-anycable/. The audit checksanycable-goin both API images.Why it changed
Only the two API images start
anycable-go(see theirProcfiles), butopenc3-rubycopied both the amd64 and arm64 binaries (~76 MB) into every image built on it: base, node, operator, init and the APIs. The unused architecture and the unused binary stayed in the image layers.CVEs found and reported on
go, impactinganycable-go, previously flowed through to more images of ours than necessary. The following images did contain these binaries and did fail on Trivy scans when newgoCVEs were discovered that now do not:openc3-ruby,openc3-base,openc3-node,openc3-operator,openc3-cosmos-init,openc3-enterprise-gem,openc3-enterprise-metrics,openc3-enterprise-operator, andopenc3-cosmos-enterprise-init. Only the images that actually use these binaries should contain them and be impacted by their CVEsTesting strategy
Built all relevant images from clean worktrees of
mainand of this branch, and compared sizes (below). Verified the installed binary runs and reports1.6.16.1-f8b38bb.Not tested: the multi-arch release script,
scripts/windows/openc3_setup.bat, and running the package audit. The UBI and multi-arch paths rely on--build-context, which podman only supports from 4.8.Review notes
Measured on an arm64 host, so each image contains the arm64 binary. Sizes are uncompressed (
docker image inspect).Compressed (per-layer gzip, roughly what a registry stores), the savings are smaller: about 26 MB for most images and about 13 MB for the two API images.
openc3-anycable/without an additional context. That is why the context is wired into each build path rather than copying the binaries into each API directory (which would add ~76 MB to git per directory).anycable-goreferences of its own. Its API images inherit the binary from the core API images (verified present in both), and the other enterprise images built on core shrink along with their parents. The enterprise rows were built from a clean enterprisemainworktree on top of the before/after core images. Enterprise grafana only borrows the frontend fromopenc3-nodein a build stage, so it is unchanged.🤖 Generated with Claude Code
Summary by CodeRabbit