Skip to content

Protobuf indirection mapping header#1236

Merged
htuch merged 8 commits intoenvoyproxy:masterfrom
htuch:pb-macros
Jul 11, 2017
Merged

Protobuf indirection mapping header#1236
htuch merged 8 commits intoenvoyproxy:masterfrom
htuch:pb-macros

Conversation

@htuch
Copy link
Copy Markdown
Member

@htuch htuch commented Jul 10, 2017

Needed for Google import, we have multiple implementations of protobuf internally and need to be able to remap to the appropriate one.

Needed for Google import. This is only part way implemented, looking for
early feedback before committing to this approach. Thanks!
@htuch
Copy link
Copy Markdown
Member Author

htuch commented Jul 10, 2017

@mattklein123
Copy link
Copy Markdown
Member

Fine with me if fine for other G folks.

Copy link
Copy Markdown
Contributor

@fengli79 fengli79 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM to the WIP in general.
Can we tests to check:

  1. No #include for protobuf headers out of common/protobuf folder.
  2. No ::google::protobuf out of common/protobuf folder.


#include "common/protobuf/descriptor.h"

#include "google/protobuf/descriptor.h"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the rest are not done yet as it's WiP - I'll be cleaning up all these refs, thanks.

@@ -62,19 +63,17 @@ class JsonTranscoderConfig : public Logger::Loggable<Logger::Id::config> {
google::protobuf::io::ZeroCopyInputStream& request_input,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf::Io::ZeroCopyInputStream

google::protobuf::util::Status
methodToRequestInfo(const google::protobuf::MethodDescriptor* method,
google::grpc::transcoding::RequestInfo* info);
google::protobuf::util::Status methodToRequestInfo(const Protobuf::MethodDescriptor* method,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf::Util::Status

google::grpc::transcoding::RequestInfo* info);

private:
google::protobuf::DescriptorPool descriptor_pool_;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf::DescriptorPool


void RpcChannelImpl::CallMethod(const ::google::protobuf::MethodDescriptor* method,
void RpcChannelImpl::CallMethod(const Protobuf::MethodDescriptor* method,
::google::protobuf::RpcController*,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protobuf::RpcController

void RpcChannelImpl::CallMethod(const Protobuf::MethodDescriptor* method,
::google::protobuf::RpcController*,
const ::google::protobuf::Message* grpc_request,
::google::protobuf::Message* grpc_response,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

// ::google::protobuf::RpcChannel
void CallMethod(const ::google::protobuf::MethodDescriptor* method,
void CallMethod(const Protobuf::MethodDescriptor* method,
::google::protobuf::RpcController* controller,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

void CallMethod(const ::google::protobuf::MethodDescriptor* method,
void CallMethod(const Protobuf::MethodDescriptor* method,
::google::protobuf::RpcController* controller,
const ::google::protobuf::Message* grpc_request,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

void CallMethod(const Protobuf::MethodDescriptor* method,
::google::protobuf::RpcController* controller,
const ::google::protobuf::Message* grpc_request,
::google::protobuf::Message* grpc_response,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Http::AsyncClient::Request* http_request_{};
const ::google::protobuf::MethodDescriptor* grpc_method_{};
const Protobuf::MethodDescriptor* grpc_method_{};
::google::protobuf::Message* grpc_response_{};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@htuch
Copy link
Copy Markdown
Member Author

htuch commented Jul 11, 2017

@fengli79 Good idea on automated validation on dependencies. I'll add a check_format step to grep for these.

@htuch htuch changed the title WiP: protobuf abstraction library. Protobuf indirection mapping header Jul 11, 2017
@htuch
Copy link
Copy Markdown
Member Author

htuch commented Jul 11, 2017

@mattklein123 @dnoe @lizan @fengli79 This is now ready, PTAL.

Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, 2 small comments, also needs master merge FYI

@@ -0,0 +1,33 @@
#pragma once
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get some comment/explanation in this file of why we have this?

SUFFIXES = (".cc", ".h", "BUILD")

# Files in these paths can make reference to protobuf stuff directly
GOOGLE_PROTOBUF_WHITELIST = ('./ci/prebuilt', './source/common/protobuf')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small ask: This is going to cause issues for us in our import. Would it be possible to do this as a regex somehow where it will match an arbitrary prefix? Or allow the prefix to be passed as a new CLI option?

namespace Envoy {

namespace Protobuf = google::protobuf;
namespace ProtobufWkt = google::protobuf;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's a Wkt?


typedef std::string String;

inline const String ToString(const std::string& s) { return s; }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the backstory so I understand why this exist but it's pretty weird looking without this context. I'm assuming as written here that it is effectively a no-op with optimizations on.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is my assumption, today it's not used for anything on the performance critical path either.


# To avoid breaking the Lyft import, we just check for path inclusion here.
def whitelistedForProtobufDeps(file_path):
return len([prefix in file_path for prefix in GOOGLE_PROTOBUF_WHITELIST]) > 0
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: s/prefix/path_segment

Right? (Just making sure I'm reading this correctly).

@htuch htuch merged commit a4d7888 into envoyproxy:master Jul 11, 2017
@htuch htuch deleted the pb-macros branch July 11, 2017 21:44
rshriram pushed a commit to rshriram/envoy that referenced this pull request Oct 30, 2018
Automatic merge from submit-queue.

Remove pessimizing move.
jpsim pushed a commit that referenced this pull request Nov 28, 2022
Description: this PR fixes the android release job and caches the release artifacts to prevent double unnecessary compute time.
Risk Level: med - confirm working with release tag.
Testing: testing done in #1236. However, we will need to cut a release to verify final correctness

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
Description: this PR fixes the android release job and caches the release artifacts to prevent double unnecessary compute time.
Risk Level: med - confirm working with release tag.
Testing: testing done in #1236. However, we will need to cut a release to verify final correctness

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
mathetake pushed a commit that referenced this pull request Mar 3, 2026
**Description**

This consolidates the extproc admin server from two separate ports
(metricsPort and healthPort) into a single adminPort (default 1064)
serving both /metrics and /health endpoints. The `aigw run` and the new
`aigw healthcheck` commands now take --admin-port flags, propagating
this to extproc.

Previously, extproc exposed metrics on port 1064 and health checks on
port 1065. Now both are served from a single HTTP server on port 1064,
simplifying configuration and Docker HEALTHCHECK setup.

The Docker HEALTHCHECK is now functional, using the new healthcheck
subcommand which polls the admin server's /health endpoint. This /health
endpoint proxies to the extproc gRPC health check, returning HTTP 200
when SERVING. A new subcommand (`aigw healthcheck`) was needed as the
image is distroless (has no curl etc).

When aigw run starts Envoy, it polls for readiness using either the
Envoy admin address (when configured in EnvoyProxy bootstrap) or by
checking if the Gateway listener port accepts TCP connections. This
ensures startup completes reliably with minimal Gateway configurations.

Gateway validation now requires at least one listener to be configured.

---------

Signed-off-by: Adrian Cole <adrian@tetrate.io>
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.

4 participants