Skip to content

Commit

Permalink
fix: Remove gRPC Core (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
lemaitre-aneo authored May 23, 2024
2 parents e6ead29 + 4b0ddb1 commit 1a440c0
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 255 deletions.
33 changes: 12 additions & 21 deletions packages/csharp/ArmoniK.Api.Client.Test/ConnectivityKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@
using ArmoniK.Api.Client.Options;
using ArmoniK.Api.Client.Submitter;

using Grpc.Core;

using NUnit.Framework;
using Grpc.Net.Client;

namespace ArmoniK.Api.Client.Tests;

Expand Down Expand Up @@ -75,21 +73,12 @@ internal static bool IsMTls(this ConnectivityKind kind)
};

internal static string? GetCaCertPath(this ConnectivityKind kind)
{
switch (kind)
{
case ConnectivityKind.TlsCert or ConnectivityKind.MTlsCert:
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && !RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework"))
{
Assert.Inconclusive("Library loading bug on Windows");
}

return Path.Combine(CertFolder,
"server1-ca.pem");
default:
return null;
}
}
=> kind switch
{
ConnectivityKind.TlsCert or ConnectivityKind.MTlsCert => Path.Combine(CertFolder,
"server1-ca.pem"),
_ => null,
};

internal static (string?, string?) GetClientCertPath(this ConnectivityKind kind)
=> kind.IsMTls()
Expand All @@ -101,17 +90,19 @@ internal static (string?, string?) GetClientCertPath(this ConnectivityKind kind)
internal static string GetEndpoint(this ConnectivityKind kind)
=> kind switch
{
ConnectivityKind.Unencrypted => "http://localhost:5000",
ConnectivityKind.Unencrypted => RuntimeInformation.FrameworkDescription.StartsWith(".NET Framework")
? "http://localhost:4999"
: "http://localhost:5000",
ConnectivityKind.TlsInsecure => "https://localhost:5001",
ConnectivityKind.TlsCert => "https://localhost:5001",
ConnectivityKind.TlsStore => "https://localhost:5002",
ConnectivityKind.MTlsInsecure => "https://localhost:5003",
ConnectivityKind.MTlsCert => "https://localhost:5003",
ConnectivityKind.MTlsStore => "https://localhost:5004",
_ => "http://localhost:5000",
_ => "http://localhost:4999",
};

internal static ChannelBase GetChannel(this ConnectivityKind kind)
internal static GrpcChannel GetChannel(this ConnectivityKind kind)
{
var (certPath, keyPath) = kind.GetClientCertPath();

Expand Down
7 changes: 4 additions & 3 deletions packages/csharp/ArmoniK.Api.Client/ArmoniK.Api.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Grpc.Core" Version="2.46.6" />
<PackageReference Include="Grpc.Net.Client.Web" Version="2.62.0" />
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" />
<PackageReference Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Portable.BouncyCastle" Version="1.9.0" />
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.59.0" />
<PackageReference Include="Grpc.Tools" Version="2.60.0">
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.62.0" />
<PackageReference Include="Grpc.Tools" Version="2.62.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Net.Http.WinHttpHandler" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading

0 comments on commit 1a440c0

Please sign in to comment.