Skip to content

Add hotreload.sh #2110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Add hotreload.sh #2110

wants to merge 4 commits into from

Conversation

Molter73
Copy link
Collaborator

@Molter73 Molter73 commented Apr 29, 2025

Description

This script is inspired by the hotreload mode in the main repo.

When using a k8s cluster with access to the local filesystem (like kind,
k3s, minikube, etc.), it configures the collector container in the
collector daemonset to execute a locally built binary, which is useful
for iterating fast or running with sanitizers enabled.

The script also provides a --revert option for dropping the
configuration changes once they are no longer needed.

Checklist

  • Investigated and inspected CI test results
  • Updated documentation accordingly

Automated testing

  • Added unit tests
  • Added integration tests
  • Added regression tests

If any of these don't apply, please comment below.

Testing Performed

Tested locally on my KinD cluster.

This script is inspired by the hotreload mode in the main repo.

When using a k8s cluster with access to the local filesystem (like kind,
k3s, minikube, etc.), it configures the collector container in the
collector daemonset to execute a locally built binary, which is useful
for iterating fast or running with sanitizers enabled.

The script also provides a --revert option for dropping the
configuration changes once they are no longer needed.
This new option will compile the collector binary with thread sanitizer
support. libtsan is added to the image-dev in order for collector to be
able to use it at runtime. libubsan is also added since it was missing.
@Molter73 Molter73 requested a review from a team as a code owner April 29, 2025 09:32
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Molter73 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider simplifying the revert logic in hotreload.sh which currently relies on multiple index-based patches.
  • Consider making the in-container collector binary path (/host/src/cmake-build/collector/collector) configurable in hotreload.sh.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

exit 0
;;

'-r' | '--hotreload')
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Inconsistent flag naming for revert/hotreload option.

The usage and getopt list use --revert, but the case handles --hotreload—please align them (e.g., use --revert consistently).

Suggested change
'-r' | '--hotreload')
'-r' | '--revert')

@codecov-commenter
Copy link

codecov-commenter commented Apr 29, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.40%. Comparing base (7ae2248) to head (029e9d4).
Report is 3 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2110   +/-   ##
=======================================
  Coverage   28.40%   28.40%           
=======================================
  Files          94       94           
  Lines        5717     5717           
  Branches     2531     2531           
=======================================
  Hits         1624     1624           
  Misses       3383     3383           
  Partials      710      710           
Flag Coverage Δ
collector-unit-tests 28.40% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -16,7 +16,13 @@ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -fno-strict-aliasing -DNDEBUG")
if(ADDRESS_SANITIZER)
set(DISABLE_PROFILING ON)
set(USE_VALGRIND OFF)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -DGRPC_ASAN_SUPRESSED")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fsanitize=undefined -DGRPC_ASAN_SUPPRESSED")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to add this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I did, it has been wrong since we first added it.

@Molter73 Molter73 requested a review from robbycochran May 5, 2025 08:39
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.

3 participants