grpc/tools/dockerfile
Arjan Singh Bal d038e0ed19 [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: 641272572
2024-06-07 09:31:49 -07:00
..
distribtest [Infra] Update fedora image to 38 (#36335) 2024-04-11 13:46:48 -07:00
grpc_artifact_centos6_x64 Big dockerimage cleanup (#28010) 2021-12-01 12:56:26 +01:00
grpc_artifact_centos6_x86 Big dockerimage cleanup (#28010) 2021-12-01 12:56:26 +01:00
grpc_artifact_protoc_aarch64 [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_linux_armv7 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_manylinux2014_aarch64 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_manylinux2014_x64 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_manylinux2014_x86 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_musllinux_1_1_x64 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_musllinux_1_1_x86 [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_clang_format [CI] Updated clang docker images to use Debian 12 (#36810) 2024-06-05 16:38:08 -07:00
grpc_clang_tidy [CI] Updated clang docker images to use Debian 12 (#36810) 2024-06-05 16:38:08 -07:00
grpc_dist_proto Pointing the protobuf submodule to the new URL (#26811) 2021-07-29 10:19:16 -07:00
grpc_scan_build Remove gflags. 2020-11-14 03:03:55 +01:00
interoptest [Interop] Test grpc-go 1.64 using go 1.22 runtime (#36755) 2024-06-07 09:31:49 -07:00
observability-test/cpp [Observability] Fix CPP observability test docker build (#34081) 2023-08-17 14:27:29 -07:00
test [CI] Updated clang docker images to use Debian 12 (#36810) 2024-06-05 16:38:08 -07:00
README.md [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_centos6_x64.current_version Move docker images from dockerhub to artifact registry. (#31591) 2022-11-17 10:12:39 +01:00
grpc_artifact_centos6_x86.current_version Move docker images from dockerhub to artifact registry. (#31591) 2022-11-17 10:12:39 +01:00
grpc_artifact_protoc_aarch64.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_linux_armv7.current_version [Python 3.12] Support Python 3.12 (#34398) 2023-09-22 09:57:29 -07:00
grpc_artifact_python_manylinux2014_aarch64.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_manylinux2014_x64.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_manylinux2014_x86.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_musllinux_1_1_x64.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
grpc_artifact_python_musllinux_1_1_x86.current_version [CI] Rebuilt docker images (#36329) 2024-04-11 11:27:03 -07:00
push_testing_images.sh [Test] Adding an additional tag to test docker images (#36341) 2024-04-11 14:45:08 -07:00

README.md

Docker images used for gRPC testing

Most of our linux tests on the CI run under a docker container, since that makes it easier to maintain the test environment and the dependencies. Having an easily reproducible test environment also make it easier to reproduce issues we see on CI locally.

The docker image definitions we use live under tools/dockerfile directory (with the exception of third_party/rake-compiler-dock docker images).

Version management

The docker images we use for testing evolve over time (and newer/older versions of it might not work with newer/older revisions of our code).

For each dockerfile (which is identified by the directory in which is it located), the "current version" that's being used by testing is determined by the corresponding .current_version file, which contains the full docker image name, including artifact registry location, docker image name, the current tag and the SHA256 image digest.

Example: For tools/dockerfile/test/cxx_debian11_x64/Dockerfile, there is a tools/dockerfile/test/cxx_debian11_x64.current_version file which contains info as follows:

us-docker.pkg.dev/grpc-testing/testing-images-public/cxx_debian11_x64:[CURRENT_CHECKSUM]@sha256:[CURRENT_SHA256_DIGEST]

This info can be passed directly to docker run command to get an environment that's identical what what we use when testing on CI.

Updating the images

The authoritative version of docker images we use for testing is stored in artifact registry, under the repository us-docker.pkg.dev/grpc-testing/testing-images-public.

If you've made modifications to a dockerfile, you can upload the new version of the artifact registry as follows:

If you haven't configured authentication in Docker for us-docker.pkg.dev previously, run:

gcloud auth configure-docker us-docker.pkg.dev
gcloud auth login

Rebuild the docker images that have been modified locally and upload the docker images to artifact registry (note that this won't overwrite the "old" versions of the docker image that are already in artifact registry)

# Install qemu, binformat, and configure binfmt interpreters
sudo apt-get install binfmt-support qemu-user-static

# Enable different multi-architecture containers by QEMU with Docker
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes

tools/dockerfile/push_testing_images.sh

Build modified docker images locally and don't push to artifact registry. This option is very useful for quick local experiments. The script is much faster if it doesn't have to interact with artifact registry:

# very useful for local experiments
LOCAL_ONLY_MODE=true tools/dockerfile/push_testing_images.sh

Migrating from dockerhub

In the past, our testing docker images were hosted on dockerhub, but we are in the process of migrating them artifact registry now.

This temporary feature might simplify the migration:

# try pull existing images from dockerhub instead of building the from scratch locally.
TRANSFER_FROM_DOCKERHUB=true tools/dockerfile/push_testing_images.sh