Commit Graph

982 Commits

Author SHA1 Message Date
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
Lidi Zheng 6c6463e1cd
Add retry example for gRPC Python (#26829)
* Add retry example for gRPC Python

* Make sanity test happy && simplfy proto definition

* Fix a grammer issue
2021-07-29 17:31:05 -07:00
Nicolas Noble a325d7f77a
Pointing the protobuf submodule to the new URL (#26811)
* Pointing the protobuf submodule to the new URL

* Also changing WORKSPACE dependencies

* More references to the old URL...
2021-07-29 10:19:16 -07:00
Shaw c472a2a58c
Update greeter_client.js (#25802)
ReferenceError: parseArgs is not defined
2021-07-28 09:37:45 -07:00
Ming-Chuan 746eaf6c48
Add BinderTransport example app (#26747)
This commit adds an app that will be served as BinderTransport example
later.

Currently the app simply calls C++ function when button is pressed. In
the future the C++ function will run BinderTransport gRPC example
instead.

Tests not included in this commit, later we will add a build test to
CI to make sure this apk is always build-able. (This app will also be
used to make sure our BinderTransport implementation is compile-able
with Android toolchain, on GitHub) For now we exclude this target in
bazel build test.

Changes are made to WORKSPACE file in order to support android builds.

Build instructions are documented at
examples/android/binder/java/io/grpc/binder/cpp/example/README.md
2021-07-27 11:18:59 +08:00
Lidi Zheng 2231c2ba77
Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
Lidi Zheng 933b10d2a8
Add a correct graceful shutdwon example for the asyncio API (#26622) 2021-07-08 10:58:58 -07:00
Vijay Pai 8aff94558c
De-experimentalize C++ callback API (#25728)
* De-experimentalize callback API

* Make FromServerContext based on ServerContextBase

* Fix lambda

* Fix headers

* De-experimentalize tests

* clang-format

* Fix consistency checks

* wip

* Fix const-ness of callback client read RPC requests

* Fix golden file

* Give full route_guide callback client example with Hold etc

* Complete example route-guide server

* De-experimentalize test services

* Omit unneeded using

* Remove some uses of non-experimental macro from test

* clang-format examples

* De-experimentalize async stub calls

* Remove experimental namespace use in qps, ubms

* De-experimentalize alarms, generic stubs, and context allocator

* De-experimentalize SetContextAllocator

* clang-format

* Fix conflicts

* Leave obsolete API in place until users can be migrated
2021-05-27 14:55:25 -07:00
Richard Belleville 7125bbe5a5
Add Python PSM security example (#26170)
* Add Python PSM security example

* Fix lint

* Add in maintenance port configuration

* Align CLI flags with Java

* Pylint
2021-05-05 15:57:38 -07:00
Yash Tibrewal a8ebadbe5f
Parse command-line args (#26161) 2021-05-04 09:32:56 -07:00
Yash Tibrewal 4c53304dcf
Add examples for xDS greeter client and server (#26157) 2021-05-03 23:26:41 -07:00
Hannah Shi 6769ce39f4
PHP: php server commit 4/n, add RpcServer, generator and server examples (#25640)
* add RpcServer and generator
add server examples: greeter and route guide

* php server generator xds client

* add generated stub

* fix clang format fail
2021-05-01 01:07:44 -07:00
Patrice Chalin 2c25e5336a
README for PHP examples: refer to grpc.io for details (#26060) 2021-04-28 13:20:39 +02:00
Vijay Pai ce16365421
clang-format C++ examples (#25764) 2021-03-22 10:23:52 -07:00
Esun Kim 343eb56df0
Added CMakeLists.txt to cpp/examples (#25692) 2021-03-17 19:59:23 -07:00
yulin liang 3bc612374c
Fix required a higher minimum deployment target of Auth Sample Test (#25736) 2021-03-17 10:50:00 -07:00
Daren McCulley fbc5194df6
replace deprecated addProtoService (#25536) 2021-03-03 10:34:51 -08:00
Yash Tibrewal f4e55b85bc Replace disrespectful term 2021-02-08 15:29:53 -08:00
Esun Kim b941a771e2
Merge pull request #25046 from veblush/route_guide_example
Added CMakeLists for route_guide example
2021-01-20 10:32:25 -08:00
Sergii Tkachenko 8db79e2e71 Python style: reformat code using updated yapf 0.30.0 2021-01-13 14:00:12 -05:00
Lidi Zheng a873c5a942
Merge pull request #25076 from lidizheng/aio-examples-3
Adding three more AsyncIO examples
2021-01-06 16:40:05 -08:00
Lidi Zheng e6dffc6fbe Adding three more AsyncIO examples
* Channelz or Debug
* Route guide
* Wait for ready
2021-01-06 10:52:39 -08:00
Stanley Cheung 436036d68a Upmerge from v1.34.x branch 2021-01-05 11:35:46 -08:00
Esun Kim e0ebe46ad3 Fix python examples 2020-12-23 09:23:32 -08:00
Esun Kim e7afadc255 Refactor examples BUILD files 2020-12-23 09:23:32 -08:00
Esun Kim 69bb5e328e Added CMakeLists for route_guide example 2020-12-22 13:44:35 -08:00
Lidi Zheng c515666a73
Merge pull request #24668 from lidizheng/example-async-bidi
Add async bidi-streaming example
2020-12-21 15:15:16 -08:00
Lidi Zheng f2d06b8458 Add async bidi-streaming example 2020-12-21 14:38:39 -08:00
Lidi Zheng 40a5a655af Polish and add AsyncIO examples
* Add type annotations
* Add test for asyncio auth example
* Use dynamic stubs to allow same code runs manually and under Bazel
* Add grpcio-tools as a Bazel dependency
* asyncio.run is not yet existed in 3.6
* Improve readability
2020-12-08 13:44:43 -08:00
Michael Lumish c3cee0713a Node xDS example: show error on failure, close client when done 2020-11-25 12:48:06 -08:00
Esun Kim 694cd98cf2
Merge pull request #24794 from chalin/patch-1
Examples README: add link to android example and fix link text
2020-11-23 15:34:38 -08:00
Michael Lumish 00ec631f52 Add a Node xDS example client 2020-11-23 12:44:31 -08:00
Michael Lumish 5aaacb538d Add target argument to Node examples 2020-11-23 12:40:32 -08:00
Patrice Chalin 48b24aa6da
Examples README: add link to android example and fix link text
Add a link to the android example and fix the link text (platforms are now served from another page).
2020-11-19 16:58:59 -05:00
Michael Lumish cbdcc5be77 Add target argument to Node examples 2020-11-19 13:57:37 -08:00
Michael Lumish 273e3cfb79 Update Node examples to use @grpc/grpc-js 2020-11-05 11:24:27 -08:00
Esun Kim 27a1c40f73 Reformat source 2020-10-21 15:40:01 -07:00
Richard Belleville de90ff64d5
Merge pull request #24478 from gnossen/runtime_protos_wkt
[gRPC Easy] Make Well-Known Types Available to Runtime Protos
2020-10-20 20:08:14 -07:00
Jan Tattermusch e2a346e466
Merge pull request #24425 from jtattermusch/modernize_helloworld_xamarin
Modernize C# HelloworldXamarin example
2020-10-20 14:14:36 +02:00
Richard Belleville 14d6850f5a And remove it too 2020-10-19 13:09:07 -07:00
Richard Belleville 3dad0eb862 Oops 2020-10-19 13:07:52 -07:00
Richard Belleville 897f97212a Add -x to shell script 2020-10-19 10:51:42 -07:00
Richard Belleville 7821040586 Modernize run_codegen script 2020-10-16 13:58:16 -07:00
Jan Tattermusch 7b694fc85d add copyright headers to Xamarin example 2020-10-16 17:30:36 +02:00
Jan Tattermusch 92eebcd110 modernize HelloworldXamarin example 2020-10-16 17:24:25 +02:00
Esun Kim 86050be0cf Clean up DEPLOYMENT_TARGET 2020-10-08 14:47:56 -07:00
Esun Kim be23ad0ed1
Merge pull request #24282 from veblush/ios-bump
Bump iOS and OSX version
2020-10-07 16:12:16 -07:00
Lidi Zheng 408fc1993b
Merge pull request #24288 from timhughes/timhughes-python-aio-helloworld
Adds python aio helloworld examples
2020-10-06 10:20:10 -07:00
Jan Tattermusch f444177a01
Merge pull request #23252 from tuttieee/fix/hello-world-example-cmake-message
Fix a message indicating the protobuf version CMakeLists.txt
2020-10-06 15:27:53 +02:00
Tim Hughes 80799468bd lint 2020-10-05 21:56:48 +01:00
Tim Hughes 0b3fc20b83 clean up docstrings and remove unused imports 2020-10-05 21:30:57 +01:00
Tim Hughes 7aff6c4555
dont need ThreadPoolExecutor in asyncio 2020-10-04 21:51:05 +01:00
Tim Hughes cef8dbf27c
Adds python aio helloworld examples 2020-10-01 00:05:11 +01:00
Esun Kim ccf3cbc6b7 Bump iOS and OSX version 2020-09-30 14:58:30 -07:00
Esun Kim fc4556a92d Add ABSL_NO_XRAY_ATTRIBUTES 2020-08-28 10:59:36 -07:00
Esun Kim 32ea9af3b0 Bump Android SDK 2020-08-27 19:54:35 -07:00
Esun Kim 10d7e2fef7 Upgrade gradlewrapper to 6.5.1 2020-08-27 14:16:09 -07:00
Jan Tattermusch 57161a7a94 add missing //examples:keyvaluestore_proto target 2020-08-25 10:53:49 +02:00
Richard Belleville aa942b0e82 Fix duplicated generated file 2020-08-25 10:04:25 +02:00
Jan Tattermusch 7e815c1a63
Merge pull request #23879 from jtattermusch/win_example_port_conflict
Change port number in examples to avoid conflict with forbidden port on windows
2020-08-18 19:37:55 +02:00
Jan Tattermusch 2ea043cb59 change port number in examples to avoid conflict with forbidden port on win 2020-08-18 09:31:44 +02:00
Richard Belleville e56fa264b6 Period 2020-08-17 11:37:21 -07:00
Richard Belleville 578c24a5e4 Spruce up no_codegen example 2020-08-17 11:03:32 -07:00