From 87f76742487870a3a79e0686a0970ae9fd6fb408 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 28 Jan 2020 11:36:29 -0500 Subject: [PATCH] cleanup C++ distribtests --- test/distrib/cpp/run_distrib_test_cmake.sh | 7 ++--- ...n_distrib_test_cmake_as_externalproject.sh | 7 ++--- .../run_distrib_test_cmake_fetchcontent.sh | 8 +++--- .../run_distrib_test_cmake_module_install.sh | 8 +++--- ...rib_test_cmake_module_install_pkgconfig.sh | 8 +++--- .../cpp/run_distrib_test_cmake_pkgconfig.sh | 7 ++--- .../cpp/run_distrib_test_raspberry_pi.sh | 8 +++--- .../distribtest/cpp_stretch_x64/Dockerfile | 26 +++++++++++++++++++ .../artifacts/distribtest_targets.py | 14 +++++----- 9 files changed, 51 insertions(+), 42 deletions(-) create mode 100644 tools/dockerfile/distribtest/cpp_stretch_x64/Dockerfile diff --git a/test/distrib/cpp/run_distrib_test_cmake.sh b/test/distrib/cpp/run_distrib_test_cmake.sh index 6e2fb790f19..dd3d7fc7a52 100755 --- a/test/distrib/cpp/run_distrib_test_cmake.sh +++ b/test/distrib/cpp/run_distrib_test_cmake.sh @@ -17,11 +17,8 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install absl mkdir -p "third_party/abseil-cpp/cmake/build" diff --git a/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh b/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh index 1e7a6fa6ef9..7ef1d2ee51a 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_as_externalproject.sh @@ -17,11 +17,8 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # To increase the confidence that gRPC installation works without depending on # too many submodules unnecessarily, just wipe out contents of most submodules diff --git a/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh b/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh index ebf790bcb79..c81cb07c826 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_fetchcontent.sh @@ -18,13 +18,11 @@ set -ex cd "$(dirname "$0")/../../.." grpc_dir=$(pwd) -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev wget +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install CMake 3.16 +apt-get update && apt-get install -y wget wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh sh cmake-linux.sh -- --skip-license --prefix=/usr rm cmake-linux.sh diff --git a/test/distrib/cpp/run_distrib_test_cmake_module_install.sh b/test/distrib/cpp/run_distrib_test_cmake_module_install.sh index 184c135c79e..96e63b187a6 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_module_install.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_module_install.sh @@ -17,13 +17,11 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev wget +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install CMake 3.16 +apt-get update && apt-get install -y wget wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh sh cmake-linux.sh -- --skip-license --prefix=/usr rm cmake-linux.sh diff --git a/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh b/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh index 845e390d34d..ab61f169621 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_module_install_pkgconfig.sh @@ -17,13 +17,11 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev pkg-config wget +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install CMake 3.16 +apt-get update && apt-get install -y wget wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh sh cmake-linux.sh -- --skip-license --prefix=/usr rm cmake-linux.sh diff --git a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh index 68e5391f8e5..2eef3181b4e 100755 --- a/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh +++ b/test/distrib/cpp/run_distrib_test_cmake_pkgconfig.sh @@ -17,11 +17,8 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y libssl-dev pkg-config +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install absl mkdir -p "third_party/abseil-cpp/cmake/build" diff --git a/test/distrib/cpp/run_distrib_test_raspberry_pi.sh b/test/distrib/cpp/run_distrib_test_raspberry_pi.sh index dbc7774aac6..b1a0ba5ea32 100755 --- a/test/distrib/cpp/run_distrib_test_raspberry_pi.sh +++ b/test/distrib/cpp/run_distrib_test_raspberry_pi.sh @@ -17,13 +17,11 @@ set -ex cd "$(dirname "$0")/../../.." -echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list -echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf -sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list -apt-get update -apt-get install -t jessie-backports -y git libssl-dev wget +# Install openssl (to use instead of boringssl) +apt-get update && apt-get install -y libssl-dev # Install CMake 3.16 +apt-get update && apt-get install -y wget wget -q -O cmake-linux.sh https://github.com/Kitware/CMake/releases/download/v3.16.1/cmake-3.16.1-Linux-x86_64.sh sh cmake-linux.sh -- --skip-license --prefix=/usr rm cmake-linux.sh diff --git a/tools/dockerfile/distribtest/cpp_stretch_x64/Dockerfile b/tools/dockerfile/distribtest/cpp_stretch_x64/Dockerfile new file mode 100644 index 00000000000..c26cc9f5e16 --- /dev/null +++ b/tools/dockerfile/distribtest/cpp_stretch_x64/Dockerfile @@ -0,0 +1,26 @@ +# Copyright 2020 The gRPC Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM debian:stretch + +# gRPC C++ dependencies based on https://github.com/grpc/grpc/blob/master/BUILDING.md +RUN apt-get update && apt-get install -y build-essential autoconf libtool pkg-config && apt-get clean + +# debian stretch has cmake 3.7: https://packages.debian.org/stretch/cmake +RUN apt-get update && apt-get install -y cmake && apt-get clean + +# C++ distribtests are setup in a way that requires git +RUN apt-get update && apt-get install -y git && apt-get clean + +CMD ["bash"] diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 37a7de4b60a..63c84481f7c 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -297,15 +297,15 @@ def targets(): """Gets list of supported targets""" return [ CppDistribTest('linux', 'x64', 'jessie', 'routeguide'), - CppDistribTest('linux', 'x64', 'jessie', 'cmake'), - CppDistribTest('linux', 'x64', 'jessie', 'cmake_as_externalproject'), CppDistribTest('linux', 'x64', 'jessie', 'cmake_as_submodule'), - CppDistribTest('linux', 'x64', 'jessie', 'cmake_fetchcontent'), - CppDistribTest('linux', 'x64', 'jessie', 'cmake_module_install'), - CppDistribTest('linux', 'x64', 'jessie', + CppDistribTest('linux', 'x64', 'stretch', 'cmake'), + CppDistribTest('linux', 'x64', 'stretch', 'cmake_as_externalproject'), + CppDistribTest('linux', 'x64', 'stretch', 'cmake_fetchcontent'), + CppDistribTest('linux', 'x64', 'stretch', 'cmake_module_install'), + CppDistribTest('linux', 'x64', 'stretch', 'cmake_module_install_pkgconfig'), - CppDistribTest('linux', 'x64', 'jessie', 'cmake_pkgconfig'), - CppDistribTest('linux', 'x64', 'jessie', 'raspberry_pi'), + CppDistribTest('linux', 'x64', 'stretch', 'cmake_pkgconfig'), + CppDistribTest('linux', 'x64', 'stretch', 'raspberry_pi'), CppDistribTest('windows', 'x86', testcase='cmake'), CppDistribTest('windows', 'x86', testcase='cmake_as_externalproject'), CSharpDistribTest('linux', 'x64', 'jessie'),