indexify 0.2.4__py3-none-any.whl → 0.2.5__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.
@@ -135,6 +135,7 @@ def _run_function(
135
135
  fn_output = None
136
136
  has_failed = False
137
137
  exception_msg = None
138
+ print(f"[bold] function_worker: [/bold] invoking function {fn_name} in graph {graph_name}")
138
139
  with redirect_stdout(stdout_capture), redirect_stderr(stderr_capture):
139
140
  try:
140
141
  key = f"{namespace}/{graph_name}/{version}/{fn_name}"
@@ -132,8 +132,22 @@ class Graph:
132
132
  self.add_node(node)
133
133
  self.routers[from_node.name].append(node.name)
134
134
  return self
135
+
136
+
137
+ def _register_cloudpickle(self):
138
+ # Get all unique modules from nodes and edges
139
+ modules = set()
140
+ for node in self.nodes.values():
141
+ modules.add(node.__module__)
142
+
143
+ # Register each module with cloudpickle
144
+ for module_name in modules:
145
+ module = sys.modules[module_name]
146
+ cloudpickle.register_pickle_by_value(module)
147
+
135
148
 
136
149
  def serialize(self):
150
+ self._register_cloudpickle()
137
151
  return cloudpickle.dumps(self)
138
152
 
139
153
  @staticmethod
@@ -4,7 +4,7 @@ class Image:
4
4
 
5
5
  self._tag = "latest"
6
6
 
7
- self._base_image = None
7
+ self._base_image = "python:3.10.15-slim-bookworm"
8
8
 
9
9
  self._run_strs = []
10
10
 
indexify/http_client.py CHANGED
@@ -85,7 +85,7 @@ class IndexifyClient:
85
85
  message = (
86
86
  f"Make sure the server is running and accesible at {self._service_url}"
87
87
  )
88
- ex = ApiException(status="ConnectionError", message=message)
88
+ ex = ApiException(message=message)
89
89
  print(ex)
90
90
  raise ex
91
91
  return response
indexify/remote_graph.py CHANGED
@@ -34,18 +34,21 @@ class RemoteGraph:
34
34
  )
35
35
 
36
36
  @classmethod
37
- def deploy(cls, g: Graph, server_url: Optional[str] = "http://localhost:8090"):
37
+ def deploy(cls, g: Graph, additional_modules=[], server_url: Optional[str] = "http://localhost:8900"):
38
38
  """
39
39
  Create a new RemoteGraph from a local Graph object.
40
40
  :param g: The local Graph object.
41
41
  :param server_url: The URL of the server where the graph will be registered.
42
42
  """
43
+ import cloudpickle
44
+ for module in additional_modules:
45
+ cloudpickle.register_pickle_by_value(module)
43
46
  client = IndexifyClient(service_url=server_url)
44
47
  client.register_compute_graph(g)
45
48
  return cls(name=g.name, server_url=server_url)
46
49
 
47
50
  @classmethod
