Commit Graph

162 Commits

Author SHA1 Message Date
Esun Kim 2bb6db765b
[Build] Backport-1.55: Removed gRPC_PROTOBUF_PACKAGE_TYPE, supporting config only (#33018)
Backport of https://github.com/grpc/grpc/pull/32988
2023-05-04 15:16:00 -07:00
Jan Tattermusch 0f1afec5a8
[protobuf] Upgrade third_party/protobuf to 22.x (#32606)
The very non-trivial upgrade of third_party/protobuf to 22.x
This PR strives to be as small as possible and many changes that were
compatible with protobuf 21.x and didn't have to be merged atomically
with the upgrade were already merged.
Due to the complexity of the upgrade, this PR wasn't created
automatically by a tool, but manually. Subsequent upgraded of
third_party/protobuf with our OSS release script should work again once
this change is merged.

This is best reviewed commit-by-commit, I tried to group changes in
logical areas.

Notable changes:
- the upgrade of third_party/protobuf submodule, the bazel protobuf
dependency itself
- upgrade of UPB dependency to 22.x (in the past, we used to always
upgrade upb to "main", but upb now has release branch as well). UPB
needs to be upgraded atomically with protobuf since there's a de-facto
circular dependency (new protobuf depends on new upb, which depends on
new protobuf for codegen).
- some protobuf and upb bazel rules are now aliases, so `
extract_metadata_from_bazel_xml.py` and `gen_upb_api_from_bazel_xml.py`
had to be modified to be able to follow aliases and reach the actual
aliased targets.
- some protobuf public headers were renamed, so especially
`src/compiler` needed to be updated to use the new headers.
- protobuf and upb now both depend on utf8_range project, so since we
bundle upb with grpc in some languages, we now have to bundle utf8_range
as well (hence changes in build for python, PHP, objC, cmake etc).
- protoc now depends on absl and utf8_range (previously protobuf had
absl dependency, but not for the codegen part), so python's
make_grpcio_tools.py required partial rewrite to be able to handle those
dependencies in the grpcio_tools build.
- many updates and fixes required for C++ distribtests (currently they
all pass, but we'll probably need to follow up, make protobuf's and
grpc's handling of dependencies more aligned and revisit the
distribtests)
- bunch of other changes mostly due to overhaul of protobuf's and upb's
internal build layout.

TODOs:
- [DONE] make sure IWYU and clang_tidy_code pass
- create a list of followups (e.g. work to reenable the few tests I had
to disable and to remove workaround I had to use)
- [DONE in cl/523706129] figure out problem(s) with internal import

---------

Co-authored-by: Craig Tiller <ctiller@google.com>
2023-04-12 18:43:58 +02:00
Yash Tibrewal bdd1ac4d1d
[GcpObservability C++] De-experimentalize API (#32715)
This PR aims to de-experimentalize the APIs for GCP Observability. 

We would have ideally wanted public feedback before declaring the APIs
stable, but we need stable APIs for GA.

Changes made after API review with @markdroth @veblush, @ctiller and the
entire Core/C++ team -
* The old experimental APIs `grpc::experimental::GcpObservabilityInit`
and `grpc::experimental::GcpObservabilityClose` are now deprecated and
will be deleted after v.1.55 release.
* The new API gets rid of the Close method and follows the RAII idiom
with a single `grpc::GcpObservability::Init()` call that returns an
`GcpObservability` object, the lifetime of which controls when
observability data is flushed.
* The `GcpObservability` class could in the future add more methods. For
example, a debug method that shows the current configuration.
* Document that GcpObservability initialization and flushing (on
`GcpObservability` destruction) are blocking calls.
* Document that gRPC is still usable if GcpObservability initialization
failed. (Added a test to prove the same).
* Since we don't have a good way to flush stats and tracing with
OpenCensus, the examples required users to sleep for 25 seconds. This
sleep is now part of `GcpObservability` destruction.

Additional Implementation details -
* `GcpObservability::Init` is now marked with `GRPC_MUST_USE_RESULT` to
make sure that the results are used. We ideally want users to store it,
but this is better than nothing.
* Added a note on GCP Observability lifetime guarantees.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-04-05 21:45:21 +00:00
Yash Tibrewal f4280fb262
GCP Observability: Fix instructions for README (#32730)
<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-03-27 21:33:28 -07:00
Yash Tibrewal 1293ee8286
Gcp Observability: Add example (#32710)
Adds a simple hello-world example for GCP Observability purposes along
with a README.
The microservices observability user guide is not yet up, but this still
refers to it anyway.

<!--

If you know who should review your pull request, please assign it to
that
person, otherwise the pull request would get assigned randomly.

If your pull request is for a specific language, please add the
appropriate
lang label.

-->
2023-03-27 12:59:45 -07:00
Jan Tattermusch 3fde13929b
Switch to protobuf's /CMakeLists.txt instead of /cmake/CMakeLists.txt (#32678)
Try to react to https://github.com/protocolbuffers/protobuf/issues/12263
and https://github.com/protocolbuffers/protobuf/pull/12295

Protobuf's /cmake/CMakeLists.txt is now deprecated if favor of
/CMakeLists.txt


58ecf38aa5/cmake/CMakeLists.txt (L3)

In this PR:
- Adjust `cmake/protobuf.cmake` to use the right CMakeLists.txt
- adjust the C++ distribtests accordingly
2023-03-22 09:14:04 -07:00
Eugene Ostroukhov d43e35738a
Examples: unify command line flags (#32456)
1. All greeter servers now support flag `--port` to customize the listen
port.
2. All client implementation now have `--target` flag to specify the
server location.
3. ABSL is used to parse the flags to reduce the amount of boilerplate
code in the examples.

Fixes: #26989
2023-02-27 10:39:21 -08:00
Esun Kim b64d623f24
CMake's better handling c++14 requirement (#31916)
* Bumped the cmake version version to 3.8

* Switch to target_compile_features for cxx_std_14

* Regen
2023-01-27 09:51:31 -08:00
Ilya Lukin 06faf44d0b
Fix missed override specifier (#31489) 2023-01-06 18:07:04 -08:00
Andres Beltran 2904ee8fd3
Add support for systemd socket activation (#31667)
* Revert "Revert "Add support for systemd socket activation (#30485)" (#31617)"

This reverts commit 867dc6cae2.

* Add checks to unix tests

* Ran generate_projects.sh and fixed styling in test

* Fix variable in unit test

* Use reinterpret_cast in test

* Rebase and fix sanity failures
2023-01-05 14:53:33 -08:00
Esun Kim 5fb4c2364d
Clean-up pkgconfig (#31660)
* Clean-up pkgconfig

* Removed run_distrib_test_cmake_module_install_pkgconfig.sh

* Proper re2

* Clean up pkgconfig.sh test script
2022-11-22 10:51:17 -08:00
Craig Tiller 867dc6cae2
Revert "Add support for systemd socket activation (#30485)" (#31617)
This reverts commit a638c407bb.
2022-11-10 16:24:30 -08:00
Andres Beltran a638c407bb
Add support for systemd socket activation (#30485)
* Add socket-activated functionality

* Fix GRPC_ERROR_NONE in tcp_server_posix_test and sanity checks

* Fix epoll1 error, sanity checks

* Use AF_INET6 in tcp_server_posix_test

Co-authored-by: Vignesh Babu <vigneshbabu@google.com>
2022-11-10 11:05:14 -08:00
Mark D. Roth 447a058837
xDS: remove deprecated C++ APIs in the experimental namespace (#31451) 2022-10-26 14:53:57 -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
Esun Kim 03e9ac6f1f
Requiring C++14 (#29589) 2022-05-12 21:17:32 -07: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
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
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
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
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
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
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
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
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
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
Esun Kim 86050be0cf Clean up DEPLOYMENT_TARGET 2020-10-08 14:47:56 -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
Donna Dionne 8dd0cb4712 Add support for xDS regex matchers. 2020-07-07 13:17:25 -07:00
Esun Kim 165ee5007a Replaced grpc::string with std::string 2020-06-29 17:56:36 -07:00
tuttieee a61e02b90f Fix a message indicating the protobuf version in cpp hello_world example's CMakeLists.txt 2020-06-22 10:41:54 +09:00
Patrice Chalin 5ac3aa789f Docs: fix links to grpc.io tutorial pages 2020-06-16 08:47:24 -04:00
Patrice Chalin 4c4933e056 Docs: fix links to quick start pages 2020-06-16 08:40:59 -04:00
Tariq Ramlall 74a207509a
Merged master 2020-05-06 15:32:33 -04:00
Jan Tattermusch beee4cefa3
Merge pull request #22636 from chalin/patch-4
C++ Hello World: refer reader to Quick Start
2020-04-15 09:24:08 +02:00
Jan Tattermusch c923f95294
Merge pull request #22633 from chalin/patch-1
Removing obsolete C++ tutorial content
2020-04-14 10:23:52 +02:00
Patrice Chalin c95c2102c6
Delete cpptutorial.md 2020-04-13 15:04:23 -04:00
Patrice Chalin a3714f5b08
C++ Hello World: refer reader to Quick Start 2020-04-09 17:20:48 -04:00
Patrice Chalin 33082023e9
C++ examples README cleanup
Contributes to https://github.com/grpc/grpc.io/issues/180.

cc @ejona86 @jtattermusch @srini100
2020-04-09 17:00:33 -04:00
Patrice Chalin ebe94949ca
Removing obsolete C++ tutorial content
Contributes to https://github.com/grpc/grpc.io/issues/180
2020-04-09 16:22:37 -04:00
Muxi Yan a7995e4c4d Use a more compressable client message 2020-03-30 14:00:21 -07:00
Donna Dionne 48fa247304 Building C++ example with grpc++ instead of grpc++_unsecure
The example should be build with grpc++, not grpc++_unsecure.

For some reason in some branches like master, both versions are built in
so problem not detected.  This problem surfaced in 1.28x so needs to be
fixed to link with the correct grpc++.
2020-03-18 09:49:26 -07:00
Donna Dionne ca8ba90292 Adding Proto Reflection and Health Check to basic C++ example server
And ensuring the example can be built and ran via
bazel, make, and cmake.
2020-03-05 12:47:14 -08:00