From 0040bb9353f782b788e4bbbe20efdc87b36aa619 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 21 Nov 2018 10:55:41 +0100 Subject: [PATCH 01/10] attempt to add alpine C# distribtest --- .../DistribTest/DistribTestDotNet.csproj | 2 +- .../csharp/run_distrib_test_dotnetcli.sh | 17 ++++++++----- .../distribtest/csharp_alpine_x64/Dockerfile | 24 +++++++++++++++++++ .../artifacts/distribtest_targets.py | 1 + 4 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile diff --git a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj index d19eac91ba4..8cdf926f07f 100644 --- a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj +++ b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp1.0;net45 + netcoreapp2.1 false false false diff --git a/test/distrib/csharp/run_distrib_test_dotnetcli.sh b/test/distrib/csharp/run_distrib_test_dotnetcli.sh index 86c2d5231e1..357ce136cb7 100755 --- a/test/distrib/csharp/run_distrib_test_dotnetcli.sh +++ b/test/distrib/csharp/run_distrib_test_dotnetcli.sh @@ -28,19 +28,24 @@ cd DistribTest dotnet restore DistribTestDotNet.csproj dotnet build DistribTestDotNet.csproj -dotnet publish -f netcoreapp1.0 DistribTestDotNet.csproj -dotnet publish -f net45 DistribTestDotNet.csproj +dotnet publish -f netcoreapp2.1 DistribTestDotNet.csproj +#dotnet publish -f net45 DistribTestDotNet.csproj ls -R bin +#ldd /root/.nuget/packages/grpc.core/*/lib/netstandard1.5/../../runtimes/linux/native/libgrpc_csharp_ext.x64.so + +#ldd /root/.nuget/packages/grpc.tools/*/tools/linux_x64/grpc_csharp_plugin + +#exit 1 # .NET 4.5 target after dotnet build -mono bin/Debug/net45/publish/DistribTestDotNet.exe +#mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET 4.5 target after dotnet publish -mono bin/Debug/net45/publish/DistribTestDotNet.exe +#mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET Core target after dotnet build -dotnet exec bin/Debug/netcoreapp1.0/DistribTestDotNet.dll +dotnet exec bin/Debug/netcoreapp2.1/DistribTestDotNet.dll # .NET Core target after dotnet publish -dotnet exec bin/Debug/netcoreapp1.0/publish/DistribTestDotNet.dll +dotnet exec bin/Debug/netcoreapp2.1/publish/DistribTestDotNet.dll diff --git a/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile new file mode 100644 index 00000000000..aa5034872c3 --- /dev/null +++ b/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile @@ -0,0 +1,24 @@ +# 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. + +FROM microsoft/dotnet:2.1-sdk-alpine + +RUN apk update && apk add bash +RUN apk update && apk add unzip + +# needed to satisfy the "ld-linux-x86-64.so.2" dependency +RUN apk add libc6-compat + +#RUN apk add libnsl +#RUN cp /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 35a561ea928..d45abdcbd41 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -309,6 +309,7 @@ def targets(): CSharpDistribTest('linux', 'x64', 'ubuntu1404'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1404', use_dotnet_cli=True), + CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True), CSharpDistribTest('macos', 'x86'), CSharpDistribTest('windows', 'x86'), CSharpDistribTest('windows', 'x64'), From 32dbe30b3517c8f4d93b6141d1f9066c2b53d960 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Sep 2019 11:04:04 -0400 Subject: [PATCH 02/10] add .NET Core distribtest for ubuntu 16.04 --- .../distribtest/csharp_ubuntu1604_x64/Dockerfile | 10 ++++++++++ tools/run_tests/artifacts/distribtest_targets.py | 1 + 2 files changed, 11 insertions(+) diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile index 93ee75cfcd4..e0d8c458d0a 100644 --- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile +++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile @@ -24,6 +24,16 @@ RUN apt-get update && apt-get install -y \ nuget \ && apt-get clean +RUN apt-get update && apt-get install -y curl && apt-get clean + +# 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 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index d45abdcbd41..e221dee3ab8 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -308,6 +308,7 @@ def targets(): CSharpDistribTest('linux', 'x64', 'centos7'), CSharpDistribTest('linux', 'x64', 'ubuntu1404'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), + CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'ubuntu1404', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True), CSharpDistribTest('macos', 'x86'), From f4c723556650dd49df1c1ad0c93eab4e7d86e5ca Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Sep 2019 11:06:23 -0400 Subject: [PATCH 03/10] get rid of ubuntu14.04 C# distribtests --- .../csharp_ubuntu1404_x64/Dockerfile | 44 ------------------- .../artifacts/distribtest_targets.py | 2 - 2 files changed, 46 deletions(-) delete mode 100644 tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile deleted file mode 100644 index 61ca1a08a46..00000000000 --- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -# 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. - -FROM ubuntu:14.04 - -RUN apt-get update && apt-get install -y apt-transport-https && 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-trusty main" | tee /etc/apt/sources.list.d/mono-official-stable.list - -RUN apt-get update && apt-get install -y \ - mono-devel \ - nuget \ - && apt-get clean - -RUN apt-get update && apt-get install -y unzip && apt-get clean - -# Install dotnet CLI -RUN apt-get install -y apt-transport-https -RUN sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list' -RUN apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893 -RUN apt-get update && apt-get install -y dotnet-dev-1.0.4 - -# Trigger the population of the local package cache for dotnet CLI -RUN mkdir warmup \ - && cd warmup \ - && dotnet new \ - && cd .. \ - && rm -rf warmup - -# 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 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index e221dee3ab8..2c7af6e37fc 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -306,10 +306,8 @@ def targets(): CSharpDistribTest('linux', 'x64', 'jessie'), CSharpDistribTest('linux', 'x86', 'jessie'), CSharpDistribTest('linux', 'x64', 'centos7'), - CSharpDistribTest('linux', 'x64', 'ubuntu1404'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True), - CSharpDistribTest('linux', 'x64', 'ubuntu1404', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True), CSharpDistribTest('macos', 'x86'), CSharpDistribTest('windows', 'x86'), From e0b87cd4a13bb29eb68350b0207b75fdb9f8cd9f Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Sep 2019 11:26:27 -0400 Subject: [PATCH 04/10] add debian stretch distribtest --- .../distribtest/csharp_stretch_x64/Dockerfile | 41 +++++++++++++++++++ .../artifacts/distribtest_targets.py | 2 + 2 files changed, 43 insertions(+) create mode 100644 tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile diff --git a/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile new file mode 100644 index 00000000000..97779c52f8b --- /dev/null +++ b/tools/dockerfile/distribtest/csharp_stretch_x64/Dockerfile @@ -0,0 +1,41 @@ +# Copyright 2019 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 debian:stretch + +RUN apt-get update && apt-get install -y apt-transport-https dirmngr gnupg ca-certificates && 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/debian stable-stretch main" | tee /etc/apt/sources.list.d/mono-official-stable.list + +RUN apt-get update && apt-get install -y \ + mono-devel \ + nuget \ + && apt-get clean + +RUN apt-get update && apt-get install -y curl && apt-get clean + +# 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 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 2c7af6e37fc..5baf9d6c298 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -305,6 +305,8 @@ def targets(): CppDistribTest('windows', 'x86', testcase='cmake_as_externalproject'), CSharpDistribTest('linux', 'x64', 'jessie'), CSharpDistribTest('linux', 'x86', 'jessie'), + CSharpDistribTest('linux', 'x64', 'stretch'), + CSharpDistribTest('linux', 'x64', 'stretch', use_dotnet_cli=True), CSharpDistribTest('linux', 'x64', 'centos7'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True), From 21104ec1ee26d2f89affaa76a737ec23fb185e61 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Sep 2019 11:29:22 -0400 Subject: [PATCH 05/10] remove BOM --- test/distrib/csharp/DistribTest/Program.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/distrib/csharp/DistribTest/Program.cs b/test/distrib/csharp/DistribTest/Program.cs index 0ea7211fc45..92f416785a6 100644 --- a/test/distrib/csharp/DistribTest/Program.cs +++ b/test/distrib/csharp/DistribTest/Program.cs @@ -16,7 +16,7 @@ #endregion -using System; +using System; using Grpc.Core; namespace TestGrpcPackage From 504c4ace804ba7e18c84125501628cf5cb327e97 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Wed, 4 Sep 2019 11:32:31 -0400 Subject: [PATCH 06/10] remove legacy c# testcodegen --- test/distrib/csharp/run_distrib_test.sh | 3 -- .../csharp/test_codegen/test_codegen.sh | 38 ------------------- .../csharp/test_codegen/testcodegen.proto | 29 -------------- test/distrib/csharp/update_version.sh | 2 +- 4 files changed, 1 insertion(+), 71 deletions(-) delete mode 100755 test/distrib/csharp/test_codegen/test_codegen.sh delete mode 100644 test/distrib/csharp/test_codegen/testcodegen.proto diff --git a/test/distrib/csharp/run_distrib_test.sh b/test/distrib/csharp/run_distrib_test.sh index 45911cd91a7..824e33e2876 100755 --- a/test/distrib/csharp/run_distrib_test.sh +++ b/test/distrib/csharp/run_distrib_test.sh @@ -27,6 +27,3 @@ nuget restore || nuget restore || nuget restore msbuild DistribTest.sln mono DistribTest/bin/Debug/DistribTest.exe - -# test that codegen work -test_codegen/test_codegen.sh diff --git a/test/distrib/csharp/test_codegen/test_codegen.sh b/test/distrib/csharp/test_codegen/test_codegen.sh deleted file mode 100755 index fa101889f68..00000000000 --- a/test/distrib/csharp/test_codegen/test_codegen.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash -# Copyright 2018 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. - -set -ex - -cd "$(dirname "$0")" - -ls -lR "../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools" - -PLATFORM_ARCH=linux_x64 -if [ "$(uname)" == "Darwin" ] -then - PLATFORM_ARCH=macosx_x64 -elif [ "$(getconf LONG_BIT)" == "32" ] -then - PLATFORM_ARCH=linux_x86 -fi - -PROTOC=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/protoc -PLUGIN=../packages/Grpc.Tools.__GRPC_NUGET_VERSION__/tools/${PLATFORM_ARCH}/grpc_csharp_plugin - -"${PROTOC}" --plugin="protoc-gen-grpc=${PLUGIN}" --csharp_out=. --grpc_out=. -I . testcodegen.proto - -ls ./*.cs - -echo 'Code generation works.' diff --git a/test/distrib/csharp/test_codegen/testcodegen.proto b/test/distrib/csharp/test_codegen/testcodegen.proto deleted file mode 100644 index 5c228b81dba..00000000000 --- a/test/distrib/csharp/test_codegen/testcodegen.proto +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018 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. - -syntax = "proto3"; - -package testcodegen; - -service Greeter { - rpc SayHello (HelloRequest) returns (HelloReply) {} -} - -message HelloRequest { - string name = 1; -} - -message HelloReply { - string message = 1; -} diff --git a/test/distrib/csharp/update_version.sh b/test/distrib/csharp/update_version.sh index 0e47ed3abd5..9759cc56481 100755 --- a/test/distrib/csharp/update_version.sh +++ b/test/distrib/csharp/update_version.sh @@ -28,4 +28,4 @@ then fi # Replaces version placeholder with value provided as first argument. -sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj test_codegen/test_codegen.sh +sed -ibak "s/__GRPC_NUGET_VERSION__/${CSHARP_VERSION}/g" DistribTest/packages.config DistribTest/DistribTest.csproj DistribTest/DistribTestDotNet.csproj From aeb04913adfcbf90cf3dd4c2cb1aa8f55ac54508 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Tue, 9 Apr 2019 12:41:27 -0400 Subject: [PATCH 07/10] improved C# distribtest --- test/distrib/csharp/DistribTest/Program.cs | 44 +++++++++++++++---- .../csharp/DistribTest/testcodegen.proto | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/test/distrib/csharp/DistribTest/Program.cs b/test/distrib/csharp/DistribTest/Program.cs index 92f416785a6..bda7b2104d6 100644 --- a/test/distrib/csharp/DistribTest/Program.cs +++ b/test/distrib/csharp/DistribTest/Program.cs @@ -17,7 +17,10 @@ #endregion using System; +using System.Linq; +using System.Threading.Tasks; using Grpc.Core; +using Helloworld; namespace TestGrpcPackage { @@ -25,14 +28,39 @@ namespace TestGrpcPackage { public static void Main(string[] args) { - // test codegen works - var reply = new Testcodegen.HelloReply(); - - // This code doesn't do much but makes sure the native extension is loaded - // which is what we are testing here. - Channel c = new Channel("127.0.0.1:1000", ChannelCredentials.Insecure); - c.ShutdownAsync().Wait(); - Console.WriteLine("Success!"); + // Disable SO_REUSEPORT to prevent https://github.com/grpc/grpc/issues/10755 + Server server = new Server(new[] { new ChannelOption(ChannelOptions.SoReuseport, 0) }) + { + Services = { Greeter.BindService(new GreeterImpl()) }, + Ports = { new ServerPort("localhost", ServerPort.PickUnused, ServerCredentials.Insecure) } + }; + server.Start(); + + Channel channel = new Channel("localhost", server.Ports.Single().BoundPort, ChannelCredentials.Insecure); + + try + { + var client = new Greeter.GreeterClient(channel); + String user = "you"; + + var reply = client.SayHello(new HelloRequest { Name = user }); + Console.WriteLine("Greeting: " + reply.Message); + Console.WriteLine("Success!"); + } + finally + { + channel.ShutdownAsync().Wait(); + server.ShutdownAsync().Wait(); + } + } + } + + class GreeterImpl : Greeter.GreeterBase + { + // Server side handler of the SayHello RPC + public override Task SayHello(HelloRequest request, ServerCallContext context) + { + return Task.FromResult(new HelloReply { Message = "Hello " + request.Name }); } } } diff --git a/test/distrib/csharp/DistribTest/testcodegen.proto b/test/distrib/csharp/DistribTest/testcodegen.proto index 7845ac92c49..61444fc080e 100644 --- a/test/distrib/csharp/DistribTest/testcodegen.proto +++ b/test/distrib/csharp/DistribTest/testcodegen.proto @@ -14,7 +14,7 @@ syntax = "proto3"; -package testcodegen; +package helloworld; service Greeter { rpc SayHello (HelloRequest) returns (HelloReply) {} From 91716467138c03fb97391c68cab3365ccf14a122 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 5 Sep 2019 08:05:36 -0400 Subject: [PATCH 08/10] fix dependencies for classic .csproj --- test/distrib/csharp/DistribTest/DistribTest.csproj | 10 ++++++++-- test/distrib/csharp/DistribTest/packages.config | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/test/distrib/csharp/DistribTest/DistribTest.csproj b/test/distrib/csharp/DistribTest/DistribTest.csproj index e3fc94b4f23..a7f48146a5d 100644 --- a/test/distrib/csharp/DistribTest/DistribTest.csproj +++ b/test/distrib/csharp/DistribTest/DistribTest.csproj @@ -68,8 +68,14 @@ - - ..\packages\System.Interactive.Async.3.0.0\lib\net45\System.Interactive.Async.dll + + ..\packages\System.Buffers.4.4.0\lib\netstandard1.1\System.Buffers.dll + + + ..\packages\System.Memory.4.5.3\lib\netstandard1.1\System.Memory.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll diff --git a/test/distrib/csharp/DistribTest/packages.config b/test/distrib/csharp/DistribTest/packages.config index 5e09d5dad01..b6c6730e34b 100644 --- a/test/distrib/csharp/DistribTest/packages.config +++ b/test/distrib/csharp/DistribTest/packages.config @@ -9,6 +9,8 @@ - + + + \ No newline at end of file From ece5fbdcb0aecc152da6cce81b33695c7adad453 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 5 Sep 2019 08:06:39 -0400 Subject: [PATCH 09/10] partially revert alpine distribtest attempts --- .../csharp/DistribTest/DistribTestDotNet.csproj | 12 +++++------- test/distrib/csharp/run_distrib_test_dotnetcli.sh | 11 +++-------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj index 8cdf926f07f..c855feb3fb3 100644 --- a/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj +++ b/test/distrib/csharp/DistribTest/DistribTestDotNet.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp2.1 + net45;netcoreapp2.1 false false false @@ -23,10 +23,8 @@ - - - /usr/lib/mono/4.5-api - /usr/local/lib/mono/4.5-api - /Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.5-api - + + + + \ No newline at end of file diff --git a/test/distrib/csharp/run_distrib_test_dotnetcli.sh b/test/distrib/csharp/run_distrib_test_dotnetcli.sh index 357ce136cb7..ca22bce9d85 100755 --- a/test/distrib/csharp/run_distrib_test_dotnetcli.sh +++ b/test/distrib/csharp/run_distrib_test_dotnetcli.sh @@ -29,20 +29,15 @@ dotnet restore DistribTestDotNet.csproj dotnet build DistribTestDotNet.csproj dotnet publish -f netcoreapp2.1 DistribTestDotNet.csproj -#dotnet publish -f net45 DistribTestDotNet.csproj +dotnet publish -f net45 DistribTestDotNet.csproj ls -R bin -#ldd /root/.nuget/packages/grpc.core/*/lib/netstandard1.5/../../runtimes/linux/native/libgrpc_csharp_ext.x64.so - -#ldd /root/.nuget/packages/grpc.tools/*/tools/linux_x64/grpc_csharp_plugin - -#exit 1 # .NET 4.5 target after dotnet build -#mono bin/Debug/net45/publish/DistribTestDotNet.exe +mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET 4.5 target after dotnet publish -#mono bin/Debug/net45/publish/DistribTestDotNet.exe +mono bin/Debug/net45/publish/DistribTestDotNet.exe # .NET Core target after dotnet build dotnet exec bin/Debug/netcoreapp2.1/DistribTestDotNet.dll From 54c02148664047d610cd60178a5dc2faaa654252 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Thu, 5 Sep 2019 08:08:46 -0400 Subject: [PATCH 10/10] protoc cannot be run on alpine linux --- .../distribtest/csharp_alpine_x64/Dockerfile | 24 ------------------- .../artifacts/distribtest_targets.py | 1 - 2 files changed, 25 deletions(-) delete mode 100644 tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile diff --git a/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile deleted file mode 100644 index aa5034872c3..00000000000 --- a/tools/dockerfile/distribtest/csharp_alpine_x64/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# 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. - -FROM microsoft/dotnet:2.1-sdk-alpine - -RUN apk update && apk add bash -RUN apk update && apk add unzip - -# needed to satisfy the "ld-linux-x86-64.so.2" dependency -RUN apk add libc6-compat - -#RUN apk add libnsl -#RUN cp /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1 diff --git a/tools/run_tests/artifacts/distribtest_targets.py b/tools/run_tests/artifacts/distribtest_targets.py index 5baf9d6c298..0674fc4c689 100644 --- a/tools/run_tests/artifacts/distribtest_targets.py +++ b/tools/run_tests/artifacts/distribtest_targets.py @@ -310,7 +310,6 @@ def targets(): CSharpDistribTest('linux', 'x64', 'centos7'), CSharpDistribTest('linux', 'x64', 'ubuntu1604'), CSharpDistribTest('linux', 'x64', 'ubuntu1604', use_dotnet_cli=True), - CSharpDistribTest('linux', 'x64', 'alpine', use_dotnet_cli=True), CSharpDistribTest('macos', 'x86'), CSharpDistribTest('windows', 'x86'), CSharpDistribTest('windows', 'x64'),