[csharp] Use a stable/supported C# runtime in ubuntu 22.04 distribtest docker images (#35955)

The current .NET SDK in these tests is EOL, and we've been seeing strange SSL errors transiently.

Update to a supported version and remove cruft in the docker image that was there to install the older version.

TODO: submitting first with the ubuntu 22.04 image test skipped, need to follow-up with a fix and unskip the test

Closes #35955

PiperOrigin-RevId: 610798209
pull/36004/head
apolcyn 11 months ago committed by Copybara-Service
parent 12897ab0fb
commit 9054988785
  1. 1
      test/distrib/csharp/DistribTest/DistribTestDotNet.csproj
  2. 10
      tools/bazelify_tests/dockerimage_current_versions.bzl
  3. 2
      tools/dockerfile/distribtest/csharp_alpine_x64.current_version
  4. 3
      tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile
  5. 2
      tools/dockerfile/distribtest/csharp_debian10_x64.current_version
  6. 2
      tools/dockerfile/distribtest/csharp_debian10_x64/Dockerfile
  7. 2
      tools/dockerfile/distribtest/csharp_dotnet31_x64.current_version
  8. 1
      tools/dockerfile/distribtest/csharp_dotnet31_x64/Dockerfile
  9. 2
      tools/dockerfile/distribtest/csharp_dotnet5_x64.current_version
  10. 1
      tools/dockerfile/distribtest/csharp_dotnet5_x64/Dockerfile
  11. 2
      tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version
  12. 39
      tools/dockerfile/distribtest/csharp_ubuntu2204_x64/Dockerfile
  13. 3
      tools/run_tests/artifacts/distribtest_targets.py

@ -9,6 +9,7 @@
<TargetFrameworks Condition="'$(SKIP_NETCOREAPP21_DISTRIBTEST)' == ''">$(TargetFrameworks);netcoreapp2.1</TargetFrameworks>
<TargetFrameworks Condition="'$(SKIP_NETCOREAPP31_DISTRIBTEST)' == ''">$(TargetFrameworks);netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="'$(SKIP_NET50_DISTRIBTEST)' == ''">$(TargetFrameworks);net5.0</TargetFrameworks>
<TargetFrameworks Condition="'$(SKIP_NET70_DISTRIBTEST)' == ''">$(TargetFrameworks);net7.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>

@ -29,12 +29,12 @@ DOCKERIMAGE_CURRENT_VERSIONS = {
"third_party/rake-compiler-dock/rake_x86_64-linux.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/rake_x86_64-linux@sha256:149b949cfe4968963d86dca7e4bc425201efb6be912a996aff952b0003f25ad0",
"tools/dockerfile/distribtest/cpp_debian10_aarch64_cross_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_debian10_aarch64_cross_x64@sha256:15eeafcd816cb32a0d44da22f654749352a92fec9626dc028b39948897d5bea3",
"tools/dockerfile/distribtest/cpp_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/cpp_debian10_x64@sha256:904e3db8521697768f94aa08230063b474246184e126f74a41b98a6f4aaf6a49",
"tools/dockerfile/distribtest/csharp_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_alpine_x64@sha256:d018105349fcabdc3aa0649c1381d840c613df6b442a53a751d7dc839a80d429",
"tools/dockerfile/distribtest/csharp_alpine_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_alpine_x64@sha256:915880cb29ea83cc3aabb3bc0f2025cc36b0a09894552bff041e3b2426e08c48",
"tools/dockerfile/distribtest/csharp_centos7_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_centos7_x64@sha256:ec715dd5fbd621789e7598c8d4ac346a7b4037b0cc83fbb29990dc8e4c1f1a13",
"tools/dockerfile/distribtest/csharp_debian10_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian10_x64@sha256:8c3838e731da70566adc6f989f2c29351fdb2f629e8797928699fff24b3a0938",
"tools/dockerfile/distribtest/csharp_dotnet31_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64@sha256:fee52df6064ff84bc9af644c2ea17ab579de3401e3a167d0d43383c24f0d500f",
"tools/dockerfile/distribtest/csharp_dotnet5_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64@sha256:408425cd74bb8b79a3b09a64ea6c54f6cdc0e757a3469f31effc017a7187e442",
"tools/dockerfile/distribtest/csharp_ubuntu2204_x64.current_version": "docker://us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64@sha256:6e43e2c8de47534bd3e478857aa14ba484ecebcd6756dd882782f6ca71a60dc3",
"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/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",

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_alpine_x64:ad69c44d058b83910b333f0c2ede094e73af465b@sha256:d018105349fcabdc3aa0649c1381d840c613df6b442a53a751d7dc839a80d429
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_alpine_x64:7d6ff1699d4d41c3beaef635460858c521d7c38d@sha256:915880cb29ea83cc3aabb3bc0f2025cc36b0a09894552bff041e3b2426e08c48

@ -30,4 +30,5 @@ ENV SKIP_NET45_DISTRIBTEST=1
ENV SKIP_NETCOREAPP31_DISTRIBTEST=1
# we have a separate distribtest for net5.0
ENV SKIP_NET50_DISTRIBTEST=1
# we have a separate distribtest for net7.0
ENV SKIP_NET70_DISTRIBTEST=1

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian10_x64:0ebcec2f23bd9e270d100e58e7de954e714225ad@sha256:8c3838e731da70566adc6f989f2c29351fdb2f629e8797928699fff24b3a0938
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_debian10_x64:aaaa27f0d2b68684447562ce0dbfec8e66445009@sha256:98cf90c3039940e2f220d1c63688428aa14bb35e89e37894e999b3490001197b

@ -36,3 +36,5 @@ RUN curl https://curl.haxx.se/ca/cacert.pem > ~/cacert.pem && cert-sync ~/cacert
ENV SKIP_NETCOREAPP21_DISTRIBTEST=1
# we have a separate distribtest for net5.0
ENV SKIP_NET50_DISTRIBTEST=1
# we have a separate distribtest for net7.0
ENV SKIP_NET70_DISTRIBTEST=1

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64:335b31cb83d37a68034cc26b3baf3302f4f6633f@sha256:fee52df6064ff84bc9af644c2ea17ab579de3401e3a167d0d43383c24f0d500f
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet31_x64:a485cb6ed77af72e82fa784fe0f60a84a8b3300b@sha256:aeea1911ea20606bb409e9b8ac68c7b4127fee2be7dcbf9382f2a26b9c865ed0

@ -22,3 +22,4 @@ RUN apt-get update && apt-get install -y unzip && apt-get clean
ENV SKIP_NET45_DISTRIBTEST=1
ENV SKIP_NETCOREAPP21_DISTRIBTEST=1
ENV SKIP_NET50_DISTRIBTEST=1
ENV SKIP_NET70_DISTRIBTEST=1

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64:bd7cd75510186f6b39f54d22b610b70fd2c43e09@sha256:408425cd74bb8b79a3b09a64ea6c54f6cdc0e757a3469f31effc017a7187e442
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_dotnet5_x64:086015310877872f8c5c617b9eb72316892e4386@sha256:2cf597a37f77da51f606b603ee2923c5fac604ab355d316c31059e1c4daef24f

@ -23,3 +23,4 @@ RUN apt-get update && apt-get install -y unzip && apt-get clean
ENV SKIP_NET45_DISTRIBTEST=1
ENV SKIP_NETCOREAPP21_DISTRIBTEST=1
ENV SKIP_NETCOREAPP31_DISTRIBTEST=1
ENV SKIP_NET70_DISTRIBTEST=1

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64:8add2411b0e373dcdfa08774d10597e433c638ee@sha256:6e43e2c8de47534bd3e478857aa14ba484ecebcd6756dd882782f6ca71a60dc3
us-docker.pkg.dev/grpc-testing/testing-images-public/csharp_ubuntu2204_x64:50bd65f5e356f8956565d27bb6d1729c56d4a2d0@sha256:b21dd7a9d0492a974cb4b287bf22b6d595664895cc81b3e37b5cca53e885b941

@ -14,40 +14,19 @@
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y apt-transport-https gnupg && apt-get clean
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates gnupg wget unzip && apt-get clean
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb https://download.mono-project.com/repo/ubuntu stable-xenial main" | tee /etc/apt/sources.list.d/mono-official-stable.list
RUN wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN apt-get update
RUN dpkg -i packages-microsoft-prod.deb
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get install -y \
mono-devel \
nuget \
&& apt-get clean
RUN rm packages-microsoft-prod.deb
RUN apt-get update && apt-get install -y curl && apt-get clean
RUN apt-get update && apt-get install -y dotnet-sdk-7.0
# Install dotnet SDK
ENV DOTNET_SDK_VERSION 2.1.500
RUN curl -sSL -o dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/$DOTNET_SDK_VERSION/dotnet-sdk-$DOTNET_SDK_VERSION-linux-x64.tar.gz \
&& mkdir -p /usr/share/dotnet \
&& tar -zxf dotnet.tar.gz -C /usr/share/dotnet \
&& rm dotnet.tar.gz \
&& ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
RUN apt-get update && apt-get install -y unzip && apt-get clean
# Make sure the mono certificate store is up to date to prevent issues with nuget restore
RUN apt-get update && apt-get install -y curl && apt-get clean
RUN curl https://curl.haxx.se/ca/cacert.pem > ~/cacert.pem && cert-sync ~/cacert.pem && rm -f ~/cacert.pem
# libssl 1.0. Ubuntu22.04 only has libssl 3
RUN curl -sSL -o libssl1.0.0_1.0.2n-1ubuntu5.8_amd64.deb http://security.ubuntu.com/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.13_amd64.deb
RUN dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.8_amd64.deb
RUN rm libssl1.0.0_1.0.2n-1ubuntu5.8_amd64.deb
# we have a separate distribtest for netcoreapp3.1
# 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.
ENV SKIP_NET45_DISTRIBTEST=1
ENV SKIP_NETCOREAPP21_DISTRIBTEST=1
ENV SKIP_NETCOREAPP31_DISTRIBTEST=1
# we have a separate distribtest for net5.0
ENV SKIP_NET50_DISTRIBTEST=1

@ -429,7 +429,8 @@ def targets():
CSharpDistribTest(
"linux", "x64", "debian10", use_dotnet_cli=True, presubmit=True
),
CSharpDistribTest("linux", "x64", "ubuntu2204", use_dotnet_cli=True),
# TODO(apolcyn): unskip ubuntu2204 after fixing dotnet SDK installation.
# CSharpDistribTest("linux", "x64", "ubuntu2204", use_dotnet_cli=True),
CSharpDistribTest(
"linux", "x64", "alpine", use_dotnet_cli=True, presubmit=True
),

Loading…
Cancel
Save