Commit Graph

944 Commits

Author SHA1 Message Date
AmosWang 166824205e
Print info when server starts (#30964) 2022-09-14 15:54:01 -07:00
h-vetinari a562807108
patch cpp example to use passed CMAKE_CXX_STANDARD (#30835) 2022-09-13 12:36:34 -07:00
AJ Heller 24bc7c455f
Match the greeter async example to the tutorial (#30731)
The "Prepare" bit is unnecessary for the basic async example. It's used
more meaningfully in the v2 async greeter implementations.
2022-08-24 11:45:32 -07:00
Yash Tibrewal 41ec08c69a
Update third_party/protobuf to 3.21.4 (#30377)
* Update third_party/protobuf

* run tools/distrib/python/make_grpcio_tools.py

* regenerate protos for ruby, php

* update build_handwritten.yaml

* regenerate projects

* Build - Use :well_known_type_protos instead of :well_known_protos

* Fix target

* Update upb

* Update Python for Protobuf 4.21 (#140)

* Update protobuf dependency on grpcio-tools

* Off by one

* Drop python 3.6 support

* Try upgrading pip

* And in the other script

* Try to figure out if we're compatible with abi3

* See what we've already got installed

* Update the requirements.txt file I didn't know existed

* And here too

* See what's installed

* Let's try that again

* Remove

* Try to confirm version

* Let me see the generated code

* Fix non-Bazel test runner

* Work for all test directories

* Regenerate example protos

* Clean up

* Generate .pyi files

* Fix type checking and linting

* Exclude pyi files from isort

* Upgrade to 3.21.4

* Update iwyu to get around messy protobuf IWYU rules

Co-authored-by: Richard Belleville <gnossen@gmail.com>
2022-08-04 09:39:49 -07:00
Benoit Daloze 0a5d9828c1
Make the gem build on TruffleRuby (#27660)
* replace darwin checks in extconf.rb to exclude TruffleRuby

* inherit RANLIB and STRIP from RbConfig, set LDXX

* enable overriding ranlib command in top-level makefile

* ensure the -no_warning_for_no_symbols flag is only used with Apple's ranlib

* don't embed openssl & zlib on truffleruby

* add RbConfig's cppflag to CPPFLAGS when using TruffleRuby

* this ensure the paths to find the system's OpenSSL are set up correctly with TruffleRuby (includes being able to find an OpenSSL installed via Homebrew etc)

* don't statically link standard libraries on Linux with Truffleruby

* This does not work when compiling to bitcode.

* Prefer SIGTERM to SIGQUIT for graceful shutdown in examples

* Overriding SIGQUIT is suboptimal, for example on JVM where it is very
  useful to dump the thread stacktraces.

* Keep the rb_tr_abi_version symbol for TruffleRuby in grpc_c.so

* Otherwise TruffleRuby cannot verify the ABI version is correct.
* See https://github.com/oracle/truffleruby/issues/2386

* Use RbConfig::CONFIG['STRIP'] instead of just `strip`

* Use a local variable for apple_toolchain for consistency

* Add a comment about -static-libgcc -static-libstdc++ and TruffleRuby

* Split comment into two for openssl/zlib

Co-authored-by: Nicolas Laurent <nicolas.laurent@oracle.com>
2022-06-27 23:12:13 -07:00
Esun Kim ec58a346f9
Changed C99 to C11 (#29687)
* Changed C99 to C11

* Remove gnu99 option

* Switch to gnu11 for xcode
2022-05-20 14:03:04 -07:00
dependabot[bot] ff90d97021
Bump y18n from 4.0.0 to 4.0.3 in /examples/node (#28738)
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-19 11:52:31 -07:00
Esun Kim 03e9ac6f1f
Requiring C++14 (#29589) 2022-05-12 21:17:32 -07:00
Lidi Zheng 3f2b3460a4
[Python] Add an UDS example (#29592) 2022-05-09 17:08:54 -07:00
Xiao ad3f591af3
[Aio] Fix typo in async graceful shutdown example (#29521)
Background: https://github.com/grpc/grpc/pull/26622
2022-05-03 10:51:44 -07:00
Jan Tattermusch e8404698d5
Remove C# implementation (individual packages will continue to be maintained through v2.46.x patches or moved to grpc-dotnet) (#29225)
* remove examples/csharp

* remove reference to examples/csharp

* remove C# references from doc/

* remove src/csharp

* update test_creds locations

* remove C# distribtests

* remove buildgen templates for files under src/csharp

* remove grpc_csharp_ext C build target

* regenerate projects

* update tools/run_tests/README.md

* change many C# test/build scripts to noop

* unbreak run_tests.py -l csharp

* unbreak C# build_package targets

* unbreak C# distribtests

* remove C# pre-build steps from prepare_build_windows.bat

* remove src/csharp from clang_format

* remove csharp and csharpcoreclr from run_interop_tests.py

* remove C# interop test docker images

* Revert "remove src/csharp"

This reverts commit 97f2b6d707.

* remove src/csharp, but keep Grpc.Tools

* add back templates/src/csharp/build/dependencies.props.template

* remove everything but Grpc.Tools and Grpc.Tools.Tests from sln

* Revert "unbreak run_tests.py -l csharp"

This reverts commit 529b5e2ec1.

* revive Grpc.Tools.Tests through run_tests.py

* Revert "unbreak C# build_package targets"

This reverts commit 79d8d83c8b.

* experiment with build_nuget.sh fixes

* simplify create_fake_native_artifacts.sh

* building of Grpc.Tools in package_targets.py

* move shared files from Grpc.Core to Grpc.Tools

* yapf format: distribtest_targets.py

* Revert "remove C# pre-build steps from prepare_build_windows.bat"

This reverts commit bd38956a2b.

* update C# README.md

* disable C# in gke OSS benchmarks
2022-04-28 12:00:34 +02:00
Nicolas Noble eb2ae7a0cc
Fixing RouteGuide's C++ Reactor example. (#29404)
* Fixing RouteGuide's C++ Reactor example.

The current method involves locking and unlocking a mutex from different
threads, which isn't allowed. Changing the strategy a bit to address
this.

* Automated change: Fix sanity tests

* Switching to absl::Mutex to annotate usage properly.

* Actually, let's not cover the examples with sanity checks.
2022-04-21 10:03:28 -07:00
Yash Tibrewal 7fb4998029
RouteGuide example: Abort if database file not found (#29398) 2022-04-14 15:13:33 -07:00
AJ Heller 1f03bbab39
Small cleanup (#29125)
The std::moves of temporaries prevented copy elision, and the functions
were unused (one with a TODO to re-enable later)
2022-03-16 18:26:41 -07:00
Jan Tattermusch bcaa3cb48e
Remove C# Legacy (a.k.a. "Classic") csproj example (#29102)
* remove C# legacy csproj example

* update BUILD-INTEGRATION.md
2022-03-16 17:40:00 +01:00
rburns1293 28db143b98
Update target frameworks in C# examples (#29047)
* Update target frameworks in examples.

* Update target frameworks and NuGets  in examples.

* upgrade Xds example

Co-authored-by: Jan Tattermusch <jtattermusch@google.com>
2022-03-15 17:33:40 +01:00
dependabot[bot] 9f23b67529
Bump Google.Protobuf in /examples/csharp/Xds/Greeter (#28858)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.12.2 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.12.2...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 14:38:08 +01:00
dependabot[bot] dc025cb1f9
Bump Google.Protobuf (#28856)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.13.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.13.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 14:37:46 +01:00
dependabot[bot] 670ccaa7bc
Bump Google.Protobuf in /examples/csharp/RouteGuide/RouteGuide (#28848)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.8.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.8.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 03:08:07 -08:00
dependabot[bot] 49b5692f9d
Bump Google.Protobuf in /examples/csharp/Helloworld/Greeter (#28849)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.8.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.8.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 02:35:18 -08:00
dependabot[bot] e15ed5ef91
Bump Google.Protobuf in /examples/csharp/HelloworldLegacyCsproj/Greeter (#28850)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.8.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.8.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 11:11:37 +01:00
dependabot[bot] cda3536ea6
Bump Google.Protobuf (#28851)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.8.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.8.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 11:10:56 +01:00
dependabot[bot] 8316d82f62
Bump Google.Protobuf (#28852)
Bumps [Google.Protobuf](https://github.com/protocolbuffers/protobuf) from 3.8.0 to 3.15.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.8.0...v3.15.0)

---
updated-dependencies:
- dependency-name: Google.Protobuf
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-22 11:10:28 +01:00
Ming-Chuan 08181286e3
Add a ChannelArguments option for sepcify custom binder intent (#28723)
User can use
`grpc::ChannelArguments::SetString("grpc.binder.custom_android_intent_action_name", "...")`
to set custom binder intent.
2022-02-09 13:54:27 +08:00
Ming-Chuan 93733de253
Add SameSignatureSecurityPolicy for binder transport (#27816)
Tested signing example server and example client APKs with different
debug key, worked as intended.
2022-01-18 15:01:01 +08:00
Michael Mercier b784a4307d
Add python async example for hellostreamingworld using generator (#27343)
* Add python async example for hellostreamingworld using generator

* add stub.read() client example + fix Copyrights + small improvements

* Format and lint + remove exernal generator

* Apply lint and auto-format
2022-01-06 10:15:40 -08:00
Stanley Cheung f3ef6869d6
PHP: update examples (#28159)
* PHP: update examples

* Fix templates
2021-11-30 16:09:47 -08:00
Esun Kim 192928c997
Use gRPC_BUILD_MSVC_MP_COUNT for windows cmake distrib tests (#28202) 2021-11-29 11:22:07 -08:00
AJ Heller c5f1d29b76
Add feature examples with continuous integration (#27917)
* Add failing end2end test for inconsistent percent-decoding of URIs

* Add passing h2_local_abstract_uds end2end tests

* Add basic abstract UDS example

* add test runner

* add proper bazel build path

* first attempt at CI configuration

* cleanup

* rename CI files for better readability
2021-11-11 14:00:10 -08:00
AJ Heller 83868b695e
Assert Android API >= v21 (#27943)
* Assert Android API >= v21

This precedes a change that would otherwise break on older Android APIs,
but in a more obvious way.

* error if __ANDROID_API__ is not defined

* update all Andriod minSdkVersions to 21

* csharp experimental: android-19 to 21
2021-11-05 19:04:05 -07:00
Ming-Chuan 1777ddf3c3
Add an experimental binder transport API for pre-finding Java class (#27939)
Due to limitation of JVM, when user want to create binder channel in
threads created in unmanaged native code, they will need to call this
new API first to make sure Java helper classes can correctly be found.

Unused code in jni_utils.cc are also cleaned up in this commit
2021-11-05 16:01:02 +08:00
Ming-Chuan 5c0df85ea8
[BinderTransport] Avoid depending on NdkBinder at compile time (#27912)
* [BinderTransport] Avoid depending on NdkBinder at compile time

We would like to make it possible to use BinderTransport in a APK that
has min sdk version lower than 29 (NdkBinder was introduced at 29)

We copies constants and type definitions from Ndk headers, creates a
same name wrapper for every NdkBinder API we use in
grpc_binder::ndk_util namespace.

We will try to load libbinder_ndk.so and resolve the symbol when the
NdkBinder API wrappers are invoked.

* regenerate projects

* Add GRPC_NO_BINDER guard
2021-11-05 01:40:49 +08:00
Richard Belleville 468768865b
Make Buildifier Sanity Test Strict (#27807)
* Fix all lint errors in repo.

* Use strict buildifier by default

* Whoops. That file does not exist

* Attempt fix to buildifier invocation

* Add missing copyright
2021-11-03 14:57:04 -07:00
Ming-Chuan d92baa99d6
Expose grpc++_binder through grpc++ (#27891)
A config option is provided so user can pass --define=grpc_no_binder=true to bazel, or passing `-DGRPC_NO_BINDER` to compiler to disable the dependency.
2021-11-03 23:30:17 +08:00
Ming-Chuan e0f793b3d3
Expose experimental binder transport API (#27632)
* Expose experimental binder transport API

New headers are added
`grpcpp/create_channel_binder.h `: interfaces for creating client
channel
`grpcpp/security/binder_credentials.h`: interfaces for binder server
credentials
`grpcpp/security/binder_security_policy.h`: interfaces for binder
security policy, which is used by both server and client. Individual
security policies are merged into this single header.

Users can now depend on the `grpc++_binder` target to use the headers
listed above.

* Regenerate projects
2021-11-01 20:25:22 +08:00
Ming-Chuan dcabe420cc
[BinderTransport] Create client channel instead of direct channel (#27790)
* [BinderTransport] Create client channel instead of direct channel

In this commit we create a client channel instead of direct channel.

BinderConnector is added to connect subchannel when the user actually
make RPC call using the channel.

BindToOnDeviceServerService() is not required anymore since now the
actual connection is delay until the channel is used.

* Regenerate projects.
2021-10-28 15:52:21 +08:00
Richard Belleville ffc43e05d8
Switch Python xDS Example Server to Listen on IPV4 Only (#27679) (#27758)
* Switch to IPV4

* Update to all hosts
2021-10-18 09:36:08 -07:00
Ming-Chuan 66d4e0ccb1
Consolidate binder targets into a single target in top-level BUILD file (#27719)
* Move binder targets into a single target in top-level BUILD file

* Regenerate projects
2021-10-18 17:29:27 +08:00
Ming-Chuan f58f903a4f
Add helper function for getting endpoint binder in Java (#27598)
Also update the server side URI scheme to use path instead of authority

See gRFC L85-core-binder-transport.md for more details
2021-10-08 10:54:22 +08:00
Ming-Chuan 332713a35a
Implement BinderTransport SecurityPolicies that requires no JNI (#27573)
This commit

1. Implements the security policies that does not require JNI. This
includes a security policy that always allow connection and a security
policy that allows connection when remote UID is the same us local UID.
2. Add security policy as an argument in our interfaces. Old interfaces
are temporarily preserved so compilation will not suddenly break when we
import the code to internal repo.
3. Pumping the security policy from the public interfaces to the code
that handles SETUP_TRANSPORT transaction.
4. Abort the transport setup when the security policy is not satisfied.

Since meaningful tests will require to be run in real Android
environment, we will implement it later. For now, this change is
manually tested with example APKs.

For security policies that need to invoke Java to check authorization,
we will implement them in later.
2021-10-07 00:21:51 +08:00
Craig Tiller d1e01ac139
Add a test for a (now-illegal) build file construct (#27602)
* Add a test for a (now-illegal) build file construct

* add to test suite!

* fix

* fix

* fix syntax
2021-10-06 07:43:59 -07:00
小么小儿郎EL 435d5207ab
fix: use == instead of is when comparing with a certain types of literals (#26519) 2021-09-21 15:36:26 -07:00
Ming-Chuan 4cb907457b
Rename binder transport example client app (#27344)
Rename the app to exampleclient

Also moved and updated README.md
2021-09-15 13:29:29 +08:00
Craig Tiller ea389c00c2
Adjust include order per style guide (#27175)
Introduce clang-format configuration to sort includes closer to our rules.
2021-09-08 12:14:44 -07:00
Ta-Wei Tu 3a5e844b38
[binder] Implicitly initialize the binder pool (#27261) 2021-09-07 19:27:46 -07:00
Ming-Chuan 2dfa59e898
Enable server side implementation in example binder server app (#27259) 2021-09-07 12:11:51 +08:00
Ming-Chuan 73003f8527
Add BinderTransport example server app (#27067)
Some code are commented out because the server interface has not been
merged yet.

After this, user should be able to install both apps on Android device
and test if basic unary call works or not
2021-08-30 18:26:49 +08:00
Ming-Chuan 9da755a61e
Import binder transport channel create interface (#27007)
Also try use the API in example apk to make sure the binder transport
code and the rest of gRPC compiles with the Android toolchain

We will properly expose our interface later.
2021-08-20 13:03:21 +08:00
Hannah Shi 62b65c5a60
deleted require paths, update grpc to v1.39.0 (#26841) 2021-08-06 11:09:57 -07:00
Richard Belleville a48067c4c8
Replace StopIteration with return (#26861) 2021-08-03 11:08:31 -07:00