indexify 0.3.12__py3-none-any.whl → 0.3.13__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.
@@ -3,12 +3,15 @@ from typing import Any, Optional
3
3
 
4
4
  import grpc
5
5
  from tensorlake.function_executor.proto.function_executor_pb2 import (
6
+ InfoRequest,
7
+ InfoResponse,
6
8
  InitializeRequest,
7
9
  InitializeResponse,
8
10
  )
9
11
  from tensorlake.function_executor.proto.function_executor_pb2_grpc import (
10
12
  FunctionExecutorStub,
11
13
  )
14
+ from tensorlake.function_executor.proto.message_validator import MessageValidator
12
15
  from tensorlake.utils.http_client import get_httpx_client
13
16
 
14
17
  from .health_checker import HealthChecker
@@ -36,7 +39,10 @@ from .metrics.function_executor import (
36
39
  metric_destroys,
37
40
  metric_establish_channel_errors,
38
41
  metric_establish_channel_latency,
42
+ metric_function_executor_infos,
39
43
  metric_function_executors_count,
44
+ metric_get_info_rpc_errors,
45
+ metric_get_info_rpc_latency,
40
46
  metric_initialize_rpc_errors,
41
47
  metric_initialize_rpc_latency,
42
48
  )
@@ -96,6 +102,7 @@ class FunctionExecutor:
96
102
  await self._create_server(config)
97
103
  await self._establish_channel()
98
104
  stub: FunctionExecutorStub = FunctionExecutorStub(self._channel)
105
+ await _collect_server_info(stub)
99
106
  await _initialize_server(stub, initialize_request)
100
107
  await self._create_invocation_state_client(
101
108
  stub=stub,
@@ -262,9 +269,29 @@ class FunctionExecutor:
262
269
  self._health_checker = None
263
270
 
264
271
 
272
+ async def _collect_server_info(stub: FunctionExecutorStub) -> None:
273
+ with (
274
+ metric_get_info_rpc_errors.count_exceptions(),
275
+ metric_get_info_rpc_latency.time(),
276
+ ):
277
+ info: InfoResponse = await stub.get_info(InfoRequest())
278
+ validator = MessageValidator(info)
279
+ validator.required_field("version")
280
+ validator.required_field("sdk_version")
281
+ validator.required_field("sdk_language")
282
+ validator.required_field("sdk_language_version")
283
+
284
+ metric_function_executor_infos.labels(
285
+ version=info.version,
286
+ sdk_version=info.sdk_version,
287
+ sdk_language=info.sdk_language,
288
+ sdk_language_version=info.sdk_language_version,
289
+ ).inc()
290
+
291
+
265
292
  async def _initialize_server(
266
293
  stub: FunctionExecutorStub, initialize_request: InitializeRequest
267
- ):
294
+ ) -> None:
268
295
  with (
269
296
  metric_initialize_rpc_errors.count_exceptions(),
270
297
  metric_initialize_rpc_latency.time(),
@@ -78,6 +78,22 @@ metric_destroy_channel_errors: prometheus_client.Counter = prometheus_client.Cou
78
78
  "Number of Function Executor channel destruction errors",
79
79
  )
80
80
 
81
+ # FE get_info RPC metrics.
82
+ metric_get_info_rpc_latency: prometheus_client.Histogram = (
83
+ latency_metric_for_fast_operation(
84
+ "function_executor_get_info_rpc", "Function Executor get_info RPC"
85
+ )
86
+ )
87
+ metric_get_info_rpc_errors: prometheus_client.Counter = prometheus_client.Counter(
88
+ "function_executor_get_info_rpc_errors",
89
+ "Number of Function Executor get_info RPC errors",
90
+ )
91
+ metric_function_executor_infos: prometheus_client.Counter = prometheus_client.Counter(
92
+ "function_executor_infos",
93
+ "Number of Function Executors with particular info",
94
+ ["version", "sdk_version", "sdk_language", "sdk_language_version"],
95
+ )
96
+
81
97
  # FE initialization RPC metrics.
