diff --git a/services/backup/docker-server/contents/build_server.sh b/services/backup/docker-server/contents/build_server.sh --- a/services/backup/docker-server/contents/build_server.sh +++ b/services/backup/docker-server/contents/build_server.sh @@ -2,7 +2,7 @@ set -e -pushd transferred/server +pushd /transferred/server rm -rf _generated mkdir _generated @@ -13,4 +13,4 @@ ./generate.sh ./build.sh -popd # transferred/server +popd # /transferred/server diff --git a/services/backup/docker-server/contents/server/CMakeLists.txt b/services/backup/docker-server/contents/server/CMakeLists.txt --- a/services/backup/docker-server/contents/server/CMakeLists.txt +++ b/services/backup/docker-server/contents/server/CMakeLists.txt @@ -18,15 +18,6 @@ set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) set(_PROTOBUF_PROTOC $) -# gRPC building parameters -set(gRPC_BUILD_CSHARP_EXT OFF) -set(gRPC_SSL_PROVIDER "package" CACHE STRING "SSL library provider") -# Disable unused plugins -set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF) -set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF) -set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF) -set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF) - if ($ENV{COMM_TEST_SERVICES} MATCHES 1) add_compile_definitions(COMM_TEST_SERVICES) endif() diff --git a/services/base-image/Dockerfile b/services/base-image/Dockerfile --- a/services/base-image/Dockerfile +++ b/services/base-image/Dockerfile @@ -2,10 +2,6 @@ ENV SHELL=/bin/bash -WORKDIR / - -COPY contents /transferred - RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ cmake \ git \ @@ -14,10 +10,14 @@ libtool \ pkg-config \ libboost-all-dev \ - libfmt-dev \ + libfmt-dev \ libgtest-dev \ && rm -rf /var/lib/apt/lists/* -RUN /transferred/install_grpc.sh +RUN mkdir -p /transferred/scripts +WORKDIR /transferred/scripts + +COPY contents/install_grpc.sh . +RUN ./install_grpc.sh CMD /bin/bash diff --git a/services/base-image/contents/install_grpc.sh b/services/base-image/contents/install_grpc.sh --- a/services/base-image/contents/install_grpc.sh +++ b/services/base-image/contents/install_grpc.sh @@ -4,32 +4,42 @@ echo "installing grpc..." -if [[ -d /usr/lib/grpc ]] -then - echo "grpc already exists, skipping installation(if the installation seems to be broken, remove this container/image and recreate it)..." - exit 0; -fi +cd /tmp -pushd /usr/lib git clone --recurse-submodules -b v1.39.1 https://github.com/grpc/grpc + pushd grpc mkdir -p cmake/build pushd cmake/build -cmake -DgRPC_INSTALL=ON \ - -DgRPC_BUILD_TESTS=OFF \ - ../.. +cmake \ + -DgRPC_INSTALL=ON \ + -DgRPC_BUILD_TESTS=OFF \ + -DgRPC_BUILD_CSHARP_EXT=OFF \ + -DgRPC_BUILD_GRPC_CPP_PLUGIN=ON \ + -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \ + -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \ + ../.. make make install popd # cmake/build +# Explicitly install abseil-cpp because of https://github.com/grpc/grpc/issues/25949 +# This should be removed after upgrading to v1.41 pushd third_party/abseil-cpp/ mkdir -p cmake/build pushd cmake/build -cmake ../.. +cmake \ + -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ + ../.. make make install popd # cmake/build popd # third_party/abseil-cpp/ popd # grpc -popd # /usr/lib + +rm -rf grpc diff --git a/services/blob/docker-server/contents/build_server.sh b/services/blob/docker-server/contents/build_server.sh --- a/services/blob/docker-server/contents/build_server.sh +++ b/services/blob/docker-server/contents/build_server.sh @@ -5,7 +5,7 @@ # folly hack - https://github.com/facebook/folly/pull/1231 sed -i 's/#if __has_include()/#if __has_include()/g' /usr/lib/folly/folly/detail/Demangle.h -pushd transferred/server +pushd /transferred/server rm -rf lib mkdir lib @@ -24,4 +24,4 @@ ./generate.sh ./build.sh -popd # transferred/server +popd # /transferred/server diff --git a/services/blob/docker-server/contents/server/cmake-components/grpc.cmake b/services/blob/docker-server/contents/server/cmake-components/grpc.cmake --- a/services/blob/docker-server/contents/server/cmake-components/grpc.cmake +++ b/services/blob/docker-server/contents/server/cmake-components/grpc.cmake @@ -6,15 +6,6 @@ set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) set(_PROTOBUF_PROTOC $) -# gRPC -set(gRPC_BUILD_CSHARP_EXT OFF) -set(gRPC_SSL_PROVIDER "package" CACHE STRING "SSL library provider") -# Disable unused plugins -set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF) -set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF) -set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF) -set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF) - # Find gRPC installation find_package(gRPC CONFIG REQUIRED) message(STATUS "Using gRPC ${gRPC_VERSION}") diff --git a/services/tunnelbroker/CMakeLists.txt b/services/tunnelbroker/CMakeLists.txt --- a/services/tunnelbroker/CMakeLists.txt +++ b/services/tunnelbroker/CMakeLists.txt @@ -18,15 +18,6 @@ set(_PROTOBUF_LIBPROTOBUF protobuf::libprotobuf) set(_PROTOBUF_PROTOC $) -# gRPC building parameters -set(gRPC_BUILD_CSHARP_EXT OFF) -set(gRPC_SSL_PROVIDER "package" CACHE STRING "SSL library provider") -# Disable unused plugins -set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF) -set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF) -set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF) -set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF) - # Find gRPC installation # Looks for gRPCConfig.cmake file installed by gRPC's cmake installation. find_package(gRPC CONFIG REQUIRED) diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile --- a/services/tunnelbroker/Dockerfile +++ b/services/tunnelbroker/Dockerfile @@ -8,7 +8,6 @@ zlib1g-dev \ && rm -rf /var/lib/apt/lists/* -RUN mkdir /transferred/scripts WORKDIR /transferred/scripts # Install SDKs