Skip to content

Conversation

@curusarn
Copy link

No description provided.

curusarn and others added 16 commits October 22, 2025 22:57
Ensures semaphore token is never leaked even if inspectOffsets()
or other ELF parsing code panics. Zero-cost defensive programming
that prevents potential deadlocks.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Use pr-X format for PR builds to avoid invalid Docker tags
when branch names contain slashes or special characters.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Without this, PR builds only stay in cache and aren't
available for testing. Now PR images will be pushed
with pr-X tags for actual testing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Remove conditional that skipped DockerHub login for PRs.
Now that we push PR images, we need to authenticate.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Switch from old fix-memory-leak-minimal.patch to
fix-memory-spikes.patch containing semaphore and
panic recovery fixes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Memory spike fixes are already applied directly to vendor files,
so patch step is no longer needed and was causing conflicts.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fails fast if our memory spike fixes are missing from the
source code before building, preventing 20+ min builds
that produce wrong images.

Checks for:
- BEYLA_MAX_CONCURRENT_ELF environment variable
- elfParseSem semaphore variable
- Semaphore implementation comments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
This prevents the Dockerfile from running 'make copy-obi-vendor' which
was overwriting our memory spike fixes with the original OBI code.
- Run full vendor update to get latest dependencies
- Apply semaphore patches to prevent ELF parsing memory spikes
- Copy generated eBPF files and Java agent jar from .obi-src
- Update Dockerfile to verify patches are preserved during build
- Add build-preserve-patches target to Makefile for CI
- Set DEV_OBI=1 in Docker build to skip vendor regeneration

This ensures we have both:
1. All required dependencies and generated files
2. Our memory spike fixes for concurrent ELF parsing
This ensures we catch any unexpected patch overwrites right before
the compile step, providing maximum confidence that our memory fixes
are actually being compiled into the binary.
The previous commit was missing:
- grafana-opentelemetry-java.jar
- All *bpfel.go and *bpfel.o eBPF generated files

These files are required for compilation and must be committed
since we're using DEV_OBI=1 to skip regeneration.
Since we've already committed all vendor dependencies and generated files,
we don't need to regenerate anything. The CI should just compile directly.

This avoids:
1. Running docker-generate which was creating new files in .obi-src
2. The broken copy-generated-files-only which was copying to wrong directories
3. Any possibility of overwriting our vendored patches
The test target needs setup-envtest and other tools installed.
Also creates the testoutput directory needed for coverage reports.
@curusarn curusarn closed this Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants