From 5043eb4d65c7b553e20942abca9ad10e4e33f5c7 Mon Sep 17 00:00:00 2001 From: tony <57042389+tonydnewell@users.noreply.github.com> Date: Thu, 29 Feb 2024 14:08:42 -0800 Subject: [PATCH] [csharp] Fix csharp_ubuntu2204_x64 docker image (#36019) Fix the docker image for C# distribution tests - csharp_ubuntu2204_x64 The package that installed the .NET 7.0 SDK is missing setting up links and thus the `dotnet` command cannot find the SDK. Setting this links has been added to the dockerfile. **NOTE**: I'm unable to update `tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version` as I don't have access to the artifact registry. Closes #36019 PiperOrigin-RevId: 611590679 --- tools/bazelify_tests/dockerimage_current_versions.bzl | 2 +- .../distribtest/csharp_ubuntu2204_x64.current_version | 2 +- tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile | 2 ++ tools/run_tests/artifacts/distribtest_targets.py | 3 +-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/bazelify_tests/dockerimage_current_versions.bzl b/tools/bazelify_tests/dockerimage_current_versions.bzl index 0fa51d73047..c30cc5ae966 100644 --- a/tools/bazelify_tests/dockerimage_current_versions.bzl +++ b/tools/bazelify_tests/dockerimage_current_versions.bzl @@ -34,7 +34,7 @@ DOCKERIMAGE_CURRENT_VERSIONS = { "tools/dockerfile/distribtest/csharp_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian10_x64@sha256:98cf90c3039940e2f220d1c63688428aa14bb35e89e37894e999b3490001197b", "tools/dockerfile/distribtest/csharp_dotnet31_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64@sha256:aeea1911ea20606bb409e9b8ac68c7b4127fee2be7dcbf9382f2a26b9c865ed0", "tools/dockerfile/distribtest/csharp_dotnet5_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64@sha256:2cf597a37f77da51f606b603ee2923c5fac604ab355d316c31059e1c4daef24f", - "tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64@sha256:b21dd7a9d0492a974cb4b287bf22b6d595664895cc81b3e37b5cca53e885b941", + "tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64@sha256:4d17c8394af37687e588a732947c82ca7efca1f58397047569614bffc902bf02", "tools/dockerfile/distribtest/php7_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/php7_debian10_x64@sha256:e760a60f2dce2dada571d9b07447a9f99ffeeb366a309dbbb5dc0a43991c22dc", "tools/dockerfile/distribtest/python_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_alpine_x64@sha256:699ac7b86199406fa27e88f30a1c623ef34ac33f6d9330fd13a6f6457ee4e19f", "tools/dockerfile/distribtest/python_arch_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/python_arch_x64@sha256:2c1adadeb010e107132cf5137f32a2d18727796631245b110cc74f69c07502e1", diff --git a/tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version b/tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version index c3b3ad1b110..0889caed1b9 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version +++ b/tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version @@ -1 +1 @@ -us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64:50bd65f5e356f8956565d27bb6d1729c56d4a2d0@sha256:b21dd7a9d0492a974cb4b287bf22b6d595664895cc81b3e37b5cca53e885b941 \ No newline at end of file +us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64:abfc4dfc1139b6a0ca4716b848ff06c12976d226@sha256:4d17c8394af37687e588a732947c82ca7efca1f58397047569614bffc902bf02 \ No newline at end of file diff --git a/tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile index 9314ebcb5c5..10213670888 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile @@ -23,6 +23,8 @@ RUN dpkg -i packages-microsoft-prod.deb RUN rm packages-microsoft-prod.deb RUN apt-get update && apt-get install -y dotnet-sdk-7.0 +# Set up links so that the dotnet command can find the installed SDK +RUN for f in /usr/share/dotnet/* ; do ln -s $f /usr/lib/dotnet ; done # we only want to test dotnet core 6.0 runtime. This also allows us to keep # this docker image minimal by not installing the other runtimes. diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 4756aac31e3..c367171c331 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -429,8 +429,7 @@ def targets(): CSharpDistribTest( "linux", "x64", "debian10", use_dotnet_cli=True, presubmit=True ), - # TODO(apolcyn): unskip ubuntu2204 after fixing dotnet SDK installation. - # CSharpDistribTest("linux", "x64", "ubuntu2204", use_dotnet_cli=True), + CSharpDistribTest("linux", "x64", "ubuntu2204", use_dotnet_cli=True), CSharpDistribTest( "linux", "x64", "alpine", use_dotnet_cli=True, presubmit=True ),