48
- def by_name(cls, name: str, server_url: Optional[str] = "http://localhost:8090"):
51
+ def by_name(cls, name: str, server_url: Optional[str] = "http://localhost:8900"):
49
52
  """
50
53
  Create a handle to call a RemoteGraph by name.
51
54
  :param name: The name of the graph.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.4
3
+ Version: 0.2.5
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -8,24 +8,24 @@ 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=0MPiKw0AWs3Z7ReC9l2z-3515yqq85ghPzdh485dnuw,3998
10
10
  indexify/executor/executor_tasks.py,sha256=gAZ2pvza1YwGlaR1o_tJW4SXtdCgK7sLJgp4W7rOjR0,1834
11
- indexify/executor/function_worker.py,sha256=83ih8TjAJHtrH6LqqDoSfzAj4zB7ZZPR2Voq0RMZ1T8,5410
11
+ indexify/executor/function_worker.py,sha256=NSxcB0RtrTCJnDdtYu-CIEbyZ1QgHC-nxHdH3UUQ1tg,5506
12
12
  indexify/executor/indexify_executor.py,sha256=2Ut_VX-Su_lm4b4aEROyRJ3gXx-uFHA-V7EN0sWiARE,771
13
13
  indexify/executor/runtime_probes.py,sha256=tvi8KCaQTVJqcyBJ4-jzEUAnQ01ZbMmjCxV2KJ96_PI,1449
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=2LqAWJ_S2Xkp4OQTmhd3InVIrBs7juV41udnSQFMMfM,840
17
- indexify/functions_sdk/graph.py,sha256=iWJV9tZwPniEQq1le-FP8FYJ8lHq8IBJMJNPfv987ys,14806
17
+ indexify/functions_sdk/graph.py,sha256=a6lfhnGgnSXDigxRyh5O6o0FETQngM-EhPswKR4V_Q0,15239
18
18
  indexify/functions_sdk/graph_definition.py,sha256=EJfC0MdKEbFF1CBaU0htrveSlcAQJCH96DLSNfZ02V4,1178
19
19
  indexify/functions_sdk/graph_validation.py,sha256=XLHiC9PAtZungJLysU3hIUOPNDkO5TXUDZ_jiZ0H4hg,2508
20
- indexify/functions_sdk/image.py,sha256=euuz2QTZQoS-JmwnPmWJ8lfIgKzrSEsfkUc2qU26xjM,679
20
+ indexify/functions_sdk/image.py,sha256=X6nFgw6IKRfnxwjxKmZGkuzX6G4jG9YpPmz5FbsT39g,705
21
21
  indexify/functions_sdk/indexify_functions.py,sha256=xxgvnw0MQ_csIksunIdero8be0PR4mfwgoHp3UlkMZU,5851
22
22
  indexify/functions_sdk/local_cache.py,sha256=cNWF67zbhbTJe3g86hyLBy3Rqzs6dNvp2SjLazGZWvw,1348
23
23
  indexify/functions_sdk/object_serializer.py,sha256=Zz4GobW3ZamBBtFDF76QxU3TP6oJNdWnhsfKd0OUFoc,1660
24
- indexify/http_client.py,sha256=Ntyvpljuq5W6keQAqQWsx-2FQNM2_tgZQk9FXa4A-qA,12187
25
- indexify/remote_graph.py,sha256=kG6Jfof2_Ze_fkNWFYw08NJeN9Eprc2wExbFud4xN-Y,2799
24
+ indexify/http_client.py,sha256=QwbLQAWVUZ95SZ-4XcnvtQRXyHtH2APqUj7nKh0C3DQ,12161
25
+ indexify/remote_graph.py,sha256=zmcjuv1r6vTNueNtVnknR1aDdbDw5LPdM8y-EczXqmk,2948
26
26
  indexify/settings.py,sha256=LSaWZ0ADIVmUv6o6dHWRC3-Ry5uLbCw2sBSg1e_U7UM,99
27
- indexify-0.2.4.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
28
- indexify-0.2.4.dist-info/METADATA,sha256=463jg3rRzHN8aWEb_fW_d7faC7XwCYmFJA8Rkkd11vs,6129
29
- indexify-0.2.4.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
- indexify-0.2.4.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
31
- indexify-0.2.4.dist-info/RECORD,,
27
+ indexify-0.2.5.dist-info/LICENSE.txt,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
28
+ indexify-0.2.5.dist-info/METADATA,sha256=xgOpgi_vOlEg8LcGLbW6sDrojG5U78M0zQLsGxk-7Hs,6129
29
+ indexify-0.2.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
30
+ indexify-0.2.5.dist-info/entry_points.txt,sha256=Pih7WV-XMpAzI5dEvROcpLr-ybVhd9Y-AtuzBKUdcDs,49
31
+ indexify-0.2.5.dist-info/RECORD,,