-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: unify ElasticSearch and OpenSearch configuration
Changes: - set the same cluster and service name - unify tutor plugin configuration variables TODO: - add internal_users.yml > admin > hash for a custom default password
- Loading branch information
Showing
11 changed files
with
76 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/harmony_search/elasticsearch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .base import BaseSearchAPI | ||
|
||
|
||
class ElasticSearchAPI(BaseSearchAPI): | ||
""" | ||
Helper class to interact with the ElasticSearch | ||
API on the deployed cluster. | ||
""" | ||
|
||
def __init__(self, namespace): | ||
super().__init__(namespace) | ||
self._curl_base = ["curl", "--insecure", "-u", "elastic:${ELASTIC_PASSWORD}"] |
12 changes: 12 additions & 0 deletions
12
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/harmony_search/opensearch.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from .base import BaseSearchAPI | ||
|
||
|
||
class OpenSearchAPI(BaseSearchAPI): | ||
""" | ||
Helper class to interact with the OpenSearch | ||
API on the deployed cluster. | ||
""" | ||
|
||
def __init__(self, namespace): | ||
super().__init__(namespace) | ||
self._curl_base = ["curl", "--insecure", "-u", "admin:admin"] |
70 changes: 0 additions & 70 deletions
70
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/opensearch.py
This file was deleted.
Oops, something went wrong.
21 changes: 4 additions & 17 deletions
21
tutor-contrib-harmony-plugin/tutor_k8s_harmony_plugin/patches/openedx-common-settings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,10 @@ | ||
# ElasticSearch is a prefered engine. | ||
# If both are turned on, ELASTICSEARCH will be used. | ||
{% if K8S_HARMONY_ENABLE_SHARED_OPENSEARCH %} | ||
ELASTICSEARCH_INDEX_PREFIX = "{{OPENSEARCH_INDEX_PREFIX}}" | ||
{% if K8S_HARMONY_ENABLE_SHARED_HARMONY_SEARCH %} | ||
ELASTICSEARCH_INDEX_PREFIX = "{{HARMONY_SEARCH_INDEX_PREFIX}}" | ||
ELASTIC_SEARCH_CONFIG = [{ | ||
"use_ssl": True, | ||
"host": "opensearch-cluster-master.{{K8S_HARMONY_NAMESPACE}}.svc.cluster.local", | ||
"host": "harmony-search-cluster-master.{{K8S_HARMONY_NAMESPACE}}.svc.cluster.local", | ||
"verify_certs": False, | ||
"port": 9200, | ||
"http_auth": "{{ OPENSEARCH_HTTP_AUTH }}" | ||
}] | ||
{% endif %} | ||
|
||
{% if K8S_HARMONY_ENABLE_SHARED_ELASTICSEARCH %} | ||
ELASTICSEARCH_INDEX_PREFIX = "{{ELASTICSEARCH_INDEX_PREFIX}}" | ||
ELASTIC_SEARCH_CONFIG = [{ | ||
"use_ssl": True, | ||
"host": "elasticsearch-master.{{K8S_HARMONY_NAMESPACE}}.svc.cluster.local", | ||
"verify_certs": False, | ||
"port": 9200, | ||
"http_auth": "{{ ELASTICSEARCH_HTTP_AUTH }}" | ||
"http_auth": "{{ HARMONY_SEARCH_HTTP_AUTH }}" | ||
}] | ||
{% endif %} |
2 changes: 1 addition & 1 deletion
2
...rmony-plugin/tutor_k8s_harmony_plugin/patches/openedx-dockerfile-post-python-requirements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters