diff --git a/templates/tools/dockerfile/apt_get_basic.include b/templates/tools/dockerfile/apt_get_basic.include index 6e19e65157a..f466d4800ed 100644 --- a/templates/tools/dockerfile/apt_get_basic.include +++ b/templates/tools/dockerfile/apt_get_basic.include @@ -1,34 +1,40 @@ -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y ${'\\'} - autoconf ${'\\'} - autotools-dev ${'\\'} build-essential ${'\\'} - bzip2 ${'\\'} - ccache ${'\\'} - curl ${'\\'} - dnsutils ${'\\'} + autoconf ${'\\'} + libtool ${'\\'} + pkg-config ${'\\'} + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y ${'\\'} gcc ${'\\'} gcc-multilib ${'\\'} - git ${'\\'} - golang ${'\\'} - gyp ${'\\'} - lcov ${'\\'} + g++ ${'\\'} + g++-multilib ${'\\'} + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y ${'\\'} libc6 ${'\\'} libc6-dbg ${'\\'} libc6-dev ${'\\'} - libgtest-dev ${'\\'} - libtool ${'\\'} + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y ${'\\'} + bzip2 ${'\\'} + curl ${'\\'} + dnsutils ${'\\'} + git ${'\\'} + lcov ${'\\'} make ${'\\'} - perl ${'\\'} strace ${'\\'} - python-dev ${'\\'} - python-setuptools ${'\\'} - python-yaml ${'\\'} - telnet ${'\\'} + time ${'\\'} unzip ${'\\'} wget ${'\\'} - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip ${'\\'} + && apt-get clean diff --git a/templates/tools/dockerfile/apt_get_basic_bullseye.include b/templates/tools/dockerfile/apt_get_basic_bullseye.include deleted file mode 100644 index 8e2a5509247..00000000000 --- a/templates/tools/dockerfile/apt_get_basic_bullseye.include +++ /dev/null @@ -1,35 +0,0 @@ -# Install Git and basic packages. -RUN apt-get update && apt-get install -y ${'\\'} - autoconf ${'\\'} - autotools-dev ${'\\'} - build-essential ${'\\'} - bzip2 ${'\\'} - ccache ${'\\'} - curl ${'\\'} - dnsutils ${'\\'} - gcc ${'\\'} - gcc-multilib ${'\\'} - git ${'\\'} - golang ${'\\'} - gyp ${'\\'} - lcov ${'\\'} - libc6 ${'\\'} - libc6-dbg ${'\\'} - libc6-dev ${'\\'} - libgtest-dev ${'\\'} - libtool ${'\\'} - make ${'\\'} - perl ${'\\'} - strace ${'\\'} - python3-dev ${'\\'} - python3-setuptools ${'\\'} - python3-yaml ${'\\'} - telnet ${'\\'} - unzip ${'\\'} - wget ${'\\'} - zip && ${'\\'} - apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean diff --git a/templates/tools/dockerfile/apt_get_pyenv.include b/templates/tools/dockerfile/apt_get_pyenv.include deleted file mode 100644 index e12b3e2c7fc..00000000000 --- a/templates/tools/dockerfile/apt_get_pyenv.include +++ /dev/null @@ -1,23 +0,0 @@ -# Install dependencies for pyenv -RUN apt-get update && apt-get install -y ${'\\'} - libbz2-dev ${'\\'} - libncurses5-dev ${'\\'} - libncursesw5-dev ${'\\'} - libreadline-dev ${'\\'} - libsqlite3-dev ${'\\'} - libssl-dev ${'\\'} - llvm ${'\\'} - mercurial ${'\\'} - zlib1g-dev && apt-get clean - -# Install Pyenv and dev Python versions 3.{5,6,7} -RUN curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash -ENV PATH /root/.pyenv/bin:$PATH -RUN eval "$(pyenv init -)" -RUN eval "$(pyenv virtualenv-init -)" -RUN pyenv update -RUN pyenv install 3.5-dev -RUN pyenv install 3.6-dev -RUN pyenv install 3.7-dev -RUN pyenv install pypy-5.3.1 -RUN pyenv local 3.5-dev 3.6-dev 3.7-dev pypy-5.3.1 diff --git a/templates/tools/dockerfile/apt_get_python_27.include b/templates/tools/dockerfile/apt_get_python_27.include deleted file mode 100644 index 363bc5067dd..00000000000 --- a/templates/tools/dockerfile/apt_get_python_27.include +++ /dev/null @@ -1,3 +0,0 @@ -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 diff --git a/templates/tools/dockerfile/compile_python_36.include b/templates/tools/dockerfile/compile_python_36.include index af4d73e9f6b..b46c44beb37 100644 --- a/templates/tools/dockerfile/compile_python_36.include +++ b/templates/tools/dockerfile/compile_python_36.include @@ -1,8 +1,8 @@ #================= # Compile CPython 3.6.9 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && ${'\\'} diff --git a/templates/tools/dockerfile/compile_python_38.include b/templates/tools/dockerfile/compile_python_38.include index 30337e0ecb7..1d4f43113bf 100644 --- a/templates/tools/dockerfile/compile_python_38.include +++ b/templates/tools/dockerfile/compile_python_38.include @@ -1,8 +1,8 @@ #================= # Compile CPython 3.8.0b4 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && ${'\\'} wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && ${'\\'} diff --git a/templates/tools/dockerfile/cxx_deps.include b/templates/tools/dockerfile/cxx_deps.include index 14831c19e8a..2c581e3600d 100644 --- a/templates/tools/dockerfile/cxx_deps.include +++ b/templates/tools/dockerfile/cxx_deps.include @@ -1,3 +1,3 @@ #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean diff --git a/templates/tools/dockerfile/debian_8_header.include b/templates/tools/dockerfile/debian_8_header.include deleted file mode 100644 index e6d0933fd87..00000000000 --- a/templates/tools/dockerfile/debian_8_header.include +++ /dev/null @@ -1 +0,0 @@ -FROM debian:8 diff --git a/templates/tools/dockerfile/debian_9_header.include b/templates/tools/dockerfile/debian_9_header.include deleted file mode 100644 index 24797313a0b..00000000000 --- a/templates/tools/dockerfile/debian_9_header.include +++ /dev/null @@ -1 +0,0 @@ -FROM debian:9 diff --git a/templates/tools/dockerfile/gcp_api_libraries.include b/templates/tools/dockerfile/gcp_api_libraries.include index dadb3d8d943..ea06deba017 100644 --- a/templates/tools/dockerfile/gcp_api_libraries.include +++ b/templates/tools/dockerfile/gcp_api_libraries.include @@ -1,2 +1,3 @@ -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 diff --git a/templates/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile.template b/templates/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile.template new file mode 100644 index 00000000000..1eff596ea6a --- /dev/null +++ b/templates/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile.template @@ -0,0 +1,44 @@ +%YAML 1.2 +--- | + # Copyright 2021 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 + + <%include file="../apt_get_basic.include"/> + <%include file="../run_tests_python_deps.include"/> + <%include file="../cmake.include"/> + <%include file="../run_tests_addons.include"/> + + # Java required by Android SDK + RUN apt-get update && apt-get -y install openjdk-8-jdk && apt-get clean + + # Install Android SDK + ENV ANDROID_SDK_VERSION 4333796 + RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \ + wget -q https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \ + unzip -q sdk-tools-linux-$ANDROID_SDK_VERSION.zip && \ + rm sdk-tools-linux-$ANDROID_SDK_VERSION.zip + ENV ANDROID_SDK_PATH /opt/android-sdk + + # Install Android NDK and cmake using sdkmanager + RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg + RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses + RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459' + ENV ANDROID_NDK_PATH $ANDROID_SDK_PATH/ndk-bundle + ENV ANDROID_SDK_CMAKE $ANDROID_SDK_PATH/cmake/3.6.4111459/bin/cmake + + # Define the default command. + CMD ["bash"] + diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile.template index 640c7d6dcc6..8ae3691e959 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile.template @@ -17,7 +17,7 @@ FROM debian:buster <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../csharp_deps.include"/> <%include file="../../csharp_dotnetcli_deps.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template index 640c7d6dcc6..8ae3691e959 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile.template @@ -17,7 +17,7 @@ FROM debian:buster <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../csharp_deps.include"/> <%include file="../../csharp_dotnetcli_deps.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile.template index e234aa5aa64..82dc1d16243 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile.template @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../debian_8_header.include"/> + FROM debian:jessie <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake_jessie_backports.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile.template index 292eaa828dd..11ba1c89ac7 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile.template @@ -17,7 +17,7 @@ FROM golang:1.16 <%include file="../../go_path.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template index 4921d93f499..280e722269e 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile.template @@ -17,7 +17,7 @@ FROM golang:1.11 <%include file="../../go_path.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile.template index 292eaa828dd..11ba1c89ac7 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile.template @@ -17,7 +17,7 @@ FROM golang:1.16 <%include file="../../go_path.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile.template index 860d4ffa41f..494d0815087 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile.template @@ -17,7 +17,7 @@ FROM golang:1.8 <%include file="../../go_path.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile.template index 20b4105fdc1..1a92d54e583 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile.template @@ -18,7 +18,7 @@ <%include file="../../go_path.include"/> <%include file="../../python_deps.include"/> - RUN pip install twisted h2==2.6.1 hyper + RUN python3 -m pip install twisted h2==2.6.1 hyper # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile.include b/templates/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile.include index dc0ffdab834..8229d28ac57 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile.include +++ b/templates/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile.include @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -<%include file="../../debian_8_header.include"/> +FROM debian:jessie RUN echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" > /etc/apt/sources.list.d/jessie-backports.list && ${'\\'} echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until && ${'\\'} diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile.template index d19ae523d93..aa48290b134 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile.template @@ -14,10 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../debian_8_header.include"/> + FROM debian:jessie <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../node_deps.include"/> <%include file="../../run_tests_addons.include"/> # Define the default command. diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile.template index 9bcc1b6932b..e53d863c92d 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile.template @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../debian_8_header.include"/> + FROM debian:jessie <%include file="../../apt_get_basic.include"/> <%include file="../../node_deps.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile.template index 999eedf063e..8e8dbdc25fc 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile.template @@ -14,8 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../debian_9_header.include"/> + FROM debian:stretch + <%include file="../../apt_get_basic.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../php7_deps.include"/> <%include file="../../run_tests_addons.include"/> <%include file="../../php_common_deps.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile.template index 25c5c524336..fcbe14fc81a 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile.template @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_bullseye.include"/> + <%include file="../../python_bullseye_base.include"/> RUN apt-get update && apt-get install -y python3 python3-all-dev python3-pip - RUN ln -s $(which python2) /usr/bin/python + RUN ln -s $(which python3) /usr/bin/python + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile.template index c7c2bcb481f..19bd9843b36 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile.template @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_bullseye.include"/> + <%include file="../../python_bullseye_base.include"/> RUN apt-get update && apt-get install -y python3 python3-pip python3-all-dev - RUN ln -s $(which python2) /usr/bin/python + RUN ln -s $(which python3) /usr/bin/python + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile.template index 329be369876..67f8cd3b19f 100644 --- a/templates/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile.template +++ b/templates/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile.template @@ -17,7 +17,7 @@ FROM debian:buster <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../ruby_deps.include"/> <%include file="../../run_tests_addons.include"/> # Define the default command. diff --git a/templates/tools/dockerfile/oss_fuzz_base.include b/templates/tools/dockerfile/oss_fuzz_base.include new file mode 100644 index 00000000000..92511a9efa8 --- /dev/null +++ b/templates/tools/dockerfile/oss_fuzz_base.include @@ -0,0 +1,41 @@ +# Pinned version of the base image is used to avoid regressions caused +# by rebuilding of this docker image. To see available versions, you can run +# "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder" +# Image(c7f1523ebd92) is built on Jul 29, 2021 +FROM gcr.io/oss-fuzz-base/base-builder@sha256:c7f1523ebd9234b9ff57e5240f8c06569143373be019c92f1e6df18a1e048f37 + +# -------------------------- WARNING -------------------------------------- +# If you are making changes to this file, consider changing +# https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile +# accordingly. +# ------------------------------------------------------------------------- + +# Install basic packages and Bazel dependencies. +RUN apt-get update && apt-get install -y software-properties-common python-software-properties +RUN add-apt-repository ppa:webupd8team/java +RUN apt-get update && apt-get -y install ${'\\'} + autoconf ${'\\'} + build-essential ${'\\'} + curl ${'\\'} + wget ${'\\'} + libtool ${'\\'} + make ${'\\'} + openjdk-8-jdk ${'\\'} + vim + +#==================== +# Python dependencies + +# Install dependencies +# TODO(jtattermusch): This installs python3.5. Is it even needed +# when we install python3.6 in the next step? +RUN apt-get update && apt-get install -y ${'\\'} + python3-all-dev + +<%include file="./compile_python_36.include"/> + +# Python2's python.h still needs to be present in order for the bazel build +# to work. +# TODO(jtattermusch): remove once https://github.com/grpc/grpc/issues/28026 +# is fixed. +RUN apt-get update && apt-get install -y python-all-dev python-setuptools diff --git a/templates/tools/dockerfile/php7_deps.include b/templates/tools/dockerfile/php7_deps.include index 7a70623bac3..f75172c9c5d 100644 --- a/templates/tools/dockerfile/php7_deps.include +++ b/templates/tools/dockerfile/php7_deps.include @@ -1,28 +1,17 @@ #================= # PHP7 dependencies -# Install Git and basic packages. +# PHP specific dependencies RUN apt-get update && apt-get install -y ${'\\'} - autoconf ${'\\'} - automake ${'\\'} - build-essential ${'\\'} - ccache ${'\\'} - curl ${'\\'} - git ${'\\'} libbison-dev ${'\\'} libcurl4-openssl-dev ${'\\'} libgmp-dev ${'\\'} libgmp3-dev ${'\\'} libssl-dev ${'\\'} - libtool ${'\\'} libxml2-dev ${'\\'} - pkg-config ${'\\'} re2c ${'\\'} - time ${'\\'} - unzip ${'\\'} - wget ${'\\'} - zip ${'\\'} - zlib1g-dev && apt-get clean + zlib1g-dev ${'\\'} + && apt-get clean # Compile PHP7 from source RUN git clone https://github.com/php/php-src /var/local/git/php-src diff --git a/templates/tools/dockerfile/php_common_deps.include b/templates/tools/dockerfile/php_common_deps.include index 88a90f8adcb..86906c33771 100644 --- a/templates/tools/dockerfile/php_common_deps.include +++ b/templates/tools/dockerfile/php_common_deps.include @@ -1,6 +1,3 @@ # Install composer RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer - -# Define the default command. -CMD ["bash"] diff --git a/templates/tools/dockerfile/php_valgrind.include b/templates/tools/dockerfile/php_valgrind.include index b5e6b534168..7f2f520e37b 100644 --- a/templates/tools/dockerfile/php_valgrind.include +++ b/templates/tools/dockerfile/php_valgrind.include @@ -1,5 +1,5 @@ -#================= -# PHP Test dependencies +#================= +# PHP Test dependencies - RUN apt-get update && apt-get install -y ${'\\'} - valgrind + RUN apt-get update && apt-get install -y ${'\\'} + valgrind \ No newline at end of file diff --git a/templates/tools/dockerfile/python_bullseye.include b/templates/tools/dockerfile/python_bullseye.include deleted file mode 100644 index 88455a0261d..00000000000 --- a/templates/tools/dockerfile/python_bullseye.include +++ /dev/null @@ -1,6 +0,0 @@ -FROM debian:bullseye - -<%include file="./apt_get_basic_bullseye.include"/> -<%include file="./apt_get_python_27.include"/> -<%include file="./gcp_api_libraries.include"/> -<%include file="./run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/python_bullseye_base.include b/templates/tools/dockerfile/python_bullseye_base.include new file mode 100644 index 00000000000..4f79aeca94b --- /dev/null +++ b/templates/tools/dockerfile/python_bullseye_base.include @@ -0,0 +1,4 @@ +FROM debian:bullseye + +<%include file="./apt_get_basic.include"/> +<%include file="./run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/python_debian11.include b/templates/tools/dockerfile/python_debian11.include deleted file mode 100644 index 78e7dd62239..00000000000 --- a/templates/tools/dockerfile/python_debian11.include +++ /dev/null @@ -1,53 +0,0 @@ -FROM debian:bullseye - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y ${'\\'} - autoconf ${'\\'} - autotools-dev ${'\\'} - build-essential ${'\\'} - bzip2 ${'\\'} - ccache ${'\\'} - curl ${'\\'} - dnsutils ${'\\'} - gcc ${'\\'} - gcc-multilib ${'\\'} - git ${'\\'} - golang ${'\\'} - gyp ${'\\'} - lcov ${'\\'} - libc6 ${'\\'} - libc6-dbg ${'\\'} - libc6-dev ${'\\'} - libgtest-dev ${'\\'} - libtool ${'\\'} - make ${'\\'} - perl ${'\\'} - strace ${'\\'} - telnet ${'\\'} - unzip ${'\\'} - wget ${'\\'} - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 3.7 from source (and installed as a default python3) -# (Bullseye comes with Python 3.9 which isn't supported by pytype yet) -RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev ${'\\'} - libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev -RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && ${'\\'} - tar -xf Python-3.7.9.tar.xz && ${'\\'} - cd Python-3.7.9 && ${'\\'} - ./configure && ${'\\'} - make -j 4 && ${'\\'} - make install -RUN curl https://bootstrap.pypa.io/get-pip.py | python3 - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2 python2-dev -RUN ln -s /usr/bin/python2 /usr/bin/python -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 - -<%include file="./gcp_api_libraries.include"/> -<%include file="./run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/python_deps.include b/templates/tools/dockerfile/python_deps.include index 76c2cc423da..f25a220acc4 100644 --- a/templates/tools/dockerfile/python_deps.include +++ b/templates/tools/dockerfile/python_deps.include @@ -1,15 +1,11 @@ #==================== -# Python dependencies +# Python dependencies to run tools/run_tests scripts # Install dependencies -RUN apt-get update && apt-get install -y ${'\\'} - python-all-dev ${'\\'} - python3-all-dev ${'\\'} - python-setuptools +RUN apt-get update && apt-get install -y python3-all-dev python3-pip # Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +RUN python3 -m pip install --upgrade pip==19.3.1 +RUN python3 -m pip install virtualenv==16.7.9 +RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 diff --git a/templates/tools/dockerfile/python_stretch.include b/templates/tools/dockerfile/python_stretch_base.include similarity index 79% rename from templates/tools/dockerfile/python_stretch.include rename to templates/tools/dockerfile/python_stretch_base.include index 63ea6ae6c65..e16db53640f 100644 --- a/templates/tools/dockerfile/python_stretch.include +++ b/templates/tools/dockerfile/python_stretch_base.include @@ -1,8 +1,6 @@ FROM debian:stretch <%include file="./apt_get_basic.include"/> -<%include file="./apt_get_python_27.include"/> -<%include file="./gcp_api_libraries.include"/> # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local diff --git a/templates/tools/dockerfile/run_tests_python_deps.include b/templates/tools/dockerfile/run_tests_python_deps.include new file mode 100644 index 00000000000..94e1eacf9be --- /dev/null +++ b/templates/tools/dockerfile/run_tests_python_deps.include @@ -0,0 +1,21 @@ +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y ${'\\'} + python3 ${'\\'} + python3-pip ${'\\'} + python3-setuptools ${'\\'} + python3-yaml ${'\\'} + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +<%include file="./gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template index 4ff8e65b4a5..5689d9dfec9 100644 --- a/templates/tools/dockerfile/test/bazel/Dockerfile.template +++ b/templates/tools/dockerfile/test/bazel/Dockerfile.template @@ -14,42 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - # Pinned version of the base image is used to avoid regressions caused - # by rebuilding of this docker image. To see available versions, you can run - # "gcloud container images list-tags gcr.io/oss-fuzz-base/base-builder" - # Image(c7f1523ebd92) is built on Jul 29, 2021 - FROM gcr.io/oss-fuzz-base/base-builder@sha256:c7f1523ebd9234b9ff57e5240f8c06569143373be019c92f1e6df18a1e048f37 - - # -------------------------- WARNING -------------------------------------- - # If you are making changes to this file, consider changing - # https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile - # accordingly. - # ------------------------------------------------------------------------- - - # Install basic packages and Bazel dependencies. - RUN apt-get update && apt-get install -y software-properties-common python-software-properties - RUN add-apt-repository ppa:webupd8team/java - RUN apt-get update && apt-get -y install ${'\\'} - autoconf ${'\\'} - build-essential ${'\\'} - curl ${'\\'} - wget ${'\\'} - libtool ${'\\'} - make ${'\\'} - openjdk-8-jdk ${'\\'} - vim - - #==================== - # Python dependencies - - # Install dependencies - RUN apt-get update && apt-get install -y ${'\\'} - python-all-dev ${'\\'} - python3-all-dev ${'\\'} - python-setuptools - - <%include file="../../compile_python_36.include"/> - + <%include file="../../oss_fuzz_base.include"/> <%include file="../../bazel.include"/> RUN mkdir -p /var/local/jenkins diff --git a/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template b/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template new file mode 100644 index 00000000000..8f8a5312a38 --- /dev/null +++ b/templates/tools/dockerfile/test/binder_transport_apk/Dockerfile.template @@ -0,0 +1,40 @@ +%YAML 1.2 +--- | + # Copyright 2021 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. + + <%include file="../../oss_fuzz_base.include"/> + <%include file="../../bazel.include"/> + + #======================== + # Android SDK/NDK installation + ENV SDK_ROOT=/opt/android-sdk + RUN mkdir -p $SDK_ROOT + RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && \ + unzip cmd.zip && rm cmd.zip && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && \ + yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529' + + # Set environment variables for Bazel rules + ENV ANDROID_HOME=/opt/android-sdk + ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529 + + RUN mkdir -p /var/local/jenkins + + # Define the default command. + CMD ["bash"] diff --git a/templates/tools/dockerfile/test/csharp_buster_x64/Dockerfile.template b/templates/tools/dockerfile/test/csharp_buster_x64/Dockerfile.template index 8d6c11932b5..0b647f4590e 100644 --- a/templates/tools/dockerfile/test/csharp_buster_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/csharp_buster_x64/Dockerfile.template @@ -17,8 +17,7 @@ FROM debian:buster <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../csharp_deps.include"/> <%include file="../../csharp_dotnetcli_deps.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template index 2f2e3d7af13..f6f40d70a3c 100644 --- a/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_alpine_x64/Dockerfile.template @@ -32,22 +32,26 @@ make ${'\\'} perl ${'\\'} strace ${'\\'} - python2-dev ${'\\'} - py2-pip ${'\\'} + python3 ${'\\'} + py3-pip ${'\\'} unzip ${'\\'} wget ${'\\'} zip - # Install Python packages from PyPI - RUN pip install --upgrade pip==19.3.1 - RUN pip install virtualenv - RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 - RUN pip install --upgrade --ignore-installed PyYAML==5.4.1 --user + # use pinned version of pip to avoid sudden breakages + RUN python3 -m pip install --upgrade pip==19.3.1 - # Google Cloud platform API libraries - RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + # TODO(jtattermusch): currently six is needed for tools/run_tests scripts + # but since our python2 usage is deprecated, we should get rid of it. + RUN python3 -m pip install six==1.16.0 + + # Google Cloud Platform API libraries + # These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) + RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user <%include file="../../run_tests_addons.include"/> - + # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile.template index 6da7861b986..6d96854bec0 100644 --- a/templates/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile.template @@ -16,11 +16,8 @@ FROM silkeh/clang:12 - RUN apt-get update && apt-get install -y build-essential curl git golang time wget zip - <%include file="../../python_deps.include"/> - RUN pip install PyYAML==5.4.1 - RUN apt-get install python-is-python2 - <%include file="../../gcp_api_libraries.include"/> + RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile.template index 2f1ae7b4df5..3a2b75bee47 100644 --- a/templates/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile.template @@ -16,11 +16,8 @@ FROM silkeh/clang:4 - RUN apt-get update && apt-get install -y build-essential curl git golang time wget zip - <%include file="../../python_deps.include"/> - RUN pip install PyYAML==5.4.1 - RUN apt-get install python-is-python2 - <%include file="../../gcp_api_libraries.include"/> + RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile.template index dda88633188..5a06d1e05bb 100644 --- a/templates/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile.template @@ -18,8 +18,7 @@ RUN apt-get --allow-releaseinfo-change update <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_debian10_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian10_x64/Dockerfile.template index 30b8ca0110a..a0e65114e82 100644 --- a/templates/tools/dockerfile/test/cxx_debian10_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian10_x64/Dockerfile.template @@ -17,12 +17,12 @@ FROM debian:10 RUN apt-get --allow-releaseinfo-change update + <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> - + # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_debian9_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian9_x64/Dockerfile.template index b45295a21af..4df30cbe931 100644 --- a/templates/tools/dockerfile/test/cxx_debian9_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian9_x64/Dockerfile.template @@ -17,8 +17,7 @@ FROM debian:9 <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_debian9_x86/Dockerfile.template b/templates/tools/dockerfile/test/cxx_debian9_x86/Dockerfile.template index 9df35535344..dc32f3615b6 100644 --- a/templates/tools/dockerfile/test/cxx_debian9_x86/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_debian9_x86/Dockerfile.template @@ -17,8 +17,7 @@ FROM i386/debian:9 <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile.template index b81bdc685af..e1a00cf5a32 100644 --- a/templates/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile.template @@ -16,12 +16,8 @@ FROM gcc:11 - RUN apt-get update && apt-get install -y curl git golang time wget zip - <%include file="../../python_deps.include"/> - RUN pip install PyYAML==5.4.1 - RUN apt-get install python-is-python2 - <%include file="../../gcp_api_libraries.include"/> - <%include file="../../cxx_deps.include"/> + RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile.template index be2883031d8..ced2ef47c51 100644 --- a/templates/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile.template @@ -16,11 +16,10 @@ FROM gcc:4.9 - <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cmake_jessie_backports.include"/> <%include file="../../run_tests_addons.include"/> - + # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template b/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template index de25278e203..bcb3023661f 100644 --- a/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile.template @@ -17,8 +17,7 @@ FROM ubuntu:16.04 <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../cxx_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template b/templates/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile.template similarity index 55% rename from templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template rename to templates/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile.template index 1777263e52e..bff0b675fcf 100644 --- a/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile.template @@ -1,6 +1,6 @@ %YAML 1.2 --- | - # Copyright 2015 gRPC authors. + # Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,27 +13,27 @@ # 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. - - <%include file="../../debian_8_header.include"/> - - <%include file="../../apt_get_basic.include"/> - - # Install Electron apt dependencies + + FROM php:7.3-zts-stretch + RUN apt-get update && apt-get install -y ${'\\'} - libasound2 ${'\\'} - libgconf-2-4 ${'\\'} - libgtk2.0-0 ${'\\'} - libnss3 ${'\\'} - libxss1 ${'\\'} - libxtst6 ${'\\'} - xvfb + autoconf automake build-essential git libtool curl ${'\\'} + zlib1g-dev ${'\\'} + && apt-get clean - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> - <%include file="../../node_deps.include"/> - <%include file="../../run_tests_addons.include"/> - # Install Mako to generate files in grpc/grpc-node - RUN pip install Mako + # install php pthreads from source + # TODO(jtattermusch): is this really needed? + # See https://github.com/grpc/grpc/pull/23056 + WORKDIR /tmp + RUN git clone https://github.com/krakjoe/pthreads + RUN cd pthreads && ${'\\'} + phpize && ${'\\'} + ./configure && ${'\\'} + make && ${'\\'} + make install + <%include file="../../run_tests_python_deps.include"/> + <%include file="../../php_common_deps.include"/> + <%include file="../../run_tests_addons.include"/> # Define the default command. CMD ["bash"] diff --git a/templates/tools/dockerfile/test/php7_debian9_x64/Dockerfile.template b/templates/tools/dockerfile/test/php7_stretch_x64/Dockerfile.template similarity index 84% rename from templates/tools/dockerfile/test/php7_debian9_x64/Dockerfile.template rename to templates/tools/dockerfile/test/php7_stretch_x64/Dockerfile.template index d39daec6c84..d57db995eef 100644 --- a/templates/tools/dockerfile/test/php7_debian9_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/php7_stretch_x64/Dockerfile.template @@ -14,11 +14,11 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../debian_9_header.include"/> + FROM debian:stretch + <%include file="../../apt_get_basic.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../php7_deps.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> <%include file="../../php_valgrind.include"/> <%include file="../../run_tests_addons.include"/> # Define the default command. diff --git a/templates/tools/dockerfile/test/python_alpine_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_alpine_x64/Dockerfile.template new file mode 100644 index 00000000000..673f0a30d21 --- /dev/null +++ b/templates/tools/dockerfile/test/python_alpine_x64/Dockerfile.template @@ -0,0 +1,49 @@ +%YAML 1.2 +--- | + # Copyright 2018 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 alpine:3.11 + + # Install Git and basic packages. + RUN apk update && apk add \ + autoconf \ + automake \ + bzip2 \ + build-base \ + cmake \ + ccache \ + curl \ + gcc \ + git \ + libtool \ + linux-headers \ + make \ + perl \ + strace \ + python3-dev \ + py3-pip \ + unzip \ + wget \ + zip + + RUN ln -s /usr/bin/pip3 /usr/bin/pip + RUN ln -s /usr/bin/python3 /usr/bin/python + + # Install Python packages from PyPI + RUN python3 -m pip install --upgrade pip==19.3.1 + RUN python3 -m pip install virtualenv + RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile.template deleted file mode 100644 index a1c9d9f84d5..00000000000 --- a/templates/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile.template +++ /dev/null @@ -1,17 +0,0 @@ -%YAML 1.2 ---- | - # Copyright 2018 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. - - <%include file="../../python_stretch.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile.template index 8dfb0cd1c29..b362d9de893 100644 --- a/templates/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile.template @@ -14,7 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_stretch.include"/> + <%include file="../../python_stretch_base.include"/> RUN apt-get update && apt-get install -y python3.5 python3-all-dev RUN curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5 + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile.template index c7d5fe36faa..795317f953d 100644 --- a/templates/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile.template @@ -14,5 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_stretch.include"/> + <%include file="../../python_stretch_base.include"/> <%include file="../../compile_python_36.include"/> + + RUN ln -s $(which python3.6) /usr/bin/python3 + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile.template index c4270bdfc89..64508299382 100644 --- a/templates/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile.template @@ -14,10 +14,12 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_stretch.include"/> + <%include file="../../python_stretch_base.include"/> RUN apt-get update && apt-get -t buster install -y python3.7 python3-all-dev RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7 # for Python test coverage reporting - RUN pip install coverage + RUN python3.7 -m pip install coverage + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile.template index b0098fda0cc..0aded74b32e 100644 --- a/templates/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile.template @@ -15,5 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_stretch.include"/> + <%include file="../../python_stretch_base.include"/> <%include file="../../compile_python_38.include"/> + + RUN ln -s $(which python3.8) /usr/bin/python3 + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/python_stretch_default_x64/Dockerfile.template b/templates/tools/dockerfile/test/python_stretch_default_x64/Dockerfile.template index f12c0a0c7f6..e67e82fe390 100644 --- a/templates/tools/dockerfile/test/python_stretch_default_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/python_stretch_default_x64/Dockerfile.template @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_stretch.include"/> + <%include file="../../python_stretch_base.include"/> <%include file="../../compile_python_36.include"/> <%include file="../../compile_python_38.include"/> @@ -26,3 +26,5 @@ # for Python test coverage reporting RUN python3.7 -m pip install coverage + + <%include file="../../gcp_api_libraries.include"/> diff --git a/templates/tools/dockerfile/test/ruby_buster_x64/Dockerfile.template b/templates/tools/dockerfile/test/ruby_buster_x64/Dockerfile.template index 771bee6dd04..6861c079f03 100644 --- a/templates/tools/dockerfile/test/ruby_buster_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/ruby_buster_x64/Dockerfile.template @@ -17,8 +17,7 @@ FROM debian:buster <%include file="../../apt_get_basic.include"/> - <%include file="../../python_deps.include"/> - <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_python_deps.include"/> <%include file="../../ruby_deps.include"/> <%include file="../../cmake.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/templates/tools/dockerfile/test/sanity/Dockerfile.template b/templates/tools/dockerfile/test/sanity/Dockerfile.template index 6d1c80805df..e8afb5ee6e9 100644 --- a/templates/tools/dockerfile/test/sanity/Dockerfile.template +++ b/templates/tools/dockerfile/test/sanity/Dockerfile.template @@ -14,9 +14,26 @@ # See the License for the specific language governing permissions and # limitations under the License. - <%include file="../../python_debian11.include"/> + FROM debian:bullseye + + <%include file="../../apt_get_basic.include"/> <%include file="../../cxx_deps.include"/> + # Install Python 3.7 from source (and installed as a default python3) + # (Bullseye comes with Python 3.9 which isn't supported by pytype yet) + RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev ${'\\'} + libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev + RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && ${'\\'} + tar -xf Python-3.7.9.tar.xz && ${'\\'} + cd Python-3.7.9 && ${'\\'} + ./configure && ${'\\'} + make -j 4 && ${'\\'} + make install + RUN curl https://bootstrap.pypa.io/get-pip.py | python3 + + <%include file="../../gcp_api_libraries.include"/> + <%include file="../../run_tests_addons.include"/> + #======================== # Sanity test dependencies @@ -26,11 +43,13 @@ libtool ${"\\"} curl ${"\\"} shellcheck - RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml + + # otherwise clang-tidy will report missing header + RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean + RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six # Upgrade Python's YAML library - RUN python2 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user # Install clang, clang-format, and clang-tidy @@ -38,7 +57,6 @@ ENV CLANG_FORMAT=clang-format-11 ENV CLANG_TIDY=clang-tidy-11 - <%include file="../../bazel.include"/> <%include file="../../buildifier.include"/> diff --git a/tools/distrib/check_redundant_namespace_qualifiers.py b/tools/distrib/check_redundant_namespace_qualifiers.py index a3834dfcc27..b74e570489e 100755 --- a/tools/distrib/check_redundant_namespace_qualifiers.py +++ b/tools/distrib/check_redundant_namespace_qualifiers.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2021 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile index aeedec8153f..f97ae4034b1 100644 --- a/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile +++ b/tools/dockerfile/distribtest/cpp_jessie_x64/Dockerfile @@ -28,8 +28,6 @@ RUN apt-get update && apt-get install -y \ pkg-config \ unzip && apt-get clean -RUN apt-get update && apt-get install -y golang && apt-get clean - RUN echo "deb http://archive.debian.org/debian jessie-backports main" | tee /etc/apt/sources.list.d/jessie-backports.list RUN echo 'Acquire::Check-Valid-Until "false";' > /etc/apt/apt.conf RUN sed -i '/deb http:\/\/deb.debian.org\/debian jessie-updates main/d' /etc/apt/sources.list diff --git a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile index ed4ff753dab..ab94ce7c8a6 100644 --- a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile @@ -18,4 +18,4 @@ RUN pacman --noconfirm -Syy RUN pacman --noconfirm -S openssl RUN pacman --noconfirm -S python RUN pacman --noconfirm -S python-pip -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_buster_x64/Dockerfile b/tools/dockerfile/distribtest/python_buster_x64/Dockerfile index 683009db921..bc509e7e7b9 100644 --- a/tools/dockerfile/distribtest/python_buster_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_buster_x64/Dockerfile @@ -15,4 +15,4 @@ FROM debian:buster RUN apt-get update && apt-get install -y python3 python3-pip -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 diff --git a/tools/dockerfile/distribtest/python_buster_x86/Dockerfile b/tools/dockerfile/distribtest/python_buster_x86/Dockerfile index e2b9299951f..aa22053379b 100644 --- a/tools/dockerfile/distribtest/python_buster_x86/Dockerfile +++ b/tools/dockerfile/distribtest/python_buster_x86/Dockerfile @@ -16,7 +16,7 @@ FROM i386/debian:buster RUN apt-get update && apt-get install -y python3 python3-pip -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 # docker is running on a 64-bit machine, so we need to # override "uname -m" to report i686 instead of x86_64, otherwise diff --git a/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile index 0272a2758f5..30850cd3526 100644 --- a/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_alpine3.7_x64/Dockerfile @@ -16,9 +16,9 @@ FROM alpine:3.11 RUN apk add --update build-base linux-headers python3 python3-dev py3-pip -RUN pip3 install --upgrade pip==19.3.1 +RUN python3 -m pip install --upgrade pip==19.3.1 -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv # bash is required for our test script invocation # ideally, we want to fix the invocation mechanism diff --git a/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile index a24e832493f..f4366bb9044 100644 --- a/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_arch_x64/Dockerfile @@ -18,5 +18,5 @@ RUN pacman --noconfirm -Syy RUN pacman --noconfirm -S openssl RUN pacman --noconfirm -S python RUN pacman --noconfirm -S python-pip -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv RUN pacman --noconfirm -S base-devel diff --git a/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile index 13cf3282354..75420816169 100644 --- a/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_buster_x64/Dockerfile @@ -15,7 +15,7 @@ FROM debian:buster RUN apt-get update && apt-get install -y python3 python3-pip -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 RUN apt-get install -y build-essential RUN apt-get install -y python3-dev diff --git a/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile b/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile index 77fadd567e7..a3b9cbc7e79 100644 --- a/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_buster_x86/Dockerfile @@ -16,7 +16,7 @@ FROM i386/debian:buster RUN apt-get update && apt-get install -y python3 python3-pip -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 RUN apt-get install -y build-essential RUN apt-get install -y python3-dev diff --git a/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile index b1299af7101..bf7cf699d68 100644 --- a/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_centos7_x64/Dockerfile @@ -18,8 +18,8 @@ RUN yum install -y python3 RUN yum install -y python3-devel RUN yum install -y epel-release RUN yum install -y python3-pip -RUN pip3 install --upgrade pip==19.3.1 -RUN pip3 install -U virtualenv +RUN python3 -m pip install --upgrade pip==19.3.1 +RUN python3 -m pip install -U virtualenv # The default gcc of CentOS 7 is gcc 4.8 which is older than gcc 4.9, # the minimum supported gcc version for gRPC Core so let's upgrade to diff --git a/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile index 26df8e889c5..cc591a536ea 100644 --- a/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_fedora34_x64/Dockerfile @@ -15,7 +15,7 @@ FROM fedora:34 RUN yum clean all && yum update -y && yum install -y python3 python3-pip -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 RUN yum groupinstall -y "Development Tools" RUN yum install -y redhat-rpm-config diff --git a/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile index 1f5775fb99e..add7b329d5a 100644 --- a/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_ubuntu1604_x64/Dockerfile @@ -19,4 +19,4 @@ RUN apt-get update -y && apt-get install -y python3 python3-pip RUN apt-get install -y build-essential RUN apt-get install -y python3-dev -RUN pip3 install virtualenv==16.7.9 +RUN python3 -m pip install virtualenv==16.7.9 diff --git a/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile b/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile index 7bcb5830d1f..8b15fdce2ac 100644 --- a/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_dev_ubuntu1804_x64/Dockerfile @@ -19,4 +19,4 @@ RUN apt-get update -y && apt-get install -y python3 python3-pip RUN apt-get install -y build-essential RUN apt-get install -y python3-dev -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile index 158ba778782..7566f476f0d 100644 --- a/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_fedora34_x64/Dockerfile @@ -15,4 +15,4 @@ FROM fedora:34 RUN yum clean all && yum update -y && yum install -y python3 python3-pip -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile index d8179ef68b4..d0a4fcbd6b7 100644 --- a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile @@ -24,4 +24,4 @@ RUN zypper --non-interactive install which # https://pypi.python.org/simple/ RUN zypper --non-interactive install ca-certificates-mozilla -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile b/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile index 8b14a4396b7..7802138394d 100644 --- a/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile +++ b/tools/dockerfile/distribtest/python_python38_buster_aarch64/Dockerfile @@ -15,4 +15,4 @@ # this an aarch64 image, qemu emulator will be used to run the tests FROM arm64v8/python:3.8-buster -RUN pip install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile index c8692e11c8b..af925d8442e 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile @@ -17,7 +17,7 @@ FROM ubuntu:16.04 RUN apt-get update -y && apt-get install -y python3 python3-pip # Necessary to fix virtualenv compatibility problems with python2.7 -RUN pip3 install --upgrade pip==19.3.1 +RUN python3 -m pip install --upgrade pip==19.3.1 # Ubuntu's python-pip package installs pip to /usr/bin, whereas the upgraded # pip lives at /usr/local/bin/pip. We'll use the absolute path for now, since diff --git a/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile index 9b1ab18742a..30337403d67 100644 --- a/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile +++ b/tools/dockerfile/distribtest/python_ubuntu1804_x64/Dockerfile @@ -16,4 +16,4 @@ FROM ubuntu:18.04 RUN apt-get update -y && apt-get install -y python3 python3-pip -RUN pip3 install virtualenv +RUN python3 -m pip install virtualenv diff --git a/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile b/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile index be96f131f92..14c63a8d4b4 100644 --- a/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile +++ b/tools/dockerfile/grpc_artifact_android_ndk/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2016 gRPC authors. +# Copyright 2021 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. @@ -12,62 +12,98 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Docker file for building gRPC artifacts for Android. +FROM debian:stretch -FROM debian:sid +#================= +# Basic C core dependencies -RUN apt-get update && apt-get install -y debian-keyring && apt-key update - -# Install Git and basic packages. -RUN apt-get update && apt-key update && apt-get install -y \ - autoconf \ - autotools-dev \ +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md +RUN apt-get update && apt-get install -y \ build-essential \ - bzip2 \ - clang \ - curl \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean + zip \ + && apt-get clean + +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + +#================= +# Install cmake +# Note that this step should be only used for distributions that have new enough cmake to satisfy gRPC's cmake version requirement. + +RUN apt-get update && apt-get install -y cmake && apt-get clean + + +RUN mkdir /var/local/jenkins -# golang needed to build BoringSSL with cmake -RUN apt-get update && apt-get install -y golang && apt-get clean # Java required by Android SDK RUN apt-get update && apt-get -y install openjdk-8-jdk && apt-get clean # Install Android SDK ENV ANDROID_SDK_VERSION 4333796 -RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \ - wget -q https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ - unzip -q sdk-tools-linux-${ANDROID_SDK_VERSION}.zip && \ - rm sdk-tools-linux-${ANDROID_SDK_VERSION}.zip +RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && wget -q https://dl.google.com/android/repository/sdk-tools-linux-$ANDROID_SDK_VERSION.zip && unzip -q sdk-tools-linux-$ANDROID_SDK_VERSION.zip && rm sdk-tools-linux-$ANDROID_SDK_VERSION.zip ENV ANDROID_SDK_PATH /opt/android-sdk # Install Android NDK and cmake using sdkmanager RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg -RUN yes | ${ANDROID_SDK_PATH}/tools/bin/sdkmanager --licenses # accept all licenses -RUN ${ANDROID_SDK_PATH}/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459' -ENV ANDROID_NDK_PATH ${ANDROID_SDK_PATH}/ndk-bundle -ENV ANDROID_SDK_CMAKE ${ANDROID_SDK_PATH}/cmake/3.6.4111459/bin/cmake - -RUN mkdir /var/local/jenkins +RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses +RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager ndk-bundle 'cmake;3.6.4111459' +ENV ANDROID_NDK_PATH $ANDROID_SDK_PATH/ndk-bundle +ENV ANDROID_SDK_CMAKE $ANDROID_SDK_PATH/cmake/3.6.4111459/bin/cmake # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile b/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile index 13f0a0a0309..b8c44f3f4b4 100644 --- a/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile +++ b/tools/dockerfile/grpc_artifact_centos6_x64/Dockerfile @@ -21,8 +21,7 @@ FROM dockcross/manylinux2010-x64:20210210-84c47e5 # Install essential packages. -RUN yum -y install golang strace - +RUN yum -y install strace && yum clean all ################## # Ruby dependencies @@ -30,7 +29,8 @@ RUN yum -y install golang strace # Install rvm RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - -RUN \curl -sSL https://get.rvm.io | bash -s stable +# Use "--insecure" to avoid cert expiration error +RUN curl -sSL --insecure https://get.rvm.io | bash -s stable # Install Ruby 2.6 RUN /bin/bash -l -c "rvm install ruby-2.6" @@ -40,9 +40,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc" RUN /bin/bash -l -c "gem install bundler" -# Clean yum -RUN yum clean all - # Create default work directory. RUN mkdir /var/local/jenkins diff --git a/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile b/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile index 49f595e2475..aa20bb80e48 100644 --- a/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile +++ b/tools/dockerfile/grpc_artifact_centos6_x86/Dockerfile @@ -21,8 +21,7 @@ FROM dockcross/manylinux2010-x86 # Install essential packages. -RUN yum -y install golang strace - +RUN yum -y install strace && yum clean all ################## # Ruby dependencies @@ -30,7 +29,8 @@ RUN yum -y install golang strace # Install rvm RUN curl -sSL https://rvm.io/mpapis.asc | gpg --import - RUN curl -sSL https://rvm.io/pkuczynski.asc | gpg --import - -RUN \curl -sSL https://get.rvm.io | bash -s stable +# Use "--insecure" to avoid cert expiration error +RUN curl -sSL --insecure https://get.rvm.io | bash -s stable # Install Ruby 2.6 RUN /bin/bash -l -c "rvm install ruby-2.6 --32" @@ -40,9 +40,6 @@ RUN /bin/bash -l -c "echo 'export PATH=/usr/local/rvm/bin:$PATH' >> ~/.bashrc" RUN /bin/bash -l -c "echo 'rvm --default use ruby-2.6' >> ~/.bashrc" RUN /bin/bash -l -c "gem install bundler" -# Clean yum -RUN yum clean all - # Create default work directory. RUN mkdir /var/local/jenkins diff --git a/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh b/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh index 0b5014c1505..b5f9a56a57b 100755 --- a/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh +++ b/tools/dockerfile/grpc_artifact_python_linux_armv7/install_python_for_wheel_crosscompilation.sh @@ -44,4 +44,4 @@ popd rm -rf "Python-${PYTHON_VERSION}" # install cython and wheel -"${PYTHON_PREFIX}/bin/pip3" install --upgrade cython wheel +"${PYTHON_PREFIX}/bin/python3" -m pip install --upgrade cython wheel diff --git a/tools/dockerfile/grpc_clang/Dockerfile b/tools/dockerfile/grpc_clang/Dockerfile deleted file mode 100644 index 8f838ea1a15..00000000000 --- a/tools/dockerfile/grpc_clang/Dockerfile +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright 2015 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 ubuntu:latest - -RUN apt-get update && apt-get install -y \ - cmake \ - g++ \ - gcc \ - git \ - make \ - python \ - && apt-get clean - -RUN git clone -b release_36 http://llvm.org/git/llvm.git -RUN git clone -b release_36 http://llvm.org/git/clang.git -RUN git clone -b release_36 http://llvm.org/git/compiler-rt.git -RUN git clone -b release_36 http://llvm.org/git/clang-tools-extra.git -RUN git clone -b release_36 http://llvm.org/git/libcxx.git -RUN git clone -b release_36 http://llvm.org/git/libcxxabi.git - -RUN mv clang llvm/tools -RUN mv compiler-rt llvm/projects -RUN mv clang-tools-extra llvm/tools/clang/tools -RUN mv libcxx llvm/projects -RUN mv libcxxabi llvm/projects - -RUN mkdir llvm-build -RUN cd llvm-build && cmake \ - -DCMAKE_BUILD_TYPE:STRING=Release \ - -DLLVM_TARGETS_TO_BUILD:STRING=X86 \ - ../llvm -RUN make -C llvm-build && make -C llvm-build install && rm -rf llvm-build - -CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile index 8fbc9ff8f27..6b58b964f82 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharp/Dockerfile @@ -14,56 +14,71 @@ FROM debian:buster -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile index 8fbc9ff8f27..6b58b964f82 100644 --- a/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_csharpcoreclr/Dockerfile @@ -14,56 +14,71 @@ FROM debian:buster -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================ # C# dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile index a05e0532a4e..e59499f80e6 100644 --- a/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_cxx/Dockerfile @@ -12,63 +12,77 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:8 +FROM debian:jessie +#================= +# Basic C core dependencies -# Install Git and basic packages. +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Use cmake 3.6 from jessie-backports diff --git a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile index 8ec46b2ce28..c3b4a9a28e6 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go/Dockerfile @@ -18,20 +18,29 @@ FROM golang:1.16 RUN ln -s /usr/local/go/bin/go /usr/local/bin #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile index bee821e26fa..adc0b063b19 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.11/Dockerfile @@ -18,20 +18,29 @@ FROM golang:1.11 RUN ln -s /usr/local/go/bin/go /usr/local/bin #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile index 8ec46b2ce28..c3b4a9a28e6 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.16/Dockerfile @@ -18,20 +18,29 @@ FROM golang:1.16 RUN ln -s /usr/local/go/bin/go /usr/local/bin #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile index e214fcc025c..ea621c90003 100644 --- a/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_go1.8/Dockerfile @@ -18,20 +18,29 @@ FROM golang:1.8 RUN ln -s /usr/local/go/bin/go /usr/local/bin #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile index d8f145773ac..0a7fbccb1b4 100644 --- a/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_http2/Dockerfile @@ -18,22 +18,18 @@ FROM golang:latest RUN ln -s /usr/local/go/bin/go /usr/local/bin #==================== -# Python dependencies +# Python dependencies to run tools/run_tests scripts # Install dependencies -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools +RUN apt-get update && apt-get install -y python3-all-dev python3-pip # Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +RUN python3 -m pip install --upgrade pip==19.3.1 +RUN python3 -m pip install virtualenv==16.7.9 +RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 -RUN pip install twisted h2==2.6.1 hyper +RUN python3 -m pip install twisted h2==2.6.1 hyper # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile index e7edd33c655..1ca33d5df1a 100644 --- a/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_java/Dockerfile @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:8 - +FROM debian:jessie RUN echo "deb http://archive.debian.org/debian/ jessie-backports main contrib non-free" > /etc/apt/sources.list.d/jessie-backports.list && \ echo 'Acquire::Check-Valid-Until no;' > /etc/apt/apt.conf.d/99no-check-valid-until && \ diff --git a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile index c02a333606b..a0db26264d4 100644 --- a/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_node/Dockerfile @@ -12,59 +12,73 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:8 +FROM debian:jessie +#================= +# Basic C core dependencies -# Install Git and basic packages. +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================== # Node dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile index 4143ac53487..5a58c32d271 100644 --- a/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_nodepurejs/Dockerfile @@ -12,43 +12,48 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:8 +FROM debian:jessie +#================= +# Basic C core dependencies -# Install Git and basic packages. +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #================== # Node dependencies diff --git a/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile index 4badb1218a6..138ec6c9681 100644 --- a/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_php7/Dockerfile @@ -12,34 +12,88 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM debian:9 - +FROM debian:stretch #================= -# PHP7 dependencies +# Basic C core dependencies -# Install Git and basic packages. +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - automake \ build-essential \ - ccache \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ + gcc \ + gcc-multilib \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ + libc6 \ + libc6-dbg \ + libc6-dev \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ curl \ + dnsutils \ git \ + lcov \ + make \ + strace \ + time \ + unzip \ + wget \ + zip \ + && apt-get clean + +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + +#================= +# PHP7 dependencies + +# PHP specific dependencies +RUN apt-get update && apt-get install -y \ libbison-dev \ libcurl4-openssl-dev \ libgmp-dev \ libgmp3-dev \ libssl-dev \ - libtool \ libxml2-dev \ - pkg-config \ re2c \ - time \ - unzip \ - wget \ - zip \ - zlib1g-dev && apt-get clean + zlib1g-dev \ + && apt-get clean # Compile PHP7 from source RUN git clone https://github.com/php/php-src /var/local/git/php-src @@ -60,6 +114,3 @@ RUN mkdir /var/local/jenkins RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer -# Define the default command. -CMD ["bash"] - diff --git a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile index 086e641655d..7445b7112df 100644 --- a/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_python/Dockerfile @@ -14,48 +14,46 @@ FROM debian:bullseye -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python3-dev \ - python3-setuptools \ - python3-yaml \ - telnet \ + time \ unzip \ wget \ - zip && \ - apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean RUN mkdir /var/local/jenkins @@ -63,4 +61,9 @@ RUN mkdir /var/local/jenkins RUN apt-get update && apt-get install -y python3 python3-all-dev python3-pip -RUN ln -s $(which python2) /usr/bin/python +RUN ln -s $(which python3) /usr/bin/python + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile index 40140efe7e4..14961a678c8 100644 --- a/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_pythonasyncio/Dockerfile @@ -14,48 +14,46 @@ FROM debian:bullseye -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python3-dev \ - python3-setuptools \ - python3-yaml \ - telnet \ + time \ unzip \ wget \ - zip && \ - apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean RUN mkdir /var/local/jenkins @@ -63,4 +61,9 @@ RUN mkdir /var/local/jenkins RUN apt-get update && apt-get install -y python3 python3-pip python3-all-dev -RUN ln -s $(which python2) /usr/bin/python +RUN ln -s $(which python3) /usr/bin/python + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile index e49dc4fa213..b121504da5f 100644 --- a/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile +++ b/tools/dockerfile/interoptest/grpc_interop_ruby/Dockerfile @@ -14,56 +14,71 @@ FROM debian:buster -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================== # Ruby dependencies diff --git a/tools/dockerfile/test/bazel/Dockerfile b/tools/dockerfile/test/bazel/Dockerfile index 8cc9dbdc27f..63453f09a24 100644 --- a/tools/dockerfile/test/bazel/Dockerfile +++ b/tools/dockerfile/test/bazel/Dockerfile @@ -41,16 +41,16 @@ RUN apt-get update && apt-get -y install \ # Python dependencies # Install dependencies +# TODO(jtattermusch): This installs python3.5. Is it even needed +# when we install python3.6 in the next step? RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3-all-dev #================= # Compile CPython 3.6.9 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ @@ -67,6 +67,12 @@ RUN python3.6 -m ensurepip && \ python3.6 -m pip install coverage +# Python2's python.h still needs to be present in order for the bazel build +# to work. +# TODO(jtattermusch): remove once https://github.com/grpc/grpc/issues/28026 +# is fixed. +RUN apt-get update && apt-get install -y python-all-dev python-setuptools + #======================== # Bazel installation diff --git a/tools/dockerfile/test/binder_transport_apk/Dockerfile b/tools/dockerfile/test/binder_transport_apk/Dockerfile index 90a1fee7466..5a4fb71421f 100644 --- a/tools/dockerfile/test/binder_transport_apk/Dockerfile +++ b/tools/dockerfile/test/binder_transport_apk/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021 gRPC authors. +# Copyright 2021 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. @@ -18,7 +18,11 @@ # Image(c7f1523ebd92) is built on Jul 29, 2021 FROM gcr.io/oss-fuzz-base/base-builder@sha256:c7f1523ebd9234b9ff57e5240f8c06569143373be019c92f1e6df18a1e048f37 -# This Dockerfile creates the environment for compiling and e2e testing of Android binder transport implementation +# -------------------------- WARNING -------------------------------------- +# If you are making changes to this file, consider changing +# https://github.com/google/oss-fuzz/blob/master/projects/grpc/Dockerfile +# accordingly. +# ------------------------------------------------------------------------- # Install basic packages and Bazel dependencies. RUN apt-get update && apt-get install -y software-properties-common python-software-properties @@ -33,24 +37,41 @@ RUN apt-get update && apt-get -y install \ openjdk-8-jdk \ vim -#======================== -# Android SDK/NDK installation -ENV SDK_ROOT=/opt/android-sdk -RUN mkdir -p ${SDK_ROOT} -RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && \ - unzip cmd.zip && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'tools' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'platform-tools' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'build-tools;30.0.3' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'platforms;android-29' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'ndk-bundle' && \ - yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${SDK_ROOT} 'ndk;21.4.7075529' - -RUN rm cmd.zip +#==================== +# Python dependencies -# Set environment variables for Bazel rules -ENV ANDROID_HOME=/opt/android-sdk -ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529 +# Install dependencies +# TODO(jtattermusch): This installs python3.5. Is it even needed +# when we install python3.6 in the next step? +RUN apt-get update && apt-get install -y \ + python3-all-dev + +#================= +# Compile CPython 3.6.9 from source + +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean + +RUN cd /tmp && \ + wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ + tar xzvf Python-3.6.9.tgz && \ + cd Python-3.6.9 && \ + ./configure && \ + make install + +RUN cd /tmp && \ + echo "ff7cdaef4846c89c1ec0d7b709bbd54d Python-3.6.9.tgz" > checksum.md5 && \ + md5sum -c checksum.md5 + +RUN python3.6 -m ensurepip && \ + python3.6 -m pip install coverage + + +# Python2's python.h still needs to be present in order for the bazel build +# to work. +# TODO(jtattermusch): remove once https://github.com/grpc/grpc/issues/28026 +# is fixed. +RUN apt-get update && apt-get install -y python-all-dev python-setuptools #======================== # Bazel installation @@ -67,6 +88,16 @@ RUN wget "https://github.com/bazelbuild/bazel/releases/download/$BAZEL_VERSION/b rm bazel-$BAZEL_VERSION-installer-linux-x86_64.sh +#======================== +# Android SDK/NDK installation +ENV SDK_ROOT=/opt/android-sdk +RUN mkdir -p $SDK_ROOT +RUN wget -O cmd.zip dl.google.com/android/repository/commandlinetools-linux-7302050_latest.zip && unzip cmd.zip && rm cmd.zip && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platform-tools' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'build-tools;30.0.3' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'platforms;android-29' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk-bundle' && yes | ./cmdline-tools/bin/sdkmanager --sdk_root=$SDK_ROOT 'ndk;21.4.7075529' + +# Set environment variables for Bazel rules +ENV ANDROID_HOME=/opt/android-sdk +ENV ANDROID_NDK_HOME=/opt/android-sdk/ndk/21.4.7075529 + RUN mkdir -p /var/local/jenkins # Define the default command. diff --git a/tools/dockerfile/test/csharp_buster_x64/Dockerfile b/tools/dockerfile/test/csharp_buster_x64/Dockerfile index 7690b45dbcb..774ce0840c9 100644 --- a/tools/dockerfile/test/csharp_buster_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_buster_x64/Dockerfile @@ -14,59 +14,71 @@ FROM debian:buster -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================ # C# dependencies diff --git a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile index f81d811ba91..9edcead9319 100644 --- a/tools/dockerfile/test/cxx_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_alpine_x64/Dockerfile @@ -30,24 +30,28 @@ RUN apk update && apk add \ make \ perl \ strace \ - python2-dev \ - py2-pip \ + python3 \ + py3-pip \ unzip \ wget \ zip -# Install Python packages from PyPI -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 -RUN pip install --upgrade --ignore-installed PyYAML==5.4.1 --user +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + +RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user -RUN mkdir /var/local/jenkins +RUN mkdir /var/local/jenkins + # Define the default command. CMD ["bash"] diff --git a/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile b/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile index 426f464cc8c..473b5536515 100644 --- a/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_clang_12_x64/Dockerfile @@ -14,31 +14,35 @@ FROM silkeh/clang:12 -RUN apt-get update && apt-get install -y build-essential curl git golang time wget zip +RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -RUN pip install PyYAML==5.4.1 -RUN apt-get install python-is-python2 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile b/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile index 95d4aeddbc6..027321dff2b 100644 --- a/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_clang_4_x64/Dockerfile @@ -14,31 +14,35 @@ FROM silkeh/clang:4 -RUN apt-get update && apt-get install -y build-essential curl git golang time wget zip +RUN apt-get update && apt-get install -y build-essential curl git time wget zip && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -RUN pip install PyYAML==5.4.1 -RUN apt-get install python-is-python2 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile b/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile index 63eeecf8b5e..bb939b223b9 100644 --- a/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_debian10_openssl102_x64/Dockerfile @@ -15,63 +15,75 @@ FROM debian:10 RUN apt-get --allow-releaseinfo-change update -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_debian10_x64/Dockerfile b/tools/dockerfile/test/cxx_debian10_x64/Dockerfile index 8a9c09290a1..491eb977057 100644 --- a/tools/dockerfile/test/cxx_debian10_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_debian10_x64/Dockerfile @@ -15,63 +15,76 @@ FROM debian:10 RUN apt-get --allow-releaseinfo-change update -# Install Git and basic packages. + +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_debian9_x64/Dockerfile b/tools/dockerfile/test/cxx_debian9_x64/Dockerfile index 5edb39d6ed5..a2a20aab022 100644 --- a/tools/dockerfile/test/cxx_debian9_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_debian9_x64/Dockerfile @@ -14,63 +14,75 @@ FROM debian:9 -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_debian9_x86/Dockerfile b/tools/dockerfile/test/cxx_debian9_x86/Dockerfile index 755ccaad28a..3d3f90d2f0b 100644 --- a/tools/dockerfile/test/cxx_debian9_x86/Dockerfile +++ b/tools/dockerfile/test/cxx_debian9_x86/Dockerfile @@ -14,63 +14,75 @@ FROM i386/debian:9 -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile b/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile index 9437ca3cf42..39bf86f1388 100644 --- a/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_gcc_11_x64/Dockerfile @@ -14,31 +14,31 @@ FROM gcc:11 -RUN apt-get update && apt-get install -y curl git golang time wget zip +RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 -RUN pip install PyYAML==5.4.1 -RUN apt-get install python-is-python2 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -#================= -# C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile b/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile index ae117ba7dd9..31a96c75a2c 100644 --- a/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_gcc_4.9_x64/Dockerfile @@ -14,59 +14,31 @@ FROM gcc:4.9 -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ - gcc \ - gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - perl \ - strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ - unzip \ - wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - +RUN apt-get update && apt-get install -y curl git time wget zip && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # Use cmake 3.6 from jessie-backports diff --git a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile index 1d895b28680..2c46afdc9a2 100644 --- a/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/test/cxx_ubuntu1604_x64/Dockerfile @@ -14,63 +14,75 @@ FROM ubuntu:16.04 -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 #================= # C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean #================= # Install cmake diff --git a/tools/dockerfile/test/node_jessie_x64/Dockerfile b/tools/dockerfile/test/node_jessie_x64/Dockerfile deleted file mode 100644 index eb2e42eb7ae..00000000000 --- a/tools/dockerfile/test/node_jessie_x64/Dockerfile +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2015 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:8 - - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ - gcc \ - gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - perl \ - strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ - unzip \ - wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - - -# Install Electron apt dependencies -RUN apt-get update && apt-get install -y \ - libasound2 \ - libgconf-2-4 \ - libgtk2.0-0 \ - libnss3 \ - libxss1 \ - libxtst6 \ - xvfb - -#==================== -# Python dependencies - -# Install dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 - -#================== -# Node dependencies - -# Install nvm -RUN touch .profile -RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash -# Install all versions of node that we want to test -RUN /bin/bash -l -c "nvm install 4 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm install 5 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm install 6 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm install 8 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm install 9 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm install 10 && npm config set cache /tmp/npm-cache" -RUN /bin/bash -l -c "nvm alias default 10" - -RUN mkdir /var/local/jenkins - -# Install Mako to generate files in grpc/grpc-node -RUN pip install Mako - -# Define the default command. -CMD ["bash"] diff --git a/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile b/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile index 6582ffce52a..e1c1cd41f1b 100644 --- a/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile +++ b/tools/dockerfile/test/php73_zts_stretch_x64/Dockerfile @@ -14,31 +14,52 @@ FROM php:7.3-zts-stretch -RUN apt-get -qq update && apt-get -qq install -y \ +RUN apt-get update && apt-get install -y \ autoconf automake build-essential git libtool curl \ zlib1g-dev \ - python-all-dev \ - python3-all-dev \ - python-setuptools + && apt-get clean +# install php pthreads from source +# TODO(jtattermusch): is this really needed? +# See https://github.com/grpc/grpc/pull/23056 WORKDIR /tmp - RUN git clone https://github.com/krakjoe/pthreads - RUN cd pthreads && \ phpize && \ ./configure && \ make && \ make install -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + +# Install composer RUN curl -sS https://getcomposer.org/installer | php RUN mv composer.phar /usr/local/bin/composer + RUN mkdir /var/local/jenkins # Define the default command. diff --git a/tools/dockerfile/test/php7_debian9_x64/Dockerfile b/tools/dockerfile/test/php7_debian9_x64/Dockerfile deleted file mode 100644 index c2c99f70f63..00000000000 --- a/tools/dockerfile/test/php7_debian9_x64/Dockerfile +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2016 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:9 - - -#================= -# PHP7 dependencies - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - automake \ - build-essential \ - ccache \ - curl \ - git \ - libbison-dev \ - libcurl4-openssl-dev \ - libgmp-dev \ - libgmp3-dev \ - libssl-dev \ - libtool \ - libxml2-dev \ - pkg-config \ - re2c \ - time \ - unzip \ - wget \ - zip \ - zlib1g-dev && apt-get clean - -# Compile PHP7 from source -RUN git clone https://github.com/php/php-src /var/local/git/php-src -RUN cd /var/local/git/php-src \ - && git checkout PHP-7.2.34 \ - && ./buildconf --force \ - && ./configure \ - --with-gmp \ - --with-openssl \ - --with-zlib \ - && make -j$(nproc) \ - && make install - -#==================== -# Python dependencies - -# Install dependencies - -RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 - -#================= -# PHP Test dependencies - - RUN apt-get update && apt-get install -y \ - valgrind - - -RUN mkdir /var/local/jenkins - -# Define the default command. -CMD ["bash"] diff --git a/tools/dockerfile/test/php7_stretch_x64/Dockerfile b/tools/dockerfile/test/php7_stretch_x64/Dockerfile new file mode 100644 index 00000000000..d03b6b06ae4 --- /dev/null +++ b/tools/dockerfile/test/php7_stretch_x64/Dockerfile @@ -0,0 +1,119 @@ +# Copyright 2016 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 + +#================= +# Basic C core dependencies + +# C/C++ dependencies according to 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 + +# GCC +RUN apt-get update && apt-get install -y \ + gcc \ + gcc-multilib \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ + libc6 \ + libc6-dbg \ + libc6-dev \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ + make \ + strace \ + time \ + unzip \ + wget \ + zip \ + && apt-get clean + +#==================== +# run_tests.py python dependencies + +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + + +#================= +# PHP7 dependencies + +# PHP specific dependencies +RUN apt-get update && apt-get install -y \ + libbison-dev \ + libcurl4-openssl-dev \ + libgmp-dev \ + libgmp3-dev \ + libssl-dev \ + libxml2-dev \ + re2c \ + zlib1g-dev \ + && apt-get clean + +# Compile PHP7 from source +RUN git clone https://github.com/php/php-src /var/local/git/php-src +RUN cd /var/local/git/php-src \ + && git checkout PHP-7.2.34 \ + && ./buildconf --force \ + && ./configure \ + --with-gmp \ + --with-openssl \ + --with-zlib \ + && make -j$(nproc) \ + && make install + +#================= +# PHP Test dependencies + + RUN apt-get update && apt-get install -y \ + valgrind + +RUN mkdir /var/local/jenkins + +# Define the default command. +CMD ["bash"] diff --git a/tools/dockerfile/test/python_alpine_x64/Dockerfile b/tools/dockerfile/test/python_alpine_x64/Dockerfile index f9af142cc94..dfb322ee5a3 100644 --- a/tools/dockerfile/test/python_alpine_x64/Dockerfile +++ b/tools/dockerfile/test/python_alpine_x64/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2015 gRPC authors. +# Copyright 2018 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. @@ -15,39 +15,17 @@ FROM alpine:3.11 # Install Git and basic packages. -RUN apk update && apk add \ - autoconf \ - automake \ - bzip2 \ - build-base \ - cmake \ - ccache \ - curl \ - gcc \ - git \ - libtool \ - linux-headers \ - make \ - perl \ - strace \ - python3-dev \ - py3-pip \ - unzip \ - wget \ - zip +RUN apk update && apk add autoconf automake bzip2 build-base cmake ccache curl gcc git libtool linux-headers make perl strace python3-dev py3-pip unzip wget zip RUN ln -s /usr/bin/pip3 /usr/bin/pip RUN ln -s /usr/bin/python3 /usr/bin/python # Install Python packages from PyPI -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 +RUN python3 -m pip install --upgrade pip==19.3.1 +RUN python3 -m pip install virtualenv +RUN python3 -m pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 -RUN mkdir -p /var/local/jenkins - -# Define the default command. -CMD ["bash"] diff --git a/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile b/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile deleted file mode 100644 index eb618daebb8..00000000000 --- a/tools/dockerfile/test/python_stretch_2.7_x64/Dockerfile +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright 2018 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 - -# Install Git and basic packages. -RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ - build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ - gcc \ - gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ - libc6 \ - libc6-dbg \ - libc6-dev \ - libgtest-dev \ - libtool \ - make \ - perl \ - strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ - unzip \ - wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 - -# Add Debian 'buster' repository, we will need it for installing newer versions of python -RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list -RUN echo 'APT::Default-Release "stretch";' | tee -a /etc/apt/apt.conf.d/00local - -RUN mkdir /var/local/jenkins - - diff --git a/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile b/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile index 0871723bbc7..7e62368acc2 100644 --- a/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile +++ b/tools/dockerfile/test/python_stretch_3.5_x64/Dockerfile @@ -14,47 +14,46 @@ FROM debian:stretch -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list @@ -66,3 +65,8 @@ RUN mkdir /var/local/jenkins RUN apt-get update && apt-get install -y python3.5 python3-all-dev RUN curl https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.5 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile b/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile index 6efa2b8746f..6f7fbdcb340 100644 --- a/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile +++ b/tools/dockerfile/test/python_stretch_3.6_x64/Dockerfile @@ -14,47 +14,46 @@ FROM debian:stretch -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list @@ -66,8 +65,8 @@ RUN mkdir /var/local/jenkins #================= # Compile CPython 3.6.9 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ @@ -83,3 +82,10 @@ RUN cd /tmp && \ RUN python3.6 -m ensurepip && \ python3.6 -m pip install coverage + +RUN ln -s $(which python3.6) /usr/bin/python3 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile b/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile index 9f518446990..fdb229b13c6 100644 --- a/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile +++ b/tools/dockerfile/test/python_stretch_3.7_x64/Dockerfile @@ -14,47 +14,46 @@ FROM debian:stretch -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list @@ -68,4 +67,9 @@ RUN apt-get update && apt-get -t buster install -y python3.7 python3-all-dev RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7 # for Python test coverage reporting -RUN pip install coverage +RUN python3.7 -m pip install coverage + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile b/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile index 4060deaf42a..0c418534b16 100644 --- a/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile +++ b/tools/dockerfile/test/python_stretch_3.8_x64/Dockerfile @@ -14,47 +14,46 @@ FROM debian:stretch -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list @@ -66,8 +65,8 @@ RUN mkdir /var/local/jenkins #================= # Compile CPython 3.8.0b4 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && \ @@ -83,3 +82,10 @@ RUN cd /tmp && \ RUN python3.8 -m ensurepip && \ python3.8 -m pip install coverage + +RUN ln -s $(which python3.8) /usr/bin/python3 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/test/python_stretch_default_x64/Dockerfile b/tools/dockerfile/test/python_stretch_default_x64/Dockerfile index e9de0958911..ab2cf6d5afc 100644 --- a/tools/dockerfile/test/python_stretch_default_x64/Dockerfile +++ b/tools/dockerfile/test/python_stretch_default_x64/Dockerfile @@ -14,47 +14,46 @@ FROM debian:stretch -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean - -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2.7 python-all-dev -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + zip \ + && apt-get clean # Add Debian 'buster' repository, we will need it for installing newer versions of python RUN echo 'deb http://ftp.de.debian.org/debian buster main' >> /etc/apt/sources.list @@ -66,8 +65,8 @@ RUN mkdir /var/local/jenkins #================= # Compile CPython 3.6.9 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ wget -q https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ @@ -86,8 +85,8 @@ RUN python3.6 -m ensurepip && \ #================= # Compile CPython 3.8.0b4 from source -RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev -RUN apt-get update && apt-get install -y jq build-essential libffi-dev +RUN apt-get update && apt-get install -y zlib1g-dev libssl-dev && apt-get clean +RUN apt-get update && apt-get install -y jq build-essential libffi-dev && apt-get clean RUN cd /tmp && \ wget -q https://www.python.org/ftp/python/3.8.0/Python-3.8.0b4.tgz && \ @@ -112,3 +111,8 @@ RUN curl https://bootstrap.pypa.io/get-pip.py | python3.7 # for Python test coverage reporting RUN python3.7 -m pip install coverage + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + diff --git a/tools/dockerfile/test/ruby_buster_x64/Dockerfile b/tools/dockerfile/test/ruby_buster_x64/Dockerfile index f96d3be6720..cc71dbb5643 100644 --- a/tools/dockerfile/test/ruby_buster_x64/Dockerfile +++ b/tools/dockerfile/test/ruby_buster_x64/Dockerfile @@ -14,59 +14,71 @@ FROM debian:buster -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - python-dev \ - python-setuptools \ - python-yaml \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean - -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean + zip \ + && apt-get clean #==================== -# Python dependencies - -# Install dependencies +# run_tests.py python dependencies +# Basic python dependencies to be able to run tools/run_tests python scripts +# These dependencies are not sufficient to build gRPC Python, gRPC Python +# deps are defined elsewhere (e.g. python_deps.include) RUN apt-get update && apt-get install -y \ - python-all-dev \ - python3-all-dev \ - python-setuptools - -# Install Python packages from PyPI -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2.7 -RUN pip install --upgrade pip==19.3.1 -RUN pip install virtualenv==16.7.9 -RUN pip install futures==3.1.1 enum34==1.1.10 protobuf==3.5.2.post1 six==1.16.0 twisted==19.10.0 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + && apt-get clean + +# use pinned version of pip to avoid sudden breakages +RUN python3 -m pip install --upgrade pip==19.3.1 + +# TODO(jtattermusch): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN python3 -m pip install six==1.16.0 + +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 + #================== # Ruby dependencies diff --git a/tools/dockerfile/test/sanity/Dockerfile b/tools/dockerfile/test/sanity/Dockerfile index ec21345d788..2ade5228494 100644 --- a/tools/dockerfile/test/sanity/Dockerfile +++ b/tools/dockerfile/test/sanity/Dockerfile @@ -14,67 +14,72 @@ FROM debian:bullseye -# Install Git and basic packages. +#================= +# Basic C core dependencies + +# C/C++ dependencies according to https://github.com/grpc/grpc/blob/master/BUILDING.md RUN apt-get update && apt-get install -y \ - autoconf \ - autotools-dev \ build-essential \ - bzip2 \ - ccache \ - curl \ - dnsutils \ + autoconf \ + libtool \ + pkg-config \ + && apt-get clean + +# GCC +RUN apt-get update && apt-get install -y \ gcc \ gcc-multilib \ - git \ - golang \ - gyp \ - lcov \ + g++ \ + g++-multilib \ + && apt-get clean + +# libc6 +RUN apt-get update && apt-get install -y \ libc6 \ libc6-dbg \ libc6-dev \ - libgtest-dev \ - libtool \ + && apt-get clean + +# Tools +RUN apt-get update && apt-get install -y \ + bzip2 \ + curl \ + dnsutils \ + git \ + lcov \ make \ - perl \ strace \ - telnet \ + time \ unzip \ wget \ - zip && apt-get clean + zip \ + && apt-get clean + +#================= +# C++ dependencies +RUN apt-get update && apt-get -y install libc++-dev clang && apt-get clean -#================ -# Build profiling -RUN apt-get update && apt-get install -y time && apt-get clean # Install Python 3.7 from source (and installed as a default python3) # (Bullseye comes with Python 3.9 which isn't supported by pytype yet) RUN apt update && apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev \ - libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev + libnss3-dev libssl-dev libreadline-dev libffi-dev libbz2-dev RUN curl -O https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tar.xz && \ - tar -xf Python-3.7.9.tar.xz && \ - cd Python-3.7.9 && \ - ./configure && \ - make -j 4 && \ - make install +tar -xf Python-3.7.9.tar.xz && \ +cd Python-3.7.9 && \ +./configure && \ +make -j 4 && \ +make install RUN curl https://bootstrap.pypa.io/get-pip.py | python3 -# Install Python 2.7 -RUN apt-get update && apt-get install -y python2 python2-dev -RUN ln -s /usr/bin/python2 /usr/bin/python -RUN curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2 - -# Google Cloud platform API libraries -RUN pip install --upgrade google-auth==1.24.0 google-api-python-client==1.12.8 oauth2client==4.1.0 +# Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +RUN python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0 RUN mkdir /var/local/jenkins -#================= -# C++ dependencies -RUN apt-get update && apt-get -y install libgflags-dev libgtest-dev libc++-dev clang && apt-get clean - - #======================== # Sanity test dependencies @@ -84,11 +89,13 @@ RUN apt-get update && apt-get install -y \ libtool \ curl \ shellcheck -RUN python2 -m pip install simplejson mako virtualenv==16.7.9 lxml + +# otherwise clang-tidy will report missing header +RUN apt-get update && apt-get install -y libgtest-dev && apt-get clean + RUN python3 -m pip install simplejson mako virtualenv==16.7.9 lxml six # Upgrade Python's YAML library -RUN python2 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user RUN python3 -m pip install --upgrade --ignore-installed PyYAML==5.4.1 --user # Install clang, clang-format, and clang-tidy @@ -96,7 +103,6 @@ RUN apt-get update && apt-get install -y clang clang-format-11 clang-tidy-11 jq ENV CLANG_FORMAT=clang-format-11 ENV CLANG_TIDY=clang-tidy-11 - #======================== # Bazel installation diff --git a/tools/run_tests/helper_scripts/run_tests_in_workspace.sh b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh index fa7a7aac0a0..7cff51fd673 100755 --- a/tools/run_tests/helper_scripts/run_tests_in_workspace.sh +++ b/tools/run_tests/helper_scripts/run_tests_in_workspace.sh @@ -30,5 +30,7 @@ git clone . "${WORKSPACE_NAME}" git submodule foreach 'cd "${repo_root}/${WORKSPACE_NAME}" \ && git submodule update --init --reference ${repo_root}/${name} ${name}' -echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" +echo "Running run_tests.py in workspace ${WORKSPACE_NAME}" +# TODO(jtattermusch): switch to python3 as soon as it stops breaking Python MacOS tests. +# See #28125. python "${WORKSPACE_NAME}/tools/run_tests/run_tests.py" "$@" diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 4634b5eee11..d5a45ceec7b 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2015 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -594,7 +594,7 @@ class Php7Language(object): return 'Makefile' def dockerfile_dir(self): - return 'tools/dockerfile/test/php7_debian9_%s' % _docker_arch_suffix( + return 'tools/dockerfile/test/php7_stretch_%s' % _docker_arch_suffix( self.args.arch) def __str__(self): @@ -1586,7 +1586,7 @@ if args.use_docker: dockerfile_dir = next(iter(dockerfile_dirs)) child_argv = [arg for arg in sys.argv if not arg == '--use_docker'] - run_tests_cmd = 'python tools/run_tests/run_tests.py %s' % ' '.join( + run_tests_cmd = 'python3 tools/run_tests/run_tests.py %s' % ' '.join( child_argv[1:]) env = os.environ.copy() diff --git a/tools/run_tests/run_tests_matrix.py b/tools/run_tests/run_tests_matrix.py index 7e1170052f1..29adeb40520 100755 --- a/tools/run_tests/run_tests_matrix.py +++ b/tools/run_tests/run_tests_matrix.py @@ -76,7 +76,7 @@ def _docker_jobspec(name, timeout_seconds = _DEFAULT_RUNTESTS_TIMEOUT shortname = 'run_tests_%s' % name test_job = jobset.JobSpec(cmdline=[ - 'python', 'tools/run_tests/run_tests.py', '--use_docker', '-t', '-j', + 'python3', 'tools/run_tests/run_tests.py', '--use_docker', '-t', '-j', str(inner_jobs), '-x', 'run_tests/%s' % _report_filename(name), '--report_suite_name', '%s' % _safe_report_name(name) @@ -230,7 +230,7 @@ def _create_test_jobs(extra_args=[], inner_jobs=_DEFAULT_INNER_JOBS): inner_jobs=inner_jobs, timeout_seconds=_CPP_RUNTESTS_TIMEOUT) - test_jobs += _generate_jobs(languages=['grpc-node', 'ruby', 'php7'], + test_jobs += _generate_jobs(languages=['ruby', 'php7'], configs=['dbg', 'opt'], platforms=['linux', 'macos'], labels=['basictests', 'multilang'],