diff --git a/analytics-datastore-clickhouse/swarm.sh b/analytics-datastore-clickhouse/swarm.sh index 15af15f0..f5a3d18a 100755 --- a/analytics-datastore-clickhouse/swarm.sh +++ b/analytics-datastore-clickhouse/swarm.sh @@ -31,7 +31,7 @@ main() { clickhouse_dev_compose_param="-c ${COMPOSE_FILE_PATH}/docker-compose.cluster.dev.yml" fi - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.cluster.yml $clickhouse_dev_compose_param instant" "Failed to deploy Analytics Datastore Clickhouse" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.cluster.yml $clickhouse_dev_compose_param --with-registry-auth instant" "Failed to deploy Analytics Datastore Clickhouse" docker::await_container_startup analytics-datastore-clickhouse-01 docker::await_container_status analytics-datastore-clickhouse-01 Running @@ -52,14 +52,14 @@ main() { clickhouse_dev_compose_param="-c ${COMPOSE_FILE_PATH}/docker-compose.dev.yml" fi - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $clickhouse_dev_compose_param instant" "Failed to deploy Analytics Datastore Clickhouse" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $clickhouse_dev_compose_param --with-registry-auth instant" "Failed to deploy Analytics Datastore Clickhouse" docker::await_container_startup analytics-datastore-clickhouse docker::await_container_status analytics-datastore-clickhouse Running fi log info "Setting config digests" config::set_config_digests "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start config importer" log info "Waiting to give core config importer time to run before cleaning up service" diff --git a/analytics-datastore-elastic-search/swarm.sh b/analytics-datastore-elastic-search/swarm.sh index 6cbc5d96..c701fcbb 100644 --- a/analytics-datastore-elastic-search/swarm.sh +++ b/analytics-datastore-elastic-search/swarm.sh @@ -33,7 +33,7 @@ import_elastic_index() { # TODO: (castelloG) [PLAT-255] Add support for multiple index imports log info "Importing Elasticsearch index mapping" config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start elastic search config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start elastic search config importer" config::remove_stale_service_configs "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml "elasticsearch" config::remove_config_importer elastic-search-config-importer } @@ -56,7 +56,7 @@ fi create_certs() { log info "Creating certificates" - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.certs.yml instant" "Creating certificates failed" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.certs.yml --with-registry-auth instant" "Creating certificates failed" docker::await_container_startup create_certs docker::await_container_status create_certs Complete @@ -113,13 +113,13 @@ add_docker_configs() { if [[ "$ACTION" == "init" ]]; then if [[ "$STATEFUL_NODES" == "cluster" ]]; then create_certs - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.cluster.yml instant" "Failed to deploy cluster" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.cluster.yml --with-registry-auth instant" "Failed to deploy cluster" add_docker_configs log info "Waiting for elasticsearch to start before automatically setting built-in passwords" docker::await_container_status $leader_node Running else - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $elastic_search_dev_compose_param instant" "Failed to deploy Analytics Datastore Elastic Search" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $elastic_search_dev_compose_param --with-registry-auth instant" "Failed to deploy Analytics Datastore Elastic Search" log info "Waiting for elasticsearch to start before automatically setting built-in passwords" docker::await_container_status $leader_node Starting diff --git a/client-registry-jempi/importer/openhim/docker-compose.config.yml b/client-registry-jempi/importer/openhim/docker-compose.config.yml new file mode 100644 index 00000000..af000aa9 --- /dev/null +++ b/client-registry-jempi/importer/openhim/docker-compose.config.yml @@ -0,0 +1,33 @@ +version: '3.9' + +services: + jempi-openhim-config-importer: + image: node:erbium-alpine + deploy: + restart_policy: + condition: none + environment: + OPENHIM_CORE_SERVICE_NAME: openhim-core + OPENHIM_MEDIATOR_API_PORT: 8080 + OPENHIM_API_USERNAME: root@openhim.org + OPENHIM_API_PASSWORD: ${JEMPI_OPENHIM_PASSWORD} + NODE_TLS_REJECT_UNAUTHORIZED: 0 + command: sh -c "node openhimConfig.js" + configs: + - source: openhim-config-importer-openhimConfig.js + target: /openhimConfig.js + - source: openhim-config-importer-openhim-import.json + target: /openhim-import.json + +configs: + openhim-config-importer-openhimConfig.js: + file: ./openhimConfig.js + name: openhim-config-importer-openhimConfig.js-${openhim_config_importer_openhimConfig_js_DIGEST:?err} + labels: + name: openhim + openhim-config-importer-openhim-import.json: + file: ./openhim-import.json + name: openhim-config-importer-openhim-import.json-${openhim_config_importer_openhim_import_js_DIGEST:?err} + labels: + name: openhim + diff --git a/client-registry-jempi/importer/openhim/openhim-import.json b/client-registry-jempi/importer/openhim/openhim-import.json new file mode 100644 index 00000000..c1439d7b --- /dev/null +++ b/client-registry-jempi/importer/openhim/openhim-import.json @@ -0,0 +1,106 @@ +{ + "Channels": [ + { + "methods": ["POST"], + "type": "http", + "allow": ["instant"], + "whitelist": [], + "authType": "private", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "JeMPI Sync Receiver", + "secured": false, + "host": "jempi-sync-reciever", + "port": 50000, + "path": "", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "requestBody": true, + "responseBody": true, + "rewriteUrlsConfig": [], + "name": "JeMPI Sync Receiver", + "urlPattern": "^/fhir/Patient.*$", + "priority": 10, + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentValue": null, + "matchContentJson": null, + "pollingSchedule": null, + "tcpHost": null, + "tcpPort": null, + "updatedBy": { + "id": "605c8ddd9e66da001494935e", + "name": "Super User" + }, + "alerts": [] + }, + { + "methods": ["POST"], + "type": "http", + "allow": ["instant"], + "whitelist": [], + "authType": "private", + "matchContentTypes": [], + "properties": [], + "txViewAcl": [], + "txViewFullAcl": [], + "txRerunAcl": [], + "status": "enabled", + "rewriteUrls": false, + "addAutoRewriteRules": true, + "autoRetryEnabled": false, + "autoRetryPeriodMinutes": 60, + "routes": [ + { + "type": "http", + "status": "enabled", + "forwardAuthHeader": false, + "name": "JeMPI Async Receiver", + "secured": false, + "host": "jempi-async-reciever", + "port": 50000, + "path": "", + "pathTransform": "", + "primary": true, + "username": "", + "password": "" + } + ], + "requestBody": true, + "responseBody": true, + "rewriteUrlsConfig": [], + "name": "JeMPI Async Receiver", + "urlPattern": "^/csv/?$", + "priority": 1, + "matchContentRegex": null, + "matchContentXpath": null, + "matchContentValue": null, + "matchContentJson": null, + "pollingSchedule": null, + "tcpHost": null, + "tcpPort": null, + "updatedBy": { + "id": "605c8ddd9e66da001494935e", + "name": "Super User" + }, + "alerts": [] + } + ] +} diff --git a/client-registry-jempi/importer/openhim/openhimConfig.js b/client-registry-jempi/importer/openhim/openhimConfig.js new file mode 100644 index 00000000..b475407d --- /dev/null +++ b/client-registry-jempi/importer/openhim/openhimConfig.js @@ -0,0 +1,52 @@ +"use strict"; + +const fs = require("fs"); +const https = require("https"); +const path = require("path"); + +const OPENHIM_CORE_SERVICE_NAME = process.env.OPENHIM_CORE_SERVICE_NAME; +const OPENHIM_API_PASSWORD = process.env.OPENHIM_API_PASSWORD; +const OPENHIM_MEDIATOR_API_PORT = process.env.OPENHIM_MEDIATOR_API_PORT; +const OPENHIM_API_USERNAME = process.env.OPENHIM_API_USERNAME; + +const authHeader = new Buffer.from( + `${OPENHIM_API_USERNAME}:${OPENHIM_API_PASSWORD}` +).toString("base64"); + +const jsonData = JSON.parse( + fs.readFileSync(path.resolve(__dirname, "openhim-import.json")) +); + +const data = JSON.stringify(jsonData); + +const options = { + protocol: "https:", + hostname: OPENHIM_CORE_SERVICE_NAME, + port: OPENHIM_MEDIATOR_API_PORT, + path: "/metadata", + method: "POST", + headers: { + "Content-Type": "application/json", + "Content-Length": data.length, + Authorization: `Basic ${authHeader}`, + }, +}; + +const req = https.request(options, (res) => { + if (res.statusCode == 401) { + throw new Error(`Incorrect OpenHIM API credentials`); + } + + if (res.statusCode != 201) { + throw new Error(`Failed to import OpenHIM config: ${res.statusCode}`); + } + + console.log("Successfully imported OpenHIM config"); +}); + +req.on("error", (error) => { + console.error("Failed to import OpenHIM config: ", error); +}); + +req.write(data); +req.end(); diff --git a/client-registry-jempi/package-metadata.json b/client-registry-jempi/package-metadata.json index 67cb5994..a82a1bda 100644 --- a/client-registry-jempi/package-metadata.json +++ b/client-registry-jempi/package-metadata.json @@ -4,7 +4,7 @@ "description": "A patient matching and deduplicater for the platform", "type": "infrastructure", "version": "0.0.1", - "dependencies": [], + "dependencies": ["interoperability-layer-openhim"], "environmentVariables": { "STATEFUL_NODES": "single", "JEMPI_KAFKA_01_MEMORY_LIMIT": "3G", @@ -49,6 +49,7 @@ "JEMPI_CONTROLLER_IMAGE_TAG": "0.1.0", "JEMPI_EM_CALCULATOR_IMAGE_TAG": "0.1.0", "JEMPI_LINKER_IMAGE_TAG": "0.1.0", - "JEMPI_API_IMAGE_TAG": "0.1.0" + "JEMPI_API_IMAGE_TAG": "0.1.0", + "JEMPI_OPENHIM_PASSWORD": "instant101" } } diff --git a/client-registry-jempi/swarm.sh b/client-registry-jempi/swarm.sh index 6b301b1c..d710f1b3 100644 --- a/client-registry-jempi/swarm.sh +++ b/client-registry-jempi/swarm.sh @@ -64,19 +64,19 @@ main() { fi if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka.yml instant" "Failed to deploy Client Registry - JeMPI (kafka.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka.yml --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (kafka.yml)" docker::await_service_ready jempi-kafka-01 docker::await_service_ready jempi-kafka-02 docker::await_service_ready jempi-kafka-03 - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafdrop.yml $kafdrop_dev_compose_param instant" "Failed to deploy Client Registry - JeMPI (kafdrop.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafdrop.yml $kafdrop_dev_compose_param --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (kafdrop.yml)" docker::await_service_ready jempi-kafdrop config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to deploy jempi-kafka-config-importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to deploy jempi-kafka-config-importer" log info "Waiting to give JeMPI Kafka config importer time to run before cleaning up service" @@ -85,11 +85,11 @@ main() { config::remove_stale_service_configs "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml "jempi-kafka" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.dgraph-zero.yml $dgraph_zero_dev_compose_param $dgraph_zero_cluster_compose_param instant" "Failed to deploy Client Registry - JeMPI (dgraph-zero.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.dgraph-zero.yml $dgraph_zero_dev_compose_param $dgraph_zero_cluster_compose_param --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (dgraph-zero.yml)" docker::await_service_ready jempi-zero-01 - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.dgraph.yml $dgraph_dev_compose_param $dgraph_cluster_compose_param instant" "Failed to deploy Client Registry - JeMPI (dgraph.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.dgraph.yml $dgraph_dev_compose_param $dgraph_cluster_compose_param --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (dgraph.yml)" docker::await_service_ready jempi-alpha-01 docker::await_service_ready jempi-alpha-02 @@ -97,7 +97,7 @@ main() { docker::await_service_ready jempi-ratel - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.combined.yml $combined_dev_compose_param instant" "Failed to deploy Client Registry - JeMPI (combined.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.combined.yml $combined_dev_compose_param --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (combined.yml)" docker::await_service_ready jempi-async-receiver docker::await_service_ready jempi-sync-receiver @@ -106,10 +106,23 @@ main() { docker::await_service_ready jempi-em-calculator docker::await_service_ready jempi-linker - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.api.yml $api_dev_compose_param instant" "Failed to deploy Client Registry - JeMPI (api.yml)" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.api.yml $api_dev_compose_param --with-registry-auth instant" "Failed to deploy Client Registry - JeMPI (api.yml)" docker::await_service_ready jempi-api + if docker service ps -q instant_openhim-core &>/dev/null; then + config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/openhim/docker-compose.config.yml + + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/openhim/docker-compose.config.yml --with-registry-auth instant" "Failed to deploy jempi-openhim-config-importer" + + log info "Waiting to give JeMPI Openhim config importer time to run before cleaning up service" + + config::remove_config_importer jempi-openhim-config-importer + config::await_service_removed instant_jempi-openhim-config-importer + else + log warn "Service 'interoperability-layer-openhim' does not appear to be running... skipping configuring of async/sync JeMPI channels" + fi + docker::deploy_sanity "${service_names[@]}" elif [[ "${ACTION}" == "down" ]]; then log info "Scaling down client-registry-jempi" @@ -124,6 +137,9 @@ main() { docker::service_destroy "$service_name" done + docker::service_destroy jempi-kafka-config-importer + docker::service_destroy jempi-openhim-config-importer + docker::try_remove_volume jempi-kafka-01-data docker::try_remove_volume jempi-kafka-02-data docker::try_remove_volume jempi-kafka-03-data diff --git a/client-registry-santempi/swarm.sh b/client-registry-santempi/swarm.sh index 6b9486a9..74302a2a 100644 --- a/client-registry-santempi/swarm.sh +++ b/client-registry-santempi/swarm.sh @@ -51,17 +51,17 @@ main() { fi if [ "$ACTION" == "init" ]; then - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param instant" "Failed to deploy SanteMPI Postgres" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param --with-registry-auth instant" "Failed to deploy SanteMPI Postgres" await_postgres_start - try "docker stack deploy -c ""$COMPOSE_FILE_PATH""/docker-compose.yml $sante_mpi_dev_compose_param instant" "Failed to deploy SanteMPI" + try "docker stack deploy -c ""$COMPOSE_FILE_PATH""/docker-compose.yml $sante_mpi_dev_compose_param --with-registry-auth instant" "Failed to deploy SanteMPI" elif [ "$ACTION" == "up" ]; then - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param instant" "Failed to stand up SanteMPI Postgres" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param --with-registry-auth instant" "Failed to stand up SanteMPI Postgres" await_postgres_start - try "docker stack deploy -c ""$COMPOSE_FILE_PATH""/docker-compose.yml $sante_mpi_dev_compose_param instant" "Failed to stand up SanteMPI" + try "docker stack deploy -c ""$COMPOSE_FILE_PATH""/docker-compose.yml $sante_mpi_dev_compose_param --with-registry-auth instant" "Failed to stand up SanteMPI" if [[ "$STATEFUL_NODES" == "cluster" ]]; then docker::deploy_sanity santedb-www santedb-mpi santempi-psql-1 santempi-psql-2 santempi-psql-3 diff --git a/dashboard-visualiser-jsreport/swarm.sh b/dashboard-visualiser-jsreport/swarm.sh index ab6d8d53..27818daf 100644 --- a/dashboard-visualiser-jsreport/swarm.sh +++ b/dashboard-visualiser-jsreport/swarm.sh @@ -44,14 +44,14 @@ main() { if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then unbound_ES_HOSTS_check - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $js_report_dev_compose_param $js_report_dev_mount_compose_param instant" "Failed to deploy JS Report" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $js_report_dev_compose_param $js_report_dev_mount_compose_param --with-registry-auth instant" "Failed to deploy JS Report" if [[ "${JS_REPORT_DEV_MOUNT}" != "true" ]]; then log info "Verifying JS Report service status" config::await_service_running "dashboard-visualiser-jsreport" "${COMPOSE_FILE_PATH}"/docker-compose.await-helper.yml "${JS_REPORT_INSTANCES}" config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start config importer" config::remove_config_importer "jsreport-config-importer" config::remove_stale_service_configs "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml "jsreport" diff --git a/dashboard-visualiser-kibana/swarm.sh b/dashboard-visualiser-kibana/swarm.sh index 0fa96f2d..68698509 100644 --- a/dashboard-visualiser-kibana/swarm.sh +++ b/dashboard-visualiser-kibana/swarm.sh @@ -19,7 +19,7 @@ readonly ROOT_PATH import_kibana_dashboards() { log info "Importing Kibana dashboard" config::set_config_digests "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start config importer" config::remove_config_importer "kibana-config-importer" config::remove_stale_service_configs "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml "kibana" } @@ -42,7 +42,7 @@ main() { fi config::set_config_digests "${COMPOSE_FILE_PATH}"/docker-compose.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $kibana_dev_compose_param instant" "Failed to deploy Dashboard Visualiser Kibana" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $kibana_dev_compose_param --with-registry-auth instant" "Failed to deploy Dashboard Visualiser Kibana" docker::await_container_startup dashboard-visualiser-kibana docker::await_container_status dashboard-visualiser-kibana Running @@ -51,7 +51,7 @@ main() { log info "Setting config digests" config::set_config_digests "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start config importer" import_kibana_dashboards diff --git a/dashboard-visualiser-superset/swarm.sh b/dashboard-visualiser-superset/swarm.sh index 0191f6fa..64ccf5f2 100644 --- a/dashboard-visualiser-superset/swarm.sh +++ b/dashboard-visualiser-superset/swarm.sh @@ -27,7 +27,7 @@ main() { if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then config::set_config_digests "$COMPOSE_FILE_PATH"/docker-compose.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $superset_dev_compose_param instant" "Failed to deploy Dashboard Visualiser Superset" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $superset_dev_compose_param --with-registry-auth instant" "Failed to deploy Dashboard Visualiser Superset" docker::await_container_startup dashboard-visualiser-superset docker::await_container_status dashboard-visualiser-superset Running @@ -36,7 +36,7 @@ main() { log info "Setting config digests" config::set_config_digests "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to start config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to start config importer" log info "Waiting to give core config importer time to run before cleaning up service" diff --git a/data-mapper-logstash/swarm.sh b/data-mapper-logstash/swarm.sh index 37253f21..559aa2cd 100644 --- a/data-mapper-logstash/swarm.sh +++ b/data-mapper-logstash/swarm.sh @@ -59,7 +59,7 @@ if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then config::generate_service_configs data-mapper-logstash /usr/share/logstash "${COMPOSE_FILE_PATH}/pipeline" "${COMPOSE_FILE_PATH}" logstash logstash_temp_compose_param="-c ${COMPOSE_FILE_PATH}/docker-compose.tmp.yml" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $logstash_dev_compose_param $logstash_dev_mount_compose_param $logstash_temp_compose_param instant" "Failed to deploy Data Mapper Logstash" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $logstash_dev_compose_param $logstash_dev_mount_compose_param $logstash_temp_compose_param --with-registry-auth instant" "Failed to deploy Data Mapper Logstash" docker::await_container_startup data-mapper-logstash docker::await_container_status data-mapper-logstash Running diff --git a/fhir-datastore-hapi-fhir/swarm.sh b/fhir-datastore-hapi-fhir/swarm.sh index 45840319..98a97811 100644 --- a/fhir-datastore-hapi-fhir/swarm.sh +++ b/fhir-datastore-hapi-fhir/swarm.sh @@ -50,11 +50,11 @@ else fi if [ "${ACTION}" == "init" ]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param instant" "Failed to deploy FHIR Datastore HAPI FHIR Postgres" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param --with-registry-auth instant" "Failed to deploy FHIR Datastore HAPI FHIR Postgres" await_postgres_start - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $hapi_fhir_dev_compose_param instant" "Failed to deploy FHIR Datastore HAPI FHIR" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $hapi_fhir_dev_compose_param --with-registry-auth instant" "Failed to deploy FHIR Datastore HAPI FHIR" if [ "$STATEFUL_NODES" == "cluster" ]; then docker::deploy_sanity hapi-fhir postgres-1 postgres-2 postgres-3 @@ -62,11 +62,11 @@ if [ "${ACTION}" == "init" ]; then docker::deploy_sanity hapi-fhir postgres-1 fi elif [ "${ACTION}" == "up" ]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param instant" "Failed to stand up hapi-fhir postgres" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-postgres.yml $postgres_cluster_compose_param $postgres_dev_compose_param --with-registry-auth instant" "Failed to stand up hapi-fhir postgres" await_postgres_start - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $hapi_fhir_dev_compose_param instant" "Failed to stand up hapi-fhir" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $hapi_fhir_dev_compose_param --with-registry-auth instant" "Failed to stand up hapi-fhir" elif [ "${ACTION}" == "down" ]; then try "docker service scale instant_hapi-fhir=0 instant_postgres-1=0" "Failed to scale down hapi-fhir" diff --git a/interoperability-layer-openhim/swarm.sh b/interoperability-layer-openhim/swarm.sh index b7a00bbf..1fc04a7c 100644 --- a/interoperability-layer-openhim/swarm.sh +++ b/interoperability-layer-openhim/swarm.sh @@ -88,7 +88,7 @@ main() { config::set_config_digests "${COMPOSE_FILE_PATH}"/docker-compose.yml config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-mongo.yml $mongo_cluster_compose_param $mongo_dev_compose_param instant" "Failed to deploy mongo" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-mongo.yml $mongo_cluster_compose_param $mongo_dev_compose_param --with-registry-auth instant" "Failed to deploy mongo" if [[ "${STATEFUL_NODES}" == "cluster" ]]; then try "${COMPOSE_FILE_PATH}/initiateReplicaSet.sh" "Fatal: Initate Mongo replica set failed." @@ -96,16 +96,16 @@ main() { prepare_console_config - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-0.yml $openhim_dev_compose_param instant" "Failed to create stack-0 openhim core/console" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-0.yml $openhim_dev_compose_param --with-registry-auth instant" "Failed to create stack-0 openhim core/console" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.await-helper.yml instant" "Failed to deploy await-helper" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.await-helper.yml --with-registry-auth instant" "Failed to deploy await-helper" log info "Waiting to give OpenHIM Core time to start up before OpenHIM Console run" verify_core - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-1.yml $openhim_dev_compose_param instant" "Failed to create stack-1 openhim core/console" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-1.yml $openhim_dev_compose_param --with-registry-auth instant" "Failed to create stack-1 openhim core/console" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to deploy config importer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to deploy config importer" log info "Waiting to give core config importer time to run before cleaning up service" @@ -127,11 +127,11 @@ main() { config::set_config_digests "$COMPOSE_FILE_PATH"/docker-compose.yml config::set_config_digests "$COMPOSE_FILE_PATH"/importer/docker-compose.config.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-mongo.yml $mongo_cluster_compose_param $mongo_dev_compose_param instant" "Failed to deploy mongo" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose-mongo.yml $mongo_cluster_compose_param $mongo_dev_compose_param --with-registry-auth instant" "Failed to deploy mongo" verify_mongos prepare_console_config - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-1.yml $openhim_dev_compose_param instant" "Failed to create stack-1 openhim core/console" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.stack-1.yml $openhim_dev_compose_param --with-registry-auth instant" "Failed to create stack-1 openhim core/console" log info "Removing stale configs..." config::remove_stale_service_configs "$COMPOSE_FILE_PATH"/docker-compose.yml "openhim" diff --git a/job-scheduler-ofelia/swarm.sh b/job-scheduler-ofelia/swarm.sh index 74e9bdea..8b5a3399 100644 --- a/job-scheduler-ofelia/swarm.sh +++ b/job-scheduler-ofelia/swarm.sh @@ -23,7 +23,7 @@ main() { config::substitute_env_vars "${COMPOSE_FILE_PATH}"/config.ini config::set_config_digests "${COMPOSE_FILE_PATH}"/docker-compose.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml instant" "Failed to deploy Job Scheduler Ofelia, does your .env file include all environment variables in your config.ini file?" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml --with-registry-auth instant" "Failed to deploy Job Scheduler Ofelia, does your .env file include all environment variables in your config.ini file?" docker::deploy_sanity job-scheduler-ofelia elif [[ "${ACTION}" == "down" ]]; then diff --git a/kafka-mapper-consumer/swarm.sh b/kafka-mapper-consumer/swarm.sh index 26223f22..dffd4671 100755 --- a/kafka-mapper-consumer/swarm.sh +++ b/kafka-mapper-consumer/swarm.sh @@ -18,7 +18,7 @@ readonly ROOT_PATH main() { if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then config::set_config_digests "${COMPOSE_FILE_PATH}"/docker-compose.yml - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml instant" "Failed to deploy Kafka Mapper Consumer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml --with-registry-auth instant" "Failed to deploy Kafka Mapper Consumer" config::remove_stale_service_configs "${COMPOSE_FILE_PATH}"/docker-compose.yml "kafka-mapper-consumer" diff --git a/kafka-unbundler-consumer/swarm.sh b/kafka-unbundler-consumer/swarm.sh index b80068ab..1ff0eb40 100755 --- a/kafka-unbundler-consumer/swarm.sh +++ b/kafka-unbundler-consumer/swarm.sh @@ -16,7 +16,7 @@ readonly ROOT_PATH main() { if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml instant" "Failed to deploy Kafka Unbundler Consumer" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml --with-registry-auth instant" "Failed to deploy Kafka Unbundler Consumer" docker::deploy_sanity kafka-unbundler-consumer elif [[ "${ACTION}" == "down" ]]; then diff --git a/message-bus-helper-hapi-proxy/swarm.sh b/message-bus-helper-hapi-proxy/swarm.sh index e1b0cdb4..d7bf7d7d 100644 --- a/message-bus-helper-hapi-proxy/swarm.sh +++ b/message-bus-helper-hapi-proxy/swarm.sh @@ -15,17 +15,17 @@ ROOT_PATH="${COMPOSE_FILE_PATH}/.." if [ "${ACTION}" == "init" ]; then if [ "${MODE}" == "dev" ]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml instant" "Failed to deploy hapi-proxy" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml --with-registry-auth instant" "Failed to deploy hapi-proxy" else - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.prod.yml instant" "Failed to deploy hapi-proxy" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.prod.yml --with-registry-auth instant" "Failed to deploy hapi-proxy" fi docker::deploy_sanity hapi-proxy elif [ "${ACTION}" == "up" ]; then if [ "${MODE}" == "dev" ]; then - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml instant" "Failed to deploy hapi-proxy" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml --with-registry-auth instant" "Failed to deploy hapi-proxy" else - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.prod.yml instant" "Failed to deploy hapi-proxy" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml -c ${COMPOSE_FILE_PATH}/docker-compose.prod.yml --with-registry-auth instant" "Failed to deploy hapi-proxy" fi elif [ "${ACTION}" == "down" ]; then try "docker service scale instant_hapi-proxy=0" "Failed to scale down hapi-proxy" diff --git a/message-bus-kafka/swarm.sh b/message-bus-kafka/swarm.sh index 54a9ce32..a24af812 100755 --- a/message-bus-kafka/swarm.sh +++ b/message-bus-kafka/swarm.sh @@ -37,7 +37,7 @@ if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then config::set_config_digests "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml log info "Deploy Zookeeper" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka-zoo.yml $kafka_zoo_cluster_compose_param instant" "Failed to deploy Message Bus Kafka" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka-zoo.yml $kafka_zoo_cluster_compose_param --with-registry-auth instant" "Failed to deploy Message Bus Kafka" docker::await_container_startup zookeeper-1 docker::await_container_status zookeeper-1 Running @@ -51,7 +51,7 @@ if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then fi log info "Deploy Kafka" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka.yml $kafka_cluster_compose_param $kafka_dev_compose_param instant" "Failed to deploy Message Bus Kafka" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka.yml $kafka_cluster_compose_param $kafka_dev_compose_param --with-registry-auth instant" "Failed to deploy Message Bus Kafka" docker::await_container_startup kafka docker::await_container_status kafka Running @@ -59,11 +59,11 @@ if [[ "${ACTION}" == "init" ]] || [[ "${ACTION}" == "up" ]]; then config::await_service_reachable "kafka" "Connected" log info "Deploy the other services dependent of Kafka" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka-utils.yml $kafka_utils_dev_compose_param instant" "Failed to deploy Message Bus Kafka" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.kafka-utils.yml $kafka_utils_dev_compose_param --with-registry-auth instant" "Failed to deploy Message Bus Kafka" config::await_service_running "kafka" "${COMPOSE_FILE_PATH}"/docker-compose.await-helper.yml "${KAFKA_INSTANCES}" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml instant" "Failed to deploy Message Bus Kafka" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/importer/docker-compose.config.yml --with-registry-auth instant" "Failed to deploy Message Bus Kafka" config::remove_stale_service_configs "${COMPOSE_FILE_PATH}"/importer/docker-compose.config.yml "ethiopia" config::remove_config_importer message-bus-kafka-config-importer diff --git a/mpi-mediator/swarm.sh b/mpi-mediator/swarm.sh index 4dd97d37..153a6e23 100644 --- a/mpi-mediator/swarm.sh +++ b/mpi-mediator/swarm.sh @@ -35,11 +35,11 @@ main() { if [[ "$ACTION" == "init" ]]; then log info "Deploying MPI-Mediator..." - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.yml $mpi_mediator_cluster_compose_param $mpi_mediator_dev_compose_param instant" "Failed to deploy mpi-mediator" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.yml $mpi_mediator_cluster_compose_param $mpi_mediator_dev_compose_param --with-registry-auth instant" "Failed to deploy mpi-mediator" overwrite "Deploying MPI-Mediator... Done" elif [[ "$ACTION" == "up" ]]; then log info "Updating MPI-Mediator..." - try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.yml $mpi_mediator_cluster_compose_param $mpi_mediator_dev_compose_param instant" "Failed to stand up mpi-mediator" + try "docker stack deploy -c $COMPOSE_FILE_PATH/docker-compose.yml $mpi_mediator_cluster_compose_param $mpi_mediator_dev_compose_param --with-registry-auth instant" "Failed to stand up mpi-mediator" overwrite "Updating MPI-Mediator... Done" elif [[ "$ACTION" == "down" ]]; then log info "Scaling MPI-Mediator down..." diff --git a/reverse-proxy-nginx/swarm.sh b/reverse-proxy-nginx/swarm.sh index 1ae515aa..552ae4db 100755 --- a/reverse-proxy-nginx/swarm.sh +++ b/reverse-proxy-nginx/swarm.sh @@ -31,7 +31,7 @@ main() { config::generate_service_configs reverse-proxy-nginx /etc/nginx/conf.d "${COMPOSE_FILE_PATH}/package-conf-insecure" "${COMPOSE_FILE_PATH}" nginx nginx_temp_compose_param="-c ${COMPOSE_FILE_PATH}/docker-compose.tmp.yml" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $nginx_temp_compose_param instant" "Failed to deploy nginx" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $nginx_temp_compose_param --with-registry-auth instant" "Failed to deploy nginx" if [ "${INSECURE_PORTS}" != "" ]; then IFS='-' read -ra PORTS <<<"$INSECURE_PORTS" @@ -62,7 +62,7 @@ main() { config::generate_service_configs reverse-proxy-nginx /etc/nginx/conf.d "${COMPOSE_FILE_PATH}/package-conf-secure" "${COMPOSE_FILE_PATH}" nginx nginx_temp_compose_param="-c ${COMPOSE_FILE_PATH}/docker-compose.tmp.yml" - try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $nginx_temp_compose_param instant" "Failed to deploy nginx" + try "docker stack deploy -c ${COMPOSE_FILE_PATH}/docker-compose.yml $nginx_temp_compose_param --with-registry-auth instant" "Failed to deploy nginx" local domain_args=() if [ -n "$SUBDOMAINS" ]; then