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

Change to use grpc-dotnet instead of Grpc.Core in C# SDK #3397

Merged
merged 15 commits into from Sep 28, 2023

Conversation

yoshd
Copy link
Contributor

@yoshd yoshd commented Sep 21, 2023

What type of PR is this?

Uncomment only one /kind <> line, press enter to put that in a new line, and remove leading whitespace from that line:

/kind breaking
/kind bug

/kind cleanup

/kind documentation
/kind feature
/kind hotfix
/kind release

What this PR does / Why we need it:

Grpc.Core used in the C# SDK is currently deprecated.
https://grpc.io/blog/grpc-csharp-future/

Changed to use grpc-dotnet instead.

Accordingly, code generation for .proto files has been modified to occur at build time, similar to the Rust SDK.
To do this, C#-specific rewritten .proto file was output to the sdks/csharp/sdk folder.

Which issue(s) this PR fixes:

Closes #

Special notes for your reviewer:

@yoshd yoshd changed the title Change csharp grpc lib Change to use grpc-dotnet instead of Grpc.Core in C# SDK Sep 21, 2023
@github-actions github-actions bot added the kind/cleanup Refactoring code, fixing up documentation, etc label Sep 21, 2023
using Microsoft.Extensions.Logging;
using System;
using System.Threading;
using System.Threading.Tasks;
using Grpc.Core;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The namespace Grpc.Core remains, but it is included in grpc-dotnet.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: ace9678b-3a9e-4208-b627-fedbfa760722

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-564d1ef-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 64dede6e-da6b-413d-afdc-4eabf3932b60

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-f2d74f8-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: e120c85b-ce3d-48c0-8edb-586ae79e7161

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-d1660e0-amd64

proto=/go/src/agones.dev/agones/proto
sdk=${proto}/sdk
googleapis=${proto}/googleapis
csharp_proto_file_output_dir=/go/src/agones.dev/agones/sdks/csharp/sdk/proto
Copy link
Member

Choose a reason for hiding this comment

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

Curious - does it have to be in sdk/proto? Also wondering if we should update the .gitignore so it doesn't ignore ./proto folder anymore, since the csharp code is now generated at build time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't necessarily need to be in sdk/proto, but since only the C# SDK uses this specially rewritten .proto files, I decided to output it there.
Currently it doesn't seem to be ignored by .gitignore, but is there likely to be a problem?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I wasn't clear, lemme explain this another way:

Shall we put the proto files in /go/src/agones.dev/agones/sdks/csharp/proto (the sdk seems redundant), which is the same as how we do the same thing with rust https://github.com/googleforgames/agones/tree/main/sdks/rust/proto

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 see, I understand!
I did it that way at first, but the actual C# SDK implementation was in sdks/csharp/sdk.
For this reason, although it is redundant, I thought it would be better to put them in the same hierarchy.
WDYT?
https://github.com/googleforgames/agones/tree/main/sdks/csharp/sdk

Copy link
Member

Choose a reason for hiding this comment

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

oooooh! So it is!

I guess what's the usual convention for csharp? Are the protos usually kept with the source code (i.e. sdk) or kept separately (i.e. one level up)?

We should probably just do whatever the regular convention is - I don't actually mind either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Normally, the proto file is often shared between the server and client, so I think it should be placed in a separate folder from the source code.
(However, this time it seems to be different in that a proto file exclusively for the C# SDK is generated.)
That said, I agree that it would be better to have a structure similar to most projects.
Now let's modify it to output to sdks/csharp .

Copy link
Member

Choose a reason for hiding this comment

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

Now let's modify it to output to sdks/csharp .

Sorry, wasn't sure I 100% understood.

I think we're saying to leave it at /go/src/agones.dev/agones/sdks/csharp/sdk/proto yes? or no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, that's no.
I modify it to csharp/sdk.
And I just committed it.

Copy link
Member

Choose a reason for hiding this comment

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

Got it! That works for me!

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: da80c334-0623-4751-b92c-177a348d3e51

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-c287767-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 8f99a110-26fc-413d-ad3d-6ec506eb8d69

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-3e57dc9-amd64

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 261c389a-8e26-4b9e-9859-aebfe92a5def

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-2f2204b-amd64

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: markmandel, yoshd

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@markmandel markmandel enabled auto-merge (squash) September 28, 2023 20:34
@google-oss-prow google-oss-prow bot removed the lgtm label Sep 28, 2023
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: bfaea9d3-c0b2-4189-8195-57a347489e7d

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3397/head:pr_3397 && git checkout pr_3397
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.36.0-dev-6ab40e6-amd64

@markmandel markmandel merged commit 6869882 into googleforgames:main Sep 28, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved kind/cleanup Refactoring code, fixing up documentation, etc size/XXL
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants