Skip to content

Commit b31a3b1

Browse files
authored
Merge pull request #238 from jembi/PLAT-718-update-mapping-mediator
Plat 718 update mapping mediator package
2 parents 716978f + 3e9d9d2 commit b31a3b1

File tree

9 files changed

+29
-11
lines changed

9 files changed

+29
-11
lines changed

.github/workflows/run-tests.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ elif [[ "${!changed_packages[*]}" == *"features/cluster-mode"* ]] && [[ $NODE_MO
3131
elif [[ "${!changed_packages[*]}" == *"infrastructure"* ]]; then
3232
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE"
3333
else
34+
# This ensures that the openhim and its mediators' tests are run only once when the openhim and its mediators have all been modified
35+
openhimRan="false"
36+
3437
for folder_name in "${!changed_packages[@]}"; do
3538
echo "$folder_name was changed"
3639

@@ -40,7 +43,8 @@ else
4043
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE":elk
4144
elif [[ $folder_name == *"kafka"* ]] || [[ $folder_name == *"monitoring"* ]]; then
4245
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE":kafka
43-
elif [[ $folder_name == *"openhim"* ]]; then
46+
elif [[ $folder_name == *"openhim"* ]] && [[ $openhimRan == "false" ]]; then
47+
openhimRan="true"
4448
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE":openhim
4549
elif [[ $folder_name == *"reverse-proxy"* ]]; then
4650
DOCKER_HOST=ssh://ubuntu@$GITHUB_RUN_ID.jembi.cloud yarn test:"$NODE_MODE":nginx

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
projectName: platform
2-
image: jembi/platform:2.3.1
2+
image: jembi/platform:2.3.2
33
logPath: /tmp/logs
44

55
packages:

interoperability-layer-openhim/docker-compose-mongo.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: "3.9"
33
services:
44
mongo-1:
55
image: mongo:4.2
6+
command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5']
67
volumes:
78
- "openhim-mongo-01:/data/db"
89
- "openhim-mongo-01-config:/data/configdb"

interoperability-layer-openhim/initiate-replica-set.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ done
5151
# With docker swarm any manager can be the target but this bit of code only work if we target node-1 specifically.
5252
# Which is generally what we do, but if node-1 is down or we choose to target another node this won't work.
5353
container_name=""
54-
if [[ "$(docker ps -f name=${STACK_NAME}_mongo-1 --format "{{.ID}}")" ]]; then
55-
container_name="$(docker ps -f name=${STACK_NAME}_mongo-1 --format "{{.ID}}")"
54+
if [[ "$(docker ps -f name=${STACK_NAME}_mongo --format "{{.ID}}")" ]]; then
55+
container_name="$(docker ps -f name=${STACK_NAME}_mongo --format "{{.ID}}")"
5656
fi
5757

5858
initiate_rep_set_response=$(docker exec -i "$container_name" mongo --eval "rs.initiate($config)")

interoperability-layer-openhim/swarm.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ function initialize_package() {
5353

5454
if [[ "${CLUSTERED_MODE}" == "true" ]] && [[ "${ACTION}" == "init" ]]; then
5555
try "${COMPOSE_FILE_PATH}/initiate-replica-set.sh $STACK" throw "Fatal: Initiate Mongo replica set failed"
56+
else
57+
try "docker exec -i $(docker ps -q -f name=openhim_mongo) mongo --eval \"rs.initiate()\"" throw "Could not initiate replica set for the single mongo instance. Some services use \
58+
mongo event listeners which only work with a replica set"
5659
fi
5760

5861
docker::deploy_service $STACK "${COMPOSE_FILE_PATH}" "docker-compose.yml" "$openhim_dev_compose_filename"

openhim-mapping-mediator/docker-compose.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@ version: '3.9'
22

33
services:
44
openhim-mapping-mediator:
5-
image: jembi/openhim-mediator-mapping:v3.0.0
5+
image: jembi/openhim-mediator-mapping:v3.1.0
66
environment:
77
OPENHIM_REGISTER: ${OPENHIM_REGISTER}
88
MONGO_URL: ${OPENHIM_MONGO_URL}
99
OPENHIM_URL: ${OPENHIM_URL}
1010
OPENHIM_USERNAME: ${OPENHIM_USERNAME}
1111
OPENHIM_PASSWORD: ${OPENHIM_PASSWORD}
12+
KAFKA_BROKERS: ${KAFKA_BROKERS}
13+
KAFKA_CLIENTID: ${KAFKA_CLIENTID}
14+
KAFKA_CONSUMER_GROUPID: ${KAFKA_CONSUMER_GROUPID}
1215
networks:
1316
openhim:
1417
mongo:
18+
kafka:
1519

1620
networks:
1721
openhim:
@@ -20,3 +24,6 @@ networks:
2024
mongo:
2125
name: openhim_mongo_public
2226
external: true
27+
kafka:
28+
name: kafka_public
29+
external: true

openhim-mapping-mediator/package-metadata.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"OPENHIM_USERNAME": "root@openhim.org",
1111
"OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim",
1212
"OPENHIM_REGISTER": "true",
13-
"OPENHIM_PASSWORD": "instant101"
13+
"OPENHIM_PASSWORD": "instant101",
14+
"KAFKA_BROKERS": "kafka-01:9092",
15+
"KAFKA_CLIENTID": "mapping-mediator",
16+
"KAFKA_CONSUMER_GROUPID": "mapping-mediator"
1417
}
1518
}

remote-img-load.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22

33
readonly HOST="$1"
44
readonly USER=${2:-ubuntu}
5+
TAG_NAME=${3:-latest} #Default to latest if version is not supplied
6+
57
if [ -z "${HOST}" ]; then
68
echo "Usage: ./remote-img-load.sh <host>"
79
exit 1
810
fi
911

10-
TAG_NAME=${1:-latest} #Default to latest if no parameter supplied and no version is specified in the config.yaml file
1112
CONFIG_TAG=$(docker run --rm -v "${PWD}":/workdir mikefarah/yq:4.24.5 '.image' "config.yaml")
1213
if [ "$CONFIG_TAG" != "null" ]; then
1314
TagVersion=${CONFIG_TAG:15}
1415
if [ -n "$TagVersion" ]; then
15-
if [[ -z "$1" ]]; then
16+
if [[ -z "$3" ]]; then
1617
#Override the TAG_NAME with the one specified in config.yaml only if no parameter was supplied
1718
TAG_NAME=$TagVersion
1819
fi
1920
fi
2021
fi
21-
2222
./build-image.sh "$TAG_NAME"
2323
echo "Transfering image to ${HOST} ..."
24-
docker save jembi/platform:latest | bzip2 | ssh "${USER}@${HOST}" docker load
24+
docker save jembi/platform:"$TAG_NAME" | bzip2 | ssh "${USER}@${HOST}" docker load
2525
echo "Image transfered"

test/cucumber/features/single-mode/openhim-packages.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ Feature: Openhim and its dependent packages?
2727
| openhim_mongo_public | openhim_public |
2828

2929
Scenario: Destroy Openhim and its dependent packages
30-
Given I use parameters "package destroy -n=interoperability-layer-openhim,client-registry-jempi,openhim-mapping-mediator --only --dev --env-file=.env.local"
30+
Given I use parameters "package destroy -n=interoperability-layer-openhim,openhim-mapping-mediator --only --dev --env-file=.env.local"
3131
When I launch the platform with params
3232
Then The service "mongo-1" should be removed
3333
And The service "openhim-core" should be removed

0 commit comments

Comments
 (0)