| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345 |
- name: Performance Test Suite
- on:
- push:
- branches:
- - 'perf/**'
- schedule:
- - cron: '0 1 * * MON-FRI'
- workflow_dispatch:
- inputs:
- ref:
- required: false
- env:
- TF_AWS_REGION: eu-west-1
- TF_VAR_s3_bucket_name: tf-emqx-performance-test2
- TF_VAR_test_duration: 1800
- TF_VAR_prometheus_remote_write_region: eu-west-1
- TF_VAR_prometheus_remote_write_url: ${{ secrets.TF_EMQX_PERF_TEST_PROMETHEUS_REMOTE_WRITE_URL }}
- SLACK_WEBHOOK_URL: ${{ secrets.TF_EMQX_PERF_TEST_SLACK_URL }}
- permissions:
- contents: read
- jobs:
- prepare:
- runs-on: ubuntu-latest
- if: github.repository_owner == 'emqx'
- container: ghcr.io/emqx/emqx-builder/5.2-9:1.15.7-26.1.2-3-ubuntu20.04
- outputs:
- BENCH_ID: ${{ steps.prepare.outputs.BENCH_ID }}
- PACKAGE_FILE: ${{ steps.package_file.outputs.PACKAGE_FILE }}
- steps:
- - uses: actions/checkout@v3
- with:
- fetch-depth: 0
- ref: ${{ github.event.inputs.ref }}
- - name: Work around https://github.com/actions/checkout/issues/766
- run: |
- git config --global --add safe.directory "$GITHUB_WORKSPACE"
- - id: prepare
- run: |
- echo "EMQX_NAME=emqx" >> $GITHUB_ENV
- echo "CODE_PATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- echo "BENCH_ID=$(date --utc +%F)/emqx-$(./pkg-vsn.sh emqx)" >> $GITHUB_OUTPUT
- - name: Build deb package
- run: |
- make ${EMQX_NAME}-pkg
- ./scripts/pkg-tests.sh ${EMQX_NAME}-pkg
- - name: Get package file name
- id: package_file
- run: |
- echo "PACKAGE_FILE=$(find _packages/emqx -name 'emqx-*.deb' | head -n 1 | xargs basename)" >> $GITHUB_OUTPUT
- - uses: actions/upload-artifact@v3
- with:
- name: emqx-ubuntu20.04
- path: _packages/emqx/${{ steps.package_file.outputs.PACKAGE_FILE }}
- scenario_1on1:
- runs-on: ubuntu-latest
- needs:
- - prepare
- env:
- TF_VAR_package_file: ${{ needs.prepare.outputs.PACKAGE_FILE }}
- steps:
- - name: Configure AWS Credentials
- uses: aws-actions/configure-aws-credentials@v2
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PERF_TEST }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PERF_TEST }}
- aws-region: eu-west-1
- - name: Checkout tf-emqx-performance-test
- uses: actions/checkout@v3
- with:
- repository: emqx/tf-emqx-performance-test
- path: tf-emqx-performance-test
- ref: v0.2.3
- - uses: actions/download-artifact@v3
- with:
- name: emqx-ubuntu20.04
- path: tf-emqx-performance-test/
- - name: Setup Terraform
- uses: hashicorp/setup-terraform@v2
- with:
- terraform_wrapper: false
- - name: run scenario
- working-directory: ./tf-emqx-performance-test
- timeout-minutes: 60
- env:
- TF_VAR_bench_id: "${{ needs.prepare.outputs.BENCH_ID }}/1on1"
- TF_VAR_use_emqttb: 1
- TF_VAR_use_emqtt_bench: 0
- TF_VAR_emqttb_instance_count: 1
- TF_VAR_emqttb_instance_type: c5.2xlarge
- TF_VAR_emqttb_scenario: '@pubsub_fwd -n 50_000 --pub-qos 1 --sub-qos 1'
- TF_VAR_emqx_instance_type: c5.2xlarge
- TF_VAR_emqx_instance_count: 3
- run: |
- terraform init
- terraform apply -auto-approve
- ./wait-emqttb.sh
- ./fetch-metrics.sh
- terraform destroy -auto-approve
- aws s3 sync --exclude '*' --include '*.tar.gz' s3://$TF_VAR_s3_bucket_name/$TF_VAR_bench_id .
- - name: Send notification to Slack
- uses: slackapi/slack-github-action@v1.24.0
- with:
- payload-file-path: "./tf-emqx-performance-test/slack-payload.json"
- - name: terraform destroy
- if: always()
- working-directory: ./tf-emqx-performance-test
- run: |
- terraform destroy -auto-approve
- - uses: actions/upload-artifact@v3
- if: success()
- with:
- name: metrics
- path: |
- "./tf-emqx-performance-test/*.tar.gz"
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: terraform
- path: |
- ./tf-emqx-performance-test/.terraform
- ./tf-emqx-performance-test/*.tfstate
- scenario_fanout:
- runs-on: ubuntu-latest
- needs:
- - prepare
- - scenario_1on1
- env:
- TF_VAR_package_file: ${{ needs.prepare.outputs.PACKAGE_FILE }}
- steps:
- - name: Configure AWS Credentials
- uses: aws-actions/configure-aws-credentials@v2
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PERF_TEST }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PERF_TEST }}
- aws-region: eu-west-1
- - name: Checkout tf-emqx-performance-test
- uses: actions/checkout@v3
- with:
- repository: emqx/tf-emqx-performance-test
- path: tf-emqx-performance-test
- ref: v0.2.3
- - uses: actions/download-artifact@v3
- with:
- name: emqx-ubuntu20.04
- path: tf-emqx-performance-test/
- - name: Setup Terraform
- uses: hashicorp/setup-terraform@v2
- with:
- terraform_wrapper: false
- - name: run scenario
- working-directory: ./tf-emqx-performance-test
- timeout-minutes: 60
- env:
- TF_VAR_bench_id: "${{ needs.prepare.outputs.BENCH_ID }}/fan-out"
- TF_VAR_use_emqttb: 1
- TF_VAR_use_emqtt_bench: 0
- TF_VAR_emqttb_instance_count: 1
- TF_VAR_emqttb_instance_type: c5.2xlarge
- TF_VAR_emqttb_scenario: '@pub --topic "t/%n" --conninterval 10ms --pubinterval 20ms --num-clients 5 --size 16 @sub --topic "t/#" --conninterval 10ms --num-clients 1000'
- TF_VAR_emqx_instance_type: c5.large
- TF_VAR_emqx_instance_count: 3
- run: |
- terraform init
- terraform apply -auto-approve
- ./wait-emqttb.sh
- ./fetch-metrics.sh
- terraform destroy -auto-approve
- aws s3 sync --exclude '*' --include '*.tar.gz' s3://$TF_VAR_s3_bucket_name/$TF_VAR_bench_id .
- - name: Send notification to Slack
- uses: slackapi/slack-github-action@v1.24.0
- with:
- payload-file-path: "./tf-emqx-performance-test/slack-payload.json"
- - name: terraform destroy
- if: always()
- working-directory: ./tf-emqx-performance-test
- run: |
- terraform destroy -auto-approve
- - uses: actions/upload-artifact@v3
- if: success()
- with:
- name: metrics
- path: |
- "./tf-emqx-performance-test/*.tar.gz"
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: terraform
- path: |
- ./tf-emqx-performance-test/.terraform
- ./tf-emqx-performance-test/*.tfstate
- scenario_fanin:
- runs-on: ubuntu-latest
- needs:
- - prepare
- - scenario_1on1
- - scenario_fanout
- env:
- TF_VAR_package_file: ${{ needs.prepare.outputs.PACKAGE_FILE }}
- steps:
- - name: Configure AWS Credentials
- uses: aws-actions/configure-aws-credentials@v2
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PERF_TEST }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PERF_TEST }}
- aws-region: eu-west-1
- - name: Checkout tf-emqx-performance-test
- uses: actions/checkout@v3
- with:
- repository: emqx/tf-emqx-performance-test
- path: tf-emqx-performance-test
- ref: v0.2.3
- - uses: actions/download-artifact@v3
- with:
- name: emqx-ubuntu20.04
- path: tf-emqx-performance-test/
- - name: Setup Terraform
- uses: hashicorp/setup-terraform@v2
- with:
- terraform_wrapper: false
- - name: run scenario
- working-directory: ./tf-emqx-performance-test
- timeout-minutes: 60
- env:
- TF_VAR_bench_id: "${{ needs.prepare.outputs.BENCH_ID }}/fan-in"
- TF_VAR_use_emqttb: 1
- TF_VAR_use_emqtt_bench: 0
- TF_VAR_emqttb_instance_count: 2
- TF_VAR_emqttb_start_n_multiplier: 25000
- TF_VAR_emqttb_instance_type: c5.xlarge
- TF_VAR_emqttb_scenario: '@pub --topic t/%n --conninterval 10ms --pubinterval 1s --num-clients 25_000 --start-n $START_N --size 16 @sub --topic \$share/perf/t/# --conninterval 10ms --num-clients 250'
- TF_VAR_emqx_instance_type: c5.2xlarge
- TF_VAR_emqx_instance_count: 3
- run: |
- terraform init
- terraform apply -auto-approve
- ./wait-emqttb.sh
- ./fetch-metrics.sh
- terraform destroy -auto-approve
- aws s3 sync --exclude '*' --include '*.tar.gz' s3://$TF_VAR_s3_bucket_name/$TF_VAR_bench_id .
- - name: Send notification to Slack
- uses: slackapi/slack-github-action@v1.24.0
- with:
- payload-file-path: "./tf-emqx-performance-test/slack-payload.json"
- - name: terraform destroy
- if: always()
- working-directory: ./tf-emqx-performance-test
- run: |
- terraform destroy -auto-approve
- - uses: actions/upload-artifact@v3
- if: success()
- with:
- name: metrics
- path: |
- "./tf-emqx-performance-test/*.tar.gz"
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: terraform
- path: |
- ./tf-emqx-performance-test/.terraform
- ./tf-emqx-performance-test/*.tfstate
- scenario_1m_conns:
- runs-on: ubuntu-latest
- needs:
- - prepare
- - scenario_fanin
- - scenario_fanout
- - scenario_1on1
- env:
- TF_VAR_package_file: ${{ needs.prepare.outputs.PACKAGE_FILE }}
- steps:
- - name: Configure AWS Credentials
- uses: aws-actions/configure-aws-credentials@v2
- with:
- aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_PERF_TEST }}
- aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_PERF_TEST }}
- aws-region: eu-west-1
- - name: Checkout tf-emqx-performance-test
- uses: actions/checkout@v3
- with:
- repository: emqx/tf-emqx-performance-test
- path: tf-emqx-performance-test
- ref: v0.2.3
- - uses: actions/download-artifact@v3
- with:
- name: emqx-ubuntu20.04
- path: tf-emqx-performance-test/
- - name: Setup Terraform
- uses: hashicorp/setup-terraform@v2
- with:
- terraform_wrapper: false
- - name: run scenario
- working-directory: ./tf-emqx-performance-test
- timeout-minutes: 60
- env:
- TF_VAR_bench_id: "${{ needs.prepare.outputs.BENCH_ID }}/1m-connections"
- TF_VAR_use_emqttb: 1
- TF_VAR_use_emqtt_bench: 0
- TF_VAR_emqttb_instance_count: 5
- TF_VAR_emqttb_instance_type: c5.2xlarge
- TF_VAR_emqttb_scenario: '@conn -N 200_000 --conninterval 1ms'
- TF_VAR_emqx_instance_type: c5.2xlarge
- TF_VAR_emqx_instance_count: 3
- run: |
- terraform init
- terraform apply -auto-approve
- ./wait-emqttb.sh
- ./fetch-metrics.sh
- terraform destroy -auto-approve
- aws s3 sync --exclude '*' --include '*.tar.gz' s3://$TF_VAR_s3_bucket_name/$TF_VAR_bench_id .
- - name: Send notification to Slack
- uses: slackapi/slack-github-action@v1.24.0
- with:
- payload-file-path: "./tf-emqx-performance-test/slack-payload.json"
- - name: terraform destroy
- if: always()
- working-directory: ./tf-emqx-performance-test
- run: |
- terraform destroy -auto-approve
- - uses: actions/upload-artifact@v3
- if: success()
- with:
- name: metrics
- path: |
- "./tf-emqx-performance-test/*.tar.gz"
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: terraform
- path: |
- ./tf-emqx-performance-test/.terraform
- ./tf-emqx-performance-test/*.tfstate
|