fred-oss 0.30.0__tar.gz → 0.32.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.
- {fred_oss-0.30.0/src/main/fred_oss.egg-info → fred_oss-0.32.0}/PKG-INFO +1 -1
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/impl.py +9 -9
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/utils.py +8 -8
- fred_oss-0.32.0/src/main/fred/version +1 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/client.py +7 -3
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/routers/_runner.py +40 -12
- {fred_oss-0.30.0 → fred_oss-0.32.0/src/main/fred_oss.egg-info}/PKG-INFO +1 -1
- fred_oss-0.30.0/src/main/fred/version +0 -1
- {fred_oss-0.30.0 → fred_oss-0.32.0}/MANIFEST.in +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/NOTICE.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/README.md +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/requirements.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/setup.cfg +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/setup.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/cli/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/cli/__main__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/cli/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/cli/main.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/comp/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/comp/_keyval.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/comp/_queue.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/comp/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/comp/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/_redis.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/_stdlib.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/dao/service/utils.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/callback/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/callback/_function.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/callback/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/callback/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/result.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/future/settings.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/cli_ext.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtime.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtimes/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtimes/scanner.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtimes/sync.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/wrappers/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/runpod/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/runpod/cli_ext.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/runpod/helper.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/maturity.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/monad/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/monad/_either.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/monad/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/monad/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/settings.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/utils/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/utils/dateops.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/utils/runtime.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/version.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/backend.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/handler.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/info.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/_handler.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/_item.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/_request.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/_runner_spec.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/model/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/plugins/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/plugins/_local.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/plugins/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/plugins/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/cli_ext.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/routers/__init__.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/routers/catalog.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/routers/interface.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/rest/server.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/settings.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/signal.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/status.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/worker/runner/utils.py +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred_oss.egg-info/SOURCES.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred_oss.egg-info/dependency_links.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred_oss.egg-info/entry_points.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred_oss.egg-info/requires.txt +0 -0
- {fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred_oss.egg-info/top_level.txt +0 -0
|
@@ -239,9 +239,9 @@ class Future(MonadInterface[A]):
|
|
|
239
239
|
def pullsync(
|
|
240
240
|
cls,
|
|
241
241
|
future_id: str,
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
retry_delay: float = 0.2,
|
|
243
|
+
retry_backoff_rate: float = 0.1,
|
|
244
|
+
retry_delay_max: float = 15,
|
|
245
245
|
timeout: float = FRD_FUTURE_DEFAULT_EXPIRATION,
|
|
246
246
|
on_complete: Optional[CallbackInterface] = None,
|
|
247
247
|
**kwargs
|
|
@@ -252,9 +252,9 @@ class Future(MonadInterface[A]):
|
|
|
252
252
|
|
|
253
253
|
Args:
|
|
254
254
|
future_id (str): The unique identifier of the future to be pulled.
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
255
|
+
retry_delay (float): Initial delay between checks for the future's completion.
|
|
256
|
+
retry_backoff_rate (float): Incremental increase in delay after each check.
|
|
257
|
+
retry_delay_max (float): Maximum delay between checks.
|
|
258
258
|
timeout (float): Maximum time to wait for the future to complete.
|
|
259
259
|
on_complete (Optional[CallbackInterface]): An optional callback to be executed
|
|
260
260
|
when the future completes.
|
|
@@ -267,9 +267,9 @@ class Future(MonadInterface[A]):
|
|
|
267
267
|
return cls(
|
|
268
268
|
function=lambda: pull_future_result(
|
|
269
269
|
future_id=future_id,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
retry_delay=retry_delay,
|
|
271
|
+
retry_backoff_rate=retry_backoff_rate,
|
|
272
|
+
retry_delay_max=retry_delay_max,
|
|
273
273
|
timeout=timeout,
|
|
274
274
|
),
|
|
275
275
|
on_complete=on_complete,
|
|
@@ -8,9 +8,9 @@ A = TypeVar("A")
|
|
|
8
8
|
|
|
9
9
|
def pull_future_result(
|
|
10
10
|
future_id: str,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
retry_delay: float = 0.2,
|
|
12
|
+
retry_backoff_rate: float = 0.1,
|
|
13
|
+
retry_delay_max: float = 15,
|
|
14
14
|
timeout: float = FRD_FUTURE_DEFAULT_EXPIRATION,
|
|
15
15
|
) -> A:
|
|
16
16
|
from fred.future.impl import FutureResult, FutureUndefinedInProgress, FutureUndefinedPending
|
|
@@ -25,15 +25,15 @@ def pull_future_result(
|
|
|
25
25
|
return value.resolve()
|
|
26
26
|
case FutureUndefinedPending() | FutureUndefinedInProgress():
|
|
27
27
|
# If the future is not yet defined, wait for it to complete
|
|
28
|
-
time.sleep(
|
|
28
|
+
time.sleep(retry_delay)
|
|
29
29
|
# Increase the delay for the next check to avoid busy waiting (exponential backoff) capped at delay_max
|
|
30
30
|
return pull_future_result(
|
|
31
31
|
future_id=future_id,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
retry_delay=min(retry_delay * (1 + retry_backoff_rate), retry_delay_max),
|
|
33
|
+
retry_backoff_rate=retry_backoff_rate,
|
|
34
|
+
retry_delay_max=retry_delay_max,
|
|
35
35
|
# TODO: Consider using a more precise timeout mechanism based on elapsed time
|
|
36
|
-
timeout=timeout -
|
|
36
|
+
timeout=timeout - retry_delay,
|
|
37
37
|
)
|
|
38
38
|
case _:
|
|
39
39
|
raise ValueError(f"Unknown future state for ID '{future_id}'")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.32.0
|
|
@@ -92,7 +92,8 @@ class RunnerClient:
|
|
|
92
92
|
self,
|
|
93
93
|
request_id: str,
|
|
94
94
|
retry_sync: int = 10,
|
|
95
|
-
retry_delay: float = 0.
|
|
95
|
+
retry_delay: float = 0.2,
|
|
96
|
+
retry_backoff_rate: float = 0.1,
|
|
96
97
|
**kwargs,
|
|
97
98
|
) -> Future:
|
|
98
99
|
# TODO: Once the broadcast method is implemented, we can add a warning notice regarding
|
|
@@ -102,6 +103,7 @@ class RunnerClient:
|
|
|
102
103
|
request_id=request_id,
|
|
103
104
|
retry_sync=retry_sync,
|
|
104
105
|
retry_delay=retry_delay,
|
|
106
|
+
retry_backoff_rate=retry_backoff_rate,
|
|
105
107
|
fail=True, # Always fail inside the future to propagate the exception
|
|
106
108
|
)
|
|
107
109
|
return future.flat_map(
|
|
@@ -112,7 +114,8 @@ class RunnerClient:
|
|
|
112
114
|
self,
|
|
113
115
|
request_id: str,
|
|
114
116
|
retry_sync: int = 10,
|
|
115
|
-
retry_delay: float = 0.
|
|
117
|
+
retry_delay: float = 0.2,
|
|
118
|
+
retry_backoff_rate: float = 0.1,
|
|
116
119
|
fail: bool = False,
|
|
117
120
|
) -> bool:
|
|
118
121
|
if not self.fetch_status(request_id=request_id):
|
|
@@ -120,7 +123,8 @@ class RunnerClient:
|
|
|
120
123
|
retry_kwargs = {
|
|
121
124
|
"request_id": request_id,
|
|
122
125
|
"retry_sync": retry_sync - 1,
|
|
123
|
-
"retry_delay": retry_delay,
|
|
126
|
+
"retry_delay": retry_delay * (1 + retry_backoff_rate), # Exponential backoff
|
|
127
|
+
"retry_backoff_rate": retry_backoff_rate,
|
|
124
128
|
"fail": fail,
|
|
125
129
|
}
|
|
126
130
|
if retry_sync:
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
|
+
|
|
2
3
|
from fred.worker.runner.rest.routers.interface import RouterInterface
|
|
3
4
|
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
class RunnerRouter(RouterInterface):
|
|
7
|
-
|
|
8
|
-
def __post_init__(self):
|
|
9
|
-
self.router.add_api_route(
|
|
10
|
-
"/handler_exists",
|
|
11
|
-
self.handler_exists,
|
|
12
|
-
methods=["GET"],
|
|
13
|
-
tags=["Runner"],
|
|
14
|
-
summary="Check if a handler class exists and is a RunnerHandler.",
|
|
15
|
-
response_description="Details about the handler class.",
|
|
16
|
-
)
|
|
6
|
+
class RunnerRouterMethods:
|
|
17
7
|
|
|
18
8
|
def handler_exists(self, classname: str, classpath: str) -> dict:
|
|
19
9
|
from fred.worker.runner.handler import RunnerHandler
|
|
@@ -38,3 +28,41 @@ class RunnerRouter(RouterInterface):
|
|
|
38
28
|
except Exception as e:
|
|
39
29
|
result_payload["metadata"]["error"] = str(e)
|
|
40
30
|
return result_payload
|
|
31
|
+
|
|
32
|
+
def runner_start(self, payload: dict) -> dict:
|
|
33
|
+
from fred.worker.runner.model.catalog import RunnerModelCatalog
|
|
34
|
+
from fred.worker.runner.plugins.catalog import PluginCatalog
|
|
35
|
+
# Determine which plugin to use; default to LOCAL if not specified
|
|
36
|
+
plugin_name: str = payload.pop("plugin", "LOCAL")
|
|
37
|
+
wait_for_exec: bool = payload.pop("wait_for_exec", False)
|
|
38
|
+
# Create the RunnerSpec from the provided payload
|
|
39
|
+
# TODO: Instead on depending on parsing a dict... Can we implement a base-model to facilitate fast-api validation?
|
|
40
|
+
runner_spec = RunnerModelCatalog.RUNNER_SPEC.value.from_payload(payload=payload)
|
|
41
|
+
# Instantiate the plugin and execute the runner
|
|
42
|
+
plugin = PluginCatalog[plugin_name.upper()]()
|
|
43
|
+
return {
|
|
44
|
+
"runner_id": plugin.execute(runner_spec, wait_for_exec=wait_for_exec).runner_id,
|
|
45
|
+
"queue_slug": runner_spec.queue_slug,
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@dataclass(frozen=True, slots=False)
|
|
50
|
+
class RunnerRouter(RouterInterface, RunnerRouterMethods):
|
|
51
|
+
|
|
52
|
+
def __post_init__(self):
|
|
53
|
+
self.router.add_api_route(
|
|
54
|
+
"/handler_exists",
|
|
55
|
+
self.handler_exists,
|
|
56
|
+
methods=["GET"],
|
|
57
|
+
tags=["Runner"],
|
|
58
|
+
summary="Check if a handler class exists and is a RunnerHandler.",
|
|
59
|
+
response_description="Details about the handler class.",
|
|
60
|
+
)
|
|
61
|
+
self.router.add_api_route(
|
|
62
|
+
"/start",
|
|
63
|
+
self.runner_start,
|
|
64
|
+
methods=["POST"],
|
|
65
|
+
tags=["Runner"],
|
|
66
|
+
summary="Start a runner using the specified plugin.",
|
|
67
|
+
response_description="The ID of the started runner.",
|
|
68
|
+
)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.30.0
|
|
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
|
{fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtimes/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/runtimes/scanner.py
RENAMED
|
File without changes
|
|
File without changes
|
{fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/wrappers/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.30.0 → fred_oss-0.32.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py
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
|
|
File without changes
|
|
File without changes
|