mirror of
https://github.com/clearml/clearml-server
synced 2025-06-26 23:15:47 +00:00
Update driver requirements
Refactor ES initialization
This commit is contained in:
@@ -82,15 +82,10 @@ def check_elastic_empty() -> bool:
|
||||
es_logger.addFilter(log_filter)
|
||||
for retry in range(max_retries):
|
||||
try:
|
||||
hosts = cluster_conf.get("hosts", None)
|
||||
http_auth = (
|
||||
es_factory.get_credentials("events")
|
||||
if cluster_conf.get("secure", True)
|
||||
else None
|
||||
)
|
||||
args = cluster_conf.get("args", {})
|
||||
es = Elasticsearch(
|
||||
hosts=hosts, http_auth=http_auth, **args
|
||||
hosts=cluster_conf.get("hosts", None),
|
||||
http_auth=es_factory.get_credentials("events", cluster_conf),
|
||||
**cluster_conf.get("args", {})
|
||||
)
|
||||
return not es.indices.get_template(name="events*")
|
||||
except exceptions.NotFoundError as ex:
|
||||
@@ -118,10 +113,7 @@ def init_es_data():
|
||||
|
||||
log.info(f"Applying mappings to ES host: {hosts_config}")
|
||||
args = cluster_conf.get("args", {})
|
||||
http_auth = (
|
||||
es_factory.get_credentials(name)
|
||||
if cluster_conf.get("secure", True)
|
||||
else None
|
||||
)
|
||||
http_auth = es_factory.get_credentials(name)
|
||||
|
||||
res = apply_mappings_to_cluster(hosts_config, name, es_args=args, http_auth=http_auth)
|
||||
log.info(res)
|
||||
|
||||
Reference in New Issue
Block a user