indexify 0.2.16__py3-none-any.whl → 0.2.17__py3-none-any.whl

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/cli.py CHANGED
@@ -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
- console.print(f"{docker_file}", style="magenta")
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 = await asyncio.get_running_loop().run_in_executor(
78
- self._executor,
79
- _run_function,
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
- outputs[node_name].extend(function_outputs)
254
- function_outputs_bytes: List[bytes] = [
255
- serializer.serialize_list(function_outputs)
256
- ]
257
- self._cache.set(
258
- self.name,
259
- node_name,
260
- input_bytes,
261
- function_outputs_bytes,
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,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.16
3
+ Version: 0.2.17
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -1,5 +1,5 @@
1
1
  indexify/__init__.py,sha256=xYjdqZQ9CEtV-s4PJhj_6Vx_dfg_qknWHkLqOSVom8g,623
2
- indexify/cli.py,sha256=tfqXvOYlrseZMRUxM70zalRz-O1IGE1cFuO_HiTZ1oU,8244
2
+ indexify/cli.py,sha256=E7NIWMAJcGHeOFG0rE2mCgT_V0e1l2M6tOPDSjKzrzg,8219
3
3
  indexify/data_loaders/__init__.py,sha256=Y5NEuseTcYAICRiweYw5wBQ2m2YplbsY21I7df-rdi4,1339
4
4
  indexify/data_loaders/local_directory_loader.py,sha256=fCrgj5drnW71ZUdDDvcB1-VJjIs1w6Q8sEW0HSGSAiA,1247
5
5
  indexify/data_loaders/url_loader.py,sha256=32SERljcq1Xsi4RdLz2dgyk2TER5pQPTtXl3gUzwHbY,1533
@@ -8,13 +8,13 @@ indexify/executor/agent.py,sha256=I08CiOWeJ_mz8OHr9_iJfp07Ma1VMQirZ2MsDp8lDZw,14
8
8
  indexify/executor/api_objects.py,sha256=SysjlGYu4JtYdqfexZHHN1IW4TtaDdFUF3hYZ5mpUJU,810
9
9
  indexify/executor/downloader.py,sha256=3mEDdluTzspsLGAZtFHZOVuyKOzT3CSema2kIK6Z1yU,4005
10
10
  indexify/executor/executor_tasks.py,sha256=gAZ2pvza1YwGlaR1o_tJW4SXtdCgK7sLJgp4W7rOjR0,1834
11
- indexify/executor/function_worker.py,sha256=RQh-lJD2UtUuYXyCDkGohe8rVpHEriJg-AjBKSgD5KI,5436
11
+ indexify/executor/function_worker.py,sha256=jxH0-kz2bx3bXf8zZKbkkcV7k92IH-x5a0iBTNGJ5zM,5131
12
12
  indexify/executor/indexify_executor.py,sha256=2Ut_VX-Su_lm4b4aEROyRJ3gXx-uFHA-V7EN0sWiARE,771
13
13
  indexify/executor/runtime_probes.py,sha256=L-nB4D2zBZ287xxPwErv5R_gxFOmTEvg61FMe3rUB_A,1460
14
14
  indexify/executor/task_reporter.py,sha256=gnnse0v6rjjni8lNzeb-ZYq6iF2DgafKoT7dcGUZhQ4,3716
15
15
  indexify/executor/task_store.py,sha256=q8s2gImsFffWeXQR0mk1Xlo1Aj_2GfclNPjQ2EA_YBo,3984
16
16
  indexify/functions_sdk/data_objects.py,sha256=CQZMzYiV7l6dyzFkYquWQHqdte6JnC7XA3i2ZyvPvgQ,844
17
- indexify/functions_sdk/graph.py,sha256=3hUZjdCesiAHJ9y1_heQsEFO-WHROR4kRYxBtVnb7Y4,11937
17
+ indexify/functions_sdk/graph.py,sha256=k-K6oZHrVqNmuh8zlI5Q3A_0UIiwXWtupyn8KBc0Au4,12014
18
18
  indexify/functions_sdk/graph_definition.py,sha256=EJfC0MdKEbFF1CBaU0htrveSlcAQJCH96DLSNfZ02V4,1178
19
19
  indexify/functions_sdk/graph_validation.py,sha256=XLHiC9PAtZungJLysU3hIUOPNDkO5TXUDZ_jiZ0H4hg,2508
20
20
  indexify/functions_sdk/image.py,sha256=0uM2VQXqB45ymnFyZVJIiyTGUYHWAHDZ1ORu-hWrofk,1338
@@ -26,8 +26,8 @@ indexify/http_client.py,sha256=x92EbFD987pIxuBVVQZ-eN9nSL-oI2vpfv6OSKuBGgs,13589
26
26
  indexify/remote_graph.py,sha256=ILg6IY6EFgyvnfz1DSzicBZhqvPkg2-UUwgI6lxp6sA,3094
27
27
  indexify/remote_pipeline.py,sha256=FW7IAv3r24OOpiqlprw3kuFrpdkqi6Ic4_tT26FThjA,761
28
28
  indexify/settings.py,sha256=LSaWZ0ADIVmUv6o6dHWRC3-Ry5uLbCw2sBSg1e_U7UM,99
29
- indexify-0.2.16.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
30
- indexify-0.2.16.dist-info/METADATA,sha256=kvomzkLgJZoVQYfukNvExhEMmzwJBMwOBTq6oPnEy9A,6199
31
- indexify-0.2.16.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
32
- indexify-0.2.16.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
33
- indexify-0.2.16.dist-info/RECORD,,
29
+ indexify-0.2.17.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
30
+ indexify-0.2.17.dist-info/METADATA,sha256=KltnuhhluL1VChxVQfmVcTnX7cYBXMGOLK_hrivj-o4,6199
31
+ indexify-0.2.17.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
32
+ indexify-0.2.17.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
33
+ indexify-0.2.17.dist-info/RECORD,,