Skip to content

Commit e0fa656

Browse files
authored
Merge pull request #1172 from opencrvs/ocrvs-10450
feat(ocrvs-10450): mongo fdw for postgres
2 parents 5949fcd + f22cd9d commit e0fa656

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Changelog
22

3+
## 2.0.0
4+
5+
### Breaking changes
6+
7+
- Switch to docker.io/chumaky/postgres_mongo_fdw:17.6_fdw5.5.2 image to support `mongo_fdw`. This is required for the legacy user migrations to work. It will be switched back to the official postgres image in a future release.
8+
- A new service `legacy-user-migration` which runs the same migration image but with the `migrate-legacy-users` flag and with the following new environment variables:
9+
- EVENTS_SUPERUSER_POSTGRES_URL
10+
- MONGO_HOST
11+
- MONGO_PORT
12+
- MONGO_USERNAME
13+
- MONGO_PASSWORD
14+
- MONGO_REPLICA_SET
15+
16+
The default values for these variables have been added to the `docker-compose.deploy.yml` file. They should work out of the box for most deployments, but please ensure to set them correctly if you have a custom MongoDB setup.
17+
318
## 1.9.1
419

520
### Breaking changes

infrastructure/docker-compose.deploy.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -913,6 +913,7 @@ services:
913913
options:
914914
gelf-address: 'udp://127.0.0.1:12201'
915915
tag: 'config'
916+
916917
migration:
917918
environment:
918919
- USER_MGNT_MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1/user-mgnt?replicaSet=rs0
@@ -942,6 +943,49 @@ services:
942943
options:
943944
gelf-address: 'udp://127.0.0.1:12201'
944945
tag: 'migration'
946+
947+
legacy-user-migration:
948+
image: ghcr.io/opencrvs/ocrvs-migration:${VERSION}
949+
command: ["/bin/sh", "-c", "/app/wait && yarn start:prod --migrate-legacy-users"]
950+
environment:
951+
- USER_MGNT_MONGO_URL=mongodb://user-mgnt:${USER_MGNT_MONGODB_PASSWORD}@mongo1/user-mgnt?replicaSet=rs0
952+
- DASHBOARD_MONGO_URL=mongodb://performance:${PERFORMANCE_MONGODB_PASSWORD}@mongo1/performance?replicaSet=rs0
953+
- APPLICATION_CONFIG_MONGO_URL=mongodb://config:${CONFIG_MONGODB_PASSWORD}@mongo1/application-config?replicaSet=rs0
954+
- HEARTH_MONGO_URL=mongodb://hearth:${HEARTH_MONGODB_PASSWORD}@mongo1/hearth-dev?replicaSet=rs0
955+
- EVENTS_MONGO_URL=mongodb://events:${EVENTS_MONGODB_PASSWORD}@mongo1/events?replicaSet=rs0
956+
- OPENHIM_MONGO_URL=mongodb://openhim:${OPENHIM_MONGODB_PASSWORD}@mongo1/openhim-dev?replicaSet=rs0
957+
- EVENTS_POSTGRES_URL=postgres://events_migrator:${EVENTS_MIGRATOR_POSTGRES_PASSWORD}@postgres/events
958+
- EVENTS_SUPERUSER_POSTGRES_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres/events
959+
- SEARCH_URL=http://search:9090/
960+
- ES_HOST=search-user:${ROTATING_SEARCH_ELASTIC_PASSWORD}@elasticsearch:9200
961+
- INFLUX_HOST=influxdb
962+
- INFLUX_PORT=8086
963+
- INFLUX_DB=ocrvs
964+
- WAIT_HOSTS=mongo1:27017,influxdb:8086,minio:9000,elasticsearch:9200
965+
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER}
966+
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD}
967+
- MINIO_HOST=minio
968+
- MINIO_PORT=9000
969+
- MINIO_BUCKET=ocrvs
970+
- SUPER_USER_PASSWORD=${SUPER_USER_PASSWORD}
971+
- MONGO_HOST=mongo1
972+
- MONGO_PORT=27017
973+
- MONGO_USERNAME=${MONGODB_ADMIN_USER}
974+
- MONGO_PASSWORD=${MONGODB_ADMIN_PASSWORD}
975+
- MONGO_REPLICA_SET=rs0
976+
deploy:
977+
labels:
978+
- 'traefik.enable=false'
979+
replicas: 1
980+
restart_policy:
981+
condition: on-failure
982+
networks:
983+
- overlay_net
984+
logging:
985+
driver: gelf
986+
options:
987+
gelf-address: 'udp://127.0.0.1:12201'
988+
tag: 'legacy-user-migration'
945989
# Configure other dependencies with deployment specifc details
946990
hearth:
947991
environment:
@@ -967,7 +1011,7 @@ services:
9671011
tag: 'hearth'
9681012

9691013
postgres:
970-
image: postgres:17.6
1014+
image: docker.io/chumaky/postgres_mongo_fdw:17.6_fdw5.5.2
9711015
networks:
9721016
- overlay_net
9731017
restart: unless-stopped

0 commit comments

Comments
 (0)