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

Enable DirectPath support for gRPC workflows #482

Closed
dilipped opened this issue Feb 3, 2023 · 3 comments · Fixed by #583
Closed

Enable DirectPath support for gRPC workflows #482

dilipped opened this issue Feb 3, 2023 · 3 comments · Fixed by #583
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@dilipped
Copy link

dilipped commented Feb 3, 2023

Is your feature request related to a problem? Please describe.
The current behavior for grpc does not utilize DirectPath. DirectPath leads to improved latency for request originating from GCE VMs and gcloud storage relies on this feature.

Describe the solution you'd like
Two changes are needed:

  1. Replace:
    return grpc.composite_channel_credentials(ssl_credentials, google_auth_credentials)

    with:
if compute_engine_channel_credentials_requested:
  return grpc.compute_engine_channel_credentials(google_auth_credentials)
else:
  grpc.composite_channel_credentials(ssl_credentials, google_auth_credentials)

where, compute_engine_channel_credentials_requested will be a bool passed to the create_channel call. Alternatively, it can rely on the env variable like it's done for other languages

  1. Add the google-c2p resolver. This can be similar to how other languages e.g. go handles it https://github.com/googleapis/google-api-go-client/blob/8d8f0a70d0bd6ba4daaa08370d1420f759ff7f9d/transport/grpc/dial.go#L182

Describe alternatives you've considered
For #2 above, we can potentially update the GAPIC client generator to create the host name with google-c2p:/// prefixed. But I think given that all other languages are handling it in the middleware, it is appropriate to make this change in this library.

Additional context
There is an internal bug related to this, but I'm not sure if I link it on a public repo.

@dilipped dilipped changed the title Use compute_engine_channel_credentials to utilize DirectPath Enable DirectPath support for gRPC workflows Feb 3, 2023
@daniel-sanche
Copy link
Contributor

+1, this change is also likely needed for the new BigTable library

@atulep atulep added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label Feb 13, 2023
@atulep
Copy link
Contributor

atulep commented Feb 13, 2023

Can you include the link to DirectPath docs ?

@parthea
Copy link
Collaborator

parthea commented Feb 15, 2023

Googlers see go/enable-directpath-grpc-python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants