Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.openSearch.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ OPENSEARCH_HOST=opensearch
# echo -n '{OPENSEARCH_ADMIN}:{OPENSEARCH_PASSWORD}' | base64
OPENSEARCH_BASIC_TOKEN=Basic YWRtaW46Qjl3YzlWcnFYN3BZ
OPENSEARCH_HOSTS='["http://opensearch:9200"]'
OPENIMIS_ADMIN_PASS='admin123'
12 changes: 11 additions & 1 deletion compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ services:
restart: always
depends_on:
migrations:
condition: service_completed_successfully
condition: service_completed_successfully
worker:
<<: *default-api
command: worker
Expand All @@ -81,6 +81,16 @@ services:
deploy:
mode: replicated
replicas: ${WORKER_REPLICAS:-3}
opensearch-init:
<<: *default-api
entrypoint: ["/entrypoint-init-opensearch.sh"]
command: []
depends_on:
- db
- backend
- opensearch
volumes:
- ./entrypoint-init-opensearch.sh:/entrypoint-init-opensearch.sh:ro
rabbitmq:
image: rabbitmq:3-management
restart: always
Expand Down
17 changes: 17 additions & 0 deletions entrypoint-init-opensearch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
set -e

REPO_DIR="/openimis-be/openimis-be-opensearch_reports_py"

if [ ! -d "$REPO_DIR" ]; then
echo "Cloning OpenIMIS OpenSearch dashboards config..."
git clone --depth 1 --branch develop https://github.com/openimis/openimis-be-opensearch_reports_py.git "$REPO_DIR"
else
echo "OpenSearch reports repo already exists, skipping clone."
fi

echo "Running dashboard configuration upload..."

cd /openimis-be/openIMIS

exec python3 manage.py upload_opensearch_dashboards --host-domain http://backend:8080 --imis-password "${OPENIMIS_ADMIN_PASS}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why port 8080 ? Also I thought that the pass was not mandatory anymore,:
why not pushing it directly to openSearch, you have OS credentials available

Loading