-
-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #853 from AppFlowy-IO/stateless
Stateless collab group
- Loading branch information
Showing
75 changed files
with
3,044 additions
and
824 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
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 |
---|---|---|
|
@@ -239,7 +239,6 @@ jobs: | |
if: always() | ||
run: docker logout | ||
|
||
|
||
appflowy_worker_image: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
|
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,49 @@ | ||
name: AppFlowy-Cloud Stress Test | ||
|
||
on: [ pull_request ] | ||
|
||
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 | ||
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 | ||
sed -i '' 's|API_EXTERNAL_URL=.*|API_EXTERNAL_URL=http://localhost:9999|' .env | ||
sed -i '' 's|APPFLOWY_GOTRUE_BASE_URL=.*|APPFLOWY_GOTRUE_BASE_URL=http://localhost:9999|' .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 |
65 changes: 65 additions & 0 deletions
65
.sqlx/query-88516b9a2a424bc7697337d6f16b0d6e94b919597d709f930467423c5b4c0ec2.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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. [email protected] | ||
- GOTRUE_SMTP_PASS=${GOTRUE_SMTP_PASS} # email password | ||
- GOTRUE_SMTP_ADMIN_EMAIL=${GOTRUE_SMTP_ADMIN_EMAIL} # email with admin privileges e.g. [email protected] | ||
- 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: |
Oops, something went wrong.