indexify 0.3.11__tar.gz → 0.3.12__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.
- {indexify-0.3.11 → indexify-0.3.12}/PKG-INFO +2 -9
- {indexify-0.3.11 → indexify-0.3.12}/pyproject.toml +9 -9
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/cli/cli.py +13 -3
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/executor.py +24 -16
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/metrics/executor.py +10 -1
- {indexify-0.3.11 → indexify-0.3.12}/README.md +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/README.md +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/api_objects.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/downloader.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/function_executor.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/function_executor_state.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/function_executor_states_container.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/health_checker.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/invocation_state_client.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/function_executor.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/function_executor_state.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/function_executor_state_container.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/health_checker.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/invocation_state_client.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/metrics/single_task_runner.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/server/client_configuration.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/server/function_executor_server.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/single_task_runner.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/task_input.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/task_output.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/metrics/downloader.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/metrics/task_fetcher.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/metrics/task_reporter.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/metrics/task_runner.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/function_allowlist.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/handler.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/health_check_handler.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/health_checker/generic_health_checker.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/health_checker/health_checker.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/metrics.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/prometheus_metrics_handler.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/server.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/startup_probe_handler.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/runtime_probes.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/task_fetcher.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/task_reporter.py +0 -0
- {indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/task_runner.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: indexify
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.12
|
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
|
@@ -15,16 +15,9 @@ Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
17
17
|
Requires-Dist: aiohttp (>=3.11.0,<4.0.0)
|
18
|
-
Requires-Dist: grpcio (==1.70.0)
|
19
|
-
Requires-Dist: httpx-sse (>=0.4.0,<0.5.0)
|
20
|
-
Requires-Dist: httpx[http2] (>=0.27,<0.28)
|
21
|
-
Requires-Dist: nanoid (>=2.0.0,<3.0.0)
|
22
18
|
Requires-Dist: prometheus-client (>=0.21.1,<0.22.0)
|
23
|
-
Requires-Dist: pydantic (==2.10.4)
|
24
|
-
Requires-Dist: pyyaml (>=6,<7)
|
25
19
|
Requires-Dist: rich (>=13.9.2,<14.0.0)
|
26
|
-
Requires-Dist:
|
27
|
-
Requires-Dist: tensorlake (>=0.1.20)
|
20
|
+
Requires-Dist: tensorlake (>=0.1)
|
28
21
|
Requires-Dist: typer (>=0.12,<0.13)
|
29
22
|
Project-URL: Repository, https://github.com/tensorlakeai/indexify
|
30
23
|
Description-Content-Type: text/markdown
|
@@ -1,7 +1,7 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "indexify"
|
3
3
|
# Incremented if any of the components provided in this packages are updated.
|
4
|
-
version = "0.3.
|
4
|
+
version = "0.3.12"
|
5
5
|
description = "Open Source Indexify components and helper tools"
|
6
6
|
authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
|
7
7
|
license = "Apache 2.0"
|
@@ -15,23 +15,23 @@ indexify-cli = "indexify.cli.cli:app"
|
|
15
15
|
[tool.poetry.dependencies]
|
16
16
|
# Common dependencies
|
17
17
|
python = "^3.9"
|
18
|
-
structlog
|
19
|
-
pyyaml
|
20
|
-
httpx
|
21
|
-
grpcio
|
18
|
+
# structlog is provided by tensorlake
|
19
|
+
# pyyaml is provided by tensorlake
|
20
|
+
# httpx is provided by tensorlake
|
21
|
+
# grpcio is provided by tensorlake
|
22
22
|
|
23
23
|
# Executor only
|
24
|
-
pydantic = "2.10.4"
|
25
|
-
httpx-sse = "^0.4.0"
|
26
24
|
aiohttp = "^3.11.0"
|
27
25
|
prometheus-client = "^0.21.1"
|
28
26
|
# Adds function-executor binary and utils lib.
|
29
|
-
tensorlake = ">=0.1
|
27
|
+
tensorlake = ">=0.1"
|
28
|
+
# pydantic is provided by tensorlake
|
29
|
+
# httpx-sse is provided by tensorlake
|
30
30
|
|
31
31
|
# CLI only
|
32
32
|
rich = "^13.9.2"
|
33
33
|
typer = "^0.12"
|
34
|
-
nanoid
|
34
|
+
# nanoid is provided by tensorlake
|
35
35
|
|
36
36
|
[tool.poetry.group.dev.dependencies]
|
37
37
|
black = "^24.10.0"
|
@@ -7,6 +7,7 @@ from tensorlake.utils.logging import (
|
|
7
7
|
configure_logging_early()
|
8
8
|
|
9
9
|
import os
|
10
|
+
import re
|
10
11
|
import shutil
|
11
12
|
import signal
|
12
13
|
import subprocess
|
@@ -185,6 +186,9 @@ def executor(
|
|
185
186
|
executor_cache: Optional[str] = typer.Option(
|
186
187
|
"~/.indexify/executor_cache", help="Path to the executor cache directory"
|
187
188
|
),
|
189
|
+
executor_id: Optional[str] = typer.Option(
|
190
|
+
None, help="ID of the executor, if not provided, a random ID will be generated"
|
191
|
+
),
|
188
192
|
# Registred ports range ends at 49151.
|
189
193
|
ports: Tuple[int, int] = typer.Option(
|
190
194
|
(50000, 51000),
|
@@ -221,9 +225,15 @@ def executor(
|
|
221
225
|
"At least one function must be specified when not running in development mode"
|
222
226
|
)
|
223
227
|
|
228
|
+
if executor_id is None:
|
229
|
+
executor_id = nanoid.generate()
|
230
|
+
elif not re.compile(r"^[a-zA-Z0-9_-]{10,}$").match(executor_id):
|
231
|
+
raise typer.BadParameter(
|
232
|
+
"--executor-id should be at least 10 characters long and only include characters _-[0-9][a-z][A-Z]"
|
233
|
+
)
|
234
|
+
|
224
235
|
executor_version = version("indexify")
|
225
|
-
|
226
|
-
logger = structlog.get_logger(module=__name__, executor_id=id)
|
236
|
+
logger = structlog.get_logger(module=__name__, executor_id=executor_id)
|
227
237
|
|
228
238
|
logger.info(
|
229
239
|
"starting executor",
|
@@ -262,7 +272,7 @@ def executor(
|
|
262
272
|
)
|
263
273
|
|
264
274
|
Executor(
|
265
|
-
id=
|
275
|
+
id=executor_id,
|
266
276
|
version=executor_version,
|
267
277
|
health_checker=GenericHealthChecker(),
|
268
278
|
code_path=executor_cache,
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import asyncio
|
2
2
|
import signal
|
3
|
+
import time
|
3
4
|
from pathlib import Path
|
4
5
|
from socket import gethostname
|
5
6
|
from typing import Any, Dict, List, Optional
|
@@ -23,6 +24,7 @@ from .metrics.executor import (
|
|
23
24
|
METRIC_TASKS_COMPLETED_OUTCOME_SUCCESS,
|
24
25
|
metric_executor_info,
|
25
26
|
metric_executor_state,
|
27
|
+
metric_task_completion_latency,
|
26
28
|
metric_task_outcome_report_latency,
|
27
29
|
metric_task_outcome_report_retries,
|
28
30
|
metric_task_outcome_reports,
|
@@ -157,26 +159,12 @@ class Executor:
|
|
157
159
|
"""Runs the supplied task.
|
158
160
|
|
159
161
|
Doesn't raise any Exceptions. All errors are reported to the server."""
|
162
|
+
start_time: float = time.monotonic()
|
160
163
|
logger = self._task_logger(task)
|
161
164
|
output: Optional[TaskOutput] = None
|
162
165
|
|
163
166
|
try:
|
164
|
-
|
165
|
-
input: SerializedObject = await self._downloader.download_input(task)
|
166
|
-
init_value: Optional[SerializedObject] = (
|
167
|
-
None
|
168
|
-
if task.reducer_output_id is None
|
169
|
-
else (await self._downloader.download_init_value(task))
|
170
|
-
)
|
171
|
-
output: TaskOutput = await self._task_runner.run(
|
172
|
-
TaskInput(
|
173
|
-
task=task,
|
174
|
-
graph=graph,
|
175
|
-
input=input,
|
176
|
-
init_value=init_value,
|
177
|
-
),
|
178
|
-
logger=logger,
|
179
|
-
)
|
167
|
+
output = await self._run_task_and_get_output(task, logger)
|
180
168
|
logger.info("task execution finished", success=output.success)
|
181
169
|
except Exception as e:
|
182
170
|
output = TaskOutput.internal_error(task)
|
@@ -189,6 +177,26 @@ class Executor:
|
|
189
177
|
metric_task_outcome_reports.inc()
|
190
178
|
await self._report_task_outcome(output=output, logger=logger)
|
191
179
|
|
180
|
+
metric_task_completion_latency.observe(time.monotonic() - start_time)
|
181
|
+
|
182
|
+
async def _run_task_and_get_output(self, task: Task, logger: Any) -> TaskOutput:
|
183
|
+
graph: SerializedObject = await self._downloader.download_graph(task)
|
184
|
+
input: SerializedObject = await self._downloader.download_input(task)
|
185
|
+
init_value: Optional[SerializedObject] = (
|
186
|
+
None
|
187
|
+
if task.reducer_output_id is None
|
188
|
+
else (await self._downloader.download_init_value(task))
|
189
|
+
)
|
190
|
+
return await self._task_runner.run(
|
191
|
+
TaskInput(
|
192
|
+
task=task,
|
193
|
+
graph=graph,
|
194
|
+
input=input,
|
195
|
+
init_value=init_value,
|
196
|
+
),
|
197
|
+
logger=logger,
|
198
|
+
)
|
199
|
+
|
192
200
|
async def _report_task_outcome(self, output: TaskOutput, logger: Any) -> None:
|
193
201
|
"""Reports the task with the given output to the server.
|
194
202
|
|
@@ -1,6 +1,9 @@
|
|
1
1
|
import prometheus_client
|
2
2
|
|
3
|
-
from ..monitoring.metrics import
|
3
|
+
from ..monitoring.metrics import (
|
4
|
+
latency_metric_for_customer_controlled_operation,
|
5
|
+
latency_metric_for_fast_operation,
|
6
|
+
)
|
4
7
|
|
5
8
|
# This file contains all metrics used by Executor.
|
6
9
|
|
@@ -31,6 +34,12 @@ metric_tasks_completed.labels(
|
|
31
34
|
outcome=METRIC_TASKS_COMPLETED_OUTCOME_ERROR_CUSTOMER_CODE
|
32
35
|
)
|
33
36
|
metric_tasks_completed.labels(outcome=METRIC_TASKS_COMPLETED_OUTCOME_ERROR_PLATFORM)
|
37
|
+
metric_task_completion_latency: prometheus_client.Histogram = (
|
38
|
+
latency_metric_for_customer_controlled_operation(
|
39
|
+
"task_completion",
|
40
|
+
"task completion from the moment it got fetched until its outcome got reported",
|
41
|
+
)
|
42
|
+
)
|
34
43
|
|
35
44
|
# Task outcome reporting metrics.
|
36
45
|
metric_task_outcome_reports: prometheus_client.Counter = prometheus_client.Counter(
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/function_executor.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/health_checker.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/function_executor/single_task_runner.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/health_check_handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/prometheus_metrics_handler.py
RENAMED
File without changes
|
File without changes
|
{indexify-0.3.11 → indexify-0.3.12}/src/indexify/executor/monitoring/startup_probe_handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|