Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experimental gRPC transport plugin #16534

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

finnegancarroll
Copy link
Contributor

@finnegancarroll finnegancarroll commented Oct 31, 2024

Description

Auxiliary transports

Provides a framework for implementing pluggable auxiliary transports through NetworkPlugin.
Auxiliary transports run in parallel to existing http & native transport servers.
None or many Auxiliary transports may be provided and can be configured with the following settings:

aux.transport.types enables all listed transports which are installed.
aux.transport.<type>.ports configures the port range for the specified transport.

In the absence of aux.transport.<type>.ports the auxiliary transport falls back to a default port range (9400-9500).
If aux.transport.types is set and the corresponding transport plugin is not installed an exception is thrown.

transport-grpc plugin

A gRPC server plugin is implemented as an initial auxiliary transport.
This gRPC server includes only default list and Health/Check services.

To enable the gRPC plugin include the following in run.gradle.

setting 'aux.transport.types', '[experimental-transport-grpc]'
setting 'aux.transport.experimental-transport-grpc.ports', '9400-9500' //optional

Then run OpenSearch with the plugin installed.

./gradlew run -PinstalledPlugins="['transport-grpc']"

grpcurl commands for querying default services.

grpcurl -plaintext localhost:9400 list
grpcurl -plaintext localhost:9400 grpc.health.v1.Health/Check

Related Issues

RFCs detailing generation of protobuf files from api-specification - 1 2.

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link
Contributor

❌ Gradle check result for b5fddb1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 24a40ad: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@finnegancarroll finnegancarroll mentioned this pull request Nov 4, 2024
1 task
Copy link
Contributor

github-actions bot commented Nov 7, 2024

❌ Gradle check result for 3bcd5bb: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Nov 7, 2024

❌ Gradle check result for b2a1078: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

github-actions bot commented Nov 8, 2024

❌ Gradle check result for ee85066: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for eda1c04: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 5038cf3: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 1e5d354: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 00d4eb1: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 6151622: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for b8d88d2: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for b404cee: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 41e70eb: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for e985043: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for bbabecd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 853b206: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for da16c66: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@finnegancarroll finnegancarroll changed the base branch from main to feature/grpc November 23, 2024 00:17
@finnegancarroll finnegancarroll marked this pull request as ready for review November 23, 2024 00:24
Copy link
Contributor

❌ Gradle check result for 9c24e1d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 9c24e1d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

❌ Gradle check result for 9c24e1d: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

The transport-grpc plugin starts a gRPC server which is injected into the Node as a lifecycle component
and gated behind an experimental feature flag. This server runs on a configurable port range in parallel to the transport-http server which still hosts the familiar REST API. Only two initial services are registered to the server, 'list' and 'Health/Check'.

Add initial housekeeping for the new plugin and its dependencies:
- Add boilerplate netty transport security policy to plugin
- Populate plugins/transport-grpc/licenses with new gRPC dependency licenses & hashes
- Initial server start/stop unit test
- Initial integ test case example
- Guava removed as a forbidden dependecy
- Bump project wide gRPC version 1.68.0 -> 1.68.2
- Update discovery-gce/repository-gcs grpc sha1 to accommodate version bump
- Add socket permissions for gRPC server in Security.java

Signed-off-by: Finn Carroll <[email protected]>
Signed-off-by: Finn Carroll <[email protected]>
Auxiliary transports are optional lifecycle components provided by
network plugins which run in parallel to the http server/native
transport. They are distinct from the existing NetworkPlugin
interfaces of 'getTransports' and 'getHttpTransports' as auxiliary
transports are optional. Multiple auxiliary transports can be provided
by installed plugins but only one may be selected with setting
'aux_transport.type'.

Signed-off-by: Finn Carroll <[email protected]>
Signed-off-by: Finn Carroll <[email protected]>
The motivation of this change is to allow for multiple configured
auxiliary transports. As such newAuxTransports() now returns a list
of enabled transports and each AuxTransport implements it's own
'aux.transport.type' and 'aux.transport.<type>.ports' setting. Since
Security.java initializes previous to Node.java during bootstrap
socket binding permissions are granted based on
'aux.transport.<type>.ports' for each enabled 'aux.transport.type',
falling back to a default if no ports are specified.

Signed-off-by: Finn Carroll <[email protected]>
getAuxServerTransportSupplierList -> getAuxServerTransportList
aux.transport.type -> aux.transport.types

Signed-off-by: Finn Carroll <[email protected]>
Copy link
Contributor

❌ Gradle check result for 5887ad9: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

Copy link
Contributor

✅ Gradle check result for c0b7f27: SUCCESS

Copy link

codecov bot commented Dec 26, 2024

Codecov Report

Attention: Patch coverage is 58.10811% with 62 lines in your changes missing coverage. Please review.

Project coverage is 72.28%. Comparing base (54ae54a) to head (c0b7f27).

Files with missing lines Patch % Lines
...arch/transport/grpc/Netty4GrpcServerTransport.java 73.40% 18 Missing and 7 partials ⚠️
...c/main/java/org/opensearch/bootstrap/Security.java 0.00% 12 Missing ⚠️
...a/org/opensearch/common/network/NetworkModule.java 25.00% 10 Missing and 2 partials ⚠️
...in/java/org/opensearch/transport/TcpTransport.java 37.50% 4 Missing and 1 partial ⚠️
...java/org/opensearch/transport/grpc/GrpcPlugin.java 0.00% 4 Missing ⚠️
...g/opensearch/http/AbstractHttpServerTransport.java 20.00% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #16534      +/-   ##
============================================
+ Coverage     72.20%   72.28%   +0.08%     
- Complexity    65191    65303     +112     
============================================
  Files          5297     5299       +2     
  Lines        303328   303448     +120     
  Branches      43913    43920       +7     
============================================
+ Hits         219026   219357     +331     
+ Misses        66331    66099     -232     
- Partials      17971    17992      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@finnegancarroll finnegancarroll marked this pull request as ready for review December 26, 2024 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants