indexify 0.2.37__tar.gz → 0.2.39__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 (34) hide show
  1. {indexify-0.2.37 → indexify-0.2.39}/PKG-INFO +2 -2
  2. {indexify-0.2.37 → indexify-0.2.39}/indexify/cli.py +27 -14
  3. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/agent.py +6 -1
  4. {indexify-0.2.37 → indexify-0.2.39}/pyproject.toml +2 -2
  5. indexify-0.2.37/indexify/executor/image_dependency_installer.py +0 -64
  6. {indexify-0.2.37 → indexify-0.2.39}/LICENSE.txt +0 -0
  7. {indexify-0.2.37 → indexify-0.2.39}/README.md +0 -0
  8. {indexify-0.2.37 → indexify-0.2.39}/indexify/__init__.py +0 -0
  9. {indexify-0.2.37 → indexify-0.2.39}/indexify/common_util.py +0 -0
  10. {indexify-0.2.37 → indexify-0.2.39}/indexify/data_loaders/__init__.py +0 -0
  11. {indexify-0.2.37 → indexify-0.2.39}/indexify/data_loaders/local_directory_loader.py +0 -0
  12. {indexify-0.2.37 → indexify-0.2.39}/indexify/data_loaders/url_loader.py +0 -0
  13. {indexify-0.2.37 → indexify-0.2.39}/indexify/error.py +0 -0
  14. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/api_objects.py +0 -0
  15. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/downloader.py +0 -0
  16. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/executor_tasks.py +0 -0
  17. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/function_worker.py +0 -0
  18. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/indexify_executor.py +0 -0
  19. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/runtime_probes.py +0 -0
  20. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/task_reporter.py +0 -0
  21. {indexify-0.2.37 → indexify-0.2.39}/indexify/executor/task_store.py +0 -0
  22. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/data_objects.py +0 -0
  23. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/graph.py +0 -0
  24. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/graph_definition.py +0 -0
  25. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/graph_validation.py +0 -0
  26. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/image.py +0 -0
  27. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/indexify_functions.py +0 -0
  28. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/local_cache.py +0 -0
  29. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/object_serializer.py +0 -0
  30. {indexify-0.2.37 → indexify-0.2.39}/indexify/functions_sdk/pipeline.py +0 -0
  31. {indexify-0.2.37 → indexify-0.2.39}/indexify/http_client.py +0 -0
  32. {indexify-0.2.37 → indexify-0.2.39}/indexify/remote_graph.py +0 -0
  33. {indexify-0.2.37 → indexify-0.2.39}/indexify/remote_pipeline.py +0 -0
  34. {indexify-0.2.37 → indexify-0.2.39}/indexify/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: indexify
3
- Version: 0.2.37
3
+ Version: 0.2.39
4
4
  Summary: Python Client for Indexify
5
5
  Home-page: https://github.com/tensorlakeai/indexify
6
6
  License: Apache 2.0
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.13
17
17
  Requires-Dist: cloudpickle (>=3.1.0,<4.0.0)
18
18
  Requires-Dist: docker (>=7.1.0,<8.0.0)
19
19
  Requires-Dist: httpx-sse (>=0.4.0,<0.5.0)
20
- Requires-Dist: httpx[http2] (>=0,<1)
20
+ Requires-Dist: httpx[http2] (==0.27.2)
21
21
  Requires-Dist: nanoid (>=2.0.0,<3.0.0)
22
22
  Requires-Dist: pydantic (==2.10.2)
23
23
  Requires-Dist: pyyaml (>=6,<7)
@@ -6,9 +6,11 @@ import subprocess
6
6
  import sys
7
7
  import threading
8
8
  import time
9
+ from importlib.metadata import version
9
10
  from typing import Annotated, List, Optional
10
11
 
11
12
  import nanoid
13
+ import structlog
12
14
  import typer
13
15
  from rich.console import Console
14
16
  from rich.panel import Panel
@@ -32,6 +34,7 @@ custom_theme = Theme(
32
34
  }
33
35
  )
34
36
 
37
+ logging = structlog.get_logger(module=__name__)
35
38
  console = Console(theme=custom_theme)
36
39
 
37
40
  app = typer.Typer(pretty_exceptions_enable=False, no_args_is_help=True)
@@ -158,6 +161,9 @@ def build_default_image():
158
161
  @app.command(help="Joins the extractors to the coordinator server")
159
162
  def executor(
160
163
  server_addr: str = "localhost:8900",
164
+ dev: Annotated[
165
+ bool, typer.Option("--dev", "-d", help="Run the executor in development mode")
166
+ ] = False,
161
167
  workers: Annotated[
162
168
  int, typer.Option(help="number of worker processes for extraction")
163
169
  ] = 1,
@@ -174,19 +180,26 @@ def executor(
174
180
  "1", help="Requested Image Version for this executor"
175
181
  ),
176
182
  ):
183
+ # configure structured logging
184
+ if not dev:
185
+ processors = [
186
+ structlog.processors.dict_tracebacks,
187
+ structlog.processors.JSONRenderer(),
188
+ ]
189
+ structlog.configure(processors=processors)
190
+
177
191
  id = nanoid.generate()
178
- console.print(
179
- Panel(
180
- f"Number of workers: {workers}\n"
181
- f"Config path: {config_path}\n"
182
- f"Server address: {server_addr}\n"
183
- f"Executor ID: {id}\n"
184
- f"Executor cache: {executor_cache}\n"
185
- f"Name Alias: {name_alias}"
186
- f"Image Version: {image_version}\n",
187
- title="Agent Configuration",
188
- border_style="info",
189
- )
192
+ executor_version = version("indexify")
193
+ logging.info(
194
+ "executor started",
195
+ workers=workers,
196
+ server_addr=server_addr,
197
+ config_path=config_path,
198
+ executor_id=id,
199
+ executor_version=executor_version,
200
+ executor_cache=executor_cache,
201
+ name_alias=name_alias,
202
+ image_version=image_version,
190
203
  )
191
204
 
192
205
  from pathlib import Path
@@ -208,8 +221,8 @@ def executor(
208
221
 
209
222
  try:
210
223
  asyncio.get_event_loop().run_until_complete(agent.run())
211
- except asyncio.CancelledError as ex:
212
- console.print(Text(f"Exiting gracefully: {ex}", style="bold yellow"))
224
+ except asyncio.CancelledError:
225
+ logging.info("graceful shutdown")
213
226
 
214
227
 
215
228
  def _create_image(image: Image, python_sdk_path):
@@ -299,7 +299,12 @@ class ExtractorAgent:
299
299
  image_version=image_version,
300
300
  labels=runtime_probe.labels,
301
301
  ).model_dump()
302
- logging.info("registering_executor", executor_id=self._executor_id, url=url)
302
+ logging.info(
303
+ "registering_executor",
304
+ executor_id=self._executor_id,
305
+ url=url,
306
+ executor_version=executor_version,
307
+ )
303
308
  try:
304
309
  async with get_httpx_client(self._config_path, True) as client:
305
310
  async with aconnect_sse(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "indexify"
3
- version = "0.2.37"
3
+ version = "0.2.39"
4
4
  description = "Python Client for Indexify"
5
5
  authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
6
6
  license = "Apache 2.0"
@@ -13,7 +13,7 @@ indexify-cli = "indexify.cli:app"
13
13
 
14
14
  [tool.poetry.dependencies]
15
15
  python = "^3.9"
16
- httpx = { version = "^0", extras = ["http2"] }
16
+ httpx = { version = "0.27.2", extras = ["http2"] }
17
17
  pyyaml = "^6"
18
18
  pydantic = "2.10.2"
19
19
  cloudpickle = "^3.1.0"
@@ -1,64 +0,0 @@
1
- import os
2
- import subprocess
3
-
4
- from rich.console import Console
5
- from rich.text import Text
6
- from rich.theme import Theme
7
-
8
- from indexify.functions_sdk.image import ImageInformation
9
-
10
- custom_theme = Theme(
11
- {
12
- "info": "cyan",
13
- "warning": "yellow",
14
- "error": "red",
15
- "success": "green",
16
- }
17
- )
18
-
19
- console = Console(theme=custom_theme)
20
-
21
-
22
- def _record_image_name(name: str, version: int):
23
- dir_path = os.path.expanduser("~/.indexify/")
24
-
25
- file_path = os.path.expanduser("~/.indexify/image_name")
26
- os.makedirs(dir_path, exist_ok=True)
27
- with open(file_path, "w") as file:
28
- file.write(name)
29
-
30
- file_path = os.path.expanduser("~/.indexify/image_version")
31
- os.makedirs(dir_path, exist_ok=True)
32
- with open(file_path, "w") as file:
33
- file.write(str(version))
34
-
35
-
36
- def _install_dependencies(run_str: str):
37
- # Throw error to the caller if these subprocesses fail.
38
- proc = subprocess.run(run_str.split())
39
- if proc.returncode != 0:
40
- raise Exception(f"Unable to install dep `{run_str}`")
41
-
42
-
43
- def executor_image_builder(
44
- image_info: ImageInformation, name_alias: str, image_version: int
45
- ):
46
- console.print(Text("Attempting Executor Bootstrap.", style="red bold"))
47
-
48
- run_strs = image_info.run_strs
49
- console.print(Text("Attempting to install dependencies.", style="red bold"))
50
-
51
- for run_str in run_strs:
52
- console.print(Text(f"Attempting {run_str}", style="red bold"))
53
- _install_dependencies(run_str)
54
-
55
- console.print(Text("Install dependencies done.", style="red bold"))
56
-
57
- console.print(
58
- Text(
59
- f"Recording image name {name_alias} and version {image_version}",
60
- style="red bold",
61
- )
62
- )
63
-
64
- _record_image_name(name_alias, image_version)
File without changes
File without changes
File without changes