envoyproxy / envoy

Cloud-native high-performance edge/middle/service proxy
https://www.envoyproxy.io
Apache License 2.0
24.28k stars 4.69k forks source link

Regarding use of envoy api along with envoy api dependencies #34841

Open Gaurav0411GitHub opened 2 weeks ago

Gaurav0411GitHub commented 2 weeks ago

Please find here steps of using envoy api and envoy api dependencies

Step1 Download and Compile the envoy git clone --branch v1.30.1 https://github.com/envoyproxy/envoy.git cd envoy; git checkout -b v1.30.1 mkdir -p cmake/build; cd cmake/build bazel --bazelrc=/dev/null build --sandbox_debug --verbose_failures --copt="-DENVOY_IGNORE_GLIBCXX_USE_CXX11_ABI_ERROR=1 -DLLVM_USE_SPLIT_DWARF" --define wasm=disabled --define tcmalloc=disabled --define signal_trace=disabled --config=sizeopt --compilation_mode=fastbuild --copt=-Wno-error=maybe-uninitialized //source/exe:envoy-static.stripped envoy is compiled successfully

Step2 Copied gRPC and protobuf from cache which are downloaded during envoy compilation and Compile gRPC that consists of protobuf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/com_github_grpc_grpc mkdir -p cmake/build/; cd cmake/build/ cmake -DgRPC_INSTALL=ON -DCMAKE_BUILD_TYPE=Release -DgRPC_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=ON ../.. make -j$(nproc) make install protoc compiler and gRPC both are installed successfully

Step3 Coppied the External Dependencies from cache which are downloaded during envoy compilation mkdir -p /home/g2gupta/envoy/api_dependencies copied the below external dependency to /home/g2gupta/envoy/api_dependencies cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/opencensus_proto/ /home/g2gupta/envoy/api_dependencies/opencensus-proto-v0.4.1/src/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/opentelemetry_proto/ /home/g2gupta/envoy/api_dependencies/opentelemetry-proto-v1.1.0/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/com_google_googleapis/ /home/g2gupta/envoy/api_dependencies/googleapis-114a745b2841a044e98cdbb19358ed29fcf4a5f1/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/com_github_cncf_xds/ /home/g2gupta/envoy/api_dependencies/xds-0c46c01016dc5c9aeddf6c745a230c32bf62841d/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/com_envoyproxy_protoc_gen_validate/ /home/g2gupta/envoy/api_dependencies/protoc-gen-validate-v1.0.4/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/prometheus_metrics_model/ /home/g2gupta/envoy/api_dependencies/client_model-v0.6.1/ cp -rf /home/g2gupta/.cache/bazel/_bazel_g2gupta/3878b2e3683646dede43e0cd951f4fcc/external/dev_cel/* /home/g2gupta/envoy/api_dependencies/cel-spec-v0.15.0/ cd /home/g2gupta/envoy/api_dependencies

Step4 Conversion from .proto file to .cc and *.h file

Step5 Conversion from .proto file to .cc and *.h file of envoy api which are located at envoy/api

Step6 When we are compiling envoy api we are getting below error envoy api v2, v2alpha, v3 are still calling descriptor_table_udpa_2fannotations_2fstatus_2eproto but when we have created .cc and .h files we got descriptor_table_protodef_xds_2fxds_2fannotations_2fv3_2fstatus_2eproto because of this mismatch of envoy api and xds we are not able to use upgraded envoy api I have also attached the error.txt

How can we remove this kind of mismatch.

tyxia commented 2 weeks ago

@Gaurav0411GitHub Are you trying to build Envoy here? You can find some instruction here https://www.envoyproxy.io/docs/envoy/v1.30.2/start/building#building

Gaurav0411GitHub commented 1 week ago

Thanks for your reply. I have compiled the envoy successfully in step1. I am not having issue in compiling the envoy. I have to use rocky linux image. I have seen there is no rocky linux image in below path so I have prepared rocky linux image myself and compiled the envoy successfully If you can provide rocky linux image to avoid further mistakes that will be good for both of us https://github.com/envoyproxy/envoy-build-tools/tree/main/docker/linux I am facing error in using envoy api in c++ code so I have specified the above steps. All envoy api and envoy api dependencies belongs to envoy 1.30.1 repository or from cache which envoy is downloading during envoy compilation. It looks like envoy api are calling some functions of envoy dependencies which have been removed by envoy api dependencies. The problem which I am able to figure out that udpa is replaced by xds and xds is upgraded there api but envoy api is still calling old udpa api which needs to be fixed. Can you please provide me work around for this error?
The issue which I am experiencing arises from a mismatch between the expected descriptor_table names in the Envoy API and the actual descriptor_table names generated by the protoc compiler from the xds repository. How can we correct this?

If you think this is not the case, Please share your rocky linux docker image and steps for using envoy api in c++ project.

Gaurav0411GitHub commented 1 week ago

Your response will be appreciable so please try to resolve the query. I am talking about the below link in which we can use data-plane api so I need steps to use data plane api in c++ project. so how can I use data plane api in c++ project? https://blog.envoyproxy.io/the-universal-data-plane-api-d15cec7a

tyxia commented 1 week ago

It seems to related to docs build cc @phlax domain expert here.

Gaurav0411GitHub commented 1 week ago

@tyxia , Can we use data plane api in c++ project with the above given steps? As per my understanding below steps should be followed by envoy team

  1. Docker file for rocky linux should be added in repository.
  2. Data Plane api should be used inside the image created by Docker file created in step1.
  3. Then these steps should be added in envoy documents. Your efforts will be appreciable in resolving the query.
phlax commented 1 week ago

we only support building using the ubuntu build image. The resultant binary should be usable on any distribution with a sufficiently recent glibc.

We dont need or want to support any other build environments on the basis that you can run this container image on any platform that supports Docker.

Gaurav0411GitHub commented 1 week ago

@phlax It's ok if you don't want to support rocky linux. So Can you please go for below 2 steps.

  1. How Data Plane api can be used inside the ubuntu image in c++ project
  2. Then these steps should be added in envoy documents. Your efforts will be appreciable in resolving the query.
phlax commented 1 week ago

as said above we support any linux platform with a sufficiently recent glibc, but we only support building with the official build container as this has all of the necessary host dependencies.

re the other question - this seems to be the same question that has been raised in various other tickets previously - the answers given there are probably better than anything i can post here/now

Gaurav0411GitHub commented 5 days ago

@phlax Thanks for your reply, Actually I am still not having steps of using data plane api in c++ project. that's why I have raised multiple queries. I read below link in which it is mentioned “We can’t promise that we will add every conceivable feature, but we would like to see other systems use these APIs and help us evolve them to meet their needs. It is our view that the commoditization of the data plane will provide tremendous benefit to end users via increasing the speed of iteration and competition in the control plane space which is where the majority of innovation will occur over the coming years.”

https://blog.envoyproxy.io/the-universal-data-plane-api-d15cec7a

Commoditization of data plane api is the reason for not sharing the steps of using data plane api in c++ project?

phlax commented 5 days ago

as explained previously there is not existing documentation for what you are trying to do (at least iiuc). There is go-control-plane which serves as a reference implementation for at least part of what you are trying to do, but not necessarily in the way you want to do it.

You have been given various pointers by myself and others about how to achieve your goals. Beyond that it is up to you to do the research and development to figure it out. Should you succeed, and wish to document the process we would be happy to review any updates to the docs.

Gaurav0411GitHub commented 5 days ago

@phlax this is my understanding there are no direct steps of using data plane api in c++ project from envoy side. I have to do my self. Is this correct? I have shared above steps, Do you think, there is any error?