indexify 0.3.4__py3-none-any.whl → 0.3.6__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.
Files changed (40) hide show
  1. indexify/cli/cli.py +6 -4
  2. indexify/executor/downloader.py +2 -3
  3. indexify/executor/executor.py +8 -7
  4. indexify/executor/function_executor/function_executor.py +3 -4
  5. indexify/executor/function_executor/health_checker.py +4 -4
  6. indexify/executor/function_executor/invocation_state_client.py +3 -4
  7. indexify/{function_executor/proto/configuration.py → executor/function_executor/server/client_configuration.py} +7 -11
  8. indexify/executor/function_executor/server/subprocess_function_executor_server.py +1 -2
  9. indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -5
  10. indexify/executor/function_executor/single_task_runner.py +2 -4
  11. indexify/executor/function_executor/task_input.py +1 -1
  12. indexify/executor/function_executor/task_output.py +1 -1
  13. indexify/executor/task_fetcher.py +5 -5
  14. indexify/executor/task_reporter.py +3 -4
  15. {indexify-0.3.4.dist-info → indexify-0.3.6.dist-info}/METADATA +3 -4
  16. indexify-0.3.6.dist-info/RECORD +25 -0
  17. indexify-0.3.6.dist-info/entry_points.txt +3 -0
  18. indexify/function_executor/README.md +0 -18
  19. indexify/function_executor/handlers/run_function/function_inputs_loader.py +0 -53
  20. indexify/function_executor/handlers/run_function/handler.py +0 -126
  21. indexify/function_executor/handlers/run_function/request_validator.py +0 -26
  22. indexify/function_executor/handlers/run_function/response_helper.py +0 -96
  23. indexify/function_executor/initialize_request_validator.py +0 -21
  24. indexify/function_executor/invocation_state/invocation_state_proxy_server.py +0 -170
  25. indexify/function_executor/invocation_state/proxied_invocation_state.py +0 -22
  26. indexify/function_executor/invocation_state/response_validator.py +0 -29
  27. indexify/function_executor/main.py +0 -50
  28. indexify/function_executor/proto/function_executor.proto +0 -130
  29. indexify/function_executor/proto/function_executor_pb2.py +0 -69
  30. indexify/function_executor/proto/function_executor_pb2.pyi +0 -225
  31. indexify/function_executor/proto/function_executor_pb2_grpc.py +0 -260
  32. indexify/function_executor/proto/message_validator.py +0 -38
  33. indexify/function_executor/server.py +0 -29
  34. indexify/function_executor/service.py +0 -133
  35. indexify/utils/README.md +0 -3
  36. indexify/utils/http_client.py +0 -88
  37. indexify/utils/logging.py +0 -66
  38. indexify-0.3.4.dist-info/RECORD +0 -45
  39. indexify-0.3.4.dist-info/entry_points.txt +0 -4
  40. {indexify-0.3.4.dist-info → indexify-0.3.6.dist-info}/WHEEL +0 -0
@@ -1,88 +0,0 @@
1
- from typing import Optional, Union
2
-
3
- import httpx
4
- import yaml
5
- from httpx import AsyncClient, Client
6
-
7
-
8
- def get_httpx_client(
9
- config_path: Optional[str] = None, make_async: Optional[bool] = False
10
- ) -> Union[AsyncClient, Client]:
11
- """
12
- Creates and returns an httpx.Client instance, optionally configured with TLS settings from a YAML config file.
13
-
14
- The function creates a basic httpx.Client by default. If a config path is provided and the config specifies
15
- 'use_tls' as True, it creates a TLS-enabled client with HTTP/2 support using the provided certificate settings.
16
- To get https.AsyncClient, provide make_async as True.
17
-
18
- Args:
19
- config_path (Optional[str]): Path to a YAML configuration file. If provided, the file should contain TLS
20
- configuration with the following structure:
21
- {
22
- "use_tls": bool,
23
- "tls_config": {
24
- "cert_path": str, # Path to client certificate
25
- "key_path": str, # Path to client private key
26
- "ca_bundle_path": str # Optional: Path to CA bundle for verification
27
- }
28
- }
29
- make_async (Optional[bool]): Whether to make an asynchronous httpx client instance.
30
-
31
- Returns:
32
- httpx.Client: An initialized httpx client instance, either with basic settings or TLS configuration
33
- if specified in the config file.
34
-
35
- Example:
36
- # Basic client without TLS
37
- client = get_httpx_client()
38
-
39
- # Client with TLS configuration from config file
40
- client = get_httpx_client("/path/to/config.yaml")
41
- """
42
- if config_path:
43
- with open(config_path, "r") as file:
44
- config = yaml.safe_load(file)
45
- if config.get("use_tls", False):
46
- print(f"Configuring client with TLS config: {config}")
47
- tls_config = config["tls_config"]
48
- return get_sync_or_async_client(make_async, **tls_config)
49
- return get_sync_or_async_client(make_async)
50
-
51
-
52
- def get_sync_or_async_client(
53
- make_async: Optional[bool] = False,
54
- cert_path: Optional[str] = None,
55
- key_path: Optional[str] = None,
56
- ca_bundle_path: Optional[str] = None,
57
- ) -> Union[AsyncClient, Client]:
58
- """
59
- Creates and returns either a synchronous or asynchronous httpx client with optional TLS configuration.
60
-
61
- Args:
62
- make_async (Optional[bool]): If True, returns an AsyncClient; if False, returns a synchronous Client.
63
- Defaults to False.
64
- cert_path (Optional[str]): Path to the client certificate file. Required for TLS configuration
65
- when key_path is also provided.
66
- key_path (Optional[str]): Path to the client private key file. Required for TLS configuration
67
- when cert_path is also provided.
68
- ca_bundle_path (Optional[str]): Path to the CA bundle file for certificate verification.
69
- If not provided, defaults to system CA certificates.
70
- """
71
- if make_async:
72
- if cert_path and key_path:
73
- return httpx.AsyncClient(
74
- http2=True,
75
- cert=(cert_path, key_path),
76
- verify=ca_bundle_path if ca_bundle_path else True,
77
- )
78
- else:
79
- return httpx.AsyncClient()
80
- else:
81
- if cert_path and key_path:
82
- return httpx.Client(
83
- http2=True,
84
- cert=(cert_path, key_path),
85
- verify=ca_bundle_path if ca_bundle_path else True,
86
- )
87
- else:
88
- return httpx.Client()
indexify/utils/logging.py DELETED
@@ -1,66 +0,0 @@
1
- import logging
2
- import sys
3
-
4
- import structlog
5
- from structlog.contextvars import merge_contextvars
6
- from structlog.dev import ConsoleRenderer, set_exc_info
7
- from structlog.processors import StackInfoRenderer, TimeStamper, add_log_level
8
-
9
- # Using this module allows us to be consistent with the logging configuration across all Python programs.
10
-
11
-
12
- def configure_logging_early():
13
- """Configures standard Python logging module.
14
-
15
- By default 3rd party modules that are using standard Python logging module
16
- (logging.getLogger()) have their log lines dropped unless the module gets configured.
17
-
18
- Not dropping log lines from 3rd party modules is useful for debugging. E.g. this helps
19
- debugging errors in grpc servers if exceptions happen inside grpc module code.
20
- """
21
- logging.basicConfig(
22
- level=logging.WARNING,
23
- # This log message format is a bit similar to the default structlog format.
24
- format="%(asctime)s [%(levelname)s] %(message)s logger=%(name)s",
25
- datefmt="%Y-%m-%d %H:%M:%S",
26
- handlers=[logging.StreamHandler(sys.stdout)],
27
- )
28
-
29
-
30
- def configure_development_mode_logging():
31
- processors = [
32
- structlog_suppressor,
33
- merge_contextvars,
34
- add_log_level,
35
- StackInfoRenderer(),
36
- set_exc_info,
37
- TimeStamper(fmt="%Y-%m-%d %H:%M:%S", utc=False),
38
- ConsoleRenderer(),
39
- ]
40
- structlog.configure(
41
- processors=processors,
42
- )
43
-
44
-
45
- def configure_production_mode_logging():
46
- processors = [
47
- structlog_suppressor,
48
- structlog.processors.format_exc_info,
49
- structlog.processors.JSONRenderer(),
50
- ]
51
- structlog.configure(processors=processors)
52
-
53
-
54
- _suppress_logging = False
55
-
56
-
57
- def structlog_suppressor(logger, name, event_dict):
58
- global _suppress_logging
59
- return None if _suppress_logging else event_dict
60
-
61
-
62
- def suppress():
63
- """Sets the log level for the root logger to the new level."""
64
- global _suppress_logging
65
- _suppress_logging = True
66
- logging.getLogger().setLevel(logging.CRITICAL)
@@ -1,45 +0,0 @@
1
- indexify/cli/cli.py,sha256=y6JNaMd5by7_v3jE1iah1krlvfzbN4r5A2WkgGTy1Ts,11427
2
- indexify/executor/README.md,sha256=ozC6_hMkhQQNVCMEpBxwiUALz6lwErPQxNxQfQDqnG4,2029
3
- indexify/executor/api_objects.py,sha256=k5tKYxaWml0sSECoEDzamCYeJnlD7zO2M7E_qGwyMrg,1032
4
- indexify/executor/downloader.py,sha256=Vrq1dAW4BifG62tlqFnImiMxdezIgOZcByTRnhDsnnw,6457
5
- indexify/executor/executor.py,sha256=lln0p0cVN2aNY3bsHFp7Phbaa2q9gnQABi1xEPxo1Nc,5859
6
- indexify/executor/function_executor/function_executor.py,sha256=837r91kL1Nt5Ct9LVFdpB89fhtHctV-c2PrgbyVSFlE,5833
7
- indexify/executor/function_executor/function_executor_state.py,sha256=_85dpaudYM0sekOqwjMxKGdK7MNQdTGUhHi67sqVHyY,2853
8
- indexify/executor/function_executor/health_checker.py,sha256=JPpwXzLVzx4RbDXdPgSUAwUj-1qTwzha3uW0SHqX1CU,2764
9
- indexify/executor/function_executor/invocation_state_client.py,sha256=jxElxnYFfdwCxKfKvQsjLIE-Z_1386wxednJ2pGKSL0,8581
10
- indexify/executor/function_executor/server/function_executor_server.py,sha256=_DLivLDikupZusRk8gVWDk7fWPT9XjZ4un1yWSlOObs,883
11
- indexify/executor/function_executor/server/function_executor_server_factory.py,sha256=pGbJMQfC5TNvyWOs6VDKdqd2PK5OHQh5_wSDP-E7DbI,1677
12
- indexify/executor/function_executor/server/subprocess_function_executor_server.py,sha256=DxQMwAvQi03OGo2sFruUrxwcMPG8In4C62L3sped2FI,694
13
- indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py,sha256=cVr2wXQL5zVlq-Ep44ZBXBFCQbrbZSMscjRmzVDakvk,4295
14
- indexify/executor/function_executor/single_task_runner.py,sha256=CwLN2pLJpORDjxgxME5-xQCBJ_mzmrdnrzjB7n4sqZo,7794
15
- indexify/executor/function_executor/task_input.py,sha256=8pBRuaQbBBPrDWwByOKZlOaXu6UDmJUO5w-6XxAYSgY,582
16
- indexify/executor/function_executor/task_output.py,sha256=3-qcT1aigmOFEp6QSJtUcQfqeJfrxvo265qgk9WAUVg,1064
17
- indexify/executor/runtime_probes.py,sha256=bo6Dq6AGZpJH099j0DHtVSDEH80tv3j9MXf3VXSx_p8,2182
18
- indexify/executor/task_fetcher.py,sha256=Cpm-LRZz1MSfW-xHJbIaKc1wxzRhIrud9GTOIxWODt0,2883
19
- indexify/executor/task_reporter.py,sha256=eueJNHYJIwAm8lY8SQJrUOWC-Nk-DPesDis1YTR4k7c,6643
20
- indexify/executor/task_runner.py,sha256=RSFeJYhQ_agXXPBm8u13HErSUPZGsCGwV1stgS7g258,5035
21
- indexify/function_executor/README.md,sha256=TAcbYYe6noUMriaQabJAaZ8a2SAYzlXl7hIdTfULqYY,950
22
- indexify/function_executor/handlers/run_function/function_inputs_loader.py,sha256=StSJCp-kkOWUuUIzONnoqtcB37nzBYGcIVy2oTEwOIQ,1588
23
- indexify/function_executor/handlers/run_function/handler.py,sha256=DY_aIR8MZsa1cnFxbVEHhcxQSqBwW4cYRN9NhzuDDFo,5090
24
- indexify/function_executor/handlers/run_function/request_validator.py,sha256=GS7_zxAlyNg0vpUrhot-DpVWFyI9Y9P8jvb7UuO4b1A,856
25
- indexify/function_executor/handlers/run_function/response_helper.py,sha256=FJVl-LyoRBx9HRaOo_umveiWzuh4anO7aXUmEMEki20,3074
26
- indexify/function_executor/initialize_request_validator.py,sha256=agYWGRHUC-7IuYtm9NPjcVo5SVOWM4PxewA93dqdkJM,682
27
- indexify/function_executor/invocation_state/invocation_state_proxy_server.py,sha256=YEnxvWV8NFVK_CxHI_C-BNizuagalY3ieN62IOxNttU,7023
28
- indexify/function_executor/invocation_state/proxied_invocation_state.py,sha256=rjZ2192bSXonNKkaDaByeOL-wVx6x6Qrtio0UVzGSz8,944
29
- indexify/function_executor/invocation_state/response_validator.py,sha256=05Y9_5s010owaDb6OUia9W9Alx1r1zJ179HboEkT-Xk,896
30
- indexify/function_executor/main.py,sha256=uOzVUhl4LzGJ9Cw3kyyFddaEIMxRETEKFHPnvJVtc50,1152
31
- indexify/function_executor/proto/configuration.py,sha256=fX-WiV9zEiUXlpwpJ-kGBkNyZEwWq2YuvSFKnB-lp_8,1217
32
- indexify/function_executor/proto/function_executor.proto,sha256=dy614X8ZGi5glbbKStyE6m0JS7zY_H5aqcwZ-rsAy_8,4218
33
- indexify/function_executor/proto/function_executor_pb2.py,sha256=ZOosY_doqi7pRxubfu0EjYfzafFdulPxEuuz-NfA_cg,7859
34
- indexify/function_executor/proto/function_executor_pb2.pyi,sha256=_ezcOmtujDQpUWamFwsPEux6nlfmY6qUjrX7Ou1gPJU,7459
35
- indexify/function_executor/proto/function_executor_pb2_grpc.py,sha256=A4r9hZ1Kb_tiSBpgGqMVwpRtvlGPkeLeMhfF1B_zKr0,10772
36
- indexify/function_executor/proto/message_validator.py,sha256=OKXPYgy5L9c-spnV9Zjv7PA_yxwzvykfhbYylYx8cwQ,1456
37
- indexify/function_executor/server.py,sha256=tJzUy_v4BT8Le9G3hgtiuDJo9YVFkAU2dVISSsX36II,1061
38
- indexify/function_executor/service.py,sha256=b1On_omDs3gH7bGloegjTDRBkWd2C5uIv6ZniFvf-pg,6036
39
- indexify/utils/README.md,sha256=2g8-H9GopacOW4YrViZc0QsaJPtK-Fox7GyfX01kcDk,86
40
- indexify/utils/http_client.py,sha256=deMlmAu4E_ZXV3blCdWNag3uO_cyD-GsMZjFFmO5r7s,3541
41
- indexify/utils/logging.py,sha256=c6NwzY7uVHMRJc8f2w2KF36rNkeZVoQfGdq7suIg9s8,2025
42
- indexify-0.3.4.dist-info/METADATA,sha256=DED1Lo70-J6OSpfru2s8SMY-6_U4MD1J6WIQsIQqe6c,1372
43
- indexify-0.3.4.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
44
- indexify-0.3.4.dist-info/entry_points.txt,sha256=pJG0YRnypesbiNJHuObfHEkjk0p_ZvEDTyyTH0kGVTY,108
45
- indexify-0.3.4.dist-info/RECORD,,
@@ -1,4 +0,0 @@
1
- [console_scripts]
2
- function-executor=indexify.function_executor.main:main
3
- indexify-cli=indexify.cli.cli:app
4
-