Skip to content

Commit

Permalink
feat(csi-334): e2e als-proxy flow validation (#487)
Browse files Browse the repository at this point in the history
* feat(csi-263): implemented getPartiesByTypeAndID proxy changes

* feat(csi-263): implemented getPartiesByTypeAndID proxy changes

* feat(csi-263): update npm test:... scripts

* feat(csi-263): added networks to redis in d-c

* feat(csi-263): added proxyCache logic for success PUT /parties

* feat(csi-263): added proxyCache logic for error PUT /parties

* feat(csi-263): updated proxyConfig format

* feat(csi-263): added jest-unit.config.js

* feat(csi-215): updated test-harness version to use fx

* chore(snapshot): 15.4.0-snapshot.0

* chore(snapshot): 15.4.0-snapshot.1

* chore(snapshot): 15.4.0-snapshot.2

* chore(snapshot): 15.4.0-snapshot.3

* chore(snapshot): 15.4.0-snapshot.4

* chore(snapshot): 15.4.0-snapshot.5

* chore(snapshot): 15.4.0-snapshot.6

* chore(snapshot): 15.4.0-snapshot.7

* chore(snapshot): 15.4.0-snapshot.8

* chore(snapshot): 15.4.0-snapshot.9

* chore(snapshot): 15.4.0-snapshot.10

* chore(snapshot): 15.4.0-snapshot.11

* feat: make proxy routing optional & update health check (#486)

* chore(csi-16): updated central-services-shared version

* chore(snapshot): 15.4.0-snapshot.12

* chore(snapshot): 15.4.0-snapshot.13

* chore(snapshot): 15.4.0-snapshot.14

* chore(csi-16): inited proxies cache

* chore(snapshot): 15.4.0-snapshot.15

* chore(snapshot): 15.4.0-snapshot.16

* feat(csi-263): added proxy int-test from parties handler

* feat(csi-263): added proxy int-test from parties handler

* feat(csi-263): added --runInBand to unit tests

* feat(csi-16): proxyCacheTtlSec = 40

* chore(snapshot): 15.4.0-snapshot.17

* feat(csi-16): proxyCacheTtlSec = 40

* feat(csi-16): proxyCacheTtlSec = 40

* chore(snapshot): 15.4.0-snapshot.18

* Update docker/account-lookup-service/default.json

Co-authored-by: Steven Oderayi <oderayi@gmail.com>

* Update test/integration-config.json

Co-authored-by: Steven Oderayi <oderayi@gmail.com>

* feat(csi-334): added source to proxyCache for payee case

* chore(snapshot): 15.4.0-snapshot.19

* feat(csi-334): added axios-retry

* chore(snapshot): 15.4.0-snapshot.20

* fix(csi-321): fixed failed GP tests

* chore(snapshot): 15.4.0-snapshot.21

* fix(csi-321): fixed case of sendCallback to requester

* chore(snapshot): 15.4.0-snapshot.22

* fix(csi-321): added contextLogger

* fix(csi-334): add proxyLib with redis-cluster

* chore(snapshot): 15.4.0-snapshot.23

* fix(csi-334): add proxyLib with redis-cluster

* chore(snapshot): 15.4.0-snapshot.24

* fix(csi-334): fixed config

* chore(snapshot): 15.4.0-snapshot.25

* fix(csi-334): used new proxyLib

---------

Co-authored-by: Steven Oderayi <oderayi@gmail.com>
  • Loading branch information
geka-evk and oderayi authored Jul 29, 2024
1 parent 0a007c1 commit f514982
Show file tree
Hide file tree
Showing 24 changed files with 567 additions and 504 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ RUN apk --no-cache add git
RUN apk add --no-cache -t build-dependencies make gcc g++ python3 py3-setuptools libtool openssl-dev autoconf automake bash \
&& cd $(npm root -g)/npm

COPY package.json package-lock.json* /opt/app/
COPY package.json package-lock.json /opt/app/

RUN npm ci

COPY src /opt/app/src
COPY config /opt/app/config
COPY migrations /opt/app/migrations
COPY seeds /opt/app/seeds
COPY test /opt/app/test

FROM node:${NODE_VERSION}
WORKDIR /opt/app
Expand Down
7 changes: 4 additions & 3 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,11 @@
},
"PROXY_CACHE": {
"enabled": true,
"type": "redis",
"type": "redis-cluster",
"proxyConfig": {
"host": "localhost",
"port": 6379
"cluster": [
{ "host": "localhost", "port": 6379 }
]
}
},
"ERROR_HANDLING": {
Expand Down
52 changes: 42 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ networks:
als-mojaloop-net:
name: als-mojaloop-net

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
networks:
- als-mojaloop-net

services:
account-lookup-service:
image: mojaloop/account-lookup-service:local
Expand All @@ -25,7 +33,7 @@ services:
- central-ledger
- proxy
- mysql-als
- redis
- redis-node-0
volumes:
- ./secrets:/opt/app/secrets
- ./src:/opt/app/src
Expand Down Expand Up @@ -139,15 +147,39 @@ services:
start_period: 40s
interval: 30s

redis:
image: redis:6.2.4-alpine
restart: "unless-stopped"
# To use with proxyCache.type === 'redis-cluster'
redis-node-0:
<<: *REDIS_NODE
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_PORT=6379
- REDIS_REPLICATION_MODE=master
- REDIS_TLS_ENABLED=no
<<: *REDIS_ENVS
REDIS_CLUSTER_CREATOR: yes
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
- redis-node-4
- redis-node-5
ports:
- "6379:6379"
networks:
- als-mojaloop-net

redis-node-1:
<<: *REDIS_NODE
redis-node-2:
<<: *REDIS_NODE
redis-node-3:
<<: *REDIS_NODE
redis-node-4:
<<: *REDIS_NODE
redis-node-5:
<<: *REDIS_NODE

## To use with proxyCache.type === 'redis'
# redis:
# image: redis:6.2.4-alpine
# restart: "unless-stopped"
# environment:
# - ALLOW_EMPTY_PASSWORD=yes
# - REDIS_PORT=6379
# - REDIS_REPLICATION_MODE=master
# ports:
# - "6379:6379"
8 changes: 4 additions & 4 deletions docker/account-lookup-service/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
},
"PROXY_CACHE": {
"enabled": true,
"enabled": true,
"type": "redis",
"type": "redis-cluster",
"proxyConfig": {
"host": "redis",
"port": 6379
"cluster": [
{ "host": "redis-node-0", "port": 6379 }
]
}
},
"ERROR_HANDLING": {
Expand Down
5 changes: 4 additions & 1 deletion docker/account-lookup-service/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"HOST": "mysql-als"
},
"PROXY_CACHE": {
"type": "redis-cluster",
"proxyConfig": {
"host": "redis"
"cluster": [
{ "host": "redis-node-0", "port": 6379 }
]
}
},
"SWITCH_ENDPOINT": "http://central-ledger:3001",
Expand Down
Loading

0 comments on commit f514982

Please sign in to comment.