3scale / APIcast

3scale API Gateway
Apache License 2.0
305 stars 169 forks source link

Make prove command failing while enabling support for power(ppc64le) architecture. #1489

Closed Shubhamgupta1010 closed 3 weeks ago

Shubhamgupta1010 commented 2 months ago

issue: Development images is created using the command _make dev-build IMAGENAME=apicasteimg, after doing so make development command is working fine, a runtime container is getting created, and inside the container make dependencies and make busted commands are also working fine. When we try to run make prove command it gives the following error:

bash-4.4# make prove
EXTRA_CFLAGS="-DHAVE_EVP_KDF_CTX=1" /usr/local/openresty/luajit/bin/rover install --roverfile=/opt/app-root/src/gateway/Roverfile > /dev/null
local/bin/carton install --deployment --cached
Installing modules using /opt/app-root/src/gateway/cpanfile (deployment mode)
Complete! Modules were installed into /opt/app-root/src/local
local/bin/carton bundle 2> /dev/null
Bundling modules using /opt/app-root/src/gateway/cpanfile
Complete! Modules were bundled into /opt/app-root/src/vendor/cache
/usr/local/openresty/luajit/bin/rover exec script/prove --verbose -j32 --harness=TAP::Harness
/tmp/U6ZHS4WFm0 at t/http_proxy.pl line 45.
nginx: [warn] conflicting server name "_" on 0.0.0.0:6657, ignored
sh: line 1: 481403 Segmentation fault      openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null
Bailout called.  Further testing stopped:  TEST 14: all_proxy with request_unbuffered policy and chunked body - Cannot start nginx using command "openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null" (status code 35584).
FAILED--Further testing stopped: TEST 14: all_proxy with request_unbuffered policy and chunked body - Cannot start nginx using command "openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null" (status code 35584).
make: *** [Makefile:142: prove] Error 255

Version: v3.15.0

Steps To Reproduce

Current Result

bash-4.4# make prove
EXTRA_CFLAGS="-DHAVE_EVP_KDF_CTX=1" /usr/local/openresty/luajit/bin/rover install --roverfile=/opt/app-root/src/gateway/Roverfile > /dev/null
local/bin/carton install --deployment --cached
Installing modules using /opt/app-root/src/gateway/cpanfile (deployment mode)
Complete! Modules were installed into /opt/app-root/src/local
local/bin/carton bundle 2> /dev/null
Bundling modules using /opt/app-root/src/gateway/cpanfile
Complete! Modules were bundled into /opt/app-root/src/vendor/cache
/usr/local/openresty/luajit/bin/rover exec script/prove --verbose -j32 --harness=TAP::Harness
/tmp/U6ZHS4WFm0 at t/http_proxy.pl line 45.
nginx: [warn] conflicting server name "_" on 0.0.0.0:6657, ignored
sh: line 1: 481403 Segmentation fault      openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null
Bailout called.  Further testing stopped:  TEST 14: all_proxy with request_unbuffered policy and chunked body - Cannot start nginx using command "openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null" (status code 35584).
FAILED--Further testing stopped: TEST 14: all_proxy with request_unbuffered policy and chunked body - Cannot start nginx using command "openresty -p /opt/app-root/src/t/servroot_6657/ -c /opt/app-root/src/t/servroot_6657/conf/nginx.conf > /dev/null" (status code 35584).
make: *** [Makefile:142: prove] Error 255
tkan145 commented 2 months ago

Hi, have you updated the --platform flag when running make dev-build? By default, it will build x86_64 image

dev-build: ## Build development image
   $(DOCKER) build --platform linux/amd64 -t $(IMAGE_NAME) \
      --build-arg OPENRESTY_RPM_VERSION=$(OPENRESTY_RPM_VERSION) \
      --build-arg LUAROCKS_VERSION=$(LUAROCKS_VERSION) \
      $(PROJECT_PATH) -f $(DEVEL_DOCKERFILE)
Shubhamgupta1010 commented 2 months ago

Hi, yes the --platform flag is updated when running make dev-build

dev-build: ## Build development image
        $(DOCKER) build --platform linux/ppc64le -t $(IMAGE_NAME) \
                --build-arg OPENRESTY_RPM_VERSION=$(OPENRESTY_RPM_VERSION) \
                --build-arg LUAROCKS_VERSION=$(LUAROCKS_VERSION) \
                $(PROJECT_PATH) -f $(DEVEL_DOCKERFILE)
tkan145 commented 2 months ago

Hi,

Seems to run ok for me.

diff --git a/Makefile b/Makefile
index 79fa72cd..d32336fd 100644
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,7 @@ dev-build: export OPENRESTY_RPM_VERSION?=1.21.4
 dev-build: export LUAROCKS_VERSION?=2.3.0
 dev-build: IMAGE_NAME ?= apicast-development:latest
 dev-build: ## Build development image
-       $(DOCKER) build --platform linux/amd64 -t $(IMAGE_NAME) \
+       $(DOCKER) build --platform linux/arm64 -t $(IMAGE_NAME) \
                --build-arg OPENRESTY_RPM_VERSION=$(OPENRESTY_RPM_VERSION) \
                --build-arg LUAROCKS_VERSION=$(LUAROCKS_VERSION) \
                $(PROJECT_PATH) -f $(DEVEL_DOCKERFILE)
diff --git a/docker-compose-devel.yml b/docker-compose-devel.yml
index 6e118560..9440da20 100644
--- a/docker-compose-devel.yml
+++ b/docker-compose-devel.yml
@@ -3,7 +3,7 @@ version: '2.2'
 services:
   development:
     image: ${IMAGE:-quay.io/3scale/apicast-ci:openresty-1.21.4-1}
-    platform: "linux/amd64"
+    platform: "linux/arm64"
     depends_on:
       - redis
     working_dir: /opt/app-root/src/

Build new image

▲ make dev-build IMAGE_NAME=dev-build
▲ make development IMAGE=dev-build

bash-4.4$ uname -a
Linux 907e019a107c 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Tue May 21 03:13:04 EDT 2024 aarch64 aarch64 aarch64 GNU/Linux

Run prove test

bash-4.4$ make prove PROVE_FILES=./t/apicast-policy-request-unbuffered.t
EXTRA_CFLAGS="-DHAVE_EVP_KDF_CTX=1" /usr/local/openresty/luajit/bin/rover install --roverfile=/opt/app-root/src/gateway/Roverfile > /dev/null
local/bin/carton install --deployment --cached
Installing modules using /opt/app-root/src/gateway/cpanfile (deployment mode)
Complete! Modules were installed into /opt/app-root/src/local
local/bin/carton bundle 2> /dev/null
Bundling modules using /opt/app-root/src/gateway/cpanfile
Complete! Modules were bundled into /opt/app-root/src/vendor/cache
/usr/local/openresty/luajit/bin/rover exec script/prove --verbose -j16 --harness=TAP::Harness ./t/apicast-policy-request-unbuffered.t
nginx: [warn] conflicting server name "_" on 0.0.0.0:24251, ignored
nginx: [warn] conflicting server name "_" on 0.0.0.0:24251, ignored
nginx: [warn] conflicting server name "_" on 0.0.0.0:24251, ignored
./t/apicast-policy-request-unbuffered.t ..
ok 1 - TEST 3: With big chunked request - status code ok
ok 2 - TEST 3: With big chunked request - response_body - response is expected (repeated req 0, req 0)
ok 3 - TEST 3: With big chunked request - grep_error_log_out (req 0)
ok 4 - TEST 3: With big chunked request - pattern "[error]" does not match a line in error.log (req 0)
ok 5 - TEST 3: With big chunked request - status code ok
ok 6 - TEST 3: With big chunked request - response_body - response is expected (repeated req 1, req 0)
ok 7 - TEST 3: With big chunked request - grep_error_log_out (req 1)
ok 8 - TEST 3: With big chunked request - pattern "[error]" does not match a line in error.log (req 1)
ok 9 - TEST 1: request_unbuffered policy with big file - status code ok
ok 10 - TEST 1: request_unbuffered policy with big file - response_body - response is expected (repeated req 0, req 0)
ok 11 - TEST 1: request_unbuffered policy with big file - grep_error_log_out (req 0)
ok 12 - TEST 1: request_unbuffered policy with big file - pattern "[error]" does not match a line in error.log (req 0)
ok 13 - TEST 1: request_unbuffered policy with big file - status code ok
ok 14 - TEST 1: request_unbuffered policy with big file - response_body - response is expected (repeated req 1, req 0)
ok 15 - TEST 1: request_unbuffered policy with big file - grep_error_log_out (req 1)
ok 16 - TEST 1: request_unbuffered policy with big file - pattern "[error]" does not match a line in error.log (req 1)
ok 17 - TEST 2: with small chunked request - status code ok
ok 18 - TEST 2: with small chunked request - response_body - response is expected (repeated req 0, req 0)
ok 19 - TEST 2: with small chunked request - pattern "[error]" does not match a line in error.log (req 0)
ok 20 - TEST 2: with small chunked request - status code ok
ok 21 - TEST 2: with small chunked request - response_body - response is expected (repeated req 1, req 0)
ok 22 - TEST 2: with small chunked request - pattern "[error]" does not match a line in error.log (req 1)
1..22
ok
All tests successful.
Files=1, Tests=22, 33 wallclock secs ( 0.12 usr  0.00 sys + 30.83 cusr  0.84 csys = 31.79 CPU)
Result: PASS
Success
bash-4.4$