GithubHelp home page GithubHelp logo

grpc / grpc-dotnet Goto Github PK

View Code? Open in Web Editor NEW
4.1K 4.1K 762.0 8.69 MB

gRPC for .NET

License: Apache License 2.0

Shell 0.43% C# 99.12% PowerShell 0.27% Batchfile 0.02% HTML 0.09% Dockerfile 0.03% JavaScript 0.06%

grpc-dotnet's Introduction

gRPC โ€“ An RPC library and framework

gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.

Homepage: grpc.io
Mailing List: [email protected]

Join the chat at https://gitter.im/grpc/grpc

To start using gRPC

To maximize usability, gRPC supports the standard method for adding dependencies to a user's chosen language (if there is one). In most languages, the gRPC runtime comes as a package available in a user's language package manager.

For instructions on how to use the language-specific gRPC runtime for a project, please refer to these documents

  • C++: follow the instructions under the src/cpp directory
  • C#/.NET: NuGet packages Grpc.Net.Client, Grpc.AspNetCore.Server
  • Dart: pub package grpc
  • Go: go get google.golang.org/grpc
  • Java: Use JARs from Maven Central Repository
  • Kotlin: Use JARs from Maven Central Repository
  • Node: npm install @grpc/grpc-js
  • Objective-C: Add gRPC-ProtoRPC dependency to podspec
  • PHP: pecl install grpc
  • Python: pip install grpcio
  • Ruby: gem install grpc
  • WebJS: follow the grpc-web instructions

Per-language quickstart guides and tutorials can be found in the documentation section on the grpc.io website. Code examples are available in the examples directory.

Precompiled bleeding-edge package builds of gRPC master branch's HEAD are uploaded daily to packages.grpc.io.

To start developing gRPC

Contributions are welcome!

Please read How to contribute which will guide you through the entire workflow of how to build the source code, how to run the tests, and how to contribute changes to the gRPC codebase. The "How to contribute" document also contains info on how the contribution process works and contains best practices for creating contributions.

Troubleshooting

Sometimes things go wrong. Please check out the Troubleshooting guide if you are experiencing issues with gRPC.

Performance

See the Performance dashboard for performance numbers of master branch daily builds.

Concepts

See gRPC Concepts

About This Repository

This repository contains source code for gRPC libraries implemented in multiple languages written on top of a shared C++ core library src/core.

Libraries in different languages may be in various states of development. We are seeking contributions for all of these libraries:

Language Source
Shared C++ [core library] src/core
C++ src/cpp
Ruby src/ruby
Python src/python
PHP src/php
C# (core library based) src/csharp
Objective-C src/objective-c
Language Source repo
Java grpc-java
Kotlin grpc-kotlin
Go grpc-go
NodeJS grpc-node
WebJS grpc-web
Dart grpc-dart
.NET (pure C# impl.) grpc-dotnet
Swift grpc-swift

grpc-dotnet's People

Contributors

analogrelay avatar apolcyn avatar captainsafia avatar damienbod avatar davidfowl avatar dependabot[bot] avatar dhhoang avatar hanabi1224 avatar jamesnk avatar jtattermusch avatar juntaoluo avatar kiapanahi avatar mayuki avatar mgravell avatar pengweiqhca avatar sebastienros avatar shirhatti avatar sleepybag avatar srini100 avatar stanley-cheung avatar stephentoub avatar tal66 avatar teo-tsirpanis avatar tomkerkhove avatar tonydnewell avatar varorbc avatar vaughanr avatar wadepickett avatar weihanli avatar wrall avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grpc-dotnet's Issues

Set up benchmark scenarios

This issue will track the work needed to set up benchmarking scenarios on our side for grpc-dotnet. More details to follow. This will help us compare performance metrics against existing implementation as well as track improvements when we optimize the implementation.

cc @shirhatti @JamesNK

Design decision: Singleton vs per request service

Current grpc .NET implementation has a singleton service
ASP.NET Core creates endpoint instances per request, e.g. controllers and service hub

We would prefer per request to support scoped DI scenarios, e.g. DB context

Make a design decision.

Create grpc templates

  • Identify what templates. Initial proposal: client, client/server, server
  • Decide on languages supported. C# only or add F#
  • Create new templates (in aspnet/templates?)
  • Decide on default proto file location
  • How are proto files referenced by client project (e.g. service reference?)

grpc sandbox cleanup - Invoking method performance

Sandbox currently invokes service method using reflection.

Should reuse ASP.NET Core infrastructure (it is used by MVC and SignalR to invoke actions/methods. Well tested, good performance, handles async)

Create nightly feed for upstream packages

To share updates between grpc/grpc and grpc/grpc-dotnet, we should create a nightly NuGet feed where upstream changes are pushed as part of the build. This is one proposal, but we're open to other ideas

Accessing HttpContext in a gRPC service call

gRPC C# offers the ServerCallContext with information about the current call. Currently there is no way access the underlying HttpContext from service methods.

  • Decide if HttpContext should be accessible
    • Service base class?
    • Service interface?
    • Include it as part of ServerCallContext. Get with extension method?
  • Implementation

Fix copyright headers

We updated the required format of copyright header a while ago.

The old format

#region Copyright notice and license

// 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.

#endregion

The new format

#region Copyright notice and license

// 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.

#endregion

Note the first line is different: Copyright 2018 The gRPC Authors.
Also the year should be the year the file was created (2019 in our case).

Test that basic interoperability tests are passing

To ensure gRPC works well cross-language, we have a set of test cases that need to pass when ran against other gRPC implementations.

https://github.com/grpc/grpc/blob/master/doc/interop-test-descriptions.md

For "basic RPC support" (originally required for "alpha" version level of gRPC) these tests need to pass:

  • empty_unary
  • large_unary
  • client_streaming
  • server_streaming
  • ping_pong
  • empty_stream

A more "advanced RPC support" (still necessary for the library to be useful) - mostly things like timeouts, cancellation, RPC metadata...

  • custom_metadata
  • status_code_and_message
  • special_status_message
  • unimplemented_method
  • unimplemented_service
  • cancel_after_begin
  • cancel_after_first_response
  • timeout_on_sleeping_server

The test need to also with both secure insecure connections.
on grpc/grpc repository we have a test framework that can run these interop tests cross-language once they are implemented.

There is also a bunch of "auth" tests, but those are client-side only (so not a requirement for server-side AspNetCore support).

Serialization API - efficiency

Consider providing an extension point allowing users to configure serialization libraries other than Google.Protobuf.

Grpc.Core already offers an abstraction layer that we can use.

Issue is for discussing improving it and Google.Protobuf (default serialization layer)

Start from #30 (comment)

determine code style to use for Grpc.AspNetCore

Grpc.Core currently has code style that's different from AspNetCore code style. What code style do we use for Grpc.AspNetCore?

Node: Grpc.Core currently doesn't have an automatic code style enforcement in place (we used to use StyleCop, but that's probably out of date now), so this might be an opportunity to adopt code style and enforcement tooling from AspNetCore.

Server logging

Ensure we have sufficient server logging with appropriate log levels

Managed client using HttpClient

This issue tracks the work required to provide a complete managed end to end experience. This is going to be blocked on Core support for trailing response header support. cc @shirhatti for an expected timeframe.

Also, I'm not certain we need to change the code gen to implement this feature. I think we can pass in an HttpClient based call invoker to the constructor of the client. I don't have a client I can prototype this with yet so I'm not 100% certain but is there any reason this wouldn't work @jtattermusch @JamesNK ?

Package signing

  • Strong naming
  • Authenticode signing
  • nupkg signing
  • Google.Protobuf nupkg/Authenticode signing

Configure MinRequestBodyDataRate when using GRPC

We need to disable MinRequestBodyDataRate rate limit checks to support streaming RPCs. We should determine what's the most natural way to do this for the Kestrel Server when GRPC services are being used.

Add support for Go To Definition in VS

Go To Definition on a concrete implementation on a service will take you the generated code in the obj folder.
We should investigate if there are enough hooks in the project system that'll allow us to link directly to the proto files.

Add instructions for building and running Grpc.AspNetCore.Server and the samples

as a README.md which has some basic instructions:

  • one paragraph about Grpc.AspNetCore.Server (what it is).
  • disclaimer that this is currently purely experimental (+ optionally what are the plans)
  • installing the required ASP.NET core preview version + other prerequisites
  • how to build, run tests, run example
  • a very basic info how to use (one snippet is enough).

Syntax support in VS and VS Code

Determine if we want to add official grammar and syntax support for VS and VS Code in addition to the third party extensions currently available.

Instantiation of ServerCallContext shouldn't require Grpc.Core.Testing nuget

asp.net core integration will need to create instances of ServerCallContext that will be passed to server-side method implementations,but the constructor is internal-only. Currently instantiating requires Grpc.Core.Testing nuget, which is fine as a workaround, but shouldn't be required in the future.

Tooling design

A few questions regarding grpc/grpc#13207. I didn't read through all 192 comments but I did briefly read through the code after using it in a prototype.

  1. .proto files in the project directory is not compiled by default

I found this to be a deliberate decision: https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets#L41-L46. What was the reason for this? I don't think that comment applies here and would rather compile .proto files by default for a more frictionless experience. MSBuild properties are not very discoverable so it's best that the user doesn't have to look up the fact that you need to set EnableDefaultProtoBufItems to true to compile .proto files.

  1. Design-time build

The goal here is to enable design-time build experience in VS. Currently, the *.cs files are generated when build is called, but ideally we should be generating these files when we detect *.proto files are being edited. We can enable this via Single File Generators and using the FastUpToDateCheck mechanism in VS. I see some code to this effect that I don't see running https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets#L370-L383 as well as code that needs to be modified https://github.com/grpc/grpc/blob/master/src/csharp/Grpc.Tools/build/_protobuf/Google.Protobuf.Tools.targets#L250. The stretch goal here may be to write a VSCode extension to enable the same design time experience.

  1. Protodep

Investigate if this file can be removed. Currently it seems like it's used to communicate which files to generate (Foo.cs and FooGrpc.cs). It may be possible to substitute with MSBuild ItemGroups which is more natural and would reduce the files that are added to the /obj folder

cc @jtattermusch @shirhatti

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.