fred-oss 0.45.0__tar.gz → 0.47.0__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 (94) hide show
  1. {fred_oss-0.45.0/src/main/fred_oss.egg-info → fred_oss-0.47.0}/PKG-INFO +1 -1
  2. fred_oss-0.47.0/src/main/fred/version +1 -0
  3. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/interface.py +9 -4
  4. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/client.py +14 -2
  5. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/routers/_runner.py +25 -0
  6. fred_oss-0.47.0/src/main/fred/worker/settings.py +7 -0
  7. {fred_oss-0.45.0 → fred_oss-0.47.0/src/main/fred_oss.egg-info}/PKG-INFO +1 -1
  8. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred_oss.egg-info/SOURCES.txt +1 -0
  9. fred_oss-0.45.0/src/main/fred/version +0 -1
  10. {fred_oss-0.45.0 → fred_oss-0.47.0}/MANIFEST.in +0 -0
  11. {fred_oss-0.45.0 → fred_oss-0.47.0}/NOTICE.txt +0 -0
  12. {fred_oss-0.45.0 → fred_oss-0.47.0}/README.md +0 -0
  13. {fred_oss-0.45.0 → fred_oss-0.47.0}/requirements.txt +0 -0
  14. {fred_oss-0.45.0 → fred_oss-0.47.0}/setup.cfg +0 -0
  15. {fred_oss-0.45.0 → fred_oss-0.47.0}/setup.py +0 -0
  16. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/cli/__init__.py +0 -0
  17. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/cli/__main__.py +0 -0
  18. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/cli/interface.py +0 -0
  19. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/cli/main.py +0 -0
  20. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/__init__.py +0 -0
  21. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/__init__.py +0 -0
  22. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/_keyval.py +0 -0
  23. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/_pubsub.py +0 -0
  24. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/_queue.py +0 -0
  25. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/catalog.py +0 -0
  26. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/comp/interface.py +0 -0
  27. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/__init__.py +0 -0
  28. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/_redis.py +0 -0
  29. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/_stdlib.py +0 -0
  30. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/catalog.py +0 -0
  31. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/interface.py +0 -0
  32. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/dao/service/utils.py +0 -0
  33. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/__init__.py +0 -0
  34. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/callback/__init__.py +0 -0
  35. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/callback/_function.py +0 -0
  36. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/callback/catalog.py +0 -0
  37. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/callback/interface.py +0 -0
  38. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/impl.py +0 -0
  39. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/result.py +0 -0
  40. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/settings.py +0 -0
  41. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/future/utils.py +0 -0
  42. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/__init__.py +0 -0
  43. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/cli_ext.py +0 -0
  44. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/runtime.py +0 -0
  45. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/runtimes/__init__.py +0 -0
  46. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/runtimes/scanner.py +0 -0
  47. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/runtimes/sync.py +0 -0
  48. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/wrappers/__init__.py +0 -0
  49. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py +0 -0
  50. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/runpod/__init__.py +0 -0
  51. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/runpod/cli_ext.py +0 -0
  52. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/integrations/runpod/helper.py +0 -0
  53. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/maturity.py +0 -0
  54. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/monad/__init__.py +0 -0
  55. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/monad/_either.py +0 -0
  56. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/monad/catalog.py +0 -0
  57. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/monad/interface.py +0 -0
  58. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/settings.py +0 -0
  59. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/utils/__init__.py +0 -0
  60. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/utils/dateops.py +0 -0
  61. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/utils/runtime.py +0 -0
  62. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/version.py +0 -0
  63. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/__init__.py +0 -0
  64. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/__init__.py +0 -0
  65. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/backend.py +0 -0
  66. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/handler.py +0 -0
  67. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/__init__.py +0 -0
  68. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/_handler.py +0 -0
  69. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/_item.py +0 -0
  70. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/_request.py +0 -0
  71. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/_runner_spec.py +0 -0
  72. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/catalog.py +0 -0
  73. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/model/interface.py +0 -0
  74. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/plugins/__init__.py +0 -0
  75. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/plugins/_local.py +0 -0
  76. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/plugins/_runpod.py +0 -0
  77. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/plugins/catalog.py +0 -0
  78. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/plugins/interface.py +0 -0
  79. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/__init__.py +0 -0
  80. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/auth.py +0 -0
  81. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/cli_ext.py +0 -0
  82. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/routers/__init__.py +0 -0
  83. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/routers/catalog.py +0 -0
  84. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/routers/interface.py +0 -0
  85. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/server.py +0 -0
  86. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/rest/settings.py +0 -0
  87. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/settings.py +0 -0
  88. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/signal.py +0 -0
  89. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/status.py +0 -0
  90. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred/worker/runner/utils.py +0 -0
  91. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred_oss.egg-info/dependency_links.txt +0 -0
  92. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred_oss.egg-info/entry_points.txt +0 -0
  93. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred_oss.egg-info/requires.txt +0 -0
  94. {fred_oss-0.45.0 → fred_oss-0.47.0}/src/main/fred_oss.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-oss
3
- Version: 0.45.0
3
+ Version: 0.47.0
4
4
  Summary: FREDOSS
5
5
  Home-page: https://fred.fahera.mx
6
6
  Author: Fahera Research, Education, and Development
@@ -0,0 +1 @@
1
+ 0.47.0
@@ -2,6 +2,7 @@ import time
2
2
  from typing import overload, Callable, Optional
3
3
  from dataclasses import dataclass, field
4
4
 
5
+ from fred.worker.settings import FRD_WORKER_DEFAULT_BROADCAST
5
6
  from fred.future.impl import Future # Should we make this import lazy?
6
7
  from fred.utils.dateops import datetime_utcnow
7
8
  from fred.settings import (
@@ -139,14 +140,14 @@ class HandlerInterface:
139
140
  return json.loads(metadata_serialized)
140
141
 
141
142
  @overload
142
- def run(self, event: dict, as_future: bool = True, future_id: Optional[str] = None) -> Future[dict]:
143
+ def run(self, event: dict, as_future: bool = True, broadcast: Optional[bool] = None, future_id: Optional[str] = None) -> Future[dict]:
143
144
  ...
144
145
 
145
146
  @overload
146
- def run(self, event: dict, as_future: bool = False, future_id: Optional[str] = None) -> dict:
147
+ def run(self, event: dict, as_future: bool = False, broadcast: Optional[bool] = None, future_id: Optional[str] = None) -> dict:
147
148
  ...
148
149
 
149
- def run(self, event: dict, as_future: bool = False, future_id: Optional[str] = None) -> dict | Future[dict]:
150
+ def run(self, event: dict, as_future: bool = False, broadcast: Optional[bool] = None, future_id: Optional[str] = None) -> dict | Future[dict]:
150
151
  """Process an incoming event and return a structured response.
151
152
  The event is expected to be a dictionary with at least an 'id' and 'input' keys.
152
153
  The 'input' key should contain the payload to be processed.
@@ -158,7 +159,11 @@ class HandlerInterface:
158
159
  If requested as a Future, returns a Future that will resolve to the response dictionary.
159
160
  """
160
161
  if as_future:
161
- return Future(function=lambda: self.run(event=event, as_future=False), future_id=future_id)
162
+ return Future(
163
+ future_id=future_id,
164
+ function=lambda: self.run(event=event, as_future=False),
165
+ broadcast=FRD_WORKER_DEFAULT_BROADCAST if broadcast is None else broadcast,
166
+ )
162
167
  # Extract payload and event ID
163
168
  payload = event.get("input", {})
164
169
  job_event_identifier = event.get("id")
@@ -124,6 +124,10 @@ class RunnerClient:
124
124
  retry_backoff_rate: float = 0.1,
125
125
  **kwargs,
126
126
  ) -> Future:
127
+ logger.warning(
128
+ "Using 'pullsync' is to be deprecated soon; use the 'Future.subscribe' "
129
+ "method instead (by default this is used on fetch_result with 'use_pullsync=False')."
130
+ )
127
131
  return Future(
128
132
  function=self._pullsync,
129
133
  request_id=request_id,
@@ -160,8 +164,16 @@ class RunnerClient:
160
164
  return False
161
165
  return True
162
166
 
163
- def fetch_result(self, request_id: str, now: bool = False, timeout: Optional[float] = None, **kwargs) -> Optional[dict]:
164
- future = self.pullsync(request_id=request_id, **kwargs)
167
+ def fetch_result(
168
+ self,
169
+ request_id: str,
170
+ now: bool = False,
171
+ timeout: Optional[float] = None,
172
+ use_pullsync: bool = False,
173
+ **kwargs,
174
+ ) -> Optional[dict]:
175
+ future = self.pullsync(request_id=request_id, **kwargs) \
176
+ if use_pullsync else Future.subscribe(future_id=request_id, **kwargs)
165
177
  if now:
166
178
  return future.getwhatevernow()
167
179
  return future.wait_and_resolve(timeout=timeout)
@@ -1,5 +1,7 @@
1
1
  from dataclasses import dataclass
2
+ from typing import Optional
2
3
 
4
+ from fred.future import Future
3
5
  from fred.settings import logger_manager
4
6
  from fred.utils.dateops import datetime_utcnow
5
7
  from fred.worker.runner.rest.routers.interface import RouterInterface
@@ -86,6 +88,21 @@ class RunnerRouterMethods:
86
88
  "dispatched_at": datetime_utcnow().isoformat(),
87
89
  }
88
90
 
91
+ def runner_output(self, request_id: str, nonblocking: bool = False, timeout: Optional[float] = None) -> dict:
92
+
93
+ output_requested_at = datetime_utcnow().isoformat()
94
+ # Subscribe to the future result using the request_id
95
+ future = Future.subscribe(future_id=request_id)
96
+ if nonblocking:
97
+ # TODO: Implement non-blocking fetch logic... let's ensure it's worth the effort.
98
+ raise NotImplementedError("Non-blocking fetch not implemented yet...")
99
+ return {
100
+ "request_id": request_id,
101
+ "output_requested_at": output_requested_at,
102
+ "output_delivered_at": datetime_utcnow().isoformat(),
103
+ "output": future.wait_and_resolve(timeout=timeout),
104
+ }
105
+
89
106
 
90
107
  @dataclass(frozen=True, slots=False)
91
108
  class RunnerRouter(RouterInterface.with_backend(), RunnerRouterMethods):
@@ -123,3 +140,11 @@ class RunnerRouter(RouterInterface.with_backend(), RunnerRouterMethods):
123
140
  summary="Execute a task by dispatching a request to the specified queue.",
124
141
  response_description="Details about the dispatched request.",
125
142
  )
143
+ self.router.add_api_route(
144
+ "/output/{request_id}",
145
+ self.runner_output,
146
+ methods=["GET"],
147
+ tags=["Runner"],
148
+ summary="Fetch the output of a previously dispatched request.",
149
+ response_description="The output of the request.",
150
+ )
@@ -0,0 +1,7 @@
1
+ from fred.settings import get_environ_variable
2
+
3
+
4
+ FRD_WORKER_DEFAULT_BROADCAST = bool(int(get_environ_variable(
5
+ name="FRD_WORKER_BROADCAST_DEFAULT",
6
+ default="0",
7
+ )) or 0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fred-oss
3
- Version: 0.45.0
3
+ Version: 0.47.0
4
4
  Summary: FREDOSS
5
5
  Home-page: https://fred.fahera.mx
6
6
  Author: Fahera Research, Education, and Development
@@ -53,6 +53,7 @@ src/main/fred/utils/dateops.py
53
53
  src/main/fred/utils/runtime.py
54
54
  src/main/fred/worker/__init__.py
55
55
  src/main/fred/worker/interface.py
56
+ src/main/fred/worker/settings.py
56
57
  src/main/fred/worker/runner/__init__.py
57
58
  src/main/fred/worker/runner/backend.py
58
59
  src/main/fred/worker/runner/client.py
@@ -1 +0,0 @@
1
- 0.45.0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes