Skip to content

Commit

Permalink
feat(mojaloop/#3817): harden fx quotes (#345)
Browse files Browse the repository at this point in the history
  • Loading branch information
oderayi authored Aug 20, 2024
1 parent 5d22d4d commit a2cae31
Show file tree
Hide file tree
Showing 28 changed files with 2,320 additions and 1,514 deletions.
20 changes: 0 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,6 @@ jobs:
- run:
name: Create dir for test results
command: mkdir -p ./test/results
# - run:
# name: Build and start the docker containers
# command: |
# ## This is not needed as we are only doing narrow-integration tests.
# # docker-compose build
# ## Lets pull only the Services needed for the Integration Test
# docker-compose pull mysql kafka init-kafka
# ## Lets startup only the Services needed for the Integration Test
# docker-compose up -d mysql kafka init-kafka
# ## Check straight away to see if any containers have exited
# docker-compose ps
# ## wait for services to be up and running
# npm run wait-4-docker
- run:
name: Prepare test environment
command: |
Expand All @@ -305,13 +292,6 @@ jobs:
command: |
npm rebuild
npm run test:int
# environment:
# ENDPOINT_URL: http://localhost:4545/notification
# - store_artifacts:
# path: ./test/results
# destination: test
# - store_test_results:
# path: ./test/results
vulnerability-check:
executor: default-docker
Expand Down
2 changes: 1 addition & 1 deletion .ncurc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ reject: [
"json-rules-engine",
"eslint",
"@mojaloop/sdk-standard-components", # Version 17.4.0 introduced the bug: this.logger.isDebugEnabled is not a function
"@mojaloop/central-services-shared" # This should be removed as soon as all vlaidations on the fx feature has been completed and cs-shared fx feature merged to masin
"@mojaloop/central-services-shared" # This should be removed as soon as all validations on the fx feature has been completed and cs-shared fx feature merged to main
]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG NODE_VERSION=lts-alpine
#

# Build Image
FROM node:${NODE_VERSION} as builder
FROM node:${NODE_VERSION} AS builder
USER root

WORKDIR /opt/app
Expand Down
41 changes: 34 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

x-depends-on: &dependsOnMysqlAndKafka
mysql:
condition: service_healthy
Expand All @@ -26,17 +24,23 @@ x-quoting-service: &quotingServiceBase
- ./secrets/:/opt/app/secrets/
depends_on:
<<: *dependsOnMysqlAndKafka
extra_hosts:
- "redis-node-0:host-gateway"
# central-ledger:
# condition: service_healthy # to perform test dfsp onboarding

# @see https://uninterrupted.tech/blog/hassle-free-redis-cluster-deployment-using-docker/
x-redis-node: &REDIS_NODE
image: docker.io/bitnami/redis-cluster:6.2.14
environment: &REDIS_ENVS
ALLOW_EMPTY_PASSWORD: 'yes'
REDIS_NODES: redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
REDIS_CLUSTER_DYNAMIC_IPS: 'no'
REDIS_CLUSTER_ANNOUNCE_IP: ${REDIS_CLUSTER_ANNOUNCE_IP}
REDIS_NODES: localhost:6379 localhost:6380 localhost:6381 localhost:6382 localhost:6383 localhost:6384
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 2s
network_mode: host

x-healthcheck-params: &healthcheckParams
interval: 30s
Expand All @@ -56,7 +60,7 @@ services:

quoting-service-handler:
<<: *quotingServiceBase
command: npm run start:handlers
command: npm run start:handlers:debug
ports:
- "3003:3003"
- "29229:9229"
Expand Down Expand Up @@ -114,25 +118,48 @@ services:
environment:
<<: *REDIS_ENVS
REDIS_CLUSTER_CREATOR: 'yes'
REDIS_PORT_NUMBER: 6379
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
- redis-node-4
- redis-node-5
ports:
- "6379:6379"

redis-node-1:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6380
ports:
- "16380:16380"
redis-node-2:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6381
ports:
- "16381:16381"
redis-node-3:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6382
ports:
- "16382:16382"
redis-node-4:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6383
ports:
- "16383:16383"
redis-node-5:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6384
ports:
- "16384:16384"

## To use with proxyCache.type === 'redis'
# redis:
Expand Down
Loading

0 comments on commit a2cae31

Please sign in to comment.