-
Notifications
You must be signed in to change notification settings - Fork 373
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
Create init image for lib-injection #2606
Conversation
db3ca3e
to
d2f48b4
Compare
55ee18f
to
1d48dad
Compare
1d48dad
to
159657b
Compare
4554856
to
764028b
Compare
764028b
to
4b648ee
Compare
Any thoughts on how to test this? There's quite a bit of non-trivial logic in |
Codecov Report
@@ Coverage Diff @@
## master #2606 +/- ##
=======================================
Coverage 98.08% 98.08%
=======================================
Files 1160 1160
Lines 63676 63678 +2
Branches 2849 2849
=======================================
+ Hits 62457 62459 +2
Misses 1219 1219
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
# and auto instrument Ruby applications in containerized environments. | ||
FROM busybox | ||
|
||
ARG UID=10000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the user id set to 10000? Any reason for this specific value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found it: http://www.linfo.org/uid.html
3901487
to
8d3e847
Compare
8d3e847
to
f656a00
Compare
84f7128
to
a9bfad6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks solid! Let's get this out and hear the feedback!
lib-injection/auto_inject.rb
Outdated
puts "[DATADOG LIB INJECTION] #{output}" | ||
end | ||
rescue => e | ||
puts "[DATADOG LIB INJECTION] trial error: #{e}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trial error? What does it mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ruby script here is conducting a trial for adding ddtrace into the bundle. The trial could be success or not and then cleanup the filesystem. I added this to be safe if there is an exception thrown during the trial but I don't see it coming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think customers may have the same question, and I suggest that the answer is part of the error message, not just a comment here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a few notes. I wouldn't say my feedback is blocking, but please do consider looking into it before we release this to customers.
Especially the current log messages I think need a bit of love.
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious about this -- does the current test
action still require write permissions? Is this perhaps a left-over from an example/another action we started from?
require 'fileutils' | ||
|
||
begin | ||
# Copies for trial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider explaining here in a bit more detail why we're doing this
lib-injection/auto_inject.rb
Outdated
puts "[DATADOG LIB INJECTION] #{output}" | ||
end | ||
rescue => e | ||
puts "[DATADOG LIB INJECTION] trial error: #{e}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think customers may have the same question, and I suggest that the answer is part of the error message, not just a comment here :)
puts "[DATADOG LIB INJECTION] LoadError: #{e}" | ||
rescue Exception => e | ||
puts "[DATADOG LIB INJECTION] Exception: #{e}" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had left an earlier comment on this PR, that perhaps you missed but -- I think we're missing some specs for this. We do have some coverage via the system tests, but consider testing some or all of the behaviors here using RSpec as well, to give us more confidence when changing this script.
4dcf76c
to
0499917
Compare
What
Create init container image for k8s admission controller injection.
The init container image leverage
RUBYOPT
for ruby intepreter and the injection script would make an attempt to include ddtrace within the bundle. The install attempt could failed due to Bundler's deployment mode or unable to resolve compatible versions from bundler, but it would not blocked application process.For a Rails/Hanami app, the application would be auto instrumented.
Public release workflow would be triggered during a release with a tag push
v*.*.*
. Otherwise, the workflow would create images for internal testing purchase.