esd-services-api-client 2.6.3a150.dev16__tar.gz → 2.6.3a155.dev9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/PKG-INFO +1 -1
- esd_services_api_client-2.6.3a155.dev9/esd_services_api_client/_version.py +1 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/beast/v3/_connector.py +0 -1
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/crystal/_connector.py +0 -1
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/README.md +5 -0
- esd_services_api_client-2.6.3a155.dev9/esd_services_api_client/nexus/abstractions/metrics_provider_factory.py +106 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/_remote_algorithm.py +0 -1
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/core/app_core.py +87 -23
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/core/app_dependencies.py +0 -25
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/input/payload_reader.py +2 -10
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/telemetry/user_telemetry_recorder.py +0 -1
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/pyproject.toml +1 -1
- esd_services_api_client-2.6.3a150.dev16/esd_services_api_client/_version.py +0 -1
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/LICENSE +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/README.md +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/beast/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/beast/v3/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/beast/v3/_models.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/README.md +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/_auth.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/_base.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/_connector.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/boxer/_models.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/common/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/crystal/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/crystal/_api_versions.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/crystal/_models.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/algrorithm_cache.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/input_object.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/logger_factory.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/nexus_object.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/abstractions/socket_provider.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/_baseline_algorithm.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/distributed.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/forked_algorithm.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/minimalistic.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/algorithms/recursive.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/configurations/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/configurations/algorithm_configuration.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/core/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/core/serializers.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/exceptions/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/exceptions/_nexus_error.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/exceptions/cache_errors.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/exceptions/input_reader_error.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/exceptions/startup_error.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/input/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/input/input_processor.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/input/input_reader.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/modules/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/modules/astra_client_module.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/modules/mlflow_module.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/telemetry/__init__.py +0 -0
- {esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/esd_services_api_client/nexus/telemetry/recorder.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = 'v2.6.3a155.dev9'
|
@@ -220,7 +220,6 @@ class BeastConnector:
|
|
220
220
|
f"Execution failed, please find request's log at: {self.base_url}/job/logs/{request_id}"
|
221
221
|
)
|
222
222
|
|
223
|
-
# pylint: disable=too-many-positional-arguments
|
224
223
|
@staticmethod
|
225
224
|
def _report_backoff_failure(
|
226
225
|
target: Any, args: Any, kwargs: Any, tries: int, elapsed: int, wait: int, **_
|
@@ -302,6 +302,10 @@ async def main():
|
|
302
302
|
"(value of y:{y})": {"y": payload.y},
|
303
303
|
"(request_id:{request_id})": {"request_id": run_args.request_id}
|
304
304
|
}
|
305
|
+
def tag_metrics(payload: MyAlgorithmPayload2, run_args: CrystalEntrypointArguments) -> dict[str, str]:
|
306
|
+
return {
|
307
|
+
"country": payload.y,
|
308
|
+
}
|
305
309
|
with ThreadingHTTPServer(("localhost", 9876), MockRequestHandler) as server:
|
306
310
|
server_thread = threading.Thread(target=server.serve_forever)
|
307
311
|
server_thread.daemon = True
|
@@ -317,6 +321,7 @@ async def main():
|
|
317
321
|
.inject_configuration(MyAlgorithmConfiguration)
|
318
322
|
.inject_payload(MyAlgorithmPayload, MyAlgorithmPayload2)
|
319
323
|
.with_log_enricher(tags_from_payload, enrich_from_payload)
|
324
|
+
.with_metric_tagger(tag_metrics)
|
320
325
|
)
|
321
326
|
|
322
327
|
await nexus.activate()
|
@@ -0,0 +1,106 @@
|
|
1
|
+
"""
|
2
|
+
Metrics provider factory.
|
3
|
+
"""
|
4
|
+
|
5
|
+
# Copyright (c) 2023-2024. ECCO Sneaks & Data
|
6
|
+
#
|
7
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
+
# you may not use this file except in compliance with the License.
|
9
|
+
# You may obtain a copy of the License at
|
10
|
+
#
|
11
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
+
#
|
13
|
+
# Unless required by applicable law or agreed to in writing, software
|
14
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
+
# See the License for the specific language governing permissions and
|
17
|
+
# limitations under the License.
|
18
|
+
#
|
19
|
+
|
20
|
+
import os
|
21
|
+
from dataclasses import dataclass
|
22
|
+
from pydoc import locate
|
23
|
+
from typing import final
|
24
|
+
|
25
|
+
from adapta.metrics import MetricsProvider
|
26
|
+
from adapta.metrics.providers.datadog_provider import DatadogMetricsProvider
|
27
|
+
from dataclasses_json import DataClassJsonMixin
|
28
|
+
|
29
|
+
from esd_services_api_client.nexus.exceptions.startup_error import (
|
30
|
+
FatalStartupConfigurationError,
|
31
|
+
)
|
32
|
+
|
33
|
+
|
34
|
+
@final
|
35
|
+
@dataclass
|
36
|
+
class MetricsProviderSettings(DataClassJsonMixin):
|
37
|
+
"""
|
38
|
+
Settings model for the metrics provider
|
39
|
+
"""
|
40
|
+
|
41
|
+
init_args: dict
|
42
|
+
fixed_tags: dict[str, str] | None = None
|
43
|
+
protocol: str | None = None
|
44
|
+
|
45
|
+
def __post_init__(self):
|
46
|
+
"""
|
47
|
+
Force not-null values with default constructor, even if the source provides nulls.
|
48
|
+
"""
|
49
|
+
if self.protocol is None:
|
50
|
+
self.protocol = "udp"
|
51
|
+
|
52
|
+
if self.fixed_tags is None:
|
53
|
+
self.fixed_tags = {}
|
54
|
+
|
55
|
+
|
56
|
+
@final
|
57
|
+
class MetricsProviderFactory:
|
58
|
+
"""
|
59
|
+
Async logger provisioner.
|
60
|
+
"""
|
61
|
+
|
62
|
+
def __init__(
|
63
|
+
self,
|
64
|
+
global_tags: dict[str, str] | None = None,
|
65
|
+
):
|
66
|
+
self._global_tags = global_tags
|
67
|
+
self._metrics_class: type[MetricsProvider] = locate(
|
68
|
+
os.getenv(
|
69
|
+
"NEXUS__METRICS_PROVIDER_CLASS",
|
70
|
+
"adapta.metrics.providers.datadog_provider.DatadogMetricsProvider",
|
71
|
+
)
|
72
|
+
)
|
73
|
+
|
74
|
+
if "NEXUS__METRICS_PROVIDER_CONFIGURATION" not in os.environ:
|
75
|
+
raise FatalStartupConfigurationError(
|
76
|
+
"NEXUS__METRICS_PROVIDER_CONFIGURATION is not provided, cannot initialize a metrics provider instance"
|
77
|
+
)
|
78
|
+
|
79
|
+
self._metrics_settings: MetricsProviderSettings = (
|
80
|
+
MetricsProviderSettings.from_json(
|
81
|
+
os.getenv("NEXUS__METRICS_PROVIDER_CONFIGURATION")
|
82
|
+
)
|
83
|
+
)
|
84
|
+
|
85
|
+
def create_provider(
|
86
|
+
self,
|
87
|
+
) -> MetricsProvider:
|
88
|
+
"""
|
89
|
+
Creates a metrics provider enriched with additional tags for each metric emitted by this algorithm.
|
90
|
+
In case of DatadogMetricsProvider, takes care of UDP/UDS specific initialization.
|
91
|
+
"""
|
92
|
+
self._metrics_settings.fixed_tags |= self._global_tags
|
93
|
+
|
94
|
+
if self._metrics_class == DatadogMetricsProvider:
|
95
|
+
if self._metrics_settings.protocol == "udp":
|
96
|
+
return self._metrics_class.udp(**self._metrics_settings.init_args)
|
97
|
+
|
98
|
+
if self._metrics_settings.protocol == "uds":
|
99
|
+
return self._metrics_class.uds(**self._metrics_settings.init_args)
|
100
|
+
|
101
|
+
return self._metrics_class(
|
102
|
+
**(
|
103
|
+
self._metrics_settings.init_args
|
104
|
+
| {"fixed_tags": self._metrics_settings.fixed_tags}
|
105
|
+
)
|
106
|
+
)
|
@@ -28,6 +28,7 @@ from typing import final, Type, Optional, Callable
|
|
28
28
|
import backoff
|
29
29
|
import urllib3.exceptions
|
30
30
|
from adapta.logs import LoggerInterface
|
31
|
+
from adapta.metrics import MetricsProvider
|
31
32
|
from adapta.process_communication import DataSocket
|
32
33
|
from adapta.storage.blob.base import StorageClient
|
33
34
|
from adapta.storage.query_enabled_store import QueryEnabledStore
|
@@ -45,6 +46,9 @@ from esd_services_api_client.nexus.abstractions.logger_factory import (
|
|
45
46
|
LoggerFactory,
|
46
47
|
BootstrapLoggerFactory,
|
47
48
|
)
|
49
|
+
from esd_services_api_client.nexus.abstractions.metrics_provider_factory import (
|
50
|
+
MetricsProviderFactory,
|
51
|
+
)
|
48
52
|
from esd_services_api_client.nexus.abstractions.nexus_object import AlgorithmResult
|
49
53
|
from esd_services_api_client.nexus.algorithms import (
|
50
54
|
BaselineAlgorithm,
|
@@ -138,6 +142,14 @@ class Nexus:
|
|
138
142
|
] | None = None
|
139
143
|
self._log_enrichment_delimiter: str = ", "
|
140
144
|
|
145
|
+
self._metric_tagger: Callable[
|
146
|
+
[
|
147
|
+
AlgorithmPayload,
|
148
|
+
CrystalEntrypointArguments,
|
149
|
+
],
|
150
|
+
dict[str, str],
|
151
|
+
] | None = None
|
152
|
+
|
141
153
|
attach_signal_handlers()
|
142
154
|
|
143
155
|
@property
|
@@ -225,6 +237,23 @@ class Nexus:
|
|
225
237
|
self._log_enrichment_delimiter = delimiter
|
226
238
|
return self
|
227
239
|
|
240
|
+
def with_metric_tagger(
|
241
|
+
self,
|
242
|
+
tagger: Callable[
|
243
|
+
[
|
244
|
+
AlgorithmPayload,
|
245
|
+
CrystalEntrypointArguments,
|
246
|
+
],
|
247
|
+
dict[str, str],
|
248
|
+
]
|
249
|
+
| None = None,
|
250
|
+
) -> "Nexus":
|
251
|
+
"""
|
252
|
+
Adds a metric `enricher` to be used with injected metrics provider to assign additional tags to emitted metrics.
|
253
|
+
"""
|
254
|
+
self._metric_tagger = tagger
|
255
|
+
return self
|
256
|
+
|
228
257
|
def with_module(self, module: Type[Module]) -> "Nexus":
|
229
258
|
"""
|
230
259
|
Adds a (custom) DI module into the DI container.
|
@@ -317,30 +346,66 @@ class Nexus:
|
|
317
346
|
|
318
347
|
bootstrap_logger.start()
|
319
348
|
|
320
|
-
|
321
|
-
|
349
|
+
try:
|
350
|
+
logger_fixed_template = {}
|
351
|
+
logger_tags = {}
|
352
|
+
metric_tags = {}
|
353
|
+
|
354
|
+
for payload_type in self._payload_types:
|
322
355
|
payload = await self._get_payload(payload_type=payload_type)
|
323
356
|
self._injector.binder.bind(
|
324
357
|
payload.__class__, to=payload, scope=singleton
|
325
358
|
)
|
326
|
-
|
327
|
-
|
328
|
-
if
|
329
|
-
else
|
330
|
-
|
331
|
-
|
359
|
+
logger_fixed_template |= (
|
360
|
+
self._log_enricher(payload, self._run_args)
|
361
|
+
if self._log_enricher
|
362
|
+
else {}
|
363
|
+
)
|
364
|
+
logger_tags |= (
|
365
|
+
self._log_tagger(payload, self._run_args)
|
332
366
|
if self._log_tagger
|
333
|
-
else
|
367
|
+
else {}
|
334
368
|
)
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
scope=singleton,
|
369
|
+
metric_tags |= (
|
370
|
+
self._metric_tagger(payload, self._run_args)
|
371
|
+
if self._metric_tagger
|
372
|
+
else {}
|
340
373
|
)
|
341
|
-
|
342
|
-
|
343
|
-
|
374
|
+
|
375
|
+
logger_factory = LoggerFactory(
|
376
|
+
fixed_template=logger_fixed_template,
|
377
|
+
fixed_template_delimiter=self._log_enrichment_delimiter,
|
378
|
+
global_tags=logger_tags,
|
379
|
+
)
|
380
|
+
# bind app-level LoggerFactory now
|
381
|
+
self._injector.binder.bind(
|
382
|
+
logger_factory.__class__,
|
383
|
+
to=logger_factory,
|
384
|
+
scope=singleton,
|
385
|
+
)
|
386
|
+
|
387
|
+
# bind app-level MetricsProvider now
|
388
|
+
metrics_provider = MetricsProviderFactory(
|
389
|
+
global_tags=metric_tags,
|
390
|
+
).create_provider()
|
391
|
+
|
392
|
+
self._injector.binder.bind(
|
393
|
+
MetricsProvider,
|
394
|
+
to=metrics_provider,
|
395
|
+
scope=singleton,
|
396
|
+
)
|
397
|
+
|
398
|
+
self._injector.binder.bind(
|
399
|
+
metrics_provider.__class__,
|
400
|
+
to=metrics_provider,
|
401
|
+
scope=singleton,
|
402
|
+
)
|
403
|
+
except BaseException as ex: # pylint: disable=broad-except
|
404
|
+
bootstrap_logger.error("Error reading algorithm payload", ex)
|
405
|
+
|
406
|
+
# ensure we flush bootstrap logger before we exit
|
407
|
+
bootstrap_logger.stop()
|
408
|
+
sys.exit(1)
|
344
409
|
|
345
410
|
bootstrap_logger.stop()
|
346
411
|
|
@@ -355,7 +420,7 @@ class Nexus:
|
|
355
420
|
|
356
421
|
root_logger.info(
|
357
422
|
"Running algorithm {algorithm} on Nexus version {version}",
|
358
|
-
algorithm=algorithm.__class__.
|
423
|
+
algorithm=algorithm.__class__.__name__,
|
359
424
|
version=__version__,
|
360
425
|
)
|
361
426
|
|
@@ -374,7 +439,7 @@ class Nexus:
|
|
374
439
|
root_logger.error(
|
375
440
|
"Algorithm {algorithm} run failed on Nexus version {version}",
|
376
441
|
ex,
|
377
|
-
algorithm=algorithm.__class__.
|
442
|
+
algorithm=algorithm.__class__.__name__,
|
378
443
|
version=__version__,
|
379
444
|
)
|
380
445
|
|
@@ -402,7 +467,9 @@ class Nexus:
|
|
402
467
|
for on_complete_task_class in self._on_complete_tasks
|
403
468
|
]
|
404
469
|
if len(on_complete_tasks) > 0:
|
405
|
-
done, pending = await asyncio.wait(
|
470
|
+
done, pending = await asyncio.wait(
|
471
|
+
on_complete_tasks, return_when=asyncio.FIRST_EXCEPTION
|
472
|
+
)
|
406
473
|
if len(pending) > 0:
|
407
474
|
root_logger.warning(
|
408
475
|
"Some post-processing operations did not complete or failed. Please review application logs for more information"
|
@@ -425,9 +492,6 @@ class Nexus:
|
|
425
492
|
|
426
493
|
root_logger.stop()
|
427
494
|
|
428
|
-
if os.getenv("NEXUS__RAISE_ERROR_ON_COMPLETE") and ex is not None:
|
429
|
-
raise ex
|
430
|
-
|
431
495
|
@classmethod
|
432
496
|
def create(cls) -> "Nexus":
|
433
497
|
"""
|
@@ -17,13 +17,11 @@
|
|
17
17
|
# limitations under the License.
|
18
18
|
#
|
19
19
|
|
20
|
-
import json
|
21
20
|
import os
|
22
21
|
import re
|
23
22
|
from pydoc import locate
|
24
23
|
from typing import final, Type, Any
|
25
24
|
|
26
|
-
from adapta.metrics import MetricsProvider
|
27
25
|
from adapta.storage.blob.base import StorageClient
|
28
26
|
from adapta.storage.query_enabled_store import QueryEnabledStore
|
29
27
|
from injector import Module, singleton, provider
|
@@ -51,28 +49,6 @@ from esd_services_api_client.nexus.core.serializers import (
|
|
51
49
|
)
|
52
50
|
|
53
51
|
|
54
|
-
@final
|
55
|
-
class MetricsModule(Module):
|
56
|
-
"""
|
57
|
-
Metrics provider module.
|
58
|
-
"""
|
59
|
-
|
60
|
-
@singleton
|
61
|
-
@provider
|
62
|
-
def provide(self) -> MetricsProvider:
|
63
|
-
"""
|
64
|
-
DI factory method.
|
65
|
-
"""
|
66
|
-
metrics_class: Type[MetricsProvider] = locate(
|
67
|
-
os.getenv(
|
68
|
-
"NEXUS__METRIC_PROVIDER_CLASS",
|
69
|
-
"adapta.metrics.providers.datadog_provider.DatadogMetricsProvider",
|
70
|
-
)
|
71
|
-
)
|
72
|
-
metrics_settings = json.loads(os.getenv("NEXUS__METRIC_PROVIDER_CONFIGURATION"))
|
73
|
-
return metrics_class(**metrics_settings)
|
74
|
-
|
75
|
-
|
76
52
|
@final
|
77
53
|
class BootstrapLoggerFactoryModule(Module):
|
78
54
|
"""
|
@@ -237,7 +213,6 @@ class ServiceConfigurator:
|
|
237
213
|
def __init__(self):
|
238
214
|
self._injection_binds = [
|
239
215
|
BootstrapLoggerFactoryModule(),
|
240
|
-
MetricsModule(),
|
241
216
|
CrystalReceiverClientModule(),
|
242
217
|
QueryEnabledStoreModule(),
|
243
218
|
StorageClientModule(),
|
@@ -1,7 +1,6 @@
|
|
1
1
|
"""
|
2
2
|
Code infrastructure for manipulating payload received from Crystal SAS URI
|
3
3
|
"""
|
4
|
-
import os
|
5
4
|
|
6
5
|
# Copyright (c) 2023-2024. ECCO Sneaks & Data
|
7
6
|
#
|
@@ -63,15 +62,8 @@ class AlgorithmPayloadReader:
|
|
63
62
|
self._http.close()
|
64
63
|
self._http = None
|
65
64
|
|
66
|
-
def __init__(
|
67
|
-
self
|
68
|
-
payload_uri: str,
|
69
|
-
payload_type: Type[AlgorithmPayload],
|
70
|
-
):
|
71
|
-
self._http = session_with_retries(
|
72
|
-
file_protocol_supported=os.getenv("NEXUS__SUPPORT_FILE_PROTOCOL_PAYLOADS")
|
73
|
-
is not None
|
74
|
-
)
|
65
|
+
def __init__(self, payload_uri: str, payload_type: Type[AlgorithmPayload]):
|
66
|
+
self._http = session_with_retries()
|
75
67
|
self._payload: Optional[AlgorithmPayload] = None
|
76
68
|
self._payload_uri = payload_uri
|
77
69
|
self._payload_type = payload_type
|
{esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/pyproject.toml
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "esd-services-api-client"
|
3
|
-
version = "v2.6.
|
3
|
+
version = "v2.6.3a155.dev9"
|
4
4
|
description = "Python clients for ESD services"
|
5
5
|
authors = ["ECCO Sneaks & Data <esdsupport@ecco.com>"]
|
6
6
|
maintainers = ['GZU <gzu@ecco.com>', 'JRB <ext-jrb@ecco.com>', 'VISA <visa@ecco.com>']
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = 'v2.6.3a150.dev16'
|
File without changes
|
{esd_services_api_client-2.6.3a150.dev16 → esd_services_api_client-2.6.3a155.dev9}/README.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|