-
-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: run stress test on selfhost runner
- Loading branch information
Showing
7 changed files
with
264 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: AppFlowy-Cloud Stress Test | ||
|
||
on: [ pull_request, push ] | ||
|
||
concurrency: | ||
group: stress-test-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: false | ||
|
||
env: | ||
POSTGRES_HOST: localhost | ||
REDIS_HOST: localhost | ||
MINIO_HOST: localhost | ||
GOTRUE_HOST: localhost | ||
SQLX_OFFLINE: true | ||
RUST_TOOLCHAIN: "1.78" | ||
|
||
jobs: | ||
test: | ||
name: Collab Stress Tests | ||
runs-on: self-hosted-appflowy3 | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Copy and Rename deploy.env to .env | ||
run: cp deploy.env .env | ||
|
||
- name: Replace Values in .env | ||
run: | | ||
sed -i '' 's|RUST_LOG=.*|RUST_LOG=debug|' .env | ||
shell: bash | ||
|
||
- name: Start Docker Compose Services | ||
run: | | ||
docker compose -f docker-compose-stress-test.yml up -d | ||
docker ps -a | ||
- name: Install Prerequisites | ||
run: | | ||
brew install protobuf | ||
- name: Run Server and Test | ||
run: | | ||
cargo run --package xtask -- --stress-test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
services: | ||
nginx: | ||
restart: on-failure | ||
image: nginx | ||
ports: | ||
- 80:80 # Disable this if you are using TLS | ||
- 443:443 | ||
volumes: | ||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf | ||
- ./nginx/ssl/certificate.crt:/etc/nginx/ssl/certificate.crt | ||
- ./nginx/ssl/private_key.key:/etc/nginx/ssl/private_key.key | ||
minio: | ||
restart: on-failure | ||
image: minio/minio | ||
ports: | ||
- 9000:9000 | ||
- 9001:9001 | ||
environment: | ||
- MINIO_BROWSER_REDIRECT_URL=http://localhost:9001 | ||
command: server /data --console-address ":9001" | ||
|
||
postgres: | ||
restart: on-failure | ||
image: pgvector/pgvector:pg16 | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER:-postgres} | ||
- POSTGRES_DB=${POSTGRES_DB:-postgres} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} | ||
- POSTGRES_HOST=${POSTGRES_HOST:-postgres} | ||
- SUPABASE_USER=${SUPABASE_USER:-supabase_auth_admin} | ||
- SUPABASE_PASSWORD=${SUPABASE_PASSWORD:-root} | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- ./migrations/before:/docker-entrypoint-initdb.d | ||
# comment out the following line if you want to persist data when restarting docker | ||
#- postgres_data:/var/lib/postgresql/data | ||
|
||
redis: | ||
restart: on-failure | ||
image: redis | ||
ports: | ||
- 6379:6379 | ||
|
||
gotrue: | ||
restart: on-failure | ||
image: supabase/gotrue:v2.159.1 | ||
depends_on: | ||
- postgres | ||
environment: | ||
# Gotrue config: https://github.com/supabase/gotrue/blob/master/example.env | ||
- GOTRUE_SITE_URL=appflowy-flutter:// # redirected to AppFlowy application | ||
- URI_ALLOW_LIST=* # adjust restrict if necessary | ||
- GOTRUE_JWT_SECRET=${GOTRUE_JWT_SECRET} # authentication secret | ||
- GOTRUE_JWT_EXP=${GOTRUE_JWT_EXP} | ||
- GOTRUE_DB_DRIVER=postgres | ||
- API_EXTERNAL_URL=${API_EXTERNAL_URL} | ||
- DATABASE_URL=${GOTRUE_DATABASE_URL} | ||
- PORT=9999 | ||
- GOTRUE_MAILER_URLPATHS_CONFIRMATION=/verify | ||
- GOTRUE_SMTP_HOST=${GOTRUE_SMTP_HOST} # e.g. smtp.gmail.com | ||
- GOTRUE_SMTP_PORT=${GOTRUE_SMTP_PORT} # e.g. 465 | ||
- GOTRUE_SMTP_USER=${GOTRUE_SMTP_USER} # email sender, e.g. noreply@appflowy.io | ||
- GOTRUE_SMTP_PASS=${GOTRUE_SMTP_PASS} # email password | ||
- GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. internal@appflowy.io | ||
- GOTRUE_SMTP_MAX_FREQUENCY=${GOTRUE_SMTP_MAX_FREQUENCY:-1ns} # set to 1ns for running tests | ||
- GOTRUE_RATE_LIMIT_EMAIL_SENT=${GOTRUE_RATE_LIMIT_EMAIL_SENT:-100} # number of email sendable per minute | ||
- GOTRUE_MAILER_AUTOCONFIRM=${GOTRUE_MAILER_AUTOCONFIRM:-false} # change this to true to skip email confirmation | ||
# Google OAuth config | ||
- GOTRUE_EXTERNAL_GOOGLE_ENABLED=${GOTRUE_EXTERNAL_GOOGLE_ENABLED} | ||
- GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID=${GOTRUE_EXTERNAL_GOOGLE_CLIENT_ID} | ||
- GOTRUE_EXTERNAL_GOOGLE_SECRET=${GOTRUE_EXTERNAL_GOOGLE_SECRET} | ||
- GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI=${GOTRUE_EXTERNAL_GOOGLE_REDIRECT_URI} | ||
# Apple OAuth config | ||
- GOTRUE_EXTERNAL_APPLE_ENABLED=${GOTRUE_EXTERNAL_APPLE_ENABLED} | ||
- GOTRUE_EXTERNAL_APPLE_CLIENT_ID=${GOTRUE_EXTERNAL_APPLE_CLIENT_ID} | ||
- GOTRUE_EXTERNAL_APPLE_SECRET=${GOTRUE_EXTERNAL_APPLE_SECRET} | ||
- GOTRUE_EXTERNAL_APPLE_REDIRECT_URI=${GOTRUE_EXTERNAL_APPLE_REDIRECT_URI} | ||
# GITHUB OAuth config | ||
- GOTRUE_EXTERNAL_GITHUB_ENABLED=${GOTRUE_EXTERNAL_GITHUB_ENABLED} | ||
- GOTRUE_EXTERNAL_GITHUB_CLIENT_ID=${GOTRUE_EXTERNAL_GITHUB_CLIENT_ID} | ||
- GOTRUE_EXTERNAL_GITHUB_SECRET=${GOTRUE_EXTERNAL_GITHUB_SECRET} | ||
- GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI=${GOTRUE_EXTERNAL_GITHUB_REDIRECT_URI} | ||
# Discord OAuth config | ||
- GOTRUE_EXTERNAL_DISCORD_ENABLED=${GOTRUE_EXTERNAL_DISCORD_ENABLED} | ||
- GOTRUE_EXTERNAL_DISCORD_CLIENT_ID=${GOTRUE_EXTERNAL_DISCORD_CLIENT_ID} | ||
- GOTRUE_EXTERNAL_DISCORD_SECRET=${GOTRUE_EXTERNAL_DISCORD_SECRET} | ||
- GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI=${GOTRUE_EXTERNAL_DISCORD_REDIRECT_URI} | ||
# Prometheus Metrics | ||
- GOTRUE_METRICS_ENABLED=true | ||
- GOTRUE_METRICS_EXPORTER=prometheus | ||
- GOTRUE_MAILER_TEMPLATES_CONFIRMATION=${GOTRUE_MAILER_TEMPLATES_CONFIRMATION} | ||
ports: | ||
- 9999:9999 | ||
|
||
volumes: | ||
postgres_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.