Skip to content

feat: share Kafka producers among threads (#1460) #3093

feat: share Kafka producers among threads (#1460)

feat: share Kafka producers among threads (#1460) #3093

name: Performance tests
concurrency:
group: ${{ github.head_ref }}${{ github.ref }}-performance-tests
cancel-in-progress: true
on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:
env:
BENCHMARKING_DIR: "tests/performance-tests/agent-performance-tests-k6"
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
run-e2e-tests:
name: "Run performance tests"
runs-on: ubuntu-latest
if: ${{ !contains(github.event.pull_request.title, '[skip ci]') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Java and Scala
uses: olafurpg/setup-scala@v14
with:
java-version: openjdk@1.17
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GITHUB_ACTOR }}
password: ${{ env.GITHUB_TOKEN }}
- uses: KengoTODA/actions-setup-docker-compose@v1
name: Install `docker-compose`
with:
version: "2.14.2"
- name: Build local version of Cloud Agent
env:
ENV_FILE: "infrastructure/local/.env"
run: |
sbt docker:publishLocal
AGENT_VERSION=$(cut version.sbt -d '=' -f2 | tr -d '" ')
sed -i.bak "s/AGENT_VERSION=.*/AGENT_VERSION=${AGENT_VERSION}/" "${ENV_FILE}" && rm -f "${ENV_FILE}.bak"
cat "${ENV_FILE}"
- name: Start services for issuer
env:
PORT: 8080
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5432
NODE_REFRESH_AND_SUBMIT_PERIOD: 1s
NODE_MOVE_SCHEDULED_TO_PENDING_PERIOD: 1s
NODE_WALLET_MAX_TPS: 1000
uses: hoverkraft-tech/compose-action@v2.0.0
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p issuer"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for holder
env:
PORT: 8090
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5433
uses: isbang/compose-action@v1.4.1
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p holder"
up-flags: "--wait"
down-flags: "--volumes"
- name: Start services for verifier
env:
PORT: 8100
ADMIN_TOKEN: admin
DEFAULT_WALLET_ENABLED: true
DEFAULT_WALLET_AUTH_API_KEY: default
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5434
uses: isbang/compose-action@v1.4.1
with:
compose-file: "./infrastructure/shared/docker-compose.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p verifier"
up-flags: "--wait"
down-flags: "--volumes"
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x
registry-url: "https://npm.pkg.github.com"
scope: "input-output-hk"
- name: Install dependencies
uses: borales/actions-yarn@v5
with:
cmd: install
dir: ${{ env.BENCHMARKING_DIR }}
- name: Compile tests to JS
uses: borales/actions-yarn@v5
with:
cmd: webpack
dir: ${{ env.BENCHMARKING_DIR }}
- name: All Smoke Tests
env:
ISSUER_AGENT_API_KEY: default
HOLDER_AGENT_API_KEY: default
VERIFIER_AGENT_API_KEY: default
run: |
# Have to use manual download because GitHub action doesnt support localhost execution
curl https://github.com/grafana/k6/releases/download/v0.45.0/k6-v0.45.0-linux-amd64.tar.gz -L | tar xvz --strip-components 1
ls -la
./k6 run -e SCENARIO_LABEL=create-prism-did-smoke ${{ env.BENCHMARKING_DIR }}/dist/create-prism-did-test.js
./k6 run -e SCENARIO_LABEL=credential-offer-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-offer-test.js
./k6 run -e SCENARIO_LABEL=credential-definition-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-definition-test.js
./k6 run -e SCENARIO_LABEL=credential-schema-smoke ${{ env.BENCHMARKING_DIR }}/dist/credential-schema-test.js
./k6 run -e SCENARIO_LABEL=did-publishing-smoke ${{ env.BENCHMARKING_DIR }}/dist/did-publishing-test.js
./k6 run -e SCENARIO_LABEL=connection-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/connection-flow-test.js
./k6 run -e SCENARIO_LABEL=issuance-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/issuance-flow-test.js
./k6 run -e SCENARIO_LABEL=present-proof-flow-smoke ${{ env.BENCHMARKING_DIR }}/dist/present-proof-flow-test.js