esd-services-api-client 2.5.8__py3-none-any.whl → 2.5.9__py3-none-any.whl

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.
@@ -17,4 +17,4 @@
17
17
  Root index.
18
18
  """
19
19
 
20
- __version__ = "2.5.8"
20
+ __version__ = "2.5.9"
@@ -32,7 +32,7 @@ from adapta.logs import LoggerInterface
32
32
  from adapta.process_communication import DataSocket
33
33
  from adapta.storage.blob.base import StorageClient
34
34
  from adapta.storage.query_enabled_store import QueryEnabledStore
35
- from injector import Injector
35
+ from injector import Injector, Module
36
36
 
37
37
  import esd_services_api_client.nexus.exceptions
38
38
  from esd_services_api_client.crystal import (
@@ -188,6 +188,13 @@ class Nexus:
188
188
 
189
189
  return self
190
190
 
191
+ def with_module(self, module: Type[Module]) -> "Nexus":
192
+ """
193
+ Adds a (custom) DI module into the DI container.
194
+ """
195
+ self._configurator = self._configurator.with_module(module)
196
+ return self
197
+
191
198
  async def _submit_result(
192
199
  self,
193
200
  result: Optional[AlgorithmResult] = None,
@@ -255,6 +255,13 @@ class ServiceConfigurator:
255
255
  """
256
256
  return self._injection_binds
257
257
 
258
+ def with_module(self, module: Type[Module]) -> "ServiceConfigurator":
259
+ """
260
+ Adds a (custom) module into the DI container.
261
+ """
262
+ self._injection_binds.append(module())
263
+ return self
264
+
258
265
  def with_input_reader(self, reader: Type[InputReader]) -> "ServiceConfigurator":
