Skip to content

Commit 1f13ce8

Browse files
authored
Fix removing gRPC from Dockerfile (#173)
The previous fix (#172) was not working as deleting the files after installation caused dangling dependencies - the instrumentation expected a dependency, but it was not found, causing instrumentation to fail. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent 67c05e1 commit 1f13ce8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ WORKDIR /operator-build
99

1010
ADD aws-opentelemetry-distro/ ./aws-opentelemetry-distro/
1111

12-
RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro
13-
1412
# Remove opentelemetry-exporter-otlp-proto-grpc and grpcio, as grpcio has strict dependencies on the Python version and
1513
# will cause confusing failures if gRPC protocol is used. Now if gRPC protocol is requested by the user, instrumentation
1614
# will complain that grpc is not installed, which is more understandable. References:
1715
# * https://github.com/open-telemetry/opentelemetry-operator/blob/b5bb0ae34720d4be2d229dafecb87b61b37699b0/autoinstrumentation/python/requirements.txt#L2
1816
# * https://github.com/MicrosoftDocs/azure-docs/blob/main/articles/azure-functions/recover-python-functions.md#troubleshoot-cannot-import-cygrpc
19-
ENV PYTHONPATH=/operator-build/workspace
20-
RUN pip uninstall opentelemetry-exporter-otlp-proto-grpc -y
21-
RUN pip uninstall grpcio -y
17+
RUN sed -i "/opentelemetry-exporter-otlp-proto-grpc/d" ./aws-opentelemetry-distro/pyproject.toml
18+
19+
RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro
2220

2321
FROM public.ecr.aws/amazonlinux/amazonlinux:minimal
2422

0 commit comments

Comments
 (0)