82
98
  metric_initialize_rpc_latency: prometheus_client.Histogram = (
83
99
  latency_metric_for_customer_controlled_operation(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: indexify
3
- Version: 0.3.12
3
+ Version: 0.3.13
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
@@ -3,12 +3,12 @@ indexify/executor/README.md,sha256=ozC6_hMkhQQNVCMEpBxwiUALz6lwErPQxNxQfQDqnG4,2
3
3
  indexify/executor/api_objects.py,sha256=TaYwDoo7EjuLBusxH512-KdvAJRtBwbEP2IObWraabU,1100
4
4
  indexify/executor/downloader.py,sha256=XjaGCzsGM3ex2HxbKGkIsB50OhlXgdnywWGCjUBdW2k,8127
5
5
  indexify/executor/executor.py,sha256=r5do6k7Izp9SIzebgOn2psYjzKZmNqHx3iuTW3vWrhg,10035
6
- indexify/executor/function_executor/function_executor.py,sha256=BxNhsW0uXxKjdKT5ixMAyIo5F7otdIT2c0FMQ09Lsrs,10234
6
+ indexify/executor/function_executor/function_executor.py,sha256=sQ5FOdrjybDDsjagghlfjV06IXTpWWDBSTHqQXI-w9M,11245
7
7
  indexify/executor/function_executor/function_executor_state.py,sha256=IWPLWa7LaN0Eq8PDu-0kFzkuKJB0COShu7wCO1oyiNA,3141
8
8
  indexify/executor/function_executor/function_executor_states_container.py,sha256=x4hlF7ZBWswk9dkA06Rvgeqar6H9TWjZ7Etyy2CzBDE,2682
9
9
  indexify/executor/function_executor/health_checker.py,sha256=YT24ajPLdYOpdt2UNyJGviGbivCDXIJpeQOxQofcl50,3258
10
10
  indexify/executor/function_executor/invocation_state_client.py,sha256=p-xgM4__cHR1ApvMV9hShrGWee_Je0VDhICZUGjpQY4,9644
11
- indexify/executor/function_executor/metrics/function_executor.py,sha256=y36cgZEp949HPCBVFF6uFQIxk2PvnSI74QSbxcAalI4,5659
11
+ indexify/executor/function_executor/metrics/function_executor.py,sha256=KHzf4cMh_HqnOAE7TZ6_oIqUH3nExOkt9LSekAEN69w,6304
12
12
  indexify/executor/function_executor/metrics/function_executor_state.py,sha256=M7cMA7JY8_8FW9xjuSqtp6o2xxUgB31LJowo7kzcexg,352
13
13
  indexify/executor/function_executor/metrics/function_executor_state_container.py,sha256=6rrAfml-TivjkHatCM4BLY7jmVs523Wzb6QIysncc-0,302
14
14
  indexify/executor/function_executor/metrics/health_checker.py,sha256=EaeIYJPrQ-qqNMGZVGkvjPoeQSCl4FzPKXEv3Cly1NE,456
@@ -40,7 +40,7 @@ indexify/executor/runtime_probes.py,sha256=bo6Dq6AGZpJH099j0DHtVSDEH80tv3j9MXf3V
40
40
  indexify/executor/task_fetcher.py,sha256=NpFfHgaY99bSL-K2D5kcDAMNUG2FArq0-qF_mgF-LBQ,3375
41
41
  indexify/executor/task_reporter.py,sha256=t7FzSKV7fG1fEtxyTcFh-sTWZ8WXApbG-qXaAMq_gRQ,7363
42
42
  indexify/executor/task_runner.py,sha256=tcS7hHdSVQexC3XEIsDTwX51bJK4iSQqC8CbWeNoud0,5590
43
- indexify-0.3.12.dist-info/METADATA,sha256=OkLYjGB3yomMTO21dsw1YR5q3swzqRsaWvsOzrPQTKg,1158
44
- indexify-0.3.12.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
45
- indexify-0.3.12.dist-info/entry_points.txt,sha256=GU9wmsgvN7nQw3N2X0PMYn1RSvF6CrhH9RuC2D8d3Gk,53
46
- indexify-0.3.12.dist-info/RECORD,,
43
+ indexify-0.3.13.dist-info/METADATA,sha256=zaJ7N4LFWTxgUPXsA01xxhPY8Dvo8D7tcPwNH6x2F5U,1158
44
+ indexify-0.3.13.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
45
+ indexify-0.3.13.dist-info/entry_points.txt,sha256=GU9wmsgvN7nQw3N2X0PMYn1RSvF6CrhH9RuC2D8d3Gk,53
46
+ indexify-0.3.13.dist-info/RECORD,,