-
Notifications
You must be signed in to change notification settings - Fork 15
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
Replace Dockerfile with Scratch as Base Image #214
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
harrryr
force-pushed
the
update-dockerfile-with-scratch
branch
from
June 19, 2024 18:48
9e78a71
to
27a033c
Compare
harrryr
force-pushed
the
update-dockerfile-with-scratch
branch
from
June 19, 2024 20:01
d4ac377
to
2445d24
Compare
srprash
reviewed
Jun 25, 2024
harrryr
force-pushed
the
update-dockerfile-with-scratch
branch
from
July 3, 2024 18:00
bab6464
to
33d122b
Compare
srprash
reviewed
Jul 3, 2024
srprash
previously approved these changes
Jul 3, 2024
thpierce
reviewed
Jul 4, 2024
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.
Please add testing for both AMD64 and ARM64 as we have conditional logic for both.
thpierce
approved these changes
Jul 5, 2024
mxiamxia
pushed a commit
to aws-observability/aws-otel-js-instrumentation
that referenced
this pull request
Oct 24, 2024
*Issue #, if available:* ADOT SDK instrumentation Docker Images only support `cp -a` copy command so that the [CWAgentOperator can extract](https://github.com/aws/amazon-cloudwatch-agent-operator/blob/main/pkg/instrumentation/nodejs.go#L65) the instrumentation SDK via `cp -a`, but upstream OTel Operator has [changed a few months ago](open-telemetry/opentelemetry-operator@4cd6dcb) to use `cp -r` instead of `-a` to copy files from the OTel SDK Instrumentation Images. Today, OTel Operator is not compatible with some of the ADOT SDKs, and in the future, CWAgent Operator may also change to use `cp -r` as well *Description of changes:* - Copy changes from Java's PR to add `cp -r` support - aws-observability/aws-otel-java-instrumentation#843 - Modify the above `cp -r` support with bug fix implemented in Python's `cp -a` command - aws-observability/aws-otel-python-instrumentation#214 (comment) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
mxiamxia
pushed a commit
that referenced
this pull request
Oct 25, 2024
*Issue #, if available:* ADOT SDK instrumentation Docker Images only support `cp -a` copy command so that the [CWAgentOperator can extract](https://github.com/aws/amazon-cloudwatch-agent-operator/blob/main/pkg/instrumentation/nodejs.go#L65) the instrumentation SDK via `cp -a`, but upstream OTel Operator has [changed a few months ago](open-telemetry/opentelemetry-operator@4cd6dcb) to use `cp -r` instead of `-a` to copy files from the OTel SDK Instrumentation Images. Today, OTel Operator is not compatible with some of the ADOT SDKs, and in the future, CWAgent Operator may also change to use `cp -r` as well *Description of changes:* - Copy changes from Java's PR to add `cp -r` support - aws-observability/aws-otel-java-instrumentation#843 - Modify the above `cp -r` support with bug fix implemented in Python's `cp -a` command - #214 (comment) *Testing:* - Tested on PetClinic Sample App's Python Services with latest OTel Operator + Collector ![image](https://github.com/user-attachments/assets/c08aec2b-01ce-46c4-abfd-27c5b4f16c6b) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue #, if available:
Currently amazon linux is used as the base image for OTEL python distribution. This image contains a lot of unnecessary packages that inflate the image and also cause issues during high sev scans. Ideally we would like to use an image with minimal content.
Scratch
was the base image that was proposed to be used withcpUtility
installed to enable thecp
command to copy the python image to the sample app pod. The cpUtility is copied from aws-otel-java-instrumentation repo, but there is a small issue where if copied from a folder, the destination directory is not correct.This piece of code in cp-utility causes the directory to change if the destination folder already exists. It was modified so that that if the destination folder exists, just reuse it and don't create a new folder. Other than also modifying the unit test, the code is identical to the otel java
Test run: https://github.com/aws-observability/aws-otel-python-instrumentation/actions/runs/9586337462
Also manually built the image locally and deployed to EKS cluster with sample app. Verified that correct telemetry was generated and
opentelemetry
folder is located in correct pathAdditionally, ran testing in ARM64 EC2 instance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.