Add full OBI source to release artifacts#1378
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1378 +/- ##
==========================================
+ Coverage 43.71% 43.78% +0.07%
==========================================
Files 312 312
Lines 33850 33893 +43
==========================================
+ Hits 14797 14841 +44
+ Misses 18101 18092 -9
- Partials 952 960 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds a “source + generated outputs” tarball to GitHub Releases so downstream consumers can build OBI without running the generation pipeline themselves.
Changes:
- Add a
release-sourceMakefile target to buildobi-<version>-source-generated.tar.gzand expand checksum generation to cover all release archives. - Update the release GitHub Actions workflow to build and publish the new source-generated archive.
- Update
RELEASING.mddocumentation to describe the new artifact and updated local release steps.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
RELEASING.md |
Documents the new source-generated release artifact and updated local build steps. |
Makefile |
Introduces release-source and updates checksum generation to include all obi-<version>-*.tar.gz archives. |
.github/workflows/release.yml |
Adds a workflow step to build and attach the new source-generated archive to draft releases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
just to get some context, this doesn't solve the case outlined here #1156 , right? |
I think it gets us closer to a solution here, I'm not sure it is complete. I'd have to understand the other verdoring workflows better. I think this gets us closer here based on what I plan to do for the collector contrib distribution. They do not want to bring in the full source history to the project as a submodule. So, instead, I plan to download and expand this artifact locally and treat as vendored source there. Based on that, it does sound like it would resolve #1156, at least for that workflow. But, I'm not sure if it would solve all. @NimrodAvni78 thoughts? |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@MrAlias not sure i understand the plan, the collector contrib should download this release archive, (which we will release on each version release) and then import it? |
If this is the case with the collector, then yes |
In the collector pipeline the replace statement will be in the manifest (like this). However, a similar approach could be taken using |
Closes #1156
Adds a
obi-<version>-source-generated.tar.gzarchive to every OBI release. This archive contains the full source tree from the tagged revision plus all generated artifacts that normally require the OBI generation pipeline to produce. Downstream consumers (e.g.opentelemetry-collector-contrib) can use it as a drop-in Go module source without needing Docker, clang, bpf2go, or the Gradle Java agent toolchain.Motivation
Issue #1156 identified that vendoring OBI — in particular for building a collector distribution with an OBI Receiver — is blocked because the generated BPF object files and Go bindings (~12 MB) are gitignored and not available from a plain
git cloneorgo mod vendor. The options considered in that issue were:ebpf-profilerdoes)This PR takes the second approach: rather than polluting the default branch history with large binary blobs, the generated artifacts are bundled into a release archive that downstream consumers can download and use as a local module replacement.
OBI generates several categories of artifacts during its build pipeline that are gitignored and not available from a plain
git clone:*_bpfel.go,*_bpfeb.go,*_bpfel.o,*_bpfeb.o, and*_bpfel.go.d/*_bpfeb.go.ddependency files — produced by bpf2go from C sources via a Docker-based clang toolchain.pkg/internal/java/embedded/obi-java-agent.jar— produced by Gradle inside a Docker container; only a placeholder string is committed to git.Any project that vendors or
replace-directs OBI as a Go module dependency must either run the full generation pipeline themselves or consume this new archive.What's in the archive
The embedded Node.js
fdextractor.jsis plain tracked source and is already included bygit archive; no special handling is needed.Changes
scripts/release-source.sh(new)Standalone bash script that builds the archive:
--release-versionresolves to the same commit asHEAD, preventing silent mixing of sources from one ref with generated artifacts from another.git archivefor the specified ref into a temp directory.*_bpfe[lb].go,*.o, and*.go.dfiles frompkg/onto the archived tree.java-docker-buildhasn't been run)..tar.gzand verifies it contains the expected generated artifacts.--debug/-xis set).The script follows the defensive bash style: strict mode, all globals
readonly, all runtime state in local variables,shellcheck-clean with no suppression comments.Makefilerelease-sourcetarget that depends ondocker-generateandjava-docker-build, then invokes the script and runsrelease-checksums.release-checksumsrewritten in POSIX sh (was using bash arrays andshopt -s nullglob).RELEASE_SOURCE_VERSIONcomputed independently fromRELEASE_VERSIONso the source archive version can be set on its own (defaults to exact tag → current branch →main)..github/workflows/release.ymlAdds a "Build source-generated release artifacts" step that runs
make release-sourceafter the binary artifacts are built. The resulting archive is uploaded alongside the amd64/arm64 tarballs and included in the draft release.RELEASING.mdDocuments the new artifact, updated local build steps, and updated archive-contents table.
How to use this artifact downstream
This is the primary use-case: a downstream project that imports OBI as a Go module but cannot (or does not want to) run the OBI generation pipeline.
Testing