Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use grpc-dotnet instead of grpc #9149

Merged
merged 10 commits into from Mar 11, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Expand Up @@ -18,6 +18,8 @@
- [cli/import] - Code generation in `pulumi import` can now be disabled with the `--generate-code=false` flag.
[#9141](https://github.com/pulumi/pulumi/pull/9141)

- [language/dotnet] - updated Pulumi dotnet packages to use grpc-dotnet instead of grpc [#9149](https://github.com/pulumi/pulumi/pull/9149)
Zaid-Ajaj marked this conversation as resolved.
Show resolved Hide resolved

### Bug Fixes

- [sdk/python] - Fix build warnings. See
Expand Down
8 changes: 6 additions & 2 deletions sdk/dotnet/Pulumi/Deployment/GrpcEngine.cs
Expand Up @@ -3,6 +3,7 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Grpc.Core;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the old package reference still being used via the Tools dep is it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, i will remove it

using Grpc.Net.Client;
using Pulumirpc;

namespace Pulumi
Expand All @@ -15,8 +16,11 @@ public GrpcEngine(string engine)
{
// maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
var maxRpcMessageSize = 400 * 1024 * 1024;
var grpcChannelOptions = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxReceiveMessageLength, maxRpcMessageSize)};
this._engine = new Engine.EngineClient(new Channel(engine, ChannelCredentials.Insecure, grpcChannelOptions));
var channel = GrpcChannel.ForAddress($"http://{engine}", new GrpcChannelOptions
{
MaxReceiveMessageSize = maxRpcMessageSize
});
this._engine = new Engine.EngineClient(channel);
}

public async Task LogAsync(LogRequest request)
Expand Down
12 changes: 7 additions & 5 deletions sdk/dotnet/Pulumi/Deployment/GrpcMonitor.cs
@@ -1,10 +1,9 @@
// Copyright 2016-2020, Pulumi Corporation

using System.Collections.Generic;
using System.Threading.Tasks;
using Grpc.Core;
using Grpc.Net.Client;
using Pulumirpc;

namespace Pulumi
{
internal class GrpcMonitor : IMonitor
Expand All @@ -15,8 +14,11 @@ public GrpcMonitor(string monitor)
{
// maxRpcMessageSize raises the gRPC Max Message size from `4194304` (4mb) to `419430400` (400mb)
var maxRpcMessageSize = 400 * 1024 * 1024;
var grpcChannelOptions = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxReceiveMessageLength, maxRpcMessageSize)};
this._client = new ResourceMonitor.ResourceMonitorClient(new Channel(monitor, ChannelCredentials.Insecure, grpcChannelOptions));
var channel = GrpcChannel.ForAddress($"http://{monitor}", new GrpcChannelOptions
{
MaxReceiveMessageSize = maxRpcMessageSize
});
this._client = new ResourceMonitor.ResourceMonitorClient(channel);
}

public async Task<SupportsFeatureResponse> SupportsFeatureAsync(SupportsFeatureRequest request)
Expand Down
4 changes: 2 additions & 2 deletions sdk/dotnet/Pulumi/Pulumi.csproj
Expand Up @@ -31,8 +31,8 @@

<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.4.1" />
<PackageReference Include="Grpc" Version="2.37.0" />
<PackageReference Include="Grpc.Tools" Version="2.37.0">
<PackageReference Include="Grpc.Net.Client" Version="2.43.0" />
<PackageReference Include="Grpc.Tools" Version="2.44.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down