Commit Graph

574 Commits

Author SHA1 Message Date
Craig Tiller b0cf42d86e [clang-format] Remove requirement that port_platform.h is at the top (#36281)
Closes #36281

PiperOrigin-RevId: 623176865
2024-04-09 08:58:34 -07:00
AJ Heller f238e5399c [security] Reland: Refactor credentials types to remove special handling for insecure creds (#36242)
See #36176. The only difference is a temporary shim for Secure credentials types, which was already discussed and approved separately.

Closes #36242

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36242 from drfloob:reland/36176 f07bebe289
PiperOrigin-RevId: 621879911
2024-04-04 09:20:02 -07:00
AJ Heller da43a61322 Automated rollback of commit 822311c0d9.
PiperOrigin-RevId: 621025232
2024-04-01 19:51:52 -07:00
AJ Heller 822311c0d9 [security] Refactor credentials types to remove special handling for insecure creds (#36176)
Forked from #35957

This PR refactors the credentials types to remove Secure and Insecure Channel and Call credentials types. We standardize on a `c_creds()` accessor method for all credentials types, which can now be treated uniformly. This notably removes special-case handling of insecure credentials.

The special code-paths for insecure creds are no longer necessary in the wake of #25586.

Closes #36176

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/36176 from drfloob:fork/35957/creds-API fd64d59c23
PiperOrigin-RevId: 621008166
2024-04-01 18:12:59 -07:00
Alexander Polcyn 1abd28eb3b Log c++ interop "soak" results at INFO instead of DEBUG
PiperOrigin-RevId: 620955008
2024-04-01 14:34:25 -07:00
Mark D. Roth 17d9e20ff1 [slice] use absl base64 APIs instead of slice base64 APIs (#35851)
Closes #35851

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35851 from markdroth:base64 6caf83d3da
PiperOrigin-RevId: 606759013
2024-02-13 15:05:50 -08:00
Yash Tibrewal 2999332d64 [CSM] De-experimentalize CsmObservability API (#35836)
Closes #35836

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35836 from yashykt:DeexperimentalizeCsmObs 1711e6d9b0
PiperOrigin-RevId: 605650394
2024-02-09 09:28:18 -08:00
Yash Tibrewal 387c894117 [CSM] Remove experimental CSM PluginOption API in favor of CsmObservability API (#35812)
Also update interop tests to use `CsmObservability` API

Closes #35812

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35812 from yashykt:UpdateCsmInterop dc99764aea
PiperOrigin-RevId: 604726881
2024-02-06 12:20:23 -08:00
Mark D. Roth 148f59c15a [reorg] move LB policy code to src/core/load_balancing (#35786)
This new directory combines code from the following locations:
- src/core/ext/filters/client_channel/lb_policy
- src/core/lib/load_balancing

Closes #35786

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35786 from markdroth:client_channel_resolver_reorg 98554efb98
PiperOrigin-RevId: 604351832
2024-02-05 10:05:35 -08:00
Stanley Cheung 48961e8a2c [PSM Interop] Add a payload to xds interop client when sending RPCs (#35545)
When testing CSM Observability, we discovered that the c++ xds interop client is not sending any payload with the `UnaryCall` RPCs so most of the metrics will have a value of 0.

Adding a payload to the xds interop client here.

We need this fix so that we can verify that the metrics are recording the right number of bytes being sent / received. So we need a non-trivial payload to be sent with the `UnaryCall` RPC between the xds interop client and server.

Closes #35545

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35545 from stanley-cheung:xds-client-payload 11be4e6f4f
PiperOrigin-RevId: 601596246
2024-01-25 16:12:45 -08:00
Yash Tibrewal 76c45b98d1 [otel] Return absl::Status as a return from BuildAndRegisterGlobal (#35659)
Just to be future-proof, I'm amending the `void` return status of `BuildAndRegisterGlobal` in `OpenTelemetryPluginBuilder` to absl::Status.

This will be backported to 1.61 as well.

Closes #35659

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35659 from yashykt:UpdateOtelApiToAddStatus 07d3f41b8a
PiperOrigin-RevId: 601458408
2024-01-25 08:40:16 -08:00
Yash Tibrewal 984daf98d7 [CSM o11y] Re-experimentalize CSM OTel Plugin Option (#35660)
We are no longer sure about this API, so re-experimentalizing it.

This PR will be backported to 1.61 as well.

Closes #35660

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35660 from yashykt:ReexperimentalizeCsmPluginOption 4f114a54d9
PiperOrigin-RevId: 601378856
2024-01-25 01:57:24 -08:00
Yash Tibrewal 4cea5d0cba [xDS Interop] Use XdsServerBuilder when testing CSM Observability (#35634)
[prod:grpc/core/master/linux/grpc_xds_k8s_lb](https://fusion2.corp.google.com/ci/kokoro/prod:grpc%2Fcore%2Fmaster%2Flinux%2Fgrpc_xds_k8s_lb/activity/6c2577f0-965b-4f22-ac2a-5454a0f77444/log)

Closes #35634

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35634 from yashykt:CsmInteropTrial a8213cd10a
PiperOrigin-RevId: 601010836
2024-01-23 22:33:57 -08:00
Yash Tibrewal acc1ad1b2b [CSM] De-experimentalize CSM OTel Plugin Option (#35526)
Closes #35526

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35526 from yashykt:DeexperimentalizeCsmPluginOption 441eccb857
PiperOrigin-RevId: 597675383
2024-01-11 15:55:26 -08:00
Yash Tibrewal d2cc24f189 [OTel] De-experimentalize API (#35509)
Closes #35509

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35509 from yashykt:DeeexperimentalizeOTelPlugin f5edf94f2c
PiperOrigin-RevId: 597613307
2024-01-11 11:44:57 -08:00
Yash Tibrewal 6741e2064d [xds interop] Use new CSM Observability APIs (#35508)
Closes #35508

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35508 from yashykt:XdsInteropNewCsm 09d408c082
PiperOrigin-RevId: 597588033
2024-01-11 10:15:04 -08:00
Eugene Ostroukhov e73b76a7da [Test] Fix bug in waiting for the Orca OOB report (#35467)
Make sure there is no unnecessary delays when there are multiple reports in the queue.

This change also adds a test for the custom LB policy.

Closes #35467

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35467 from eugeneo:tasks/orca-test-timeout-316026521 4aab50a118
PiperOrigin-RevId: 597007131
2024-01-09 12:21:45 -08:00
Yash Tibrewal 5888738c5a [OTel] Add a PluginOption API (#35434)
Closes #35434

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35434 from yashykt:OTelPluginOption 1db870bed4
PiperOrigin-RevId: 596966190
2024-01-09 18:28:43 +00:00
Yash Tibrewal c12a5645f7 [OTel] Experimental API for metrics (#35348)
Provide a public experimental API and bazel compatible build target for OpenTelemetry metrics.

Details -
* New `OpenTelemetryPluginBuilder` class that provides the API specified in https://github.com/grpc/proposal/blob/master/A66-otel-stats.md
* The existing `grpc::internal::OpenTelemetryPluginBuilder` class is moved to `grpc::internal::OpenTelemetryPluginBuilderImpl` for disambiguation.
* Renamed `OTel` in some instances to `OpenTelemetry` for consistency.

Closes #35348

COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35348 from yashykt:OTelPublicApi e32328825e
PiperOrigin-RevId: 594271246
2023-12-28 09:45:29 -08:00
Mark D. Roth 3e785d395d [RefCounted and friends] Fix type safety of ref-counted types.
Previously, `RefCountedPtr<>` and `WeakRefCountedPtr<>` incorrectly allowed
implicit casting of any type to any other type.  This hadn't caused a
problem until recently, but now that it has, we need to fix it.  I have
fixed this by changing these smart pointer types to allow type
conversions only when the type used is convertible to the type of the
smart pointer.  This means that if `Subclass` inherits from `Base`, then
we can set a `RefCountedPtr<BaseClass>` to a value of type
`RefCountedPtr<Subclass>`, but we cannot do the reverse.

We had been (ab)using this bug to make it more convenient to deal with
down-casting in subclasses of ref-counted types.  For example, because
`Resolver` inherits from `InternallyRefCounted<Resolver>`, calling
`Ref()` on a subclass of `Resolver` will return `RefCountedPtr<Resolver>`
rather than returning the subclass's type.  The ability to implicitly
convert to the subclass type made this a bit easier to deal with.  Now
that that ability is gone, we need a different way of dealing with that
problem.

I considered several ways of dealing with this, but none of them are
quite as ergonomic as I would ideally like.  For now, I've settled on
requiring callers to explicitly down-cast as needed, although I have
provided some utility functions to make this slightly easier:

- `RefCounted<>`, `InternallyRefCounted<>`, and `DualRefCounted<>` all
  provide a templated `RefAsSubclass<>()` method that will return a new
  ref as a subclass.  The type used with `RefAsSubclass()` must be a
  subclass of the type passed to `RefCounted<>`, `InternallyRefCounted<>`,
  or `DualRefCounted<>`.
- In addition, `DualRefCounted<>` provides a templated `WeakRefAsSubclass<T>()`
  method.  This is the same as `RefAsSubclass()`, except that it returns
  a weak ref instead of a strong ref.
- In `RefCountedPtr<>`, I have added a new `Ref()` method that takes
  debug tracing parameters.  This can be used instead of calling `Ref()`
  on the underlying object in cases where the caller already has a
  `RefCountedPtr<>` and is calling `Ref()` only to specify the debug
  tracing parameters.  Using this method on `RefCountedPtr<>` is more
  ergonomic, because the smart pointer is already using the right
  subclass, so no down-casting is needed.
- In `WeakRefCountedPtr<>`, I have added a new `WeakRef()` method that
  takes debug tracing parameters.  This is the same as the new `Ref()`
  method on `RefCountedPtr<>`.
- In both `RefCountedPtr<>` and `WeakRefCountedPtr<>`, I have added a
  templated `TakeAsSubclass<>()` method that takes the ref out of the
  smart pointer and returns a new smart pointer of the down-casted type.
  Just as with the `RefAsSubclass()` method above, the type used with
  `TakeAsSubclass()` must be a subclass of the type passed to
  `RefCountedPtr<>` or `WeakRefCountedPtr<>`.

Note that I have *not* provided an `AsSubclass<>()` variant of the
`RefIfNonZero()` methods.  Those methods are used relatively rarely, so
it's not as important for them to be quite so ergonomic.  Callers of
these methods that need to down-cast can use
`RefIfNonZero().TakeAsSubclass<>()`.

PiperOrigin-RevId: 592327447
2023-12-19 13:27:56 -08:00
gRPC Team Bot 667def7505 Internal change
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/35043 from gtcooke94:deprecate_old_crl_apis 003057a93c
PiperOrigin-RevId: 585744149
2023-11-27 21:41:47 +00:00
Stanley Cheung ff2c0313e3
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34866)
Roll forward of #34832, 3rd attempt. Will run a grpc import cherry-pick
to make sure the next import is going to be clean.
2023-11-02 14:59:16 -07:00
Stanley Cheung 9303b86010
Revert "[PSM Interop] Add flag to enable CSM Observability in c++ image" (#34858)
Reverts grpc/grpc#34840
2023-11-02 10:42:07 -07:00
Stanley Cheung a62c2607a6
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34840)
Roll forward of #34832 (reverted in #34837).

Need #34836 to be  merged first.
2023-11-01 18:52:57 -07:00
Vignesh Babu c4b9a9a8fc
Revert "[PSM Interop] Add flag to enable CSM Observability in c++ image" (#34837)
Reverts grpc/grpc#34832. Broke import
2023-10-31 18:27:29 -07:00
Stanley Cheung 433cfa99a5
[PSM Interop] Add flag to enable CSM Observability in c++ image (#34832)
Add the flag `enable_csm_observability` to the c++ PSM interop testing
image, such that when enabled from the PSM interop testing framework,
the C++ client/server app will enable the CSM Observability plugin.
2023-10-31 14:42:51 -07:00
Yijie Ma bae0c705aa
[Deps] Update to Clang-16 (#34492)
<!--

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-10-11 16:26:32 -07:00
Mark D. Roth 7a06614f95
[resolver and LB policy APIs] reland: change address list to support multiple addresses per endpoint (#34531)
Re-land #33567, which was reverted in #34527.

First commit is a pure revert, second commit is a small fix needed to
avoid breaking internal callers.
2023-09-28 15:40:05 -07:00
Mark D. Roth 41f26de3b6
Revert "[resolver and LB policy APIs] change address list to support multiple addresses per endpoint" (#34527)
Reverts grpc/grpc#33567 due to import problems.
2023-09-28 12:15:35 -07:00
Mark D. Roth fd2e8c9462
[resolver and LB policy APIs] change address list to support multiple addresses per endpoint (#33567)
More changes as part of the dualstack design:
- Change resolver and LB policy APIs to support multiple addresses per
endpoint. Specifically, replace `ServerAddress` with
`EndpointAddresses`, which encodes more than one address. Per-address
channel args are retained at the same level, so they are now
per-endpoint. For now, `EndpointAddress` provides a single-address ctor
and a single-address accessor for backward compatibility, so
`ServerAdress` is an alias for `EndpointAddresses`; eventually, this
alias and the single-address methods will be removed.
- Add an `EndpointAddressSet` class, which represents an unordered set
of addresses to be used as a map key. This will be used in a number of
LB policies that need to store per-endpoint state.
- Change the LB policy API's `ChannelControlHelper::CreateSubchannel()`
method to take the address and per-endpoint channel args as separate
parameters, so that we don't need to construct a legacy `ServerAddress`
object as we create a new subchannel for each address in the endpoint.
- Change pick_first to flatten the address list.
- Change ring_hash to use `EndpointAddressSet` as the key for its
endpoint map, and to use the first address of the endpoint as the hash
key.
- Change WRR to use `EndpointAddressSet` as the key for its endpoint
weight map.

Note that support for multiple addresses per endpoint is guarded in RR
by the existing `round_robin_delegate_to_pick_fist` experiment and in
WRR by the existing `wrr_delegate_to_pick_first` experiment.

This PR does *not* include support for multiple addresses per endpoint
for the outlier_detection or xds_override_host LB policies; those will
come in subsequent PRs.
2023-09-28 09:32:36 -07:00
Eugene Ostroukhov 98ac00d7d2
[interop test] Fix the test (#34424) 2023-09-20 11:53:08 -07:00
Eugene Ostroukhov 490f6a3ee9
[test interop] Add HookService to the maintenence server (#34413)
This pull request adds another hook service on the maintenance server.
This will enable clients to gradually migrate from the standalone hook
server.

Changes:
1. Hook service can now be used separately.
2. Copied latest protos and updated the hook service to new API.
3. Added the hook service to the maintenance server.
2023-09-19 18:06:31 -07:00
Stanley Cheung fc159a6901
[Observability Testing] register prometheus exporter (#34380)
Working towards testing against CSM Observability. Added ability to
register a prometheus exporter with our Opentelemetry plugin. This will
allow our metrics to be available at the standard prometheus port
`:9464`.
2023-09-19 16:54:58 -07:00
Eugene Ostroukhov 73c5da6f02
[PSM Interop] Synchronize messages.proto (#34182) 2023-08-28 12:45:10 -07:00
Eugene Ostroukhov 88df0a1c71
[PSM Interop] Return trailing metadata. (#34096)
1. Trailing metadata is now reported.
2. messages.proto was synchronized.
3. Corrected order of arguments in EXPECT_EQ so the output makes sense now.
2023-08-25 14:02:23 -07:00
Eugene Ostroukhov a6689e6444
[PSM Interop] Maintain RPC behaviors order (#34164)
Fixes comment
https://github.com/grpc/grpc/pull/32810#discussion_r1304953101
2023-08-24 17:03:38 -07:00
Eugene Ostroukhov 7efc7d2806
[PSM Interop] Reapply hook server and fix race condition (#34132)
1. Revert parts of 440eef2288 that
reverted 16b67ae312
2. Fix race conditions in the test case that caused TSAN failures.
2023-08-24 10:50:45 -07:00
Eugene Ostroukhov 440eef2288
[Import] Revert #34027 and #34129 (#34133)
This reverts commit 16b67ae312.
2023-08-22 15:55:59 -07:00
Eugene Ostroukhov 16b67ae312
[PSM Interop] Add "hook service" (#34027) 2023-08-21 16:23:38 -07:00
Eugene Ostroukhov 89209debad
[PSM Interop] Extend headers matching. (#34082)
1. Headers will now be matched ignoring the case.
2. "*" can now be set to return all metadata values.
2023-08-16 16:47:11 -07:00
Eugene Ostroukhov 44de3ab221
[PSM Interop] Restore "Report per-RPC metadata if requested. (#33939)" (#34037) 2023-08-10 13:01:47 -07:00
Mohan Li 66f60aa763
[test] Allow set request/response size in interop soak test (#34010)
Internal bug: b/289109827
2023-08-10 09:34:27 -07:00
Eugene Ostroukhov fc9a1ccaed
[PSM Interop] Revert "Report per-RPC metadata if requested. (#33939)" (#34028)
This reverts commit 6fadb994ef.
2023-08-09 16:23:12 -07:00
Eugene Ostroukhov 6fadb994ef
[PSM Interop] Report per-RPC metadata if requested. (#33939) 2023-08-09 14:16:12 -07:00
Eugene Ostroukhov 18be986e3b
[XDS Interop] Move XdsStatsWatcher to a separate file. (#34000)
This will help with introducing test coverage as the logic becomes more
complex.
2023-08-07 19:26:30 -07:00
Eugene Ostroukhov fc4736c1ad
[interop] Fix crash in pick_first LB policy (#33519)
Fixes http://b/288420022
2023-06-22 16:29:15 -07:00
Eugene Ostroukhov d55431995c
[interop] Implement "hostname" for RPC behavior (#33446)
This enables outlier detection test. See #33135
2023-06-16 11:14:01 -07:00
Mark D. Roth d20e8d141b
[LB policies] add delegating helper classes (#33445)
This eliminates the need to modify every parent policy whenever we add
new helper methods. It should also eliminate some binary bloat.
2023-06-15 08:08:47 -07:00
Eugene Ostroukhov 0980076bb9
[interop] fix C++ server to add mutex for orca_oob test (#33278)
Following improvements were made to `orca_oob` interop test to increase
compatibility and stability:

1. Timeout was increased to 10s (see #33098)
2. Server will block clients trying to run this test concurrently.
3. Data is cleared in the beginning of the call.
2023-05-31 20:07:51 -07:00
AJ Heller 252ebad341
[infra] Fix absl::Mutex check and remove all uses (#33144)
`tools/run_tests/sanity/check_absl_mutex.sh` was broken, a missing paren
crashed the script if run locally. It's unclear yet how our sanity
checks were not complaining about this, `run_tests.py` does not save the
log.
2023-05-16 12:50:52 -07:00