openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mham...@apache.org
Subject [incubator-openwhisk-apigateway] branch master updated: Integrate upstream Aarch64 changes (#332)
Date Thu, 07 Mar 2019 16:39:18 GMT
This is an automated email from the ASF dual-hosted git repository.

mhamann pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-apigateway.git


The following commit(s) were added to refs/heads/master by this push:
     new 00c4c7c  Integrate upstream Aarch64 changes (#332)
00c4c7c is described below

commit 00c4c7cb5125cf72799c184e0ff538abd9830ea2
Author: Jonathan Springer <jonpspri@gmail.com>
AuthorDate: Thu Mar 7 11:39:13 2019 -0500

    Integrate upstream Aarch64 changes (#332)
    
    * Integrate upstream Aarch64 changes
    
    * Update Makefile to support parameterized builds.
---
 Dockerfile | 36 +++++++++++++++++++++++++++---------
 Makefile   | 25 +++++++++++++++++--------
 2 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index b87b0dd..47dd8e1 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -24,6 +24,9 @@
 
 FROM alpine:3.9
 
+# Busybox's ash shell supports pipefail, which is useful for tarballs
+SHELL [ "/bin/ash", "-o", "pipefail", "-c"]
+
 # install dependencies
 RUN apk update && \
     apk add \
@@ -86,18 +89,33 @@ RUN  echo " ... adding Openresty, NGINX and PCRE" \
      && tar -zxf ./openresty-${OPENRESTY_VERSION}.tar.gz \
      && tar -zxf ./pcre-${PCRE_VERSION}.tar.gz \
      && cd /tmp/api-gateway/openresty-${OPENRESTY_VERSION} \
-
-     && if [ x`uname -m` = xs390x ]; then \
+     && case "$(uname -m)" in \
+        aarch64) \
+          luajitdir="" \
+          pcrejit="--with-pcre-jit" \
+          ; echo " ... Patching ngx_lua and LuaJIT modules for ARM64 ... " \
+          && rm -rf ./bundle/ngx_lua-* \
+          && curl -k -L https://github.com/openresty/lua-nginx-module/archive/v0.10.14rc3.tar.gz
\
+            | tar -zxf - -C ./bundle \
+          && mv ./bundle/lua-nginx-module-0.10.14rc3 ./bundle/ngx_lua-0.10.14rc3
\
+          && rm -rf ./bundle/LuaJIT-* \
+          && curl -k -L https://github.com/openresty/luajit2/archive/v2.1-20181029.tar.gz
\
+            | tar -zxf - -C ./bundle \
+          && mv ./bundle/luajit2-2.1-20181029 ./bundle/LuaJIT-2.2.1-20181029 \
+          ;; \
+        s390x) \
           luajitdir="=/usr/local/" \
-	  pcrejit="" \
-        ; elif [ x`uname -m` = xppc64le ]; then \
+          pcrejit="" \
+          ;; \
+        ppc64le) \
           luajitdir="=/usr/local/" \
           pcrejit="--with-pcre-jit" \
-        ; else \
-	  luajitdir="" \
-	  pcrejit="--with-pcre-jit" \
-	; fi \
-
+          ;; \
+        *) \
+          luajitdir="" \
+          pcrejit="--with-pcre-jit" \
+          ;; \
+      esac \
      && echo "        - building debugging version of the api-gateway ... " \
      && ./configure \
             --prefix=${_exec_prefix}/api-gateway \
diff --git a/Makefile b/Makefile
index d4eee3b..7da0c67 100644
--- a/Makefile
+++ b/Makefile
@@ -15,15 +15,24 @@
 # limitations under the License.
 #
 
-DOCKER_TAG ?= snapshot-`date +'%Y%m%d-%H%M'`
-DOCKER_REGISTRY ?= ''
+#
+#  TODO:  Use 'latest'; override with "latest-$(uname -m)" for multiarch
+#
+#DOCKER_TAG ?= snapshot-`date +'%Y%m%d-%H%M'`
+
+OPENWHISK_TARGET_REGISTRY ?= docker.io
+OPENWHISK_TARGET_PREFIX ?= openwhisk
+OPENWHISK_TARGET_TAG ?= latest
+
+RUNTIME := ${OPENWHISK_TARGET_REGISTRY}/${OPENWHISK_TARGET_PREFIX}/apigateway:${OPENWHISK_TARGET_TAG}
+PROFILING := ${OPENWHISK_TARGET_REGISTRY}/${OPENWHISK_TARGET_PREFIX}/apigateway-profiling:${OPENWHISK_TARGET_TAG}
 
 docker:
-	docker build -t openwhisk/apigateway .
+	docker build -t ${RUNTIME} .
 
 .PHONY: docker-ssh
 docker-ssh:
-	docker run -ti --entrypoint='bash' openwhisk/apigateway:latest
+	docker run -ti --entrypoint='bash' ${RUNTIME}
 
 .PHONY: test-build
 test-build:
@@ -32,7 +41,7 @@ test-build:
 .PHONY: profile-build
 profile-build:
 	./build_profiling.sh
-	docker build -t openwhisk/apigateway-profiling -f Dockerfile.profiling .
+	docker build -t ${PROFILING} -f Dockerfile.profiling .
 
 .PHONY: profile-run
 profile-run: profile-build
@@ -47,7 +56,7 @@ profile-run: profile-build
 		-e CACHE_SIZE=2048 \
 		-e CACHE_TTL=180 \
 		-e OPTIMIZE=1 \
-		-d openwhisk/apigateway-profiling:latest
+		-d ${PROFILING}
 
 .PHONY: test-run
 test-run:
@@ -64,7 +73,7 @@ docker-run:
 		-e TOKEN_GITHUB_URL=https://api.github.com/user \
 		-e APPID_PKURL=https://appid-oauth.ng.bluemix.net/oauth/v3/ \
 		-e LD_LIBRARY_PATH=/usr/local/lib \
-		openwhisk/apigateway:latest
+		${TARGET}
 
 .PHONY: docker-debug
 docker-debug:
@@ -76,7 +85,7 @@ docker-debug:
 			-p 80:80 -p 5000:5000 \
 			-e "LOG_LEVEL=info" -e "DEBUG=true" \
 			-v ${HOME}/tmp/apiplatform/apigateway/:/etc/api-gateway \
-			openwhisk/apigateway:latest ${DOCKER_ARGS}
+			${TARGET}
 
 .PHONY: docker-reload
 docker-reload:


Mime
View raw message