diff --git a/.env.cluster b/.env.cluster index b0f144a9..a1215e27 100644 --- a/.env.cluster +++ b/.env.cluster @@ -88,18 +88,18 @@ GF_SERVER_DOMAIN=grafana.domain KC_POSTGRES_REPLICA_SET=pgpool-1:5432,pgpool-2:5432,pgpool-3:5432 # Client Registry - JeMPI -JEMPI_WEB_INSTANCES=3 +JEMPI_WEB_INSTANCES=1 REACT_APP_JEMPI_BASE_API_HOST=https://jempi-api.domain REACT_APP_JEMPI_BASE_API_PORT=50000 JEMPI_SESSION_SECURE=true -JEMPI_REPMGR_PARTNER_NODES=jempi-postgresql-01,jempi-postgresql-02,jempi-postgresql-03 +JEMPI_REPMGR_PARTNER_NODES=jempi-postgresql-01 JEMPI_ASYNC_RECEIVER_INSTANCES=1 JEMPI_SYNC_RECEIVER_INSTANCES=1 JEMPI_PRE_PROCESSOR_INSTANCES=1 JEMPI_CONTROLLER_INSTANCES=1 JEMPI_EM_CALCULATOR_INSTANCES=1 JEMPI_LINKER_INSTANCES=1 -JEMPI_API_INSTANCES=3 +JEMPI_API_INSTANCES=1 # Resource limits OPENHIM_MEMORY_LIMIT=4G diff --git a/client-registry-jempi/swarm.sh b/client-registry-jempi/swarm.sh index d1323691..92e57aa2 100644 --- a/client-registry-jempi/swarm.sh +++ b/client-registry-jempi/swarm.sh @@ -52,11 +52,12 @@ function initialize_package() { log info "Running package in PROD mode" fi - if [[ "$CLUSTERED_MODE" == "true" ]]; then - dgraph_cluster_compose_param="docker-compose.dgraph-cluster.yml" - dgraph_zero_cluster_compose_param="docker-compose.dgraph-zero-cluster.yml" - combined_cluster_compose_param="docker-compose.combined-cluster.yml" - fi + # Jempi not working in clustered mode, temporarily disable + # if [[ "$CLUSTERED_MODE" == "true" ]]; then + # dgraph_cluster_compose_param="docker-compose.dgraph-cluster.yml" + # dgraph_zero_cluster_compose_param="docker-compose.dgraph-zero-cluster.yml" + # combined_cluster_compose_param="docker-compose.combined-cluster.yml" + # fi ( log info "Importing JeMPI Kafka topics" diff --git a/identity-access-manager-keycloak/docker-compose-postgres.cluster.yml b/identity-access-manager-keycloak/docker-compose-postgres.cluster.yml deleted file mode 100644 index a6ec7061..00000000 --- a/identity-access-manager-keycloak/docker-compose-postgres.cluster.yml +++ /dev/null @@ -1,75 +0,0 @@ -version: '3.9' - -services: - keycloak-postgres-1: - environment: - REPMGR_PARTNER_NODES: ${KC_REPMGR_PARTNER_NODES} - deploy: - placement: - constraints: - - "node.labels.name==node-1" - - keycloak-postgres-2: - image: bitnami/postgresql-repmgr:14 - environment: - POSTGRESQL_PASSWORD: ${KC_POSTGRESQL_PASSWORD} - POSTGRESQL_USERNAME: ${KC_POSTGRESQL_USERNAME} - POSTGRESQL_DATABASE: ${KC_POSTGRESQL_DATABASE} - REPMGR_NODE_NETWORK_NAME: keycloak-postgres-2 - REPMGR_PASSWORD: ${KC_REPMGR_PASSWORD} - REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: keycloak-postgres-2 - REPMGR_PRIMARY_HOST: ${KC_REPMGR_PRIMARY_HOST} - REPMGR_PARTNER_NODES: ${KC_REPMGR_PARTNER_NODES} - volumes: - - 'keycloak-postgres-2-data:/bitnami/postgresql' - deploy: - placement: - constraints: - - "node.labels.name==node-2" - replicas: 1 - resources: - limits: - cpus: ${KC_POSTGRES_CPU_LIMIT} - memory: ${KC_POSTGRES_MEMORY_LIMIT} - reservations: - cpus: ${KC_POSTGRES_CPU_RESERVE} - memory: ${KC_POSTGRES_MEMORY_RESERVE} - networks: - default: - keycloak_backup_net: {} - - - keycloak-postgres-3: - image: bitnami/postgresql-repmgr:14 - environment: - POSTGRESQL_PASSWORD: ${KC_POSTGRESQL_PASSWORD} - POSTGRESQL_USERNAME: ${KC_POSTGRESQL_USERNAME} - POSTGRESQL_DATABASE: ${KC_POSTGRESQL_DATABASE} - REPMGR_NODE_NETWORK_NAME: keycloak-postgres-3 - REPMGR_PASSWORD: ${KC_REPMGR_PASSWORD} - REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: keycloak-postgres-3 - REPMGR_PRIMARY_HOST: ${KC_REPMGR_PRIMARY_HOST} - REPMGR_PARTNER_NODES: ${KC_REPMGR_PARTNER_NODES} - volumes: - - 'keycloak-postgres-3-data:/bitnami/postgresql' - deploy: - placement: - constraints: - - "node.labels.name==node-3" - replicas: 1 - resources: - limits: - cpus: ${KC_POSTGRES_CPU_LIMIT} - memory: ${KC_POSTGRES_MEMORY_LIMIT} - reservations: - cpus: ${KC_POSTGRES_CPU_RESERVE} - memory: ${KC_POSTGRES_MEMORY_RESERVE} - networks: - default: - keycloak_backup_net: {} - -volumes: - keycloak-postgres-2-data: - keycloak-postgres-3-data: diff --git a/identity-access-manager-keycloak/docker-compose-postgres.dev.yml b/identity-access-manager-keycloak/docker-compose-postgres.dev.yml deleted file mode 100644 index 79e221ae..00000000 --- a/identity-access-manager-keycloak/docker-compose-postgres.dev.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: '3.9' - -services: - keycloak-postgres-1: - ports: - - target: 5432 - published: 5434 - mode: host diff --git a/identity-access-manager-keycloak/docker-compose-postgres.yml b/identity-access-manager-keycloak/docker-compose-postgres.yml deleted file mode 100644 index 4a8f2279..00000000 --- a/identity-access-manager-keycloak/docker-compose-postgres.yml +++ /dev/null @@ -1,40 +0,0 @@ -version: "3.9" - -services: - keycloak-postgres-1: - image: bitnami/postgresql-repmgr:14 - environment: - POSTGRESQL_PASSWORD: ${KC_POSTGRESQL_PASSWORD} - POSTGRESQL_USERNAME: ${KC_POSTGRESQL_USERNAME} - POSTGRESQL_DATABASE: ${KC_POSTGRESQL_DATABASE} - POSTGRESQL_POSTGRES_PASSWORD: ${KC_POSTGRESQL_PASSWORD} - REPMGR_NODE_NETWORK_NAME: keycloak-postgres-1 - REPMGR_PASSWORD: ${KC_REPMGR_PASSWORD} - REPMGR_RECONNECT_INTERVAL: 3 - REPMGR_NODE_NAME: keycloak-postgres-1 - REPMGR_PRIMARY_HOST: ${KC_REPMGR_PRIMARY_HOST} - REPMGR_PARTNER_NODES: ${KC_REPMGR_PARTNER_NODES} - volumes: - - "keycloak-postgres-1-data:/bitnami/postgresql" - deploy: - replicas: 1 - resources: - limits: - cpus: ${KC_POSTGRES_CPU_LIMIT} - memory: ${KC_POSTGRES_MEMORY_LIMIT} - reservations: - cpus: ${KC_POSTGRES_CPU_RESERVE} - memory: ${KC_POSTGRES_MEMORY_RESERVE} - networks: - default: - keycloak_backup_net: {} - -volumes: - keycloak-postgres-1-data: - -networks: - default: - keycloak_backup_net: - name: keycloak_backup - driver: overlay - attachable: true diff --git a/identity-access-manager-keycloak/docker-compose.yml b/identity-access-manager-keycloak/docker-compose.yml index bb4d38dc..d2025ac4 100644 --- a/identity-access-manager-keycloak/docker-compose.yml +++ b/identity-access-manager-keycloak/docker-compose.yml @@ -1,14 +1,14 @@ -version: '3.9' +version: "3.9" services: identity-access-manager-keycloak: - image: keycloak/keycloak:20.0 + image: ${KEYCLOAK_IMAGE} command: [ "start", "--proxy=edge", "--hostname-url=${KC_FRONTEND_URL}", - "--import-realm" + "--import-realm", ] hostname: identity-access-manager-keycloak healthcheck: @@ -44,7 +44,7 @@ services: KC_OPENHIM_ROOT_URL: ${KC_OPENHIM_ROOT_URL} deploy: placement: - max_replicas_per_node: 1 + max_replicas_per_node: ${KEYCLOAK_MAX_REPLICAS_PER_NODE} networks: reverse-proxy: public: diff --git a/identity-access-manager-keycloak/package-metadata.json b/identity-access-manager-keycloak/package-metadata.json index 6b6436b1..88d546cb 100644 --- a/identity-access-manager-keycloak/package-metadata.json +++ b/identity-access-manager-keycloak/package-metadata.json @@ -6,6 +6,14 @@ "version": "0.0.1", "dependencies": ["database-postgres"], "environmentVariables": { + "POSTGRES_IMAGE": "bitnami/postgresql-repmgr:14", + "KEYCLOAK_POSTGRES_1": "node-1", + "KEYCLOAK_POSTGRES_2": "node-2", + "KEYCLOAK_POSTGRES_3": "node-3", + "POSTGRES_REPLICAS": "1", + "KEYCLOAK_IMAGE": "keycloak/keycloak:20.0", + "KEYCLOAK_REPLICAS": "1", + "KEYCLOAK_MAX_REPLICAS_PER_NODE": "1", "KEYCLOAK_ADMIN": "admin", "KEYCLOAK_ADMIN_PASSWORD": "dev_password_only", "KC_FRONTEND_URL": "http://localhost:9088", diff --git a/interoperability-layer-openhim/docker-compose-mongo.cluster.yml b/interoperability-layer-openhim/docker-compose-mongo.cluster.yml index 566ec6b5..79868fdf 100644 --- a/interoperability-layer-openhim/docker-compose-mongo.cluster.yml +++ b/interoperability-layer-openhim/docker-compose-mongo.cluster.yml @@ -1,23 +1,23 @@ -version: '3.9' +version: "3.9" services: mongo-1: - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + command: ["--replSet", "mongo-set", "--wiredTigerCacheSizeGB", "0.5"] deploy: placement: constraints: - - "node.labels.name==node-1" + - "node.labels.name==${MONGO_1_PLACEMENT}" mongo-2: - image: mongo:4.2 + image: ${MONGO_IMAGE} volumes: - - 'openhim-mongo-02:/data/db' - - 'openhim-mongo-02-config:/data/configdb' - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + - "openhim-mongo-02:/data/db" + - "openhim-mongo-02-config:/data/configdb" + command: ["--replSet", "mongo-set", "--wiredTigerCacheSizeGB", "0.5"] deploy: placement: constraints: - - "node.labels.name==node-2" + - "node.labels.name==${MONGO_2_PLACEMENT}" replicas: 1 resources: limits: @@ -32,15 +32,15 @@ services: mongo_backup_net: mongo-3: - image: mongo:4.2 + image: ${MONGO_IMAGE} volumes: - - 'openhim-mongo-03:/data/db' - - 'openhim-mongo-03-config:/data/configdb' - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + - "openhim-mongo-03:/data/db" + - "openhim-mongo-03-config:/data/configdb" + command: ["--replSet", "mongo-set", "--wiredTigerCacheSizeGB", "0.5"] deploy: placement: constraints: - - "node.labels.name==node-3" + - "node.labels.name==${MONGO_3_PLACEMENT}" replicas: 1 resources: limits: diff --git a/interoperability-layer-openhim/docker-compose-mongo.yml b/interoperability-layer-openhim/docker-compose-mongo.yml index c67589f6..69117ee7 100644 --- a/interoperability-layer-openhim/docker-compose-mongo.yml +++ b/interoperability-layer-openhim/docker-compose-mongo.yml @@ -2,8 +2,8 @@ version: "3.9" services: mongo-1: - image: mongo:4.2 - command: ['--replSet', 'mongo-set', '--wiredTigerCacheSizeGB', '0.5'] + image: ${MONGO_IMAGE} + command: ["--replSet", "mongo-set", "--wiredTigerCacheSizeGB", "0.5"] volumes: - "openhim-mongo-01:/data/db" - "openhim-mongo-01-config:/data/configdb" diff --git a/interoperability-layer-openhim/docker-compose.await-helper-mongo.yml b/interoperability-layer-openhim/docker-compose.await-helper-mongo.yml index c02d4ffe..82729d17 100644 --- a/interoperability-layer-openhim/docker-compose.await-helper-mongo.yml +++ b/interoperability-layer-openhim/docker-compose.await-helper-mongo.yml @@ -1,10 +1,10 @@ -version: '3.9' +version: "3.9" services: await-helper: - image: jembi/await-helper:1.0.1 + image: ${AWAIT_HELPER_IMAGE} deploy: replicas: 1 restart_policy: condition: none - command: '-k http://mongo-1:27017' + command: "-k http://mongo-1:27017" diff --git a/interoperability-layer-openhim/docker-compose.await-helper.yml b/interoperability-layer-openhim/docker-compose.await-helper.yml index 8fe4c43e..9625820b 100644 --- a/interoperability-layer-openhim/docker-compose.await-helper.yml +++ b/interoperability-layer-openhim/docker-compose.await-helper.yml @@ -1,10 +1,10 @@ -version: '3.9' +version: "3.9" services: await-helper: - image: jembi/await-helper:1.0.1 + image: ${AWAIT_HELPER_IMAGE} deploy: replicas: 1 restart_policy: condition: none - command: '-k https://openhim-core:8080/heartbeat' + command: "-k https://openhim-core:8080/heartbeat" diff --git a/interoperability-layer-openhim/docker-compose.yml b/interoperability-layer-openhim/docker-compose.yml index de445e94..518d93dc 100644 --- a/interoperability-layer-openhim/docker-compose.yml +++ b/interoperability-layer-openhim/docker-compose.yml @@ -27,7 +27,7 @@ services: deploy: replicas: ${OPENHIM_CORE_INSTANCES} placement: - max_replicas_per_node: 1 + max_replicas_per_node: ${OPENHIM_CORE_MAX_REPLICAS_PER_NODE} resources: limits: cpus: ${OPENHIM_CPU_LIMIT} @@ -41,7 +41,7 @@ services: - prometheus-port=8080 openhim-console: - image: ${OPENHIM_CONSOLE_VERSION} + image: ${OPENHIM_CONSOLE_IMAGE} environment: OPENHIM_CORE_MEDIATOR_HOSTNAME: ${OPENHIM_CORE_MEDIATOR_HOSTNAME} OPENHIM_MEDIATOR_API_PORT: ${OPENHIM_MEDIATOR_API_PORT} @@ -58,7 +58,7 @@ services: deploy: replicas: ${OPENHIM_CONSOLE_INSTANCES} placement: - max_replicas_per_node: 1 + max_replicas_per_node: ${OPENHIM_CONSOLE_MAX_REPLICAS_PER_NODE} resources: limits: cpus: ${OPENHIM_CONSOLE_CPU_LIMIT} diff --git a/interoperability-layer-openhim/package-metadata.json b/interoperability-layer-openhim/package-metadata.json index 1d8974b1..a866f05c 100644 --- a/interoperability-layer-openhim/package-metadata.json +++ b/interoperability-layer-openhim/package-metadata.json @@ -7,9 +7,17 @@ "dependencies": [], "environmentVariables": { "OPENHIM_CORE_IMAGE": "jembi/openhim-core:microfrontends-3.0.0-beta", + "OPENHIM_CONSOLE_IMAGE": "jembi/openhim-console:v1.18.2", + "MONGO_IMAGE": "mongo:4.2", + "AWAIT_HELPER_IMAGE": "jembi/await-helper:1.0.1", + "MONGO_1_PLACEMENT": "node-1", + "MONGO_2_PLACEMENT": "node-2", + "MONGO_3_PLACEMENT": "node-3", "MONGO_SET_COUNT": "1", "OPENHIM_CORE_INSTANCES": "1", + "OPENHIM_CORE_MAX_REPLICAS_PER_NODE": "1", "OPENHIM_CONSOLE_INSTANCES": "1", + "OPENHIM_CONSOLE_MAX_REPLICAS_PER_NODE": "1", "OPENHIM_CORE_MEDIATOR_HOSTNAME": "localhost", "OPENHIM_MEDIATOR_API_PORT": "8080", "OPENHIM_CPU_LIMIT": "0", @@ -27,7 +35,6 @@ "OPENHIM_MONGO_MEMORY_RESERVE": "500M", "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim", "OPENHIM_MONGO_ATNAURL": "mongodb://mongo-1:27017/openhim", - "OPENHIM_CONSOLE_VERSION": "jembi/openhim-console:microfrontend-poc", "KAFKA_HOSTS": "kafka-01:9092", "KC_REALM_NAME": "platform-realm", "KC_FRONTEND_URL": "http://localhost:9088", diff --git a/job-scheduler-ofelia/docker-compose.yml b/job-scheduler-ofelia/docker-compose.yml index 5cd0e3c8..00740f61 100644 --- a/job-scheduler-ofelia/docker-compose.yml +++ b/job-scheduler-ofelia/docker-compose.yml @@ -1,8 +1,8 @@ -version: '3.9' +version: "3.9" services: job-scheduler-ofelia: - image: mcuadros/ofelia:v0.3.6 + image: ${JOB_SCHEDULER_OFELIA_IMAGE} command: daemon --config=/tmp/config.ini configs: - target: /tmp/config.ini @@ -14,5 +14,5 @@ configs: ofelia-config.ini: file: ./config.ini name: ofelia-config.ini-${ofelia_config_ini_DIGEST:?err} - labels: + labels: name: ofelia diff --git a/job-scheduler-ofelia/package-metadata.json b/job-scheduler-ofelia/package-metadata.json index a4592a6d..719dffae 100644 --- a/job-scheduler-ofelia/package-metadata.json +++ b/job-scheduler-ofelia/package-metadata.json @@ -6,6 +6,7 @@ "version": "0.0.1", "dependencies": [], "environmentVariables": { + "JOB_SCHEDULER_OFELIA_IMAGE": "mcuadros/ofelia:v0.3.6", "RENEWAL_EMAIL": "dummy@jembi.org", "STAGING": "true", "DOMAIN_NAME": "localhost", diff --git a/openhim-mapping-mediator/docker-compose.yml b/openhim-mapping-mediator/docker-compose.yml index cdfdd87b..3503fcf2 100644 --- a/openhim-mapping-mediator/docker-compose.yml +++ b/openhim-mapping-mediator/docker-compose.yml @@ -1,8 +1,8 @@ -version: '3.9' +version: "3.9" services: openhim-mapping-mediator: - image: jembi/openhim-mediator-mapping:v3.3.0 + image: ${OPENHIM_MAPPING_MEDIATOR_IMAGE} environment: OPENHIM_REGISTER: ${OPENHIM_REGISTER} MONGO_URL: ${OPENHIM_MONGO_URL} diff --git a/openhim-mapping-mediator/package-metadata.json b/openhim-mapping-mediator/package-metadata.json index 353515e5..f0b9cb0a 100644 --- a/openhim-mapping-mediator/package-metadata.json +++ b/openhim-mapping-mediator/package-metadata.json @@ -6,6 +6,7 @@ "version": "0.0.1", "dependencies": ["interoperability-layer-openhim"], "environmentVariables": { + "OPENHIM_MAPPING_MEDIATOR_IMAGE": "jembi/openhim-mediator-mapping:v3.3.0", "OPENHIM_URL": "https://openhim-core:8080", "OPENHIM_USERNAME": "root@openhim.org", "OPENHIM_MONGO_URL": "mongodb://mongo-1:27017/openhim", diff --git a/test/cucumber/features/cluster-mode/jempi.cluster.feature b/test/cucumber/features/cluster-mode/jempi.cluster.feature index 81279549..83210fd8 100644 --- a/test/cucumber/features/cluster-mode/jempi.cluster.feature +++ b/test/cucumber/features/cluster-mode/jempi.cluster.feature @@ -23,8 +23,6 @@ Feature: Client Registry JeMPI? And The service "jempi-alpha-02" should be started with 1 replica And The service "jempi-alpha-03" should be started with 1 replica And The service "jempi-zero-01" should be started with 1 replica - And The service "jempi-zero-02" should be started with 1 replica - And The service "jempi-zero-03" should be started with 1 replica And The service "jempi-async-receiver" should be started with 1 replica And The service "jempi-async-receiver" should be connected to the networks | kafka_public | jempi_default | @@ -41,12 +39,11 @@ Feature: Client Registry JeMPI? And The service "jempi-linker" should be started with 1 replica And The service "jempi-linker" should be connected to the networks | kafka_public | jempi_default | - And The service "jempi-api" should be started with 3 replica + And The service "jempi-api" should be started with 1 replica + And The service "mongo-1" should be started with 1 replica And The service "jempi-api" should be connected to the networks | kafka_public | jempi_default | And The service "jempi-postgresql-01" should be started with 1 replica - And The service "jempi-postgresql-02" should be started with 1 replica - And The service "jempi-postgresql-03" should be started with 1 replica And The service "jempi-web" should be started with 3 replica And The service "jempi-web" should be connected to the networks | reverse-proxy_public | keycloak_public | jempi_default | @@ -74,13 +71,9 @@ Feature: Client Registry JeMPI? And The service "jempi-em-calculator" should be removed And The service "jempi-linker" should be removed And The service "jempi-zero-01" should be removed - And The service "jempi-zero-02" should be removed - And The service "jempi-zero-03" should be removed And The service "jempi-api" should be removed And The service "jempi-web" should be removed And The service "jempi-postgresql-01" should be removed - And The service "jempi-postgresql-02" should be removed - And The service "jempi-postgresql-03" should be removed And The service "mongo-1" should be removed And The service "mongo-2" should be removed And The service "mongo-3" should be removed