esd-services-api-client 2.5.7__tar.gz → 2.5.9__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.
Files changed (55) hide show
  1. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/PKG-INFO +1 -1
  2. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/__init__.py +1 -1
  3. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/forked_algorithm.py +10 -10
  4. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/core/app_core.py +8 -1
  5. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/core/app_dependencies.py +7 -0
  6. esd_services_api_client-2.5.9/esd_services_api_client/nexus/modules/__init__.py +20 -0
  7. esd_services_api_client-2.5.9/esd_services_api_client/nexus/modules/mlflow_module.py +43 -0
  8. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/pyproject.toml +1 -1
  9. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/LICENSE +0 -0
  10. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/README.md +0 -0
  11. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/beast/__init__.py +0 -0
  12. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/beast/v3/__init__.py +0 -0
  13. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/beast/v3/_connector.py +0 -0
  14. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/beast/v3/_models.py +0 -0
  15. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/README.md +0 -0
  16. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/__init__.py +0 -0
  17. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/_auth.py +0 -0
  18. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/_base.py +0 -0
  19. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/_connector.py +0 -0
  20. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/boxer/_models.py +0 -0
  21. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/common/__init__.py +0 -0
  22. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/crystal/__init__.py +0 -0
  23. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/crystal/_api_versions.py +0 -0
  24. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/crystal/_connector.py +0 -0
  25. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/crystal/_models.py +0 -0
  26. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/README.md +0 -0
  27. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/__init__.py +0 -0
  28. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/__init__.py +0 -0
  29. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/algrorithm_cache.py +0 -0
  30. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/input_object.py +0 -0
  31. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/logger_factory.py +0 -0
  32. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/nexus_object.py +0 -0
  33. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/abstractions/socket_provider.py +0 -0
  34. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/__init__.py +0 -0
  35. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/_baseline_algorithm.py +0 -0
  36. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/_remote_algorithm.py +0 -0
  37. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/distributed.py +0 -0
  38. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/minimalistic.py +0 -0
  39. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/algorithms/recursive.py +0 -0
  40. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/configurations/__init__.py +0 -0
  41. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/configurations/algorithm_configuration.py +0 -0
  42. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/core/__init__.py +0 -0
  43. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/core/serializers.py +0 -0
  44. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/exceptions/__init__.py +0 -0
  45. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/exceptions/_nexus_error.py +0 -0
  46. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/exceptions/cache_errors.py +0 -0
  47. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/exceptions/input_reader_error.py +0 -0
  48. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/exceptions/startup_error.py +0 -0
  49. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/input/__init__.py +0 -0
  50. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/input/input_processor.py +0 -0
  51. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/input/input_reader.py +0 -0
  52. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/input/payload_reader.py +0 -0
  53. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/telemetry/__init__.py +0 -0
  54. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/telemetry/recorder.py +0 -0
  55. {esd_services_api_client-2.5.7 → esd_services_api_client-2.5.9}/esd_services_api_client/nexus/telemetry/user_telemetry_recorder.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: esd-services-api-client
3
- Version: 2.5.7
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
@@ -17,4 +17,4 @@
17
17
  Root index.
18
18
  """
19
19
 
20
- __version__ = "2.5.7"
20
+ __version__ = "2.5.9"
@@ -153,14 +153,6 @@ class ForkedAlgorithm(NexusObject[TPayload, AlgorithmResult]):
153
153
  self._get_forks, **self._inputs, **kwargs
154
154
  )()
155
155
 
156
- if len(forks) > 0:
157
- self._logger.info(
158
- "Forking node with: {forks}, after the node run",
159
- forks=",".join([fork.alias() for fork in forks]),
160
- )
161
- else:
162
- self._logger.info("Leaf algorithm node: proceeding with this node run only")
163
-
164
156
  run_result = await partial(
165
157
  _measured_run,
166
158
  **kwargs,
@@ -170,7 +162,15 @@ class ForkedAlgorithm(NexusObject[TPayload, AlgorithmResult]):
170
162
  logger=self._logger,
171
163
  )()
172
164
 
173
- # now await callback scheduling
174
- await asyncio.wait([asyncio.create_task(fork.run(**kwargs)) for fork in forks])
165
+ if len(forks) > 0:
166
+ self._logger.info(
167
+ "Forking node with: {forks}, after the node run",
168
+ forks=",".join([fork.alias() for fork in forks]),
169
+ )
170
+ await asyncio.wait(
171
+ [asyncio.create_task(fork.run(**kwargs)) for fork in forks]
172
+ )
173
+ else:
174
+ self._logger.info("Leaf algorithm node: proceeding with this node run only")
175
175
 
176
176
  return run_result
@@ -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
  [tool.poetry]
2
2
  name = "esd-services-api-client"
3
- version = "2.5.7"
3
+ version = "2.5.9"
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>']