Skip to content

Commit

Permalink
Fix removing gRPC from Dockerfile (#173)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
thpierce committed Apr 22, 2024
1 parent 9d94b92 commit ac39462
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ WORKDIR /operator-build

ADD aws-opentelemetry-distro/ ./aws-opentelemetry-distro/

RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro

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

RUN mkdir workspace && pip install --target workspace ./aws-opentelemetry-distro

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

Expand Down

0 comments on commit ac39462

Please sign in to comment.