Skip to content

Commit

Permalink
fix the performance test with single docker compose for 3 agents
Browse files Browse the repository at this point in the history
Signed-off-by: mineme0110 <[email protected]>
  • Loading branch information
mineme0110 committed Nov 27, 2024
1 parent 370cff9 commit 13375d0
Show file tree
Hide file tree
Showing 8 changed files with 532 additions and 453 deletions.
69 changes: 6 additions & 63 deletions .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,7 @@ jobs:
sed -i.bak "s/AGENT_VERSION=.*/AGENT_VERSION=${AGENT_VERSION}/" "${ENV_FILE}" && rm -f "${ENV_FILE}.bak"
cat "${ENV_FILE}"
- name: Create Docker Network
run: |
docker network create agent-network || echo "Network already exists"
- name: Start services for prism node & postgres
env:
PG_PORT: 5432
NODE_REFRESH_AND_SUBMIT_PERIOD: 1s
NODE_MOVE_SCHEDULED_TO_PENDING_PERIOD: 1s
NODE_WALLET_MAX_TPS: 1000
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose-node.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p prism-node"
up-flags: "--wait"
down-flags: "--volumes"

- name: Start services for issuer
- name: Start services for issuer holder and verifier
env:
PORT: 8080
ADMIN_TOKEN: admin
Expand All @@ -81,48 +64,16 @@ jobs:
API_KEY_AUTO_PROVISIONING: false
API_KEY_ENABLED: true
DOCKERHOST: "host.docker.internal"
PG_PORT: 5432
ISSUER_PORT: 8080
HOLDER_PORT: 8090
VERIFIER_PORT: 8100
NODE_REFRESH_AND_SUBMIT_PERIOD: 1s
NODE_MOVE_SCHEDULED_TO_PENDING_PERIOD: 1s
NODE_WALLET_MAX_TPS: 1000
uses: hoverkraft-tech/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose-agent.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/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose-agent.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/[email protected]
with:
compose-file: "./infrastructure/shared/docker-compose-agent.yml"
compose-flags: "--env-file ./infrastructure/local/.env -p verifier"
compose-file: "./infrastructure/shared/docker-compose-combined.yml"
compose-flags: "--env-file ./infrastructure/local/.env"
up-flags: "--wait"
down-flags: "--volumes"

Expand Down Expand Up @@ -162,11 +113,3 @@ jobs:
./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
- name: Remove Docker Network
if: always()
run: |
echo "Forcefully stopping all containers on agent-network"
docker ps -q --filter network=agent-network | xargs -r docker stop || echo "No containers to stop"
docker ps -a -q --filter network=agent-network | xargs -r docker rm || echo "No containers to remove"
docker network rm agent-network || echo "Network not found"
44 changes: 44 additions & 0 deletions infrastructure/shared/apisix/conf/apisix-holder.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins:
- name: proxy-rewrite
- name: cors

routes:
- uri: /cloud-agent/*
upstream_id: 4
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/cloud-agent/(.*)", "/$1"]
- uri: /docs/cloud-agent/api/*
upstream_id: 4
plugins:
proxy-rewrite:
regex_uri: ["^/docs/cloud-agent/api/(.*)", "/docs/$1"]
- uri: /didcomm*
upstream_id: 3
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/didcomm(.*)", "/$1"]
- uri: /apidocs/*
upstream_id: 5
plugins:
proxy-rewrite:
regex_uri: ["^/apidocs/(.*)", "/$1"]

upstreams:
- id: 3
nodes:
"cloud-agent-holder:8090": 1 # didcom and system
type: roundrobin
- id: 4
nodes:
"cloud-agent-holder:8085": 1 # tapir
type: roundrobin
- id: 5
nodes:
"swagger-ui-holder:8080": 1
type: roundrobin
#END
44 changes: 44 additions & 0 deletions infrastructure/shared/apisix/conf/apisix-issuer.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins:
- name: proxy-rewrite
- name: cors

routes:
- uri: /cloud-agent/*
upstream_id: 4
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/cloud-agent/(.*)", "/$1"]
- uri: /docs/cloud-agent/api/*
upstream_id: 4
plugins:
proxy-rewrite:
regex_uri: ["^/docs/cloud-agent/api/(.*)", "/docs/$1"]
- uri: /didcomm*
upstream_id: 3
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/didcomm(.*)", "/$1"]
- uri: /apidocs/*
upstream_id: 5
plugins:
proxy-rewrite:
regex_uri: ["^/apidocs/(.*)", "/$1"]

upstreams:
- id: 3
nodes:
"cloud-agent-issuer:8090": 1 # didcom and system
type: roundrobin
- id: 4
nodes:
"cloud-agent-issuer:8085": 1 # tapir
type: roundrobin
- id: 5
nodes:
"swagger-ui-issuer:8080": 1
type: roundrobin
#END
44 changes: 44 additions & 0 deletions infrastructure/shared/apisix/conf/apisix-verifier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins:
- name: proxy-rewrite
- name: cors

routes:
- uri: /cloud-agent/*
upstream_id: 4
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/cloud-agent/(.*)", "/$1"]
- uri: /docs/cloud-agent/api/*
upstream_id: 4
plugins:
proxy-rewrite:
regex_uri: ["^/docs/cloud-agent/api/(.*)", "/docs/$1"]
- uri: /didcomm*
upstream_id: 3
plugins:
cors:
allow_origins: "*"
proxy-rewrite:
regex_uri: ["^/didcomm(.*)", "/$1"]
- uri: /apidocs/*
upstream_id: 5
plugins:
proxy-rewrite:
regex_uri: ["^/apidocs/(.*)", "/$1"]

upstreams:
- id: 3
nodes:
"cloud-agent-verifier:8090": 1 # didcom and system
type: roundrobin
- id: 4
nodes:
"cloud-agent-verifier:8085": 1 # tapir
type: roundrobin
- id: 5
nodes:
"swagger-ui-verifier:8080": 1
type: roundrobin
#END
163 changes: 0 additions & 163 deletions infrastructure/shared/docker-compose-agent.yml

This file was deleted.

Loading

0 comments on commit 13375d0

Please sign in to comment.