Skip to content
This repository was archived by the owner on Jan 11, 2025. It is now read-only.

Commit 2e24b3a

Browse files
fabiocicerchiaweb-flow
authored andcommitted
added extended version (#5)
* improved readme * improved labels * added smoke tests for nginx + changed STOPSIGNAL + minor improvements * added extended version with extra lua modules: headers-more-nginx-module, lua-nginx-module, lua-resty-cookie, lua-resty-core, lua-resty-dns, lua-resty-lrucache, lua-resty-memcached, lua-resty-mysql, lua-resty-redis, lua-resty-shell, lua-resty-upstream-healthcheck, lua-resty-websocket, nginx-lua-prometheus, stream-lua-nginx-module * fixed logos * refactoring + benchmarks
2 parents dba463d + 12eb564 commit 2e24b3a

28 files changed

+4794
-796
lines changed

README.md

Lines changed: 260 additions & 37 deletions
Large diffs are not rendered by default.

bin/benchmark.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
npm install artillery
3+
docker-compose -f docker-compose.test.yml up
4+
echo "ARTILLERY - NGINX"
5+
./node_modules/.bin/artillery run test/artillery-nginx.yml
6+
echo "ARTILLERY - NGINX-LUA"
7+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml
8+
echo "ARTILLERY - OPENRESTY"
9+
./node_modules/.bin/artillery run test/artillery-openresty.yml

bin/test.sh

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function test() {
99

1010
FOUND=$(docker image ls -q fabiocicerchia/nginx-lua:$DOCKER_TAG | wc -l)
1111
if [ $FOUND -ne 0 ]; then
12-
docker run -d --name nginx_lua_test -p 8080:80 -v $PWD/test/nginx.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:$DOCKER_TAG
12+
docker run -d --name nginx_lua_test -p 8080:80 -v $PWD/test/nginx-lua.conf:/etc/nginx/nginx.conf fabiocicerchia/nginx-lua:$DOCKER_TAG
1313
COUNT=0
1414
until [ $COUNT -eq 20 -o "$(curl --output /dev/null --silent --head --fail http://localhost:8080; echo $?)" == "0" ]; do
1515
echo -n '.'; sleep 0.5;
@@ -20,6 +20,7 @@ function test() {
2020
docker rm -f nginx_lua_test
2121
else
2222
echo "Image not found: fabiocicerchia/nginx-lua:$DOCKER_TAG"
23+
exit 1
2324
fi
2425
}
2526

@@ -29,29 +30,31 @@ function runtest() {
2930
OS_VER=$3
3031
VER_TAGS=$4
3132
OS_TAGS=$5
33+
DEFAULT=$6
3234

3335
MAJOR=$(echo $NGINX_VER | cut -d '.' -f 1)
3436
MINOR=$MAJOR.$(echo $NGINX_VER | cut -d '.' -f 2)
3537
PATCH=$NGINX_VER
3638

3739
test $PATCH-$OS$OS_VER
40+
test $MINOR-$OS$OS_VER
41+
test $MAJOR-$OS$OS_VER
3842

39-
if [ "$VER_TAGS$OS_TAGS" == "11" ]; then
43+
if [ "$VER_TAGS$OS_TAGS$DEFAULT" == "111" ]; then
4044
test $MAJOR
41-
test $MAJOR-$OS
42-
test $MAJOR-$OS$OS_VER
4345
test $MINOR
4446
test $PATCH
47+
test latest
48+
fi
49+
50+
if [ "$VER_TAGS$OS_TAGS" == "11" ]; then
51+
test $MAJOR-$OS
52+
test $MAJOR-$OS$OS_VER
4553
fi
4654

4755
if [ "$OS_TAGS" == "1" ]; then
4856
test $MINOR-$OS
4957
test $PATCH-$OS
50-
test $MINOR-$OS$OS_VER
51-
fi
52-
53-
if [ "$VER_TAGS$OS_TAGS" == "11" ]; then
54-
test latest
5558
fi
5659

5760
}
@@ -68,6 +71,8 @@ elif [ "$OS" == "fedora" ]; then VERSIONS=$FEDORA
6871
elif [ "$OS" == "ubuntu" ]; then VERSIONS=$UBUNTU
6972
fi
7073

74+
docker images
75+
7176
NLEN=${#NGINX[@]}
7277
for (( I=0; I<$NLEN; I++ )); do
7378
NGINX_VER="${NGINX[$I]}"

docker-compose.test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: '3.7'
2+
services:
3+
nginx-lua:
4+
image: fabiocicerchia/nginx-lua:latest
5+
ports:
6+
- 8080:80
7+
volumes:
8+
- ./test/nginx-lua.conf:/etc/nginx/nginx.conf
9+
nginx:
10+
image: nginx:latest
11+
ports:
12+
- 8081:80
13+
volumes:
14+
- ./test/nginx-non-lua.conf:/etc/nginx/nginx.conf
15+
openresty:
16+
image: openresty/openresty:latest
17+
ports:
18+
- 8082:80
19+
volumes:
20+
- ./test/nginx-lua.conf:/etc/nginx/nginx.conf

0 commit comments

Comments
 (0)