indexify 0.2.46__tar.gz → 0.2.48__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.
- {indexify-0.2.46 → indexify-0.2.48}/PKG-INFO +1 -1
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/single_task_runner.py +2 -2
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/task_runner.py +2 -2
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/function_executor_service.py +7 -1
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/image.py +21 -9
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/indexify_functions.py +4 -0
- {indexify-0.2.46 → indexify-0.2.48}/pyproject.toml +1 -1
- {indexify-0.2.46 → indexify-0.2.48}/LICENSE.txt +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/README.md +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/__init__.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/cli.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/common_util.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/data_loaders/__init__.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/data_loaders/local_directory_loader.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/data_loaders/url_loader.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/error.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/api_objects.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/downloader.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/executor.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/function_executor.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/function_executor_state.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/invocation_state_client.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/server/function_executor_server.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/task_input.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/task_output.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/runtime_probes.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/task_fetcher.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/executor/task_reporter.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/handlers/run_function/function_inputs_loader.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/handlers/run_function/handler.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/handlers/run_function/request_validator.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/handlers/run_function/response_helper.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/initialize_request_validator.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/invocation_state/invocation_state_proxy_server.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/invocation_state/proxied_invocation_state.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/invocation_state/response_validator.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/configuration.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor.proto +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2.pyi +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2_grpc.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/message_validator.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/server.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/data_objects.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/graph.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/graph_definition.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/graph_validation.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/invocation_state/invocation_state.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/invocation_state/local_invocation_state.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/object_serializer.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/pipeline.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/http_client.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/logging.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/remote_graph.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/remote_pipeline.py +0 -0
- {indexify-0.2.46 → indexify-0.2.48}/indexify/settings.py +0 -0
{indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/single_task_runner.py
RENAMED
@@ -80,8 +80,8 @@ class SingleTaskRunner:
|
|
80
80
|
return function_executor
|
81
81
|
except Exception as e:
|
82
82
|
self._logger.error(
|
83
|
-
"failed to initialize function executor",
|
84
|
-
exc_info=e,
|
83
|
+
f"failed to initialize function executor: {e.details()}",
|
84
|
+
# exc_info=e.details(),
|
85
85
|
)
|
86
86
|
await function_executor.destroy()
|
87
87
|
raise
|
@@ -33,8 +33,8 @@ class TaskRunner:
|
|
33
33
|
return await self._run(task_input, logger)
|
34
34
|
except Exception as e:
|
35
35
|
logger.error(
|
36
|
-
"failed running the task",
|
37
|
-
exc_info=e,
|
36
|
+
f"failed running the task: {e.details()}",
|
37
|
+
# exc_info=e.debug_error_string(),
|
38
38
|
)
|
39
39
|
return TaskOutput.internal_error(task_input.task)
|
40
40
|
|
@@ -56,7 +56,13 @@ class FunctionExecutorService(FunctionExecutorServicer):
|
|
56
56
|
# share the model's file descriptor between all tasks or download function configuration
|
57
57
|
# only once.
|
58
58
|
graph_serializer = get_serializer(request.graph.content_type)
|
59
|
-
|
59
|
+
|
60
|
+
try:
|
61
|
+
graph = graph_serializer.deserialize(request.graph.bytes)
|
62
|
+
except Exception as e:
|
63
|
+
self._logger.error(f"Caught exception {e}")
|
64
|
+
return InitializeResponse(success=False)
|
65
|
+
|
60
66
|
self._function = graph_serializer.deserialize(graph[request.function_name])
|
61
67
|
|
62
68
|
self._logger = self._logger.bind(
|
@@ -7,7 +7,7 @@ import pathlib
|
|
7
7
|
import sys
|
8
8
|
import tarfile
|
9
9
|
from io import BytesIO
|
10
|
-
from typing import List, Optional
|
10
|
+
from typing import Dict, List, Optional
|
11
11
|
|
12
12
|
import docker
|
13
13
|
import docker.api.build
|
@@ -32,12 +32,13 @@ HASH_BUFF_SIZE = 1024**2
|
|
32
32
|
|
33
33
|
class BuildOp(BaseModel):
|
34
34
|
op_type: str
|
35
|
+
options: Dict[str, str] = {}
|
35
36
|
args: List[str]
|
36
37
|
|
37
38
|
def hash(self, hash):
|
38
39
|
match self.op_type:
|
39
|
-
case "RUN":
|
40
|
-
hash.update(
|
40
|
+
case "RUN" | "ADD":
|
41
|
+
hash.update(self.op_type.encode())
|
41
42
|
for a in self.args:
|
42
43
|
hash.update(a.encode())
|
43
44
|
|
@@ -57,8 +58,10 @@ class BuildOp(BaseModel):
|
|
57
58
|
|
58
59
|
def render(self):
|
59
60
|
match self.op_type:
|
60
|
-
case "RUN":
|
61
|
-
|
61
|
+
case "RUN" | "ADD":
|
62
|
+
options = [f"--{k}={v}" for k, v in self.options.items()]
|
63
|
+
return f"{self.op_type} {' '.join(options)} {' '.join(self.args)}"
|
64
|
+
|
62
65
|
case "COPY":
|
63
66
|
return f"COPY {self.args[0]} {self.args[1]}"
|
64
67
|
case _:
|
@@ -76,6 +79,7 @@ class Build(BaseModel):
|
|
76
79
|
image_hash: str
|
77
80
|
status: str | None
|
78
81
|
result: str | None
|
82
|
+
error_message: str | None = None # Only provided when result is "failed"
|
79
83
|
|
80
84
|
created_at: datetime.datetime | None
|
81
85
|
started_at: datetime.datetime | None = None
|
@@ -105,12 +109,20 @@ class Image:
|
|
105
109
|
self._base_image = base_image
|
106
110
|
return self
|
107
111
|
|
108
|
-
def
|
109
|
-
self._build_ops.append(
|
112
|
+
def add(self, source: str, dest: str, **kwargs):
|
113
|
+
self._build_ops.append(
|
114
|
+
BuildOp(op_type="ADD", args=[source, dest], options=kwargs)
|
115
|
+
)
|
110
116
|
return self
|
111
117
|
|
112
|
-
def
|
113
|
-
self._build_ops.append(BuildOp(op_type="
|
118
|
+
def run(self, run_str, **kwargs):
|
119
|
+
self._build_ops.append(BuildOp(op_type="RUN", args=[run_str], options=kwargs))
|
120
|
+
return self
|
121
|
+
|
122
|
+
def copy(self, source: str, dest: str, **kwargs):
|
123
|
+
self._build_ops.append(
|
124
|
+
BuildOp(op_type="COPY", args=[source, dest], options=kwargs)
|
125
|
+
)
|
114
126
|
return self
|
115
127
|
|
116
128
|
def to_image_information(self):
|
@@ -267,6 +267,8 @@ class IndexifyFunctionWrapper:
|
|
267
267
|
# with json encoding which won't deserialize in tuple.
|
268
268
|
if isinstance(input, tuple) or isinstance(input, list):
|
269
269
|
args += input
|
270
|
+
elif isinstance(input, dict):
|
271
|
+
kwargs.update(input)
|
270
272
|
else:
|
271
273
|
args.append(input)
|
272
274
|
extracted_data = self.indexify_function._call_run(*args, **kwargs)
|
@@ -292,6 +294,8 @@ class IndexifyFunctionWrapper:
|
|
292
294
|
# with json encoding which won't deserialize in tuple.
|
293
295
|
if isinstance(input, tuple) or isinstance(input, list):
|
294
296
|
args += input
|
297
|
+
elif isinstance(input, dict):
|
298
|
+
kwargs.update(input)
|
295
299
|
else:
|
296
300
|
args.append(input)
|
297
301
|
|
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
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/function_executor.py
RENAMED
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/function_executor_state.py
RENAMED
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/executor/function_executor/invocation_state_client.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
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/handlers/run_function/handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/initialize_request_validator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor.proto
RENAMED
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2.py
RENAMED
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2.pyi
RENAMED
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/function_executor/proto/function_executor_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.2.46 → indexify-0.2.48}/indexify/functions_sdk/invocation_state/invocation_state.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
|