259
266
  """
260
267
  Adds the input reader implementation to the DI.
@@ -0,0 +1,20 @@
1
+ # Copyright (c) 2023-2024. ECCO Sneaks & Data
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+
16
+ """
17
+ Import index.
18
+ """
19
+
20
+ from esd_services_api_client.nexus.modules.mlflow_module import MlflowModule
@@ -0,0 +1,43 @@
1
+ # Copyright (c) 2023-2024. ECCO Sneaks & Data
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+ #
15
+
16
+ """
17
+ MLFlow module that provides the MLFlow client to the Nexus framework.
18
+ """
19
+
20
+ import os
21
+ from typing import final
22
+ from injector import Module, singleton, provider
23
+ from adapta.ml.mlflow import MlflowBasicClient
24
+ from esd_services_api_client.nexus.exceptions.startup_error import (
25
+ FatalStartupConfigurationError,
26
+ )
27
+
28
+
29
+ @final
30
+ class MlflowModule(Module):
31
+ """
32
+ MLFlow module.
33
+ """
34
+
35
+ @singleton
36
+ @provider
37
+ def provide(self) -> MlflowBasicClient:
38
+ """
39
+ DI factory method.
40
+ """
41
+ if "NEXUS__MLFLOW_TRACKING_URI" not in os.environ:
42
+ raise FatalStartupConfigurationError("NEXUS__MLFLOW_TRACKING_URI")
43
+ return MlflowBasicClient(os.environ["NEXUS__MLFLOW_TRACKING_URI"])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: esd-services-api-client
3
- Version: 2.5.8
3
+ Version: 2.5.9
4
4
  Summary: Python clients for ESD services
5
5
  License: Apache 2.0
6
6
  Author: ECCO Sneaks & Data
@@ -1,4 +1,4 @@
1
- esd_services_api_client/__init__.py,sha256=KN_Kjl98O7GhQYyQAuprEfJgTvHkSr0lZV5-SAoaW3Y,648
1
+ esd_services_api_client/__init__.py,sha256=tkUlBJ37E9K-lNWs-fMkgNFWubeJ_IWZXHJYF4P9sWw,648
2
2
  esd_services_api_client/beast/__init__.py,sha256=zNhXcHSP5w4P9quM1XP4oXVJEccvC_VScG41TZ0GzZ8,723
3
3
  esd_services_api_client/beast/v3/__init__.py,sha256=FtumtInoDyCCRE424Llqv8QZLRuwXzj-smyfu1od1nc,754
4
4
  esd_services_api_client/beast/v3/_connector.py,sha256=VqxiCzJWKERh42aZAIphzmOEG5cdOcKM0DQzG7eQ_-8,11479
@@ -32,8 +32,8 @@ esd_services_api_client/nexus/algorithms/recursive.py,sha256=uaCCl4q-st_KqbcmkdO
32
32
  esd_services_api_client/nexus/configurations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  esd_services_api_client/nexus/configurations/algorithm_configuration.py,sha256=eE7diX2PATCGkmqhvFOcZwXrr6vns4fqnJGmgNvhhZM,1091
34
34
  esd_services_api_client/nexus/core/__init__.py,sha256=sOgKKq3_LZGbLmQMtMS7lDw2hv027qownTmNIRV0BB8,627
35
- esd_services_api_client/nexus/core/app_core.py,sha256=PXFXCmg1_0MMQw0s0F2sT-AHUA9eWO4cFSdMLlvPCoc,12144
36
- esd_services_api_client/nexus/core/app_dependencies.py,sha256=dDmgPBJbPzvAWAkKCSPKT1i5fP5cAPDxVL6K27Bp_nI,8561
35
+ esd_services_api_client/nexus/core/app_core.py,sha256=6DQics-AKEqOA62hNSOn4Pd04QjywYbOljF7XAXpkhE,12382
36
+ esd_services_api_client/nexus/core/app_dependencies.py,sha256=vx9vKMnTbmLzi3HJYxJn5_VrPi8bUg85KXB9vSIE2Sc,8781
37
37
  esd_services_api_client/nexus/core/serializers.py,sha256=Vk9FaEeDHXx3S7rPlYoWzsOcN6gzLzemsrjq6ytfaI0,2217
38
38
  esd_services_api_client/nexus/exceptions/__init__.py,sha256=feN33VdqB5-2bD9aJesJl_OlsKrNNo3hZCnQgKuaU9k,696
39
39
  esd_services_api_client/nexus/exceptions/_nexus_error.py,sha256=QvtY38mNoIA6t26dUN6UIsaPfljhtVNsbQVS7ksMb-Q,895
@@ -44,10 +44,12 @@ esd_services_api_client/nexus/input/__init__.py,sha256=ODYhZ791tPC4-eVxSRRlh8FLD
44
44
  esd_services_api_client/nexus/input/input_processor.py,sha256=vqzeQrtRFqBKTPSEiWX_JZJTF9itMwwvWjPnJVLrSwQ,3132
45
45
  esd_services_api_client/nexus/input/input_reader.py,sha256=aXNMGxrdUX5RDYR666GSGkcZqYMFYoZ8zGVDuUFFFZQ,3505
46
46
  esd_services_api_client/nexus/input/payload_reader.py,sha256=Kq0xN1Shyqv71v6YkcrqVTDbmsEjZc8ithsXYpyu87M,2516
47
+ esd_services_api_client/nexus/modules/__init__.py,sha256=MRui7s4uqAiLTRmBx3EyfS9CvYfYcaQXZuO829hwYio,705
48
+ esd_services_api_client/nexus/modules/mlflow_module.py,sha256=d4y8XetGF37md4dEpEO0CFPj2lDmK_f6LspUm4dRAW4,1331
47
49
  esd_services_api_client/nexus/telemetry/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
50
  esd_services_api_client/nexus/telemetry/recorder.py,sha256=j4x-wOSNZHkFco-ENlKtSm22d4WGHmuzKMnzvGQAtlQ,4849
49
51
  esd_services_api_client/nexus/telemetry/user_telemetry_recorder.py,sha256=NOcb2l1SkMHinBXSrfbiBZSpufzhBWkuh3Px3NXrkcg,4997
50
- esd_services_api_client-2.5.8.dist-info/LICENSE,sha256=0gS6zXsPp8qZhzi1xaGCIYPzb_0e8on7HCeFJe8fOpw,10693
51
- esd_services_api_client-2.5.8.dist-info/METADATA,sha256=_KBIIPC3voC-_zFJ3Dl-AmbfK9u03gQCvX4mkq40uJU,1164
52
- esd_services_api_client-2.5.8.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
53
- esd_services_api_client-2.5.8.dist-info/RECORD,,
52
+ esd_services_api_client-2.5.9.dist-info/LICENSE,sha256=0gS6zXsPp8qZhzi1xaGCIYPzb_0e8on7HCeFJe8fOpw,10693
53
+ esd_services_api_client-2.5.9.dist-info/METADATA,sha256=RDcGeEkiGOpSVHAmFVQz2rmgBEfteNt-VKWL3Xz3NNQ,1164
54
+ esd_services_api_client-2.5.9.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
55
+ esd_services_api_client-2.5.9.dist-info/RECORD,,