diff --git a/templates/tools/dockerfile/gcp_api_libraries_venv.include b/templates/tools/dockerfile/gcp_api_libraries_venv.include new file mode 100644 index 00000000000..3cd4b48c44a --- /dev/null +++ b/templates/tools/dockerfile/gcp_api_libraries_venv.include @@ -0,0 +1,7 @@ +# Install Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +# This template is similar to gcp_api_libraries.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ + 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/interoptest/grpc_interop_go1.x/Dockerfile.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template new file mode 100644 index 00000000000..3137796840f --- /dev/null +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile.template @@ -0,0 +1,23 @@ +%YAML 1.2 +--- | + # Copyright 2024 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 golang:latest + + <%include file="../../go_path.include"/> + <%include file="../../run_tests_python_deps_venv.include"/> + # Define the default command. + CMD ["bash"] + diff --git a/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template new file mode 100644 index 00000000000..a08798b1d6b --- /dev/null +++ b/templates/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh.template @@ -0,0 +1,3 @@ +%YAML 1.2 +--- | + <%include file="../../go_build_interop.sh.include"/> diff --git a/templates/tools/dockerfile/run_tests_python_deps_venv.include b/templates/tools/dockerfile/run_tests_python_deps_venv.include new file mode 100644 index 00000000000..920cc7ca2d6 --- /dev/null +++ b/templates/tools/dockerfile/run_tests_python_deps_venv.include @@ -0,0 +1,33 @@ +#==================== +# 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) +# This template is similar to run_tests_python_deps.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN apt-get update && apt-get install -y ${'\\'} + python3 ${'\\'} + python3-pip ${'\\'} + python3-setuptools ${'\\'} + python3-yaml ${'\\'} + python3-venv ${'\\'} + && apt-get clean + +# Create a python virtual env for installing required dependencies. +ENV PYTHON_ENV="/opt/venv/grpc-interop" +RUN python3 -m venv "$PYTHON_ENV" +RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc + +# Use bash explicitly as /bin/sh doesn't support the "source" command. +# use pinned version of pip to avoid sudden breakages +# TODO(#36814): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && \ + python3 -m pip install --upgrade pip==19.3.1 && \ + python3 -m pip install six==1.16.0 && \ + python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" + + +<%include file="./gcp_api_libraries_venv.include"/> diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 54b4f77977f..90306784754 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -78,6 +78,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/interoptest/grpc_interop_go1.16.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.16@sha256:3767f47c9d06584c6c07b7ab536e13f3e87550330e6c2652ad288d3a72b0de23", "tools/dockerfile/interoptest/grpc_interop_go1.19.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.19@sha256:889e7ff34399a5e16af87940d1eaa239e56da307f7faca3f8f1d28379c2e3df3", "tools/dockerfile/interoptest/grpc_interop_go1.8.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.8@sha256:7830a301b37539252c592b9cd7fa30a6142d0afc717a05fc8d2b82c74fb45efe", + "tools/dockerfile/interoptest/grpc_interop_go1.x.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a", "tools/dockerfile/interoptest/grpc_interop_http2.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_http2@sha256:e3f247d8038374848fadf7215b841e3575c0b2a4217feb503a79b8004b164c5a", "tools/dockerfile/interoptest/grpc_interop_java.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_java@sha256:6c0319bbbf77d6c198f61adf92d205efd33cbd2cccaf914a1af8f2dcb61b16a1", "tools/dockerfile/interoptest/grpc_interop_node.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_node@sha256:549a7683cc024fb7ffee807eaa8acb6c2d5a5dd0184a2590f91852804eea39a4", diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version new file mode 100644 index 00000000000..1437c2993ad --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x.current_version @@ -0,0 +1 @@ +us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9740f2234d8c996def3f0e09791328c39dac0ab1@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a \ No newline at end of file diff --git a/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile new file mode 100644 index 00000000000..d7b5ba18533 --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x/Dockerfile @@ -0,0 +1,58 @@ +# Copyright 2024 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 golang:latest + +# Using login shell removes Go from path, so we add it. +RUN ln -s /usr/local/go/bin/go /usr/local/bin + +#==================== +# 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) +# This template is similar to run_tests_python_deps.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN apt-get update && apt-get install -y \ + python3 \ + python3-pip \ + python3-setuptools \ + python3-yaml \ + python3-venv \ + && apt-get clean + +# Create a python virtual env for installing required dependencies. +ENV PYTHON_ENV="/opt/venv/grpc-interop" +RUN python3 -m venv "$PYTHON_ENV" +RUN echo "source $PYTHON_ENV/bin/activate" >> ~/.bashrc + +# Use bash explicitly as /bin/sh doesn't support the "source" command. +# use pinned version of pip to avoid sudden breakages +# TODO(#36814): currently six is needed for tools/run_tests scripts +# but since our python2 usage is deprecated, we should get rid of it. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && python3 -m pip install --upgrade pip==19.3.1 && python3 -m pip install six==1.16.0 && python3 -m pip install --upgrade google-auth==1.23.0 google-api-python-client==1.12.8 oauth2client==4.1.0" + + +# Install Google Cloud Platform API libraries +# These are needed for uploading test results to BigQuery (e.g. by tools/run_tests scripts) +# This template is similar to gcp_api_libraries.include but installs the +# dependencies in a python virtual environment. This is required from pip 23.0 +# onwards as installation of system-wide packages is blocked by default. +RUN /bin/bash -c "source $PYTHON_ENV/bin/activate && 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.x/build_interop.sh b/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh new file mode 100644 index 00000000000..309340cb9ed --- /dev/null +++ b/tools/dockerfile/interoptest/grpc_interop_go1.x/build_interop.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# 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. +# +# Builds Go interop server and client in a base image. +set -e + +# Turn on support for Go modules. +export GO111MODULE=on + +# Clone just the grpc-go source code without any dependencies. +# We are cloning from a local git repo that contains the right revision +# to test instead of using "go get" to download from Github directly. +git clone --recursive /var/local/jenkins/grpc-go src/google.golang.org/grpc + +# copy service account keys if available +cp -r /var/local/jenkins/service_account $HOME || true + +# Build the interop client and server +(cd src/google.golang.org/grpc/interop/client && go install) +(cd src/google.golang.org/grpc/interop/server && go install) + diff --git a/tools/interop_matrix/client_matrix.py b/tools/interop_matrix/client_matrix.py index c22a8d59d0b..c2b990f7d01 100644 --- a/tools/interop_matrix/client_matrix.py +++ b/tools/interop_matrix/client_matrix.py @@ -53,7 +53,7 @@ def should_build_docker_interop_image_from_release_tag(lang): # Dictionary of default runtimes per language LANG_RUNTIME_MATRIX = { "cxx": ["cxx"], # This is actually debian8. - "go": ["go1.8", "go1.11", "go1.16", "go1.19"], + "go": ["go1.x"], "java": ["java"], "python": ["python", "pythonasyncio"], "node": ["node"], @@ -301,6 +301,7 @@ LANG_RELEASE_MATRIX = { ("v1.61.2", ReleaseInfo(runtimes=["go1.19"])), ("v1.62.2", ReleaseInfo(runtimes=["go1.19"])), ("v1.63.2", ReleaseInfo(runtimes=["go1.19"])), + ("v1.64.0", ReleaseInfo()), ] ), "java": OrderedDict(