indexify 0.4.3__py3-none-any.whl → 0.4.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.
- indexify/cli/build_image.py +5 -0
- indexify/executor/channel_manager.py +51 -1
- indexify/proto/executor_api_pb2.py +2 -2
- indexify/proto/executor_api_pb2.pyi +2 -2
- indexify/proto/executor_api_pb2_grpc.py +1 -1
- {indexify-0.4.3.dist-info → indexify-0.4.5.dist-info}/METADATA +2 -2
- {indexify-0.4.3.dist-info → indexify-0.4.5.dist-info}/RECORD +9 -9
- {indexify-0.4.3.dist-info → indexify-0.4.5.dist-info}/WHEEL +0 -0
- {indexify-0.4.3.dist-info → indexify-0.4.5.dist-info}/entry_points.txt +0 -0
indexify/cli/build_image.py
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
import importlib
|
2
|
+
|
1
3
|
import click
|
2
4
|
from tensorlake.functions_sdk.image import Image
|
3
5
|
from tensorlake.functions_sdk.workflow_module import (
|
@@ -35,6 +37,7 @@ def build_image(
|
|
35
37
|
)
|
36
38
|
raise click.Abort
|
37
39
|
|
40
|
+
indexify_version: str = importlib.metadata.version("indexify")
|
38
41
|
for image in workflow_module_info.images.keys():
|
39
42
|
image: Image
|
40
43
|
if image_names is not None and image.image_name not in image_names:
|
@@ -44,6 +47,8 @@ def build_image(
|
|
44
47
|
continue
|
45
48
|
|
46
49
|
click.echo(f"Building image `{image.image_name}`")
|
50
|
+
|
51
|
+
image.run(f"pip install 'indexify=={indexify_version}'")
|
47
52
|
built_image, generator = image.build()
|
48
53
|
for output in generator:
|
49
54
|
click.secho(output)
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import asyncio
|
2
|
+
import os
|
2
3
|
from typing import Any, Dict, Optional
|
3
4
|
|
4
5
|
import grpc.aio
|
@@ -17,6 +18,7 @@ _CONNECT_TIMEOUT_SEC = 5
|
|
17
18
|
class ChannelManager:
|
18
19
|
def __init__(self, server_address: str, config_path: Optional[str], logger: Any):
|
19
20
|
self._logger: Any = logger.bind(module=__name__, server_address=server_address)
|
21
|
+
self._keep_alive_period_sec: int = _keep_alive_period_sec_from_env(logger)
|
20
22
|
self._server_address: str = server_address
|
21
23
|
self._channel_credentials: Optional[grpc.ChannelCredentials] = None
|
22
24
|
# This lock protects the fields below.
|
@@ -97,12 +99,18 @@ class ChannelManager:
|
|
97
99
|
|
98
100
|
The channel is not be ready to use. Raises an exception on failure.
|
99
101
|
"""
|
102
|
+
channel_options: list[tuple[str, int]] = _channel_options(
|
103
|
+
self._keep_alive_period_sec
|
104
|
+
)
|
100
105
|
if self._channel_credentials is None:
|
101
|
-
return grpc.aio.insecure_channel(
|
106
|
+
return grpc.aio.insecure_channel(
|
107
|
+
target=self._server_address, options=channel_options
|
108
|
+
)
|
102
109
|
else:
|
103
110
|
return grpc.aio.secure_channel(
|
104
111
|
target=self._server_address,
|
105
112
|
credentials=self._channel_credentials,
|
113
|
+
options=channel_options,
|
106
114
|
)
|
107
115
|
|
108
116
|
async def _create_ready_channel(self) -> grpc.aio.Channel:
|
@@ -165,3 +173,45 @@ class ChannelManager:
|
|
165
173
|
except Exception as e:
|
166
174
|
self._logger.error("failed closing channel", exc_info=e)
|
167
175
|
self._channel = None
|
176
|
+
|
177
|
+
|
178
|
+
def _channel_options(keep_alive_period_sec: int) -> list[tuple[str, int]]:
|
179
|
+
"""Returns the gRPC channel options."""
|
180
|
+
# See https://grpc.io/docs/guides/keepalive/.
|
181
|
+
#
|
182
|
+
# NB: Rust Tonic framework that we're using in Server is not using gRPC core and doesn't support
|
183
|
+
# these options. From https://github.com/hyperium/tonic/issues/258 it supports gRPC PINGs when
|
184
|
+
# there are in-flight RPCs (and streams) without any extra configuration.
|
185
|
+
return [
|
186
|
+
("grpc.keepalive_time_ms", keep_alive_period_sec * 1000),
|
187
|
+
(
|
188
|
+
"grpc.http2.max_pings_without_data",
|
189
|
+
-1,
|
190
|
+
), # Allow any number of empty PING messages
|
191
|
+
(
|
192
|
+
"grpc.keepalive_permit_without_calls",
|
193
|
+
0,
|
194
|
+
), # Don't send PINGs when there are no in-flight RPCs (and streams)
|
195
|
+
]
|
196
|
+
|
197
|
+
|
198
|
+
def _keep_alive_period_sec_from_env(logger: Any) -> int:
|
199
|
+
"""Returns the keep alive period in seconds."""
|
200
|
+
# We have to use gRPC keep alive (PING) to prevent proxies/load-balancers from closing underlying HTTP/2
|
201
|
+
# (TCP) connections due to periods of idleness in gRPC streams that we use between Executor and Server.
|
202
|
+
# If a proxy/load-balancer closes the connection, then we see it as gRPC stream errors which results in
|
203
|
+
# a lot of error logs noise.
|
204
|
+
#
|
205
|
+
# The default period of 50 sec is used for one of the standard proxy/load-balancer timeouts of 1 minute.
|
206
|
+
DEFAULT_KEEP_ALIVE_PERIOD_SEC = "50"
|
207
|
+
keep_alive_period_sec = int(
|
208
|
+
os.getenv(
|
209
|
+
"INDEXIFY_EXECUTOR_GRPC_KEEP_ALIVE_PERIOD_SEC",
|
210
|
+
DEFAULT_KEEP_ALIVE_PERIOD_SEC,
|
211
|
+
)
|
212
|
+
)
|
213
|
+
if keep_alive_period_sec != int(DEFAULT_KEEP_ALIVE_PERIOD_SEC):
|
214
|
+
logger.info(
|
215
|
+
f"gRPC keep alive (PING) period is set to {keep_alive_period_sec} sec"
|
216
|
+
)
|
217
|
+
return keep_alive_period_sec
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
3
|
# NO CHECKED-IN PROTOBUF GENCODE
|
4
4
|
# source: indexify/proto/executor_api.proto
|
5
|
-
# Protobuf Python Version:
|
5
|
+
# Protobuf Python Version: 6.31.0
|
6
6
|
"""Generated protocol buffer code."""
|
7
7
|
from google.protobuf import descriptor as _descriptor
|
8
8
|
from google.protobuf import descriptor_pool as _descriptor_pool
|
@@ -11,7 +11,7 @@ from google.protobuf import symbol_database as _symbol_database
|
|
11
11
|
from google.protobuf.internal import builder as _builder
|
12
12
|
|
13
13
|
_runtime_version.ValidateProtobufRuntimeVersion(
|
14
|
-
_runtime_version.Domain.PUBLIC,
|
14
|
+
_runtime_version.Domain.PUBLIC, 6, 31, 0, "", "indexify/proto/executor_api.proto"
|
15
15
|
)
|
16
16
|
# @@protoc_insertion_point(imports)
|
17
17
|
|
@@ -1,6 +1,6 @@
|
|
1
|
+
from collections.abc import Iterable as _Iterable
|
2
|
+
from collections.abc import Mapping as _Mapping
|
1
3
|
from typing import ClassVar as _ClassVar
|
2
|
-
from typing import Iterable as _Iterable
|
3
|
-
from typing import Mapping as _Mapping
|
4
4
|
from typing import Optional as _Optional
|
5
5
|
from typing import Union as _Union
|
6
6
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: indexify
|
3
|
-
Version: 0.4.
|
3
|
+
Version: 0.4.5
|
4
4
|
Summary: Open Source Indexify components and helper tools
|
5
5
|
Home-page: https://github.com/tensorlakeai/indexify
|
6
6
|
License: Apache 2.0
|
@@ -17,7 +17,7 @@ Requires-Dist: aiohttp (>=3.11.0,<4.0.0)
|
|
17
17
|
Requires-Dist: boto3 (>=1.37.30,<2.0.0)
|
18
18
|
Requires-Dist: prometheus-client (>=0.21.1,<0.22.0)
|
19
19
|
Requires-Dist: psutil (>=7.0.0,<8.0.0)
|
20
|
-
Requires-Dist: tensorlake (
|
20
|
+
Requires-Dist: tensorlake (==0.1.88)
|
21
21
|
Project-URL: Repository, https://github.com/tensorlakeai/indexify
|
22
22
|
Description-Content-Type: text/markdown
|
23
23
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
indexify/cli/__init__.py,sha256=ELFLx_Z_oWm30jwOpYjbD6Ori3Nzz4ldkvmGVK7QMgw,426
|
2
|
-
indexify/cli/build_image.py,sha256=
|
2
|
+
indexify/cli/build_image.py,sha256=tqo90TiXSaE88ywqprB5CJCH2PhOXKxhvZThvi6kA7Y,1752
|
3
3
|
indexify/cli/deploy.py,sha256=YM5NB1B5WDalN4Hx-EC5NL30p3UBenrctMv6kPSbd94,1833
|
4
4
|
indexify/cli/executor.py,sha256=UgKPQaObIJVFht0niLEsw8y4k8XBF3siWpTig2_nV8U,6584
|
5
5
|
indexify/executor/README.md,sha256=ozC6_hMkhQQNVCMEpBxwiUALz6lwErPQxNxQfQDqnG4,2029
|
@@ -7,7 +7,7 @@ indexify/executor/blob_store/blob_store.py,sha256=XViw_KRfFSNqwcFYwMZixZF-EYCjXK
|
|
7
7
|
indexify/executor/blob_store/local_fs_blob_store.py,sha256=6LexqMBGXp8f6Ka95R6xMIUyDutrZJABOMNcp-ssa98,1809
|
8
8
|
indexify/executor/blob_store/metrics/blob_store.py,sha256=5_xiPREeHWFtxFh1NupDsF8zP4pmUPgLNNn-UE9Uzvc,1008
|
9
9
|
indexify/executor/blob_store/s3_blob_store.py,sha256=G3B_V3gUE7XbUY42lDtBczUKuA7q8S7MD43tx1aHrJo,3445
|
10
|
-
indexify/executor/channel_manager.py,sha256=
|
10
|
+
indexify/executor/channel_manager.py,sha256=SeBaOYJXJ6KNw59c4C4n54qhcCusNda2756Rbu8pFFM,8642
|
11
11
|
indexify/executor/executor.py,sha256=AGtOHbznjGLQMjJHie10gxq1fLq3h23uXvk4tVkxxEw,6294
|
12
12
|
indexify/executor/function_allowlist.py,sha256=PCelCW6qIe_2sH11BCKr7LDqarRV5kwNsrfB2EV7Zwo,1772
|
13
13
|
indexify/executor/function_executor/function_executor.py,sha256=cnixOPaKNSLCBpe6LzJ_IrwPcYAlG3AP_GW48xik8Gc,12005
|
@@ -59,10 +59,10 @@ indexify/executor/monitoring/startup_probe_handler.py,sha256=zXXsBU15SMlBx1bSFpx
|
|
59
59
|
indexify/executor/state_reconciler.py,sha256=Go0B2k1iq0iZiZTIjRkG2sfeILj_vTNpc8W2o0sBIDA,19179
|
60
60
|
indexify/executor/state_reporter.py,sha256=OxtIEa79lsZe5HzENHJPCYB4zESPw2zkNlGpKtKeOak,14629
|
61
61
|
indexify/proto/executor_api.proto,sha256=YWQHV4GMCSa0IJbPzM5nlEOxHDB2Fw4QlqI34vmdY4w,10858
|
62
|
-
indexify/proto/executor_api_pb2.py,sha256=
|
63
|
-
indexify/proto/executor_api_pb2.pyi,sha256=
|
64
|
-
indexify/proto/executor_api_pb2_grpc.py,sha256=
|
65
|
-
indexify-0.4.
|
66
|
-
indexify-0.4.
|
67
|
-
indexify-0.4.
|
68
|
-
indexify-0.4.
|
62
|
+
indexify/proto/executor_api_pb2.py,sha256=vfPLmr6mKeBQv6JwNzsTaFltT0Vna7dGwxu8PM24ZiI,15125
|
63
|
+
indexify/proto/executor_api_pb2.pyi,sha256=yclRlxH5GuiXuebs_0ePfnKM516DrBrvqEFF4E0Etl8,21151
|
64
|
+
indexify/proto/executor_api_pb2_grpc.py,sha256=JpT5K6jiS0NJVNyTt1mAPpyJMXuEGeNN2V6R3KmLHZ4,7607
|
65
|
+
indexify-0.4.5.dist-info/METADATA,sha256=Xcv47Vcpt_eruMXrfGSwZMHOsQGGCH99xru6HQSknsw,1115
|
66
|
+
indexify-0.4.5.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
|
67
|
+
indexify-0.4.5.dist-info/entry_points.txt,sha256=rMJqbE5KPZIXTPIfAtVIM4zpUElqYVgEYd6i7N23zzg,49
|
68
|
+
indexify-0.4.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|