Skip to content

Commit

Permalink
update opensearch config
Browse files Browse the repository at this point in the history
  • Loading branch information
delcroip committed Nov 1, 2024
1 parent 3517475 commit d2326c8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci_assembly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ jobs:
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOST: localhost
OPENSEARCH_HOSTS: "http://localhost:9200"
OPENSEARCH_HOSTS: "localhost:9200"

- name: Django tests MSSQL
working-directory: ./openIMIS
Expand Down Expand Up @@ -206,5 +205,4 @@ jobs:
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOST: localhost
OPENSEARCH_HOSTS: "http://localhost:9200"
OPENSEARCH_HOSTS: "localhost:9200"
8 changes: 2 additions & 6 deletions .github/workflows/ci_module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ jobs:
MODE: DEV
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOST: localhost
OPENSEARCH_HOSTS: "http://localhost:9200"
OPENSEARCH_HOSTS: "localhost:9200"
ci_module_psql_test:
name: Run All Tests (PSQL)
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -518,9 +516,7 @@ jobs:
MODE: DEV
OPENSEARCH_ADMIN: admin
OPENSEARCH_PASSWORD: B9wc9VrqX7pY
OPEN_SEARCH_HTTP_PORT: 9200
OPENSEARCH_HOST: localhost
OPENSEARCH_HOSTS: "http://localhost:9200"
OPENSEARCH_HOSTS: "localhost:9200"
- name: Generate Coverage Report
if: always()
working-directory: ./openimis/openIMIS
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
| PHOTO_ROOT_PATH | String | Define the path for the photos of insurees. This setting is used in the Insuree module. The value set here will be overwritten by the InsureeConfig file. |
| DJANGO_MIGRATE | True, False | Based on the value set, application runs the migration command before starting up. If the SITE_ROOT value is set to api then the migration will always run regardless of the value |
| SCHEDULER_AUTOSTART | True, False | All the modules will be searched for the scheduled tasks, if the value is set to True |
| OPENSEARCH_HOST | String | Define the opensearch host |
| OPENSEARCH_HOSTS | String | Define the opensearch hosts, comma separated http://opensearch:9200 |
| OPENSEARCH_ADMIN | String | Define the login name for open search |
| OPENSEARCH_PASSWORD | String | Define the admin password to login to open search |
| BE_BRANCH | String | Define the github branch for the Backend form which you wan to install the module. Default is develop. |
Expand Down
7 changes: 5 additions & 2 deletions openIMIS/openIMIS/settings/opensearch.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import os


OPENSEARCH_HOST = os.environ.get("OPENSEARCH_HOST", "0.0.0.0")

os_hosts = os.environ.get("OPENSEARCH_HOSTS", "opensearch:9200")


OPEN_SEARCH_HTTP_PORT = os.environ.get("OPEN_SEARCH_HTTP_PORT", "9200")
OPENSEARCH_DSL_AUTOSYNC = os.environ.get('OPENSEARCH_DSL_AUTOSYNC', 'True') == 'True'

OPENSEARCH_DSL = {
'default': {
'hosts': f"{OPENSEARCH_HOST}:{OPEN_SEARCH_HTTP_PORT}",
'hosts': os_hosts.split(','),
'http_auth': (
f"{os.environ.get('OPENSEARCH_ADMIN')}",
f"{os.environ.get('OPENSEARCH_PASSWORD')}"
Expand Down
1 change: 0 additions & 1 deletion openIMIS/openIMIS/settings/queue_cache.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import os
import json


# Celery message broker configuration for RabbitMQ. One can also use Redis on AWS SQS
CELERY_BROKER_URL = os.environ.get("CELERY_BROKER_URL", "amqp://rabitmq")
if 'CELERY_RESULT_BACKEND' in os.environ:
Expand Down

0 comments on commit d2326c8

Please sign in to comment.