apache / openwhisk-apigateway

Apache OpenWhisk API Gateway service for exposing actions as REST interfaces.
https://openwhisk.apache.org/
Apache License 2.0
64 stars 45 forks source link

Multi-architecture build of API Gateway. #285

Closed jonpspri closed 5 years ago

jonpspri commented 6 years ago

This ended up a lot more massive that I’d intended, but we’ll start with the big one and figure out what works and what doesn’t to get from Point A to Point B.

This adds mechanisms to the API Gateway build process to build the API Gateway architecture images on multiple supported architectures. For the moment, those are amd64/x86_64, s390x and ppc64le. We intend to support arm64 eventually, but there is a deep bug in the OpenRESTy use of LuaJIT that needs to be addressed first.

At the high level, the changes are:

  1. Directory restructuring to isolate the common elements between the regular and profiling builds. This include the ‘/etc/api-gateway’ directory, a configuration file, and a build script(s) directory.
  2. Breaking the primary build script out into a separate script (rather than Dockerfile code) to ease maintenance and be more forgiving of backslashes, semicolons, double-ampersands and all that jazz. I’d like to add other build stages to this script, but want feedback ack and ideally some assistance.
  3. Adding/coding the gradle framework needed to build the multi-architecture mainifrest in the same fashion as the various OpenWhisk runtimes.
  4. Breaking the profiling image out into its own directory and dockerfile. Reusing the build script(s) as possible. The goal is to have only architecture-dependent stuff in the Dockerfiles; the builds should all happen in the various build scripts. Also, should look at where Environment variable are defined.
  5. Tinkering with the Makefile to use the gradle builds when appropriate. (n.b. I’d like to put all of the make actions into Gradle and do away with the Makefile, but time is pressing and I don’t know what other scripts use the Makefile).

I think this pull request can be broken down into some subsidiary requests, but I’d appreciate some agreement on the endgame. @csantanapr @mhamann, your high-level thoughts, please? Thanks!

csantanapr commented 6 years ago

Approach looks sound

vielmetti commented 6 years ago

We intend to support arm64 eventually, but there is a deep bug in the OpenRESTy use of LuaJIT that needs to be addressed first.

The particular issue regarding LuaJIT on OpenRESTy on arm64 is detailed at https://github.com/openresty/lua-nginx-module/issues/1152 - it has to do with the "lightuserdata" function in LuaJIT.

jonpspri commented 6 years ago

@vielmetti - The good news is that I met with the guys from CloudFlare while I was at Think 2018 and they intend to apply some of their resources to resolving that issue. I expect it'll be taken care of in another couple months.

vielmetti commented 6 years ago

That is good news, @jonpspri .