Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat benchmarks #4615

Draft
wants to merge 22 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add bin script to run benchmarks inside container
  • Loading branch information
abnegate committed Nov 2, 2022
commit 9335563e878822f65efaee7a2fc20b07e75ed208
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 1 addition & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
3 changes: 3 additions & 0 deletions bin/benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

/usr/src/code/vendor/bin/phpbench run --config /usr/src/code/phpbench.json --report appwrite $@
3 changes: 0 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down