fred-oss 0.34.0__tar.gz → 0.36.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.34.0/src/main/fred_oss.egg-info → fred_oss-0.36.0}/PKG-INFO +1 -1
- fred_oss-0.36.0/src/main/fred/version +1 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/client.py +33 -10
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/_runner_spec.py +5 -5
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/plugins/_local.py +1 -2
- fred_oss-0.36.0/src/main/fred/worker/runner/plugins/_runpod.py +79 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/plugins/catalog.py +2 -1
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/plugins/interface.py +13 -8
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/routers/_runner.py +1 -1
- {fred_oss-0.34.0 → fred_oss-0.36.0/src/main/fred_oss.egg-info}/PKG-INFO +1 -1
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred_oss.egg-info/SOURCES.txt +1 -1
- fred_oss-0.34.0/src/main/fred/version +0 -1
- fred_oss-0.34.0/src/main/fred/worker/runner/info.py +0 -54
- {fred_oss-0.34.0 → fred_oss-0.36.0}/MANIFEST.in +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/NOTICE.txt +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/README.md +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/requirements.txt +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/setup.cfg +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/setup.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/cli/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/cli/__main__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/cli/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/cli/main.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/comp/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/comp/_keyval.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/comp/_queue.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/comp/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/comp/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/_redis.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/_stdlib.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/dao/service/utils.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/callback/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/callback/_function.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/callback/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/callback/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/impl.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/result.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/settings.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/future/utils.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/cli_ext.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtime.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtimes/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtimes/scanner.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtimes/sync.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/wrappers/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/wrappers/dbutils.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/runpod/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/runpod/cli_ext.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/runpod/helper.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/maturity.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/monad/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/monad/_either.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/monad/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/monad/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/settings.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/utils/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/utils/dateops.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/utils/runtime.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/version.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/backend.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/handler.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/_handler.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/_item.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/_request.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/model/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/plugins/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/auth.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/cli_ext.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/routers/__init__.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/routers/catalog.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/routers/interface.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/server.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/rest/settings.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/settings.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/signal.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/status.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/worker/runner/utils.py +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred_oss.egg-info/dependency_links.txt +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred_oss.egg-info/entry_points.txt +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred_oss.egg-info/requires.txt +0 -0
- {fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred_oss.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
0.36.0
|
|
@@ -88,6 +88,34 @@ class RunnerClient:
|
|
|
88
88
|
def fetch_status(request_id: str) -> Optional[str]:
|
|
89
89
|
return FutureResult._get_status_key(future_id=request_id).get()
|
|
90
90
|
|
|
91
|
+
def _pullsync(
|
|
92
|
+
self,
|
|
93
|
+
request_id: str,
|
|
94
|
+
retry_sync: int = 10,
|
|
95
|
+
retry_delay: float = 0.2,
|
|
96
|
+
retry_backoff_rate: float = 0.1,
|
|
97
|
+
**kwargs,
|
|
98
|
+
):
|
|
99
|
+
from fred.future.utils import pull_future_result
|
|
100
|
+
|
|
101
|
+
if not self._is_ready_for_pullsync(
|
|
102
|
+
request_id=request_id,
|
|
103
|
+
retry_sync=retry_sync,
|
|
104
|
+
retry_delay=retry_delay,
|
|
105
|
+
retry_backoff_rate=retry_backoff_rate,
|
|
106
|
+
# Always fail in pullsync to raise an exception if not ready.
|
|
107
|
+
# In addition, this will be caught by the Future to propagate the exception.
|
|
108
|
+
fail=True,
|
|
109
|
+
):
|
|
110
|
+
raise ValueError(f"The provided request_id '{request_id}' is not ready for pullsync.")
|
|
111
|
+
|
|
112
|
+
return pull_future_result(
|
|
113
|
+
future_id=request_id,
|
|
114
|
+
retry_delay=retry_delay,
|
|
115
|
+
retry_backoff_rate=retry_backoff_rate,
|
|
116
|
+
**kwargs
|
|
117
|
+
)
|
|
118
|
+
|
|
91
119
|
def pullsync(
|
|
92
120
|
self,
|
|
93
121
|
request_id: str,
|
|
@@ -96,18 +124,13 @@ class RunnerClient:
|
|
|
96
124
|
retry_backoff_rate: float = 0.1,
|
|
97
125
|
**kwargs,
|
|
98
126
|
) -> Future:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
future = Future(
|
|
102
|
-
function=self._is_ready_for_pullsync,
|
|
127
|
+
return Future(
|
|
128
|
+
function=self._pullsync,
|
|
103
129
|
request_id=request_id,
|
|
104
130
|
retry_sync=retry_sync,
|
|
105
131
|
retry_delay=retry_delay,
|
|
106
132
|
retry_backoff_rate=retry_backoff_rate,
|
|
107
|
-
|
|
108
|
-
)
|
|
109
|
-
return future.flat_map(
|
|
110
|
-
lambda _: Future.pullsync(future_id=request_id, **kwargs)
|
|
133
|
+
**kwargs
|
|
111
134
|
)
|
|
112
135
|
|
|
113
136
|
def _is_ready_for_pullsync(
|
|
@@ -137,8 +160,8 @@ class RunnerClient:
|
|
|
137
160
|
return False
|
|
138
161
|
return True
|
|
139
162
|
|
|
140
|
-
def fetch_result(self, request_id: str, now: bool = False, timeout: Optional[float] = None) -> Optional[dict]:
|
|
141
|
-
future = self.pullsync(request_id=request_id)
|
|
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)
|
|
142
165
|
if now:
|
|
143
166
|
return future.getwhatevernow()
|
|
144
167
|
return future.wait_and_resolve(timeout=timeout)
|
|
@@ -73,11 +73,11 @@ class RunnerSpec(ModelInterface):
|
|
|
73
73
|
"timeout": self.timeout,
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
def as_event(self) -> dict:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
76
|
+
def as_event(self, drop_id: bool = False) -> dict:
|
|
77
|
+
event = {"input": self.as_dict()}
|
|
78
|
+
if not drop_id:
|
|
79
|
+
event["id"] = self.runner_id
|
|
80
|
+
return event
|
|
81
81
|
|
|
82
82
|
@property
|
|
83
83
|
def request_queue_name(self) -> str:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
from dataclasses import dataclass
|
|
2
2
|
|
|
3
3
|
from fred.settings import logger_manager
|
|
4
|
-
from fred.worker.runner.info import RunnerInfo
|
|
5
4
|
from fred.worker.runner.handler import RunnerHandler
|
|
6
5
|
from fred.worker.runner.model._runner_spec import RunnerSpec
|
|
7
6
|
from fred.worker.runner.plugins.interface import PluginInterface
|
|
@@ -31,4 +30,4 @@ class LocalPlugin(PluginInterface):
|
|
|
31
30
|
import_pattern=outer_handler_classpath,
|
|
32
31
|
**outer_handler_init_kwargs,
|
|
33
32
|
)
|
|
34
|
-
outer_handler.run(event=spec.as_event(), as_future=False)
|
|
33
|
+
return outer_handler.run(event=spec.as_event(), as_future=False)
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import posixpath
|
|
2
|
+
from dataclasses import dataclass
|
|
3
|
+
|
|
4
|
+
from fred.settings import logger_manager
|
|
5
|
+
from fred.worker.runner.model._runner_spec import RunnerSpec
|
|
6
|
+
from fred.worker.runner.plugins.interface import PluginInterface
|
|
7
|
+
from fred.settings import get_environ_variable
|
|
8
|
+
|
|
9
|
+
logger = logger_manager.get_logger(name=__name__)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@dataclass(frozen=True, slots=True)
|
|
13
|
+
class RunpodPlugin(PluginInterface):
|
|
14
|
+
|
|
15
|
+
def _execute(
|
|
16
|
+
self,
|
|
17
|
+
spec: RunnerSpec,
|
|
18
|
+
**kwargs
|
|
19
|
+
):
|
|
20
|
+
"""Execute the runner specification on RunPod's serverless platform.
|
|
21
|
+
Args:
|
|
22
|
+
spec (RunnerSpec): The runner specification to execute.
|
|
23
|
+
**kwargs: Additional keyword arguments for RunPod configuration, such as:
|
|
24
|
+
- runpod_key: API key for RunPod.
|
|
25
|
+
- runpod_url: Base URL for RunPod API.
|
|
26
|
+
- runpod_serverless_id: The ID of the serverless function to invoke.
|
|
27
|
+
- runpod_serverless_endpoint: The endpoint to use ('run' or 'runsync').
|
|
28
|
+
- headers: Additional headers to include in the request.
|
|
29
|
+
"""
|
|
30
|
+
import requests
|
|
31
|
+
|
|
32
|
+
RUNPOD_KEY = (
|
|
33
|
+
kwargs.get("runpod_key")
|
|
34
|
+
or get_environ_variable(name="RUNPOD_KEY", default="")
|
|
35
|
+
)
|
|
36
|
+
RUNPOD_URL = (
|
|
37
|
+
kwargs.get("runpod_url")
|
|
38
|
+
or get_environ_variable(name="RUNPOD_URL", default="https://api.runpod.ai/v2")
|
|
39
|
+
)
|
|
40
|
+
RUNPOD_SERVERLESS_ID = (
|
|
41
|
+
kwargs.get("runpod_serverless_id")
|
|
42
|
+
or get_environ_variable(name="RUNPOD_SERVERLESS_ID", default=None)
|
|
43
|
+
)
|
|
44
|
+
RUNPOD_SERVERLESS_ENDPOINT = (
|
|
45
|
+
# We do expect the specific endpoint to come from kwargs in most cases
|
|
46
|
+
kwargs.get("runpod_serverless_endpoint")
|
|
47
|
+
or get_environ_variable(name="RUNPOD_SERVERLESS_ENDPOINT", default="run")
|
|
48
|
+
)
|
|
49
|
+
if not RUNPOD_KEY:
|
|
50
|
+
raise ValueError("RUNPOD_KEY is required to execute the runner on RunPod.")
|
|
51
|
+
if not RUNPOD_SERVERLESS_ID:
|
|
52
|
+
raise ValueError("RUNPOD_SERVERLESS_ID is required to execute the runner on RunPod.")
|
|
53
|
+
if RUNPOD_SERVERLESS_ENDPOINT not in ["run", "runsync"]:
|
|
54
|
+
# Right now we only support these two endpoints... We might add more in the future.
|
|
55
|
+
# https://docs.runpod.io/serverless/endpoints/send-requests
|
|
56
|
+
raise ValueError("RUNPOD_SERVERLESS_ENDPOINT must be either 'run' or 'runsync'.")
|
|
57
|
+
target_url = posixpath.join(
|
|
58
|
+
RUNPOD_URL,
|
|
59
|
+
RUNPOD_SERVERLESS_ID,
|
|
60
|
+
RUNPOD_SERVERLESS_ENDPOINT,
|
|
61
|
+
)
|
|
62
|
+
headers = {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
"Authorization": f"Bearer {RUNPOD_KEY}",
|
|
65
|
+
**kwargs.get("headers", {}),
|
|
66
|
+
}
|
|
67
|
+
start_event = spec.as_event(drop_id=True)
|
|
68
|
+
response = requests.post(
|
|
69
|
+
url=target_url,
|
|
70
|
+
json=start_event,
|
|
71
|
+
headers=headers,
|
|
72
|
+
)
|
|
73
|
+
return {
|
|
74
|
+
"target_url": target_url,
|
|
75
|
+
"spec_created_at": spec.created_at,
|
|
76
|
+
"status_code": response.status_code,
|
|
77
|
+
"response": response.json(),
|
|
78
|
+
"ok": response.ok,
|
|
79
|
+
}
|
|
@@ -3,6 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
|
|
4
4
|
from fred.settings import logger_manager
|
|
5
5
|
from fred.worker.runner.plugins._local import LocalPlugin
|
|
6
|
+
from fred.worker.runner.plugins._runpod import RunpodPlugin
|
|
6
7
|
|
|
7
8
|
logger = logger_manager.get_logger(name=__name__)
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ class PluginCatalog(enum.Enum):
|
|
|
11
12
|
"""Enum for the different plugins available in FRED."""
|
|
12
13
|
|
|
13
14
|
LOCAL = LocalPlugin
|
|
14
|
-
RUNPOD =
|
|
15
|
+
RUNPOD = RunpodPlugin
|
|
15
16
|
LAMBDA = None # Placeholder for future AWS Lambda plugin
|
|
16
17
|
|
|
17
18
|
def __call__(self, *args, **kwargs):
|
|
@@ -4,7 +4,7 @@ from typing import Optional
|
|
|
4
4
|
|
|
5
5
|
from fred.future import Future
|
|
6
6
|
from fred.settings import logger_manager
|
|
7
|
-
from fred.
|
|
7
|
+
from fred.monad.catalog import EitherMonad
|
|
8
8
|
from fred.worker.runner.status import RunnerStatus
|
|
9
9
|
from fred.worker.runner.model._runner_spec import RunnerSpec
|
|
10
10
|
from fred.worker.runner.backend import RunnerBackend
|
|
@@ -55,7 +55,7 @@ class PluginInterface:
|
|
|
55
55
|
self,
|
|
56
56
|
spec: RunnerSpec,
|
|
57
57
|
**kwargs
|
|
58
|
-
) ->
|
|
58
|
+
) -> dict:
|
|
59
59
|
"""Wrapper method to handle execution and include error logging.
|
|
60
60
|
|
|
61
61
|
Since we don't control the implementation of the _execute method in subclasses, we
|
|
@@ -66,17 +66,17 @@ class PluginInterface:
|
|
|
66
66
|
outer_handler (RunnerHandler): The outer handler to use for execution.
|
|
67
67
|
**kwargs: Additional keyword arguments to pass to the execution method implemented by the subclass.
|
|
68
68
|
"""
|
|
69
|
-
|
|
69
|
+
response = {"runner_id": spec.runner_id}
|
|
70
70
|
runner_status = self.backend.keyval(
|
|
71
|
-
key=RunnerStatus.get_key(runner_id=runner_id)
|
|
71
|
+
key=RunnerStatus.get_key(runner_id=spec.runner_id)
|
|
72
72
|
)
|
|
73
73
|
try:
|
|
74
|
-
self._execute(spec=spec, **kwargs)
|
|
74
|
+
response["plugin_output"] = self._execute(spec=spec, **kwargs)
|
|
75
75
|
except Exception as e:
|
|
76
76
|
runner_status.set(RunnerStatus.ERROR.get_val(str(e)))
|
|
77
|
-
logger.error(f"Error executing runner '{runner_id}': {e}")
|
|
77
|
+
logger.error(f"Error executing runner '{spec.runner_id}': {e}")
|
|
78
78
|
raise
|
|
79
|
-
return
|
|
79
|
+
return response
|
|
80
80
|
|
|
81
81
|
def execute(
|
|
82
82
|
self,
|
|
@@ -101,7 +101,12 @@ class PluginInterface:
|
|
|
101
101
|
logger.info(f"Monitoring disabled for runner '{runner_id}'.")
|
|
102
102
|
if wait_for_exec:
|
|
103
103
|
logger.info(f"Waiting for execution of runner '{runner_id}' to complete.")
|
|
104
|
-
future_exec.wait(timeout=timeout)
|
|
104
|
+
match future_exec.wait(timeout=timeout):
|
|
105
|
+
case EitherMonad.Right(value):
|
|
106
|
+
logger.info(f"Execution of runner '{runner_id}' completed successfully.")
|
|
107
|
+
logger.debug(f"Execution of runner '{runner_id}' output: {value}")
|
|
108
|
+
case EitherMonad.Left(error):
|
|
109
|
+
logger.error(f"Execution of runner '{runner_id}' failed with error: {error}")
|
|
105
110
|
if future_monitor and wait_for_monitor:
|
|
106
111
|
future_monitor.wait(timeout=timeout)
|
|
107
112
|
return PluginExecutionOutput(
|
|
@@ -58,7 +58,7 @@ class RunnerRouterMethods:
|
|
|
58
58
|
# Instantiate the plugin and execute the runner
|
|
59
59
|
plugin = PluginCatalog[plugin_name.upper()]()
|
|
60
60
|
return {
|
|
61
|
-
"runner_id": plugin.execute(runner_spec, wait_for_exec=wait_for_exec).runner_id,
|
|
61
|
+
"runner_id": plugin.execute(runner_spec, wait_for_exec=wait_for_exec, **payload).runner_id,
|
|
62
62
|
"queue_slug": runner_spec.queue_slug,
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -56,7 +56,6 @@ src/main/fred/worker/runner/__init__.py
|
|
|
56
56
|
src/main/fred/worker/runner/backend.py
|
|
57
57
|
src/main/fred/worker/runner/client.py
|
|
58
58
|
src/main/fred/worker/runner/handler.py
|
|
59
|
-
src/main/fred/worker/runner/info.py
|
|
60
59
|
src/main/fred/worker/runner/settings.py
|
|
61
60
|
src/main/fred/worker/runner/signal.py
|
|
62
61
|
src/main/fred/worker/runner/status.py
|
|
@@ -70,6 +69,7 @@ src/main/fred/worker/runner/model/catalog.py
|
|
|
70
69
|
src/main/fred/worker/runner/model/interface.py
|
|
71
70
|
src/main/fred/worker/runner/plugins/__init__.py
|
|
72
71
|
src/main/fred/worker/runner/plugins/_local.py
|
|
72
|
+
src/main/fred/worker/runner/plugins/_runpod.py
|
|
73
73
|
src/main/fred/worker/runner/plugins/catalog.py
|
|
74
74
|
src/main/fred/worker/runner/plugins/interface.py
|
|
75
75
|
src/main/fred/worker/runner/rest/__init__.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
0.34.0
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import uuid
|
|
2
|
-
from typing import Optional
|
|
3
|
-
from dataclasses import dataclass
|
|
4
|
-
|
|
5
|
-
from fred.settings import logger_manager
|
|
6
|
-
|
|
7
|
-
logger = logger_manager.get_logger(name=__name__)
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
@dataclass(frozen=True, slots=True)
|
|
11
|
-
class RunnerInfo:
|
|
12
|
-
runner_id: str
|
|
13
|
-
created_at: str
|
|
14
|
-
runner_inner_handler_classname: str
|
|
15
|
-
runner_inner_handler_classpath: str
|
|
16
|
-
lifetime: int
|
|
17
|
-
timeout: int
|
|
18
|
-
|
|
19
|
-
@classmethod
|
|
20
|
-
def create(
|
|
21
|
-
cls,
|
|
22
|
-
runner_inner_handler_classname: str,
|
|
23
|
-
runner_inner_handler_classpath: str,
|
|
24
|
-
runner_id: Optional[str] = None,
|
|
25
|
-
created_at: Optional[str] = None,
|
|
26
|
-
lifetime: int = 3600, # Default to 1 hour
|
|
27
|
-
timeout: int = 10, # Default to 10 seconds
|
|
28
|
-
) -> "RunnerInfo":
|
|
29
|
-
from fred.utils.dateops import datetime_utcnow
|
|
30
|
-
return cls(
|
|
31
|
-
runner_id=runner_id or str(uuid.uuid4()),
|
|
32
|
-
runner_inner_handler_classname=runner_inner_handler_classname,
|
|
33
|
-
runner_inner_handler_classpath=runner_inner_handler_classpath,
|
|
34
|
-
created_at=created_at or datetime_utcnow().isoformat(),
|
|
35
|
-
lifetime=lifetime,
|
|
36
|
-
timeout=timeout,
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
def get_start_event(self, **kwargs) -> dict:
|
|
40
|
-
runner_id = kwargs.pop("runner_id", self.runner_id)
|
|
41
|
-
payload = {
|
|
42
|
-
"lifetime": self.lifetime,
|
|
43
|
-
"timeout": self.timeout,
|
|
44
|
-
"runner_configs": {
|
|
45
|
-
"id": runner_id,
|
|
46
|
-
"import_pattern": self.runner_inner_handler_classpath,
|
|
47
|
-
"handler_classname": self.runner_inner_handler_classname,
|
|
48
|
-
},
|
|
49
|
-
**kwargs,
|
|
50
|
-
}
|
|
51
|
-
return {
|
|
52
|
-
"input": payload,
|
|
53
|
-
"id": runner_id,
|
|
54
|
-
}
|
|
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
|
{fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtimes/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/runtimes/scanner.py
RENAMED
|
File without changes
|
|
File without changes
|
{fred_oss-0.34.0 → fred_oss-0.36.0}/src/main/fred/integrations/databricks/wrappers/__init__.py
RENAMED
|
File without changes
|
{fred_oss-0.34.0 → fred_oss-0.36.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
|