indexify 0.2.4__tar.gz → 0.2.5__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.
Files changed (30) hide show
  1. {indexify-0.2.4 → indexify-0.2.5}/PKG-INFO +1 -1
  2. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/function_worker.py +1 -0
  3. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/graph.py +14 -0
  4. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/image.py +1 -1
  5. {indexify-0.2.4 → indexify-0.2.5}/indexify/http_client.py +1 -1
  6. {indexify-0.2.4 → indexify-0.2.5}/indexify/remote_graph.py +5 -2
  7. {indexify-0.2.4 → indexify-0.2.5}/pyproject.toml +1 -1
  8. {indexify-0.2.4 → indexify-0.2.5}/LICENSE.txt +0 -0
  9. {indexify-0.2.4 → indexify-0.2.5}/README.md +0 -0
  10. {indexify-0.2.4 → indexify-0.2.5}/indexify/__init__.py +0 -0
  11. {indexify-0.2.4 → indexify-0.2.5}/indexify/cli.py +0 -0
  12. {indexify-0.2.4 → indexify-0.2.5}/indexify/data_loaders/__init__.py +0 -0
  13. {indexify-0.2.4 → indexify-0.2.5}/indexify/data_loaders/local_directory_loader.py +0 -0
  14. {indexify-0.2.4 → indexify-0.2.5}/indexify/data_loaders/url_loader.py +0 -0
  15. {indexify-0.2.4 → indexify-0.2.5}/indexify/error.py +0 -0
  16. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/agent.py +0 -0
  17. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/api_objects.py +0 -0
  18. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/downloader.py +0 -0
  19. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/executor_tasks.py +0 -0
  20. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/indexify_executor.py +0 -0
  21. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/runtime_probes.py +0 -0
  22. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/task_reporter.py +0 -0
  23. {indexify-0.2.4 → indexify-0.2.5}/indexify/executor/task_store.py +0 -0
  24. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/data_objects.py +0 -0
  25. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/graph_definition.py +0 -0
  26. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/graph_validation.py +0 -0
  27. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/indexify_functions.py +0 -0
  28. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/local_cache.py +0 -0
  29. {indexify-0.2.4 → indexify-0.2.5}/indexify/functions_sdk/object_serializer.py +0 -0
  30. {indexify-0.2.4 → indexify-0.2.5}/indexify/settings.py +0 -0
@@ -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
@@ -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
 
@@ -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
@@ -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
  [tool.poetry]
2
2
  name = "indexify"
3
- version = "0.2.4"
3
+ version = "0.2.5"
4
4
  description = "Python Client for Indexify"
5
5
  authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
6
6
  license = "Apache 2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes