Add bin script to run benchmarks inside container

This commit is contained in:
Jake Barnby
2022-11-02 19:12:26 +13:00
parent 3c9d4b877a
commit 9335563e87
5 changed files with 7 additions and 26 deletions
+1 -1
View File
@@ -44,4 +44,4 @@ jobs:
run: docker compose exec -T appwrite test --debug
- name: Run Benchmark
run: docker run --rm -v $PWD:/app composer benchmark-compare
run: docker compose exec -T appwrite benchmark --ref=baseline
+1 -22
View File
@@ -330,28 +330,7 @@ RUN mkdir -p /storage/uploads && \
chown -Rf www-data.www-data /storage/debug && chmod -Rf 0755 /storage/debug
# Executables
RUN chmod +x /usr/local/bin/doctor && \
chmod +x /usr/local/bin/maintenance && \
chmod +x /usr/local/bin/usage && \
chmod +x /usr/local/bin/install && \
chmod +x /usr/local/bin/migrate && \
chmod +x /usr/local/bin/realtime && \
chmod +x /usr/local/bin/executor && \
chmod +x /usr/local/bin/schedule && \
chmod +x /usr/local/bin/sdks && \
chmod +x /usr/local/bin/specs && \
chmod +x /usr/local/bin/ssl && \
chmod +x /usr/local/bin/test && \
chmod +x /usr/local/bin/vars && \
chmod +x /usr/local/bin/worker-audits && \
chmod +x /usr/local/bin/worker-certificates && \
chmod +x /usr/local/bin/worker-databases && \
chmod +x /usr/local/bin/worker-deletes && \
chmod +x /usr/local/bin/worker-functions && \
chmod +x /usr/local/bin/worker-builds && \
chmod +x /usr/local/bin/worker-mails && \
chmod +x /usr/local/bin/worker-messaging && \
chmod +x /usr/local/bin/worker-webhooks
RUN chmod +x /usr/local/bin/*
# Letsencrypt Permissions
RUN mkdir -p /etc/letsencrypt/live/ && chmod -Rf 755 /etc/letsencrypt/live/
Executable
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/env sh
/usr/src/code/vendor/bin/phpbench run --config /usr/src/code/phpbench.json --report appwrite $@
-3
View File
@@ -15,17 +15,14 @@
"format": "vendor/bin/phpcbf",
"benchmark": [
"Composer\\Config::disableProcessTimeout",
"git config --global --add safe.directory /app",
"vendor/bin/phpbench run --report=appwrite"
],
"benchmark-tag": [
"Composer\\Config::disableProcessTimeout",
"git config --global --add safe.directory /app",
"vendor/bin/phpbench run --report=appwrite --tag=baseline"
],
"benchmark-compare": [
"Composer\\Config::disableProcessTimeout",
"git config --global --add safe.directory /app",
"vendor/bin/phpbench run --report=appwrite --ref=baseline"
]
},
+2
View File
@@ -78,6 +78,8 @@ services:
- appwrite-certificates:/storage/certificates:rw
- appwrite-functions:/storage/functions:rw
- ./phpunit.xml:/usr/src/code/phpunit.xml
- ./phpbench.json:/usr/src/code/phpbench.json
- ./.phpbench:/usr/src/code/.phpbench
- ./tests:/usr/src/code/tests
- ./app:/usr/src/code/app
- ./docs:/usr/src/code/docs