diff --git a/.env b/.env index 13cb708f..7dd2ad1a 100644 --- a/.env +++ b/.env @@ -12,11 +12,26 @@ CENTRAL_LEDGER_VERSION=v17.0.3 ## CL snapshot release with included fix: JSON.stringify disabled in logResponse function # CENTRAL_LEDGER_VERSION=v17.0.4-snapshot.0 +## Testing & Sims +TEST_SIMULATOR_VERSION=v11.1.3 +TEST_TTK_SVC_VERSION=v16.1.1 +TEST_TTK_UI_VERSION=v15.3.0 +TEST_TTK_CLI_VERSION=v1.2.0 +TEST_CALLBACK_HAND_SVC_VERSION=local + +## Dependencies +DEP_KAFKA_VERSION=3.5.0 +DEP_KAfKA_UI_VERSION=latest +DEP_MYSQL_VERSION=8.0 +DEP_MONGO_VERSION=6.0.5 + ## Monitoring Docker Image Versions GRAFANA_VERSION=10.0.2 GRAFANA_RENDERER_VERSION=3.7.1 PROMETHEUS_VERSION=v2.45.0 NODE_EXPORTER_VERSION=latest +MYSQLD_EXPORTER_VERSION=v0.15.0 +KAFKA_EXPORTER_VERSION=latest CADVISER_VERSION=latest ## Load Docker Image Versions diff --git a/.gitignore b/.gitignore index 25161e30..9ba8ee25 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,6 @@ **/results/** +**/reports/** + automate_perf.env diff --git a/docker-compose-monitoring.yml b/docker-compose-monitoring.yml index 6a4a8f74..1a1d8b4e 100644 --- a/docker-compose-monitoring.yml +++ b/docker-compose-monitoring.yml @@ -44,7 +44,7 @@ services: # - node.hostname == ${HOSTNAME} node-exporter: - image: quay.io/prometheus/node-exporter:latest + image: quay.io/prometheus/node-exporter:${NODE_EXPORTER_VERSION} volumes: - /proc:/host/proc:ro - /sys:/host/sys:ro @@ -141,7 +141,7 @@ services: - ./docker/renderer/config.json:/usr/src/app/config.json mysqlexporter-als: - image: prom/mysqld-exporter:v0.15.0 + image: prom/mysqld-exporter:${MYSQLD_EXPORTER_VERSION} # ports: # - "9104:9104" networks: @@ -156,7 +156,7 @@ services: - als-test mysqlexporter-cl: - image: prom/mysqld-exporter:v0.15.0 + image: prom/mysqld-exporter:${MYSQLD_EXPORTER_VERSION} # ports: # - "9104:9104" networks: @@ -171,7 +171,7 @@ services: - transfers-test kafka-exporter: - image: danielqsj/kafka-exporter:latest + image: danielqsj/kafka-exporter:${KAFKA_EXPORTER_VERSION} ports: - "9308:9308" networks: @@ -180,14 +180,12 @@ services: command: - --kafka.server=kafka:9092 - ## Debug utilities - kafka-debug-console: - # image: quay.io/cloudhut/kowl:v1.4.0 - image: docker.redpanda.com/redpandadata/console:latest + kafka-mon-ui: + image: docker.redpanda.com/redpandadata/console:${DEP_KAfKA_UI_VERSION} deploy: replicas: 1 restart: on-failure - hostname: kafka-debug-console + hostname: kafka-mon-ui ports: - "9080:8080" networks: diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index c0389ce5..556f3a5a 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -61,7 +61,7 @@ services: - als-test mysql-als: - image: mysql/mysql-server + image: mysql/mysql-server:${DEP_MYSQL_VERSION} env_file: - .env - perf.env @@ -432,7 +432,7 @@ services: - transfers-test # objstore: - # image: mongo:6.0.5 + # image: mongo:${DEP_MONGO_VERSION} # container_name: objstore # ports: # - "27017:27017" @@ -456,7 +456,7 @@ services: container_name: kafka-provisioning networks: - mojaloop-net - image: docker.io/bitnami/kafka:3.4.0 + image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION} env_file: - perf.env depends_on: @@ -491,7 +491,7 @@ services: kafka: networks: - mojaloop-net - image: docker.io/bitnami/kafka:3.4.0 + image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION} container_name: kafka # ports: # - "9092:9092" @@ -525,7 +525,7 @@ services: - transfers-test mysql-cl: - image: mysql/mysql-server + image: mysql/mysql-server:${DEP_MYSQL_VERSION} container_name: mysql-cl # ports: # - "3306:3306" @@ -636,7 +636,7 @@ services: ## Testing Toolkit mojaloop-testing-toolkit: - image: mojaloop/ml-testing-toolkit:v16.1.1 + image: mojaloop/ml-testing-toolkit:${TEST_TTK_SVC_VERSION} env_file: - .env - perf.env @@ -666,7 +666,7 @@ services: - transfers-test mojaloop-testing-toolkit-ui: - image: mojaloop/ml-testing-toolkit-ui:v15.3.0 + image: mojaloop/ml-testing-toolkit-ui:${TEST_TTK_UI_VERSION} env_file: - .env - perf.env @@ -687,7 +687,7 @@ services: - transfers-test ttk-provisioning-als: - image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 + image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} env_file: - .env - perf.env @@ -711,7 +711,7 @@ services: - ttk-provisioning-als ttk-provisioning-transfers: - image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 + image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} env_file: - .env - perf.env @@ -749,7 +749,7 @@ services: - ttk-provisioning-transfers callback-handler-svc-oracle-sim: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -759,7 +759,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -782,7 +782,7 @@ services: - als-test callback-handler-svc-cl-sim: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -792,7 +792,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -816,7 +816,7 @@ services: - transfers-test sim-perffsp1: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -826,7 +826,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -852,7 +852,7 @@ services: - 8dfsp sim-perffsp2: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -862,7 +862,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -888,7 +888,7 @@ services: - 8dfsp sim-perffsp3: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -898,7 +898,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -919,7 +919,7 @@ services: - 8dfsp sim-perffsp4: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -929,7 +929,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -950,7 +950,7 @@ services: - 8dfsp sim-perffsp5: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -960,7 +960,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -980,7 +980,7 @@ services: - 8dfsp sim-perffsp6: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -990,7 +990,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -1010,7 +1010,7 @@ services: - 8dfsp sim-perffsp7: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -1020,7 +1020,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: @@ -1040,7 +1040,7 @@ services: - 8dfsp sim-perffsp8: - image: mojaloop/callback-handler-svc:local + image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} deploy: mode: replicated replicas: 1 @@ -1050,7 +1050,7 @@ services: build: context: ./packages/callback-handler-svc cache_from: - - mojaloop/callback-handler-svc:local + - mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION} # ports: # - "3001:3001" networks: diff --git a/docker-compose.yml b/docker-compose.yml index 6a0db205..a366c321 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,7 +43,7 @@ services: - all-services objstore: - image: mongo:6.0.5 + image: mongo:${DEP_MONGO_VERSION} container_name: objstore ports: - "27017:27017" @@ -66,28 +66,12 @@ services: container_name: kafka-provisioning networks: - mojaloop-net - image: docker.io/bitnami/kafka:3.4.0 + image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION} depends_on: - kafka - entrypoint: [ '/bin/sh', '-c' ] - command: | - " - # blocks until kafka is reachable - kafka-topics.sh --bootstrap-server kafka:29092 --list - echo -e 'Creating kafka topics' - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-prepare --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-position --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-fulfil --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-notification-event --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-get --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-admin-transfer --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-prepare --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-fulfil --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-processing --replication-factor 1 --partitions 1 - kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-get --replication-factor 1 --partitions 1 - echo -e 'Successfully created the following topics:' - kafka-topics.sh --bootstrap-server kafka:29092 --list - " + volumes: + - ./docker/kafka/scripts:/tmp/kafka/scripts + command: bash /tmp/kafka/scripts/provision.sh profiles: - central-ledger - transfer @@ -98,7 +82,7 @@ services: kafka: networks: - mojaloop-net - image: docker.io/bitnami/kafka:3.4.0 + image: docker.io/bitnami/kafka:${DEP_KAFKA_VERSION} container_name: kafka # ports: # - "9092:9092" @@ -131,7 +115,7 @@ services: - all-services mysql: - image: mysql/mysql-server + image: mysql/mysql-server:${DEP_MYSQL_VERSION} container_name: mysql # ports: # - "3306:3306" @@ -215,7 +199,7 @@ services: - all-services simulator: - image: mojaloop/simulator:v11.1.3 + image: mojaloop/simulator:${TEST_SIMULATOR_VERSION} container_name: simulator # ports: # - "8444:8444" @@ -272,7 +256,7 @@ services: - all-services mysql-als: - image: mysql/mysql-server + image: mysql/mysql-server:${DEP_MYSQL_VERSION} container_name: mysql-als # ports: # - "3307:3306" @@ -298,7 +282,7 @@ services: ## Testing Toolkit mojaloop-testing-toolkit: - image: mojaloop/ml-testing-toolkit:v16.1.1 + image: mojaloop/ml-testing-toolkit:${TEST_TTK_SVC_VERSION} volumes: - "./docker/ml-testing-toolkit/spec_files:/opt/app/spec_files" - "./docker/ml-testing-toolkit/test-cases:/opt/app/examples" @@ -323,7 +307,7 @@ services: - all-services mojaloop-testing-toolkit-ui: - image: mojaloop/ml-testing-toolkit-ui:v15.3.0 + image: mojaloop/ml-testing-toolkit-ui:${TEST_TTK_UI_VERSION} ports: - "9660:6060" environment: @@ -339,7 +323,7 @@ services: - all-services ttk-provisioning: - image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 + image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} volumes: - "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections" - "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments" @@ -360,13 +344,13 @@ services: command: - sh - -c - - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning -e environments/default-env.json --save-report --report-format html --report-target file://reports/ttk-provisioning-report.html" + - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning -e environments/default-env.json --save-report true --report-format html --report-target file://reports/ttk-provisioning-report.html" user: root profiles: - ttk-provisioning ttk-tests: - image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 + image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION} volumes: - "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections" - "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments" @@ -389,21 +373,20 @@ services: command: - sh - -c - - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/tests -e environments/default-env.json --report-format html --save-report --report-target file://reports/ttk-func-tests-report.html" + - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/tests -e environments/default-env.json --report-format html --save-report true --report-target file://reports/ttk-func-tests-report.html" user: root profiles: - ttk-tests ## Debug utilities - kowl: - image: quay.io/cloudhut/kowl:v1.4.0 - container_name: cl_kowl + kafka-debug-ui: + image: docker.redpanda.com/redpandadata/console:${DEP_KAfKA_UI_VERSION} deploy: replicas: 1 restart: on-failure - hostname: kowl - # ports: - # - "8080:8080" + hostname: kafka-debug-ui + ports: + - "8080:8080" networks: - mojaloop-net environment: diff --git a/docker/kafka/scripts/provision.sh b/docker/kafka/scripts/provision.sh new file mode 100644 index 00000000..972d7dc5 --- /dev/null +++ b/docker/kafka/scripts/provision.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +KAFKAHOST="${1:-kafka}" +KAFKAPORT="${2:-29092}" + +# blocks until kafka is reachable +echo -e "------------------------------------------" +echo -e "Listing current kafka topics" +echo -e "__________________________________________" +kafka-topics.sh --bootstrap-server $KAFKAHOST:$KAFKAPORT --list +echo -e "" +echo -e "------------------------------------------" +echo -e "Creating kafka topics" +echo -e "__________________________________________" + + +# List of topics to create +topics=( + "topic-transfer-prepare" + "topic-transfer-position" + "topic-transfer-fulfil" + "topic-notification-event" + "topic-transfer-get" + "topic-admin-transfer" + "topic-bulk-prepare" + "topic-bulk-fulfil" + "topic-bulk-processing" + "topic-bulk-get" +) + +# Loop through the topics and create them using kafka-topics.sh +for topic in "${topics[@]}" +do + echo -e "--> Creating topic $topic..." + kafka-topics.sh --bootstrap-server $KAFKAHOST:$KAFKAPORT --create --if-not-exists --topic "$topic" --replication-factor 1 --partitions 1 +done + +echo -e "" +echo -e "------------------------------------------" +echo -e "Successfully created the following topics:" +echo -e "__________________________________________" +kafka-topics.sh --bootstrap-server $KAFKAHOST:$KAFKAPORT --list