indexify 0.2.15__tar.gz → 0.2.17__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.15 → indexify-0.2.17}/PKG-INFO +1 -1
- {indexify-0.2.15 → indexify-0.2.17}/indexify/cli.py +1 -1
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/function_worker.py +4 -16
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/graph.py +15 -14
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/image.py +14 -5
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/indexify_functions.py +3 -1
- {indexify-0.2.15 → indexify-0.2.17}/pyproject.toml +1 -1
- {indexify-0.2.15 → indexify-0.2.17}/LICENSE.txt +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/README.md +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/__init__.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/data_loaders/__init__.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/data_loaders/local_directory_loader.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/data_loaders/url_loader.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/error.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/agent.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/api_objects.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/downloader.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/executor_tasks.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/indexify_executor.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/runtime_probes.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/task_reporter.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/executor/task_store.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/data_objects.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/graph_definition.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/graph_validation.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/local_cache.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/object_serializer.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/functions_sdk/pipeline.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/http_client.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/remote_graph.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/remote_pipeline.py +0 -0
- {indexify-0.2.15 → indexify-0.2.17}/indexify/settings.py +0 -0
@@ -261,7 +261,7 @@ WORKDIR /app
|
|
261
261
|
docker_file += f"\nRUN pip install indexify"
|
262
262
|
|
263
263
|
console.print("Creating image using Dockerfile contents:", style="cyan bold")
|
264
|
-
|
264
|
+
print(f"{docker_file}")
|
265
265
|
|
266
266
|
client = docker.from_env()
|
267
267
|
image_name = f"{image._image_name}:{image._tag}"
|
@@ -62,6 +62,7 @@ class FunctionWorker:
|
|
62
62
|
self._executor: concurrent.futures.ProcessPoolExecutor = (
|
63
63
|
concurrent.futures.ProcessPoolExecutor(max_workers=workers)
|
64
64
|
)
|
65
|
+
self._workers = workers
|
65
66
|
|
66
67
|
async def async_submit(
|
67
68
|
self,
|
@@ -74,22 +75,9 @@ class FunctionWorker:
|
|
74
75
|
init_value: Optional[IndexifyData] = None,
|
75
76
|
) -> FunctionWorkerOutput:
|
76
77
|
try:
|
77
|
-
result =
|
78
|
-
|
79
|
-
|
80
|
-
namespace,
|
81
|
-
graph_name,
|
82
|
-
fn_name,
|
83
|
-
input,
|
84
|
-
code_path,
|
85
|
-
version,
|
86
|
-
init_value,
|
87
|
-
)
|
88
|
-
except BrokenProcessPool as mp:
|
89
|
-
self._executor.shutdown(wait=True, cancel_futures=True)
|
90
|
-
traceback.print_exc()
|
91
|
-
raise mp
|
92
|
-
except FunctionRunException as e:
|
78
|
+
result = _run_function(namespace, graph_name, fn_name, input, code_path, version, init_value)
|
79
|
+
# TODO - bring back running in a separate process
|
80
|
+
except Exception as e:
|
93
81
|
return FunctionWorkerOutput(
|
94
82
|
exception=str(e),
|
95
83
|
stdout=e.stdout,
|
@@ -229,12 +229,12 @@ class Graph:
|
|
229
229
|
cached_output_bytes: Optional[bytes] = self._cache.get(
|
230
230
|
self.name, node_name, input_bytes
|
231
231
|
)
|
232
|
-
if cached_output_bytes is not None and enable_cache:
|
233
|
-
print(
|
234
|
-
f"ran {node_name}: num outputs: {len(cached_output_bytes)} (cache hit)"
|
235
|
-
)
|
232
|
+
if cached_output_bytes is not None and enable_cache:
|
236
233
|
function_outputs: List[IndexifyData] = []
|
237
234
|
cached_output_list = serializer.deserialize_list(cached_output_bytes)
|
235
|
+
print(
|
236
|
+
f"ran {node_name}: num outputs: {len(cached_output_list)} (cache hit)"
|
237
|
+
)
|
238
238
|
if accumulator_values.get(node_name, None) is not None:
|
239
239
|
accumulator_values[node_name] = cached_output_list[-1].model_copy()
|
240
240
|
outputs[node_name] = []
|
@@ -250,16 +250,17 @@ class Graph:
|
|
250
250
|
if accumulator_values.get(node_name, None) is not None:
|
251
251
|
accumulator_values[node_name] = function_outputs[-1].model_copy()
|
252
252
|
outputs[node_name] = []
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
self.
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
253
|
+
if function_outputs:
|
254
|
+
outputs[node_name].extend(function_outputs)
|
255
|
+
function_outputs_bytes: List[bytes] = [
|
256
|
+
serializer.serialize_list(function_outputs)
|
257
|
+
]
|
258
|
+
self._cache.set(
|
259
|
+
self.name,
|
260
|
+
node_name,
|
261
|
+
input_bytes,
|
262
|
+
function_outputs_bytes,
|
263
|
+
)
|
263
264
|
if accumulator_values.get(node_name, None) is not None and queue:
|
264
265
|
print(
|
265
266
|
f"accumulator not none for {node_name}, continuing, len queue: {len(queue)}"
|
@@ -1,11 +1,20 @@
|
|
1
|
+
def python_version_to_image(python_version):
|
2
|
+
if python_version.startswith("3.9"):
|
3
|
+
return "python:3.9.20-bookworm"
|
4
|
+
elif python_version.startswith("3.10"):
|
5
|
+
return "python:3.10.15-bookworm"
|
6
|
+
elif python_version.startswith("3.11"):
|
7
|
+
return "python:3.11.10-bookworm"
|
8
|
+
else:
|
9
|
+
raise ValueError(f"unsupported Python version: {python_version}")
|
10
|
+
|
11
|
+
|
1
12
|
class Image:
|
2
|
-
def __init__(self):
|
13
|
+
def __init__(self, python="3.10"):
|
3
14
|
self._image_name = None
|
4
|
-
|
5
15
|
self._tag = "latest"
|
6
|
-
|
7
|
-
self.
|
8
|
-
|
16
|
+
self._base_image = python_version_to_image(python)
|
17
|
+
self._python_version = python
|
9
18
|
self._run_strs = []
|
10
19
|
|
11
20
|
def name(self, image_name):
|
@@ -218,6 +218,8 @@ class IndexifyFunctionWrapper:
|
|
218
218
|
args.append(input)
|
219
219
|
|
220
220
|
extracted_data = self.indexify_function.run(*args, **kwargs)
|
221
|
+
if extracted_data is None:
|
222
|
+
return []
|
221
223
|
|
222
224
|
return extracted_data if isinstance(extracted_data, list) else [extracted_data]
|
223
225
|
|
@@ -234,7 +236,7 @@ class IndexifyFunctionWrapper:
|
|
234
236
|
acc = self.indexify_function.accumulate.model_validate(
|
235
237
|
self.indexify_function.accumulate()
|
236
238
|
)
|
237
|
-
outputs: List[Any] = self.run_fn(input, acc=acc)
|
239
|
+
outputs: Optional[List[Any]] = self.run_fn(input, acc=acc)
|
238
240
|
return [
|
239
241
|
IndexifyData(payload=serializer.serialize(output)) for output in outputs
|
240
242
|
]
|
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
|