Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
drosetti committed Oct 22, 2024
1 parent 0707f7d commit de051be
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 39 deletions.
7 changes: 3 additions & 4 deletions docker/elasticsearch.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ services:
uwsgi:
depends_on:
- elasticsearch
volumes:
- ../certs:/opt/deploy/intel_owl/certs

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
Expand All @@ -19,10 +21,7 @@ services:
- ../certs:/usr/share/elasticsearch/config/certificates
environment:
- discovery.type=single-node
- xpack.security.http.ssl.enabled=true
- xpack.security.http.ssl.key=/usr/share/elasticsearch/config/certificates/elastic.key
- xpack.security.http.ssl.certificate_authorities=/usr/share/elasticsearch/config/certificates/elastic_ca.crt
- xpack.security.http.ssl.certificate=/usr/share/elasticsearch/config/certificates/elastic.crt
- xpack.security.http.ssl.enabled=false

volumes:
elastic_data:
23 changes: 0 additions & 23 deletions docker/test.elasticsearch.override.yml

This file was deleted.

14 changes: 4 additions & 10 deletions intel_owl/settings/elasticsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from elasticsearch import Elasticsearch

from intel_owl import secrets
from intel_owl.settings.commons import STAGE_CI, STAGE_LOCAL

ELASTICSEARCH_BI_ENABLED = (
secrets.get_secret("ELASTICSEARCH_BI_ENABLED", False) == "True"
Expand All @@ -29,19 +28,14 @@
f"ELASTICSEARCH BI client configuration did not connect correctly: {ELASTICSEARCH_BI_CLIENT.info()}"
)

ELASTIC_CLIENT_NAME = (
"default" # use this as value for the param "using" in Search to use the client
)
ELASTIC_HOST = secrets.get_secret("ELASTIC_HOST")
if ELASTIC_HOST:
ELASTIC_PASSWORD = secrets.get_secret("ELASTIC_PASSWORD")

elastic_client_settings = {"hosts": ELASTIC_HOST}

ELASTIC_PASSWORD = secrets.get_secret("ELASTIC_PASSWORD")
if ELASTIC_PASSWORD:
elastic_client_settings["basic_auth"] = ("elastic", ELASTIC_PASSWORD)
if STAGE_LOCAL or STAGE_CI:
elastic_client_settings["verify_certs"] = False
ELASTICSEARCH_DSL = {ELASTIC_CLIENT_NAME: elastic_client_settings}
ELASTICSEARCH_DSL = {"default": elastic_client_settings}

ELASTICSEARCH_DSL_INDEX_SETTINGS = {
"number_of_shards": int(secrets.get_secret("ELASTICSEARCH_DSL_NO_OF_SHARDS")),
Expand All @@ -52,5 +46,5 @@
else:
ELASTICSEARCH_DSL_AUTOSYNC = False
ELASTICSEARCH_DSL = {
ELASTIC_CLIENT_NAME: {"hosts": ""},
"default": {"hosts": ""},
}
4 changes: 2 additions & 2 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ declare -A env_arguments=(["prod"]=1 ["test"]=1 ["ci"]=1)
declare -A test_mode=(["test"]=1 ["ci"]=1)
declare -A cmd_arguments=(["build"]=1 ["up"]=1 ["start"]=1 ["restart"]=1 ["down"]=1 ["stop"]=1 ["kill"]=1 ["logs"]=1 ["ps"]=1)

declare -A path_mapping=(["default"]="docker/default.yml" ["postgres"]="docker/postgres.override.yml" ["rabbitmq"]="docker/rabbitmq.override.yml" ["test"]="docker/test.override.yml" ["ci"]="docker/ci.override.yml" ["custom"]="docker/custom.override.yml" ["traefik"]="docker/traefik.yml" ["traefik_prod"]="docker/traefik_prod.yml" ["traefik_local"]="docker/traefik_local.yml" ["multi_queue"]="docker/multi-queue.override.yml" ["test_multi_queue"]="docker/test.multi-queue.override.yml" ["flower"]="docker/flower.override.yml" ["test_flower"]="docker/test.flower.override.yml" ["elastic"]="docker/elasticsearch.override.yml" ["test_elastic"]="docker/test.elasticsearch.override.yml" ["https"]="docker/https.override.yml" ["nfs"]="docker/nfs.override.yml" ["redis"]="docker/redis.override.yml" ["nginx_default"]="docker/nginx.override.yml")
declare -A path_mapping=(["default"]="docker/default.yml" ["postgres"]="docker/postgres.override.yml" ["rabbitmq"]="docker/rabbitmq.override.yml" ["test"]="docker/test.override.yml" ["ci"]="docker/ci.override.yml" ["custom"]="docker/custom.override.yml" ["traefik"]="docker/traefik.yml" ["traefik_prod"]="docker/traefik_prod.yml" ["traefik_local"]="docker/traefik_local.yml" ["multi_queue"]="docker/multi-queue.override.yml" ["test_multi_queue"]="docker/test.multi-queue.override.yml" ["flower"]="docker/flower.override.yml" ["test_flower"]="docker/test.flower.override.yml" ["elastic"]="docker/elasticsearch.override.yml" ["https"]="docker/https.override.yml" ["nfs"]="docker/nfs.override.yml" ["redis"]="docker/redis.override.yml" ["nginx_default"]="docker/nginx.override.yml")
print_synopsis () {
echo "SYNOPSIS"
echo -e " start <env> <command> [OPTIONS]"
Expand Down Expand Up @@ -297,7 +297,7 @@ done

# add all the test files
if [[ $env_argument == "test" ]]; then
test_values=("multi_queue" "flower", "elastic")
test_values=("multi_queue" "flower")
for value in "${test_values[@]}"; do
if [ "${params["$value"]}" ]; then
compose_files+=("${path_mapping["test_$value"]}")
Expand Down

0 comments on commit de051be

Please sign in to comment.