Skip to content
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

Not preserve the ownership of the files copied in the autoinstrumentation #2695

Merged
merged 14 commits into from
Mar 13, 2024

Conversation

iblancasa
Copy link
Contributor

@iblancasa iblancasa commented Feb 29, 2024

Closes #2655.

Using -a is a problem when you try to instrument pods that are not run as root.

@iblancasa iblancasa requested a review from a team February 29, 2024 18:28
Co-authored-by: Mikołaj Świątek <[email protected]>
@pavolloffay
Copy link
Member

@iblancasa would it be possible to build e2e tests to verify this?

@swiatekm
Copy link
Contributor

swiatekm commented Mar 4, 2024

@iblancasa would it be possible to build e2e tests to verify this?

We should consider running instrumentation e2e tests with images built from the repo imo at least in some circumstances. Not clear how annoying it would be.

@iblancasa
Copy link
Contributor Author

@iblancasa would it be possible to build e2e tests to verify this?

I'm not sure what to add to the current E2E tests to check this. Any ideas?

@swiatekm
Copy link
Contributor

swiatekm commented Mar 4, 2024

@iblancasa would it be possible to build e2e tests to verify this?

I'm not sure what to add to the current E2E tests to check this. Any ideas?

I don't think there's an easy way to do it right now. Have you tried building these images locally and running E2E tests with them?

@iblancasa
Copy link
Contributor Author

@iblancasa would it be possible to build e2e tests to verify this?

I'm not sure what to add to the current E2E tests to check this. Any ideas?

I don't think there's an easy way to do it right now. Have you tried building these images locally and running E2E tests with them?

This approach should be OK with the current images, right? We're not changing them.
I can test if, after this change, the applications from the E2E tests are still properly autoinstrumented. What do you think?

@swiatekm
Copy link
Contributor

swiatekm commented Mar 4, 2024

I thought for some reason we were changing the images themselves in this PR, sorry for the confusion. Existing E2E tests should probably be fine here, though I'm not 100% confident we have the necessary coverage for all instrumentations.

@iblancasa
Copy link
Contributor Author

...though I'm not 100% confident we have the necessary coverage for all instrumentations.

What do you think I can add to increase the coverage?

@IshwarKanse
Copy link
Contributor

IshwarKanse commented Mar 5, 2024

@swiatekm-sumo @iblancasa This #2702 PR fixes our instrumentation tests and checks if all the containers in the pods are started and not in Error or CrashLoopBackoff state. If any of the containers in the instrumented application pod fails, we collect all the container logs using catch: I have fixed the tests in the e2e-instrumentation test suite and checking the e2e-multi-instrumentation. By the way I ran into this issue in the e2e-multi-instrumenation for Java and Nodejs, checking for Java if I need to raise a bug.

@swiatekm swiatekm self-requested a review March 6, 2024 14:34
Copy link
Contributor

@swiatekm swiatekm left a comment

Choose a reason for hiding this comment

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

LGTM. E2E tests actually do check this, so if they pass, we should be good.

@iblancasa
Copy link
Contributor Author

Can we merge this?

@@ -865,7 +865,7 @@ func TestInjectDotNet(t *testing.T) {
{
Name: dotnetInitContainerName,
Image: "img:1",
Command: []string{"cp", "-a", "/autoinstrumentation/.", dotnetInstrMountPath},
Command: []string{"cp", "-r", "/autoinstrumentation/.", dotnetInstrMountPath},
Copy link
Contributor

@jaronoff97 jaronoff97 Mar 8, 2024

Choose a reason for hiding this comment

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

is cp -r available on all of the distributions we use? I tested it on my mac and it failed... i guess if our e2e tests are passing thats reason enough for me to believe it does work, but have you tested this locally on a cluster?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we use busybox everywhere, so it should work.

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah i think just some extra confirmation that this worked on a local kind cluster would be good

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current E2E are testing this if I'm not wrong @IshwarKanse

Copy link
Contributor

@IshwarKanse IshwarKanse Mar 11, 2024

Choose a reason for hiding this comment

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

So the current e2e tests are not checking the status of the containers in the pod. I have fixed that with the PR #2702 (pending merge )with the changes, we check all the containers in the instrumented app pod are running and the test will fail if any of the container fails.

@sanicheev
Copy link

@iblancasa having the same issues.
Tested this branch on one of the clusters and it works.
Can we please merge this one?

@iblancasa
Copy link
Contributor Author

@iblancasa having the same issues. Tested this branch on one of the clusters and it works. Can we please merge this one?

Happy to heard it works!

@pavolloffay pavolloffay merged commit 4cd6dcb into open-telemetry:main Mar 13, 2024
31 checks passed
@iblancasa iblancasa deleted the bug/2655 branch March 13, 2024 15:23
ItielOlenick pushed a commit to ItielOlenick/opentelemetry-operator that referenced this pull request May 1, 2024
…tion (open-telemetry#2695)

* Not preserve the ownership of the files copied in the autoinstrumentation. Closes open-telemetry#2655

Signed-off-by: Israel Blancas <[email protected]>

* Update .chloggen/fix-2655.yaml

Co-authored-by: Mikołaj Świątek <[email protected]>

---------

Signed-off-by: Israel Blancas <[email protected]>
Co-authored-by: Mikołaj Świątek <[email protected]>
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.

Node.js pod CrashLoopBackOff after auto-instrumenting
6 participants