Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(3666): added quoting-handlers to docker-compose #45

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ ML_API_ADAPTER_VERSION=v14.0.4
ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.3
## ALS snapshot release with fix: v14.2.3 + caching for validateParticipant and resolve Participants via Oracles
# ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.4-snapshot.3
# QUOTING_SERVICE_VERSION=v15.2.1
#QUOTING_SERVICE_VERSION=v15.4.0
QUOTING_SERVICE_VERSION=v15.4.0
QUOTING_SERVICE_NEW_VERSION=v15.6.0-snapshot.5
## CL initial baseline with version included in Mojaloop v15.1.0 Helm Release
# CENTRAL_LEDGER_VERSION=v17.0.3
## Cl latest version
Expand Down Expand Up @@ -44,7 +45,9 @@ CADVISER_VERSION=latest
K6_VERSION=0.45.0

## Performance Testing Replicas
QS_REPLICAS=1
QS_REPLICAS=8
QS_NEW_API_REPLICAS=4
QS_NEW_HANDLER_REPLICAS=8
ALS_REPLICAS=1
CENTRAL_LEDGER_GENERAL_REPLICAS=1
CENTRAL_LEDGER_POSITION_REPLICAS=1
Expand Down
64 changes: 64 additions & 0 deletions docker-compose-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,63 @@ services:
- all-services
- quotes-test

quoting-service-new:
image: "mojaloop/quoting-service:${QUOTING_SERVICE_NEW_VERSION}"
deploy:
mode: replicated
replicas: ${QS_NEW_API_REPLICAS}
networks:
- mojaloop-net
depends_on:
mysql-cl:
condition: service_started
central-ledger:
condition: service_started
kafka:
condition: service_started
environment:
## Allows TraceID to be propogated - https://github.com/mojaloop/event-sdk#configuration
- EVENT_SDK_TRACEID_PER_VENDOR=false
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
user: root
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service-new-perf.js /opt/app/config/default.json && node src/index.js"
# ports:
# - "3002:3002"
healthcheck:
test: wget -q http://localhost:3002/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
profiles:
- all-services
- quotes-test

quoting-handlers:
image: "mojaloop/quoting-service:${QUOTING_SERVICE_NEW_VERSION}"
deploy:
mode: replicated
replicas: ${QS_NEW_HANDLER_REPLICAS}
networks:
- mojaloop-net
environment:
## Allows TraceID to be propogated - https://github.com/mojaloop/event-sdk#configuration
- EVENT_SDK_TRACEID_PER_VENDOR=false
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
user: root
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service-new-perf.js /opt/app/config/default.json && npm run start:handlers"
depends_on:
mysql-cl:
condition: service_started
central-ledger:
condition: service_started
kafka:
condition: service_started
profiles:
- all-services
- quotes-test

# objstore:
# image: mongo:${DEP_MONGO_VERSION}
# container_name: objstore
Expand Down Expand Up @@ -549,6 +606,12 @@ services:
# kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-fulfil --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM
# kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-processing --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM
# kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-get --replication-factor 1 --partitions $$KAFKA_GENERAL_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-quotes-post --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-quotes-put --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-quotes-get --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulkquotes-post --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulkquotes-put --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulkquotes-get --replication-factor 1 --partitions $$KAFKA_QUOTES_PARTITIONS_NUM
echo -e 'Successfully created the following topics:'
kafka-topics.sh --bootstrap-server kafka:29092 --list
"
Expand All @@ -559,6 +622,7 @@ services:
- agreement
- all-services
- transfers-test
- quotes-test

kafka:
networks:
Expand Down
59 changes: 37 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,35 @@ networks:
mojaloop-net:
name: mojaloop-net

x-quoting-service-base: &quoting-service-base
# https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
image: "mojaloop/quoting-service:${QUOTING_SERVICE_VERSION}"
container_name: quoting-service
networks:
- mojaloop-net
depends_on: &quoting-service-base-depends-on
mysql:
condition: service_started
central-ledger:
condition: service_started
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
user: root
profiles:
- quoting-service
- agreement
- all-services


services:

## Switch
central-ledger:
image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION}
container_name: central-ledger
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-ledger.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/api/index.js"
# ports:
# - "3001:3001"
ports:
- "3001:3001"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
Expand Down Expand Up @@ -117,8 +137,8 @@ services:
mysql:
image: mysql/mysql-server:${DEP_MYSQL_VERSION}
container_name: mysql
# ports:
# - "3306:3306"
ports:
- "3306:3306"
volumes:
# Note: this fixes the permissions issue, but docker-compose up will fail on first attempt
- ./docker/sql-init/:/docker-entrypoint-initdb.d/
Expand All @@ -143,37 +163,32 @@ services:
- all-services

quoting-service:
image: "mojaloop/quoting-service:${QUOTING_SERVICE_VERSION}"
container_name: quoting-service
<<: *quoting-service-base
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service.js /opt/app/config/default.json && node src/index.js"
networks:
- mojaloop-net
depends_on:
mysql:
condition: service_started
central-ledger:
condition: service_started
# ports:
# - "3002:3002"
volumes:
- ./docker/config-modifier:/opt/app/config-modifier
healthcheck:
test: wget -q http://localhost:3002/health -O /dev/null || exit 1
timeout: 20s
retries: 30
interval: 15s
user: root
profiles:
- quoting-service
- agreement
- all-services

quoting-handlers:
<<: *quoting-service-base
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/quoting-service.js /opt/app/config/default.json && npm run start:handlers"
container_name: quoting-handlers
depends_on:
<<: *quoting-service-base-depends-on
kafka:
condition: service_started
# todo: add healthcheck for quoting-handlers

ml-api-adapter:
image: mojaloop/ml-api-adapter:${ML_API_ADAPTER_VERSION}
container_name: ml-api-adapter
command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/ml-api-adapter.js /opt/app/config/default.json && /opt/app/wait4/wait4.js ml-api-adapter && node src/api/index.js"
# ports:
# - "3000:3000"
ports:
- "3000:3000"
volumes:
- ./docker/wait4:/opt/app/wait4
- ./docker/config-modifier:/opt/app/config-modifier
Expand Down
106 changes: 106 additions & 0 deletions docker/config-modifier/configs/quoting-service-new-perf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
module.exports = {
"HOSTNAME": "http://quoting-service-new",
"DATABASE": {
"HOST": "mysql-cl"
},
"SIMPLE_ROUTING_MODE": false,
"SWITCH_ENDPOINT": "http://callback-handler-svc-cl-sim:3001/admin",
"KAFKA": {
"CONSUMER": {
"QUOTE": {
"POST": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"PUT": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"GET": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
}
},
"BULK_QUOTE": {
"POST": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"PUT": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"GET": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
}
}
},
"PRODUCER": {
"QUOTE": {
"POST": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"PUT": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"GET": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
}
},
"BULK_QUOTE": {
"POST": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"PUT": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
},
"GET": {
"config": {
"rdkafkaConf": {
"metadata.broker.list": "kafka:29092"
}
}
}
}
}
}
}
Loading