mirror of
https://github.com/clearml/clearml-server
synced 2025-03-03 18:54:20 +00:00
Fix issues with new dependencies
This commit is contained in:
parent
c196043d2a
commit
4c98b87554
@ -64,7 +64,7 @@ def get_index_name(company_id: Union[str, Sequence[str]], event_type: str):
|
|||||||
|
|
||||||
def check_empty_data(es: Elasticsearch, company_id: str, event_type: EventType) -> bool:
|
def check_empty_data(es: Elasticsearch, company_id: str, event_type: EventType) -> bool:
|
||||||
es_index = get_index_name(company_id, event_type.value)
|
es_index = get_index_name(company_id, event_type.value)
|
||||||
if not es.indices.exists(es_index):
|
if not es.indices.exists(index=es_index):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ class QueueMetrics:
|
|||||||
logged = 0
|
logged = 0
|
||||||
for q in queues:
|
for q in queues:
|
||||||
queue_doc = make_doc(q)
|
queue_doc = make_doc(q)
|
||||||
self.es.index(index=es_index, body=queue_doc)
|
self.es.index(index=es_index, document=queue_doc)
|
||||||
redis_key = _queue_metrics_key_pattern.format(queue=q.id)
|
redis_key = _queue_metrics_key_pattern.format(queue=q.id)
|
||||||
redis.set(redis_key, json.dumps(queue_doc))
|
redis.set(redis_key, json.dumps(queue_doc))
|
||||||
logged += 1
|
logged += 1
|
||||||
|
@ -8,8 +8,7 @@ from typing import Sequence, Optional
|
|||||||
|
|
||||||
import dpath
|
import dpath
|
||||||
import requests
|
import requests
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter, Retry
|
||||||
from requests.packages.urllib3.util.retry import Retry
|
|
||||||
|
|
||||||
from apiserver.bll.query import Builder as QueryBuilder
|
from apiserver.bll.query import Builder as QueryBuilder
|
||||||
from apiserver.bll.util import get_server_uuid
|
from apiserver.bll.util import get_server_uuid
|
||||||
|
@ -21,7 +21,7 @@ def apply_mappings_to_cluster(
|
|||||||
with f.open() as json_data:
|
with f.open() as json_data:
|
||||||
data = json.load(json_data)
|
data = json.load(json_data)
|
||||||
template_name = f.stem
|
template_name = f.stem
|
||||||
res = es.indices.put_template(template_name, body=data)
|
res = es.indices.put_template(name=template_name, body=data)
|
||||||
return {"mapping": template_name, "result": res}
|
return {"mapping": template_name, "result": res}
|
||||||
|
|
||||||
p = HERE / "mappings"
|
p = HERE / "mappings"
|
||||||
|
@ -85,7 +85,7 @@ def check_elastic_empty() -> bool:
|
|||||||
es = Elasticsearch(
|
es = Elasticsearch(
|
||||||
hosts=cluster_conf.get("hosts", None),
|
hosts=cluster_conf.get("hosts", None),
|
||||||
http_auth=es_factory.get_credentials("events", cluster_conf),
|
http_auth=es_factory.get_credentials("events", cluster_conf),
|
||||||
**cluster_conf.get("args", {})
|
**cluster_conf.get("args", {}),
|
||||||
)
|
)
|
||||||
return not es.indices.get_template(name="events*")
|
return not es.indices.get_template(name="events*")
|
||||||
except exceptions.NotFoundError as ex:
|
except exceptions.NotFoundError as ex:
|
||||||
@ -115,5 +115,7 @@ def init_es_data():
|
|||||||
args = cluster_conf.get("args", {})
|
args = cluster_conf.get("args", {})
|
||||||
http_auth = es_factory.get_credentials(name)
|
http_auth = es_factory.get_credentials(name)
|
||||||
|
|
||||||
res = apply_mappings_to_cluster(hosts_config, name, es_args=args, http_auth=http_auth)
|
res = apply_mappings_to_cluster(
|
||||||
|
hosts_config, name, es_args=args, http_auth=http_auth
|
||||||
|
)
|
||||||
log.info(res)
|
log.info(res)
|
||||||
|
@ -9,9 +9,8 @@ import requests
|
|||||||
import six
|
import six
|
||||||
from boltons.iterutils import remap
|
from boltons.iterutils import remap
|
||||||
from boltons.typeutils import issubclass
|
from boltons.typeutils import issubclass
|
||||||
from requests.adapters import HTTPAdapter
|
from requests.adapters import HTTPAdapter, Retry
|
||||||
from requests.auth import HTTPBasicAuth
|
from requests.auth import HTTPBasicAuth
|
||||||
from requests.packages.urllib3.util.retry import Retry
|
|
||||||
|
|
||||||
from apiserver.apierrors.base import BaseError
|
from apiserver.apierrors.base import BaseError
|
||||||
from apiserver.config_repo import config
|
from apiserver.config_repo import config
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
from operator import itemgetter
|
from operator import itemgetter
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
from apiserver.apierrors.errors.bad_request import InvalidTaskStatus
|
|
||||||
from apiserver.tests.automated import TestService
|
from apiserver.tests.automated import TestService
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user