mirror of https://github.com/grpc/grpc.git
[Interop] Test grpc-go 1.64 using go 1.22 runtime (#36755)
Use the latest golang base image for Go interop tests. Presently the latest image points to Go 1.22. <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. --> ## Commands run To render the Dockerfile from its template ```sh $ tools/buildgen/generate_projects.sh ``` To build and upload the base docker image. ```sh $ tools/dockerfile/push_testing_images.sh ``` To build and upload the interop docker image for grpc-go 1.64.0 ```sh $ tools/interop_matrix/create_matrix_images.py --git_checkout --release=v1.64.0 --upload_images --language go ``` To verify the image is uploaded ```sh $ gcloud container images list-tags gcr.io/grpc-testing/grpc_interop_go1.x DIGEST TAGS TIMESTAMP b36be4961ec4 infrastructure-public-image-v1.64.0,v1.64.0 2024-06-03T22:26:48 ``` Verify the backward compatability tests pass ```sh $ export docker_image=gcr.io/grpc-testing/grpc_interop_go1.x:v1.64.0 $ tools/interop_matrix/testcases/go__master Testing gcr.io/grpc-testing/grpc_interop_go1.x:v1.64.0 ``` Fixes: https://github.com/grpc/grpc/issues/36060 Closes #36755 PiperOrigin-RevId: 641272572pull/36849/head
parent
1dbfd4c9f2
commit
d038e0ed19
9 changed files with 161 additions and 1 deletions
@ -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" |
@ -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"] |
||||
|
@ -0,0 +1,3 @@ |
||||
%YAML 1.2 |
||||
--- | |
||||
<%include file="../../go_build_interop.sh.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"/> |
@ -0,0 +1 @@ |
||||
us-docker.pkg.dev/grpc-testing/testing-images-public/grpc_interop_go1.x:9740f2234d8c996def3f0e09791328c39dac0ab1@sha256:c1d1babd31ea7e635aa68d56803212f9e0091ff628288c18dc86d890f837303a |
@ -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"] |
@ -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) |
||||
|
Loading…
Reference in new issue