Skip to content

Provide an official ARM docker image and/or provide documentation for building on ARM #1861

Closed

Description

@gizmochief7

Would it be possible to get an official Docker image of Envoy on ARM or at least some documentation on how to build it?
My team and I have tried off and on to build Envoy on ARM using the Bazel build process without any luck. Its challenging to say the least. I just saw a PR #1795 by @costinm dated a couple weeks ago based on the issue #1781 that talked about building it on ARM successfully after a few fixes. This is great news but we aren't sure how to duplicate it. @costinm mentioned that he used a custom CMAKE and a pi-cross-compiler to make it work. Documentation on this would be very helpful. Also, if there exist an image I could use for testing, then that would be very helpful too. Thanks again for such an awesome product!

Activity

  1. changed the title [-]Provide an official ARM docker image and/or provide documentation for building on ARM[/-] [+]Provide an official ARM docker image and/or provide documentation for building on ARM label:"help wanted"[/+] on Oct 16, 2017
  2. changed the title [-]Provide an official ARM docker image and/or provide documentation for building on ARM label:"help wanted"[/-] [+]Provide an official ARM docker image and/or provide documentation for building on ARM Label: Help Wanted[/+] on Oct 16, 2017
  3. changed the title [-]Provide an official ARM docker image and/or provide documentation for building on ARM Label: Help Wanted[/-] [+]Provide an official ARM docker image and/or provide documentation for building on ARM [Label: Help Wanted][/+] on Oct 16, 2017
  4. changed the title [-]Provide an official ARM docker image and/or provide documentation for building on ARM [Label: Help Wanted][/-] [+]Provide an official ARM docker image and/or provide documentation for building on ARM[/+] on Oct 16, 2017
  5. vielmetti commented on Nov 20, 2017

    @vielmetti

    @gizmochief7 it's been a little while, have you made progress? It sounds like you're building for 32-bit ARMv7; my particular interest is in arm64 builds.

  6. gizmochief7 commented on Nov 21, 2017

    @gizmochief7
    Author

    @vielmetti It has been and I almost forgot about posting this. We did not have any further luck with this attempt and without any community help we decided to move past Envoy. We tried out another reverse proxy/side car project for micro services and it just worked out of the box on both 32-bit and 64-bit. So we haven't wasted any more time here. Sorry I couldn't be more help.

  7. costinm commented on Nov 21, 2017

    @costinm
    Contributor
  8. rshriram commented on Nov 21, 2017

    @rshriram
    Member

    fwiw, I tried to build bazel on my pi (yes, it took several hours), and then built envoy on pi for armv7l 64bit. While envoy started up and was able to talk to http services, it had difficulty talking to certain https services (esp twitter). There seemed to be some boringssl issue that prevented ssl connections from working. My hunch was that it didn't compile properly. At that point, I gave up, because I had spent 4 solid days fighting bazel on pi.

  9. costinm commented on Nov 21, 2017

    @costinm
    Contributor
  10. costinm commented on Nov 21, 2017

    @costinm
    Contributor
  11. moderation commented on May 16, 2018

    @moderation
    Contributor

    I've secured a Pine64 Rock64 SOC which is ARM8 / aarch64 and has 4GB of RAM. I've successfully
    compiled Bazel 0.13.0. I'm not having any luck compiling Envoy.

    I've leveraged @clnperez way of removing the Lua JIT.

    I can't get her trick to use the locally installed Go to work go_register_toolchains(go_version="host"). When I use this Bazel uses a symbolic link to the installed Go tools (~/Library/go/pkg/tool/linux_arm64) and tries to compile Gazelle and protoc-gen-go and fails because link can't see gcc on $PATH. Installing these tools on the host don't fix the issue. I expect this is something to do with breaking the hermetic seal by using go_version="host".

    I've modified source/extensions/extensions_build_config.bzl to only include a minimum number of extensions.

    I'm using bazel --bazelrc=/dev/null build -s -c opt //source/exe:envoy-static.stripped --define google_grpc=disabled --define signal_trace=disabled --define hot_restart=disabled --verbose_failures as the build command with the following WORKSPACE.

    workspace(name = "envoy")
    
    load("//bazel:repositories.bzl", "envoy_dependencies")
    load("//bazel:cc_configure.bzl", "cc_configure")
    
    envoy_dependencies(
       skip_targets=['luajit']
    )
    cc_configure()
    
    load("@envoy_api//bazel:repositories.bzl", "api_dependencies")
    api_dependencies()
    
    load("@io_bazel_rules_go//go:def.bzl", "go_download_sdk", "go_rules_dependencies", "go_register_toolchains")
    load("@com_lyft_protoc_gen_validate//bazel:go_proto_library.bzl", "go_proto_repositories")
    
    go_proto_repositories(shared=0)
    go_rules_dependencies()
    
    go_download_sdk(name = "go_sdk", sdks = {"linux_arm64":  ("go1.10.2.linux-arm64.tar.gz", "d6af66c71b12d63c754d5bf49c3007dc1c9821eb1a945118bfd5a539a327c4c8"), }, )
    
    go_register_toolchains()
    

    This prevents the build automatically downloading Go for linux_amd64.

    The build then fails with

    ERROR: ~/.cache/bazel/_bazel_moderation/1d277edd85b03195d275adc4870a9bef/external/com_lyft_protoc_gen_validate/validate/BUILD:35:1: no such package '@com_github_golang_protobuf//ptypes/duration': no such package '@io_bazel_rules_go_repository_tools//': no such package '@go_sdk//': Unsupported host linux_amd64 and referenced by '@com_lyft_protoc_gen_validate//validate:go_default_library'
    ERROR: Analysis of target '//source/exe:envoy-static.stripped' failed; build aborted: no such package '@com_github_golang_protobuf//ptypes/duration': no such package '@io_bazel_rules_go_repository_tools//': no such package '@go_sdk//': Unsupported host linux_amd64
    

    My suspicion is that the lyft/protoc-gen-validate is hard coded for linux_amd64 (or considering compilation works on MacOS / Darwin maybe it just doesn't support ARM).

    Any help from Bazel wizards like @jmillikin-stripe or from people that have tried non amd64 compilation like @clnperez @costinm @rshriram would be great.

  12. vielmetti commented on May 16, 2018

    @vielmetti

    Issue noted in https://github.com/lyft/protoc-gen-validate/issues/75 - there are definitely some hard-coded dependencies in lyft/protoc-gen-validate to amd64 binaries.

  13. clnperez commented on May 17, 2018

    @clnperez
    Contributor

    I'll try and help. I don't have much ARM experience but a coworker (@tophj-ibm) does. So we'll try to put our heads together on this one. Any progress we can make would be great. We'd also like to have a ppc64le docker image.

    wonder twins unite?

    My first guess is that something in cc_configure works differently for ARM. I ran into some things where, when using certain flags, gcc would behave differently for power than it did for x86. envoy, for the last release, seems to have come to rely a lot more on how bazel configured the gcc toolchain and did a little less customization. That got rid of almost all the issues I was seeing, but maybe there is some more tweaking needed for ARM.

    For your WORKSPACE file, what's the logic behind including the call to `go_download_sdk'?

  14. 94 remaining items

  15. al45tair commented on Jul 14, 2020

    @al45tair

    @CelsoSantos It's been a while, but IIRC the command I ran back on the 18th of May worked and generated a Docker image (which I uploaded to Docker Hub as al45tair/envoy-arm64). It seems to work.

    @moderation @carmiac It's probably worth getting some time on an ARM64 server machine rather than building on a Pi. Even if you don't have access to one at work (I'm lucky in that regard), you can spin them up in AWS — there are Graviton and Graviton2 instances available, I believe — and they'll build it a lot faster than a Pi will.

  16. moderation commented on Jul 14, 2020

    @moderation
    Contributor

    @al45tair I'm pretty happy with my local RPi4 dev environment. After the initial build the subsequent incremental builds are relatively quick and compiling out all the extensions you don't need works well. I'm in a very small minority of people who don't think Docker helps with anything so I'm building Bazel and Envoy straight on the RPi4

  17. lizan commented on Jul 14, 2020

    @lizan
    Member

    Realistically speaking, how far are we from an arm64 image that could be considered stable?

    I wouldn't be comfortable saying it is stable until it passes most of our test suite on arm64.

  18. vielmetti commented on Jul 15, 2020

    @vielmetti

    A note that Bazel 3.4.0 now ships with official arm64 binaries -

    bazelbuild/bazel#8833 (comment)

    That may save you a build step, @moderation , if you can adapt to any changes associated with the Bazel point release at 3.4.0.

  19. moderation commented on Jul 15, 2020

    @moderation
    Contributor

    Thanks @vielmetti. Looks like they need to work on their automation a bit as the latest release 3.4.1 isn't yet available. But definitely looks promising

  20. added a commit that references this issue on Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions