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

Commit 746385e

Browse files
fabiocicerchiaweb-flow
authored andcommitted
Updated benchmarks + added auto updated repo + added linter (#6)
* Updated benchmarks + added auto updated repo + added linter * linting
1 parent 2e24b3a commit 746385e

File tree

69 files changed

+4186
-371
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+4186
-371
lines changed

.github/linters/.dockerfilelintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
rules:
2+
invalid_command: off

.github/linters/.markdown-lint.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
line-length: false

.github/workflows/auto_update.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Auto Update
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
env:
8+
IMAGE_NAME: fabiocicerchia/nginx-lua
9+
10+
jobs:
11+
auto_update:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Generate Supported Versions
17+
run: ./bin/auto_update.sh

.github/workflows/linter.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
###########################
3+
###########################
4+
## Linter GitHub Actions ##
5+
###########################
6+
###########################
7+
name: Lint Code Base
8+
9+
#
10+
# Documentation:
11+
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
12+
#
13+
14+
#############################
15+
# Start the job on all push #
16+
#############################
17+
on:
18+
push:
19+
branches-ignore:
20+
- 'master'
21+
22+
###############
23+
# Set the Job #
24+
###############
25+
jobs:
26+
build:
27+
# Name the Job
28+
name: Lint Code Base
29+
# Set the agent to run on
30+
runs-on: ubuntu-latest
31+
32+
##################
33+
# Load all steps #
34+
##################
35+
steps:
36+
##########################
37+
# Checkout the code base #
38+
##########################
39+
- name: Checkout Code
40+
uses: actions/checkout@v2
41+
42+
################################
43+
# Run Linter against code base #
44+
################################
45+
- name: Lint Code Base
46+
uses: docker://github/super-linter:v3
47+
env:
48+
VALIDATE_ALL_CODEBASE: true

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docker
1+
name: Docker Builds
22

33
on:
44
push:

.shellcheckrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
disable=SC2086,SC2178,SC1091
2+

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MIT License
1+
# MIT License
22

33
Copyright (c) 2020 Fabio Cicerchia
44

README.md

Lines changed: 138 additions & 277 deletions
Large diffs are not rendered by default.

bin/auto_update.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC2086,SC2178,SC1091,SC2004
3+
4+
./bin/generate_supported_versions.sh | tee supported_versions
5+
./bin/dockerfile-generate.sh
6+
./bin/generate_tags.py | tee docs/TAGS.md
7+
git config --global user.name "fabiocicerchia"
8+
git config --global user.email "[email protected]"
9+
git add -A
10+
git commit -m "Automated updates"
11+
set +x
12+
git remote set-url --push origin "https://fabiocicerchia:${GH_TOKEN}@github.com/fabiocicerchia/nginx-lua.git"
13+
set -x
14+
git push origin HEAD:master

bin/benchmark.sh

100644100755
Lines changed: 141 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,146 @@
11
#!/bin/bash
2+
# shellcheck disable=SC2086,SC2178,SC1091,SC2004
3+
4+
# VM: ubuntu-s-1vcpu-2gb-fra1-01
5+
6+
# SETUP
7+
sudo apt-get update
8+
sudo apt-get install \
9+
apt-transport-https \
10+
ca-certificates \
11+
curl \
12+
gnupg-agent \
13+
software-properties-common
14+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
15+
sudo apt-key fingerprint 0EBFCD88
16+
sudo add-apt-repository \
17+
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
18+
$(lsb_release -cs) \
19+
stable"
20+
sudo apt-get update
21+
sudo apt-get install docker-ce docker-ce-cli containerd.io
22+
sudo curl -L "https://github.com/docker/compose/releases/download/1.26.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
23+
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
24+
sudo apt-get install -y nodejs
25+
26+
# RUN
227
npm install artillery
3-
docker-compose -f docker-compose.test.yml up
28+
docker-compose -f docker-compose.test.yml up -d
29+
430
echo "ARTILLERY - NGINX"
5-
./node_modules/.bin/artillery run test/artillery-nginx.yml
31+
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.1.txt
632
echo "ARTILLERY - NGINX-LUA"
7-
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml
33+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.1.txt
834
echo "ARTILLERY - OPENRESTY"
9-
./node_modules/.bin/artillery run test/artillery-openresty.yml
35+
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.1.txt
36+
37+
echo "ARTILLERY - NGINX"
38+
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.2.txt
39+
echo "ARTILLERY - NGINX-LUA"
40+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.2.txt
41+
echo "ARTILLERY - OPENRESTY"
42+
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.2.txt
43+
44+
echo "ARTILLERY - NGINX"
45+
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.3.txt
46+
echo "ARTILLERY - NGINX-LUA"
47+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.3.txt
48+
echo "ARTILLERY - OPENRESTY"
49+
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.3.txt
50+
51+
echo "ARTILLERY - NGINX"
52+
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.4.txt
53+
echo "ARTILLERY - NGINX-LUA"
54+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.4.txt
55+
echo "ARTILLERY - OPENRESTY"
56+
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.4.txt
57+
58+
echo "ARTILLERY - NGINX"
59+
./node_modules/.bin/artillery run test/artillery-nginx.yml > artillery.nginx.5.txt
60+
echo "ARTILLERY - NGINX-LUA"
61+
./node_modules/.bin/artillery run test/artillery-nginx-lua.yml > artillery.nginx-lua.5.txt
62+
echo "ARTILLERY - OPENRESTY"
63+
./node_modules/.bin/artillery run test/artillery-openresty.yml > artillery.openresty.5.txt
64+
65+
#####
66+
67+
echo "ARTILLERY - ALPINE"
68+
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.1.txt
69+
echo "ARTILLERY - UBUNTU"
70+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.1.txt
71+
echo "ARTILLERY - DEBIAN"
72+
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.1.txt
73+
echo "ARTILLERY - FEDORA"
74+
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.1.txt
75+
echo "ARTILLERY - CENTOS"
76+
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.1.txt
77+
78+
echo "ARTILLERY - ALPINE"
79+
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.2.txt
80+
echo "ARTILLERY - UBUNTU"
81+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.2.txt
82+
echo "ARTILLERY - DEBIAN"
83+
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.2.txt
84+
echo "ARTILLERY - FEDORA"
85+
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.2.txt
86+
echo "ARTILLERY - CENTOS"
87+
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.2.txt
88+
89+
echo "ARTILLERY - ALPINE"
90+
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.3.txt
91+
echo "ARTILLERY - UBUNTU"
92+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.3.txt
93+
echo "ARTILLERY - DEBIAN"
94+
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.3.txt
95+
echo "ARTILLERY - FEDORA"
96+
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.3.txt
97+
echo "ARTILLERY - CENTOS"
98+
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.3.txt
99+
100+
echo "ARTILLERY - ALPINE"
101+
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.4.txt
102+
echo "ARTILLERY - UBUNTU"
103+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.4.txt
104+
echo "ARTILLERY - DEBIAN"
105+
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.4.txt
106+
echo "ARTILLERY - FEDORA"
107+
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.4.txt
108+
echo "ARTILLERY - CENTOS"
109+
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.4.txt
110+
111+
echo "ARTILLERY - ALPINE"
112+
./node_modules/.bin/artillery run test/artillery-alpine.yml > artillery.alpine.5.txt
113+
echo "ARTILLERY - UBUNTU"
114+
./node_modules/.bin/artillery run test/artillery-ubuntu.yml > artillery.ubuntu.5.txt
115+
echo "ARTILLERY - DEBIAN"
116+
./node_modules/.bin/artillery run test/artillery-debian.yml > artillery.debian.5.txt
117+
echo "ARTILLERY - FEDORA"
118+
./node_modules/.bin/artillery run test/artillery-fedora.yml > artillery.fedora.5.txt
119+
echo "ARTILLERY - CENTOS"
120+
./node_modules/.bin/artillery run test/artillery-centos.yml > artillery.centos.5.txt
121+
122+
echo Nginx
123+
TESTS=$(grep -r virtual docs/benchmark/reports/different_images/*nginx.* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
124+
echo "scale=2; (${TESTS%?})/3" | bc
125+
echo Nginx-Lua
126+
TESTS=$(grep -r virtual docs/benchmark/reports/different_images/*nginx-lua* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
127+
echo "scale=2; (${TESTS%?})/3" | bc
128+
echo OpenResty
129+
TESTS=$(grep -r virtual docs/benchmark/reports/different_images/*openresty* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
130+
echo "scale=2; (${TESTS%?})/3" | bc
131+
132+
echo Alpine
133+
TESTS=$(grep -r virtual docs/benchmark/reports/distros/*alpine* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
134+
echo "scale=2; (${TESTS%?})/3" | bc
135+
echo Ubuntu
136+
TESTS=$(grep -r virtual docs/benchmark/reports/distros/*ubuntu* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
137+
echo "scale=2; (${TESTS%?})/3" | bc
138+
echo Debian
139+
TESTS=$(grep -r virtual docs/benchmark/reports/distros/*debian* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
140+
echo "scale=2; (${TESTS%?})/3" | bc
141+
echo Fedora
142+
TESTS=$(grep -r virtual docs/benchmark/reports/distros/*fedora* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
143+
echo "scale=2; (${TESTS%?})/3" | bc
144+
echo Centos
145+
TESTS=$(grep -r virtual docs/benchmark/reports/distros/*centos* -A10 | grep 'median' | sed 's/.*: //' | sort -n | tail -n4 | head -n3 | tr '\n' '+')
146+
echo "scale=2; (${TESTS%?})/3" | bc

0 commit comments

Comments
 (0)