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

OpenTelemetry static linking #9286

Merged
merged 4 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/opentelemetry/rootfs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ ExternalProject_Add(
-DgRPC_SSL_PROVIDER=package
-DOPENSSL_ROOT_DIR=OpenSSL
-DgRPC_BUILD_TESTS=OFF
-DBUILD_SHARED_LIBS=ON
-DBUILD_SHARED_LIBS=OFF
-DgRPC_INSTALL=ON
CMAKE_CACHE_ARGS -DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
TEST_AFTER_INSTALL 0
Expand Down
2 changes: 1 addition & 1 deletion images/opentelemetry/rootfs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ COPY --from=grpc /opt/third_party/install/ /usr
COPY --from=otel-cpp /opt/third_party/install/ /usr
RUN bash /opt/third_party/build.sh -n

FROM alpine:3.16.2
FROM alpine:3.16.2 as final
COPY --from=base /opt/third_party/init_module.sh /usr/local/bin/init_module.sh
COPY --from=nginx /etc/nginx/modules /etc/nginx/modules
COPY --from=nginx /opt/third_party/install/lib /etc/nginx/modules
48 changes: 2 additions & 46 deletions images/opentelemetry/rootfs/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ install_otel()
-DWITH_JAEGER=OFF \
-DCMAKE_INSTALL_PREFIX=${INSTAL_DIR} \
-DBUILD_TESTING=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DWITH_OTLP=ON \
-DWITH_OTLP_GRPC=ON \
-DWITH_EXAMPLES=OFF \
Expand All @@ -123,7 +123,7 @@ get_src()

install_nginx()
{
export NGINX_VERSION=1.19.10
export NGINX_VERSION=1.21.6

# Check for recent changes: https://github.com/open-telemetry/opentelemetry-cpp-contrib/compare/2656a4...main
export OPENTELEMETRY_CONTRIB_COMMIT=6467ec2e4d67b08b44580b7eb7a298786f4eef91
Expand Down Expand Up @@ -153,50 +153,6 @@ install_nginx()
cp ${INSTAL_DIR}/otel_ngx_module.so /etc/nginx/modules/otel_ngx_module.so

mkdir -p ${INSTAL_DIR}/lib
cp /usr/lib/libopentelemetry_exporter_otlp_grpc.so* ${INSTAL_DIR}/lib
cp /usr/lib/libopentelemetry_otlp_recordable.so* ${INSTAL_DIR}/lib
cp /usr/lib/libprotobuf.so* ${INSTAL_DIR}/lib
cp /usr/lib/libopentelemetry_trace.so* ${INSTAL_DIR}/lib
cp /usr/lib/libopentelemetry_resources.so* ${INSTAL_DIR}/lib
cp /usr/lib/libopentelemetry_common.so* ${INSTAL_DIR}/lib
cp /usr/lib/libstdc++.so* ${INSTAL_DIR}/lib

cp /usr/lib/libgrpc.so* ${INSTAL_DIR}/lib
cp /usr/lib/libgcc_s.so* ${INSTAL_DIR}/lib
cp /usr/lib/libgrpc++.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_bad_variant_access.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_synchronization.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_raw_hash_set.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_hash.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_statusor.so* ${INSTAL_DIR}/lib
cp /usr/lib/libgpr.so* ${INSTAL_DIR}/lib
cp /usr/lib/libupb.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_status.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_time.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_strings.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_stacktrace.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_symbolize.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_malloc_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_base.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_spinlock_wait.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_raw_logging_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libre2.so* ${INSTAL_DIR}/lib
cp /usr/lib/libaddress_sorting.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_cord.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_bad_optional_access.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_str_format_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_throw_delegate.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_time_zone.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_city.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_low_level_hash.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_cordz_info.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_int128.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_strings_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_debugging_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_cord_internal.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_cordz_functions.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_cordz_handle.so* ${INSTAL_DIR}/lib
cp /usr/lib/libabsl_exponential_biased.so* ${INSTAL_DIR}/lib
}

while getopts ":hpng:o:" option; do
Expand Down