Difficulties building istio/proxy

Hi,

I’m attempting to build a custom sidecar image, but so far I’ve been unable to build even a stock copy of istio/proxy. I’ve tried the following tags/branches, each errors out, often for differing reasons:

  • 1.5.4
  • release-1.5
  • release-1.6
  • master

I suspect my development environment, which I built from a stock Ubuntu Bionic image, and followed the sequence of dependency installation documented here: https://medium.com/@nadundesilva/building-istio-from-source-on-linux-be860d660aa7

Just to give a taste of my pain, here’s what I’m seeing on master:

root@af8fdf91d4e6:/usr/local/go/src/istio.io/proxy# make
Building with your local toolchain.
export PATH=/usr/lib/llvm-9/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin:/usr/local/llvm/bin:/root/go/bin CC=clang CXX=clang++ && bazel  build  --config=libc++ //...
...
ERROR: /root/.cache/bazel/_bazel_root/7addcad33983dcfc374c6f8f60774bde/external/envoy/source/extensions/filters/http/common/compressor/BUILD:11:1: C++ compilation of rule '@envoy//source/extensions/filters/http/common/compressor:compressor_lib' failed (Exit 1) clang failed: error executing command /usr/local/llvm/bin/clang -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -fcolor-diagnostics -fno-omit-frame-pointer '-stdlib=libc++' -MD -MF ... (remaining 311 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
external/envoy/source/extensions/filters/http/common/compressor/compressor.cc:245:19: error: loop variable 'pair' of type 'const std::__1::pair<absl::string_view, float>' creates a copy from type 'const std::__1::pair<absl::string_view, float>' [-Werror,-Wrange-loop-construct]
  for (const auto pair : pairs) {
                         ^
external/envoy/source/extensions/filters/http/common/compressor/compressor.cc:245:8: note: use reference type 'const std::__1::pair<absl::string_view, float> &' to prevent copying
  for (const auto pair : pairs) {
       ^~~~~~~~~~~~~~~~~
                  &
1 error generated.

Any help getting unstuck would be greatly appreciated.

Thanks,
-Jon

Hi Jon.

I was able to succeed with the following:

  1. editing the istio proxy repo to include the envoy filter I wanted to add.*
  2. Building the repo inside the envoyproxy/envoy docker image.
  3. Copying the resulting envoy binary out, and dropping it into the /usr/local/bin/envoy of the istio proxyv2 image, found at this dockerfile: https://github.com/istio/istio/blob/085e01c8e4dfd165fce77af8df3e56882f69210b/pilot/docker/Dockerfile.proxyv2

To deploy the istio bookinfo app with your custom envoy:

  1. Turn off auto sidecar injection.
  2. Run istioctl kube-inject samples/bookinfo/platform/kube/bookinfo.yaml > out.yaml
  3. Edit out.yaml by replacing every occurrence of docker.io/istio/proxyv2:X.X.X with the name of the image you created in the previous section. Also, replace imagePullPolicy: Always to imagePullPolicy: IfNotPresent throughout the file.
  4. Run kubectl apply -f out.yaml

You should now have your filter running.

* you need to specifically edit the istio-proxy repo because istio has written some custom filters without which istio doesn’t work.

@nrjpoddar do you want to share anything here, based on our earlier conversation?

We have created a build server setup here which we use to build proxy/envoy. Take a look it it helps!