indexify 0.4.26__tar.gz → 0.4.27__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.4.26 → indexify-0.4.27}/PKG-INFO +1 -1
- {indexify-0.4.26 → indexify-0.4.27}/pyproject.toml +1 -1
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/function_executor.py +4 -4
- indexify-0.4.27/src/indexify/executor/function_executor_controller/aio_utils.py +26 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/create_function_executor.py +16 -3
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/function_executor_controller.py +9 -1
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/terminate_function_executor.py +7 -3
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/state_reconciler.py +2 -0
- {indexify-0.4.26 → indexify-0.4.27}/README.md +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/cli/__init__.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/cli/build_image.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/cli/deploy.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/cli/executor.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/README.md +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/blob_store/blob_store.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/blob_store/local_fs_blob_store.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/blob_store/metrics/blob_store.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/blob_store/s3_blob_store.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/channel_manager.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/executor.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_allowlist.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/health_checker.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/invocation_state_client.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/metrics/function_executor.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/metrics/health_checker.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/metrics/invocation_state_client.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/server/client_configuration.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/server/function_executor_server.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/__init__.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/completed_task_metrics.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/debug_event_loop.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/downloads.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/events.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/finalize_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/loggers.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/message_validators.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/completed_task_metrics.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/downloads.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/finalize_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/function_executor_controller.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/prepare_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/metrics/run_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/prepare_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/run_task.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/task_info.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/task_input.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/task_output.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/host_resources/host_resources.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/host_resources/nvidia_gpu.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/host_resources/nvidia_gpu_allocator.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/logging.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/metrics/channel_manager.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/metrics/executor.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/metrics/state_reconciler.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/metrics/state_reporter.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/handler.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/health_check_handler.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/health_checker/generic_health_checker.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/health_checker/health_checker.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/health_checker/metrics/health_checker.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/metrics.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/prometheus_metrics_handler.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/server.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/startup_probe_handler.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/state_reporter.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/proto/executor_api.proto +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/proto/executor_api_pb2.py +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/proto/executor_api_pb2.pyi +0 -0
- {indexify-0.4.26 → indexify-0.4.27}/src/indexify/proto/executor_api_pb2_grpc.py +0 -0
@@ -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.4.
|
4
|
+
version = "0.4.27"
|
5
5
|
description = "Open Source Indexify components and helper tools"
|
6
6
|
authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
|
7
7
|
license = "Apache 2.0"
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor/function_executor.py
RENAMED
@@ -308,10 +308,7 @@ async def _initialize_server(
|
|
308
308
|
customer_code_timeout_sec: float,
|
309
309
|
logger: Any,
|
310
310
|
) -> FunctionExecutorInitializationResult:
|
311
|
-
with (
|
312
|
-
metric_initialize_rpc_errors.count_exceptions(),
|
313
|
-
metric_initialize_rpc_latency.time(),
|
314
|
-
):
|
311
|
+
with metric_initialize_rpc_latency.time():
|
315
312
|
try:
|
316
313
|
initialize_response: InitializeResponse = await stub.initialize(
|
317
314
|
initialize_request,
|
@@ -322,6 +319,9 @@ async def _initialize_server(
|
|
322
319
|
response=initialize_response,
|
323
320
|
)
|
324
321
|
except grpc.aio.AioRpcError as e:
|
322
|
+
# Increment the metric manually as we're not raising this exception.
|
323
|
+
metric_initialize_rpc_errors.inc()
|
324
|
+
metric_create_errors.inc()
|
325
325
|
if e.code() == grpc.StatusCode.DEADLINE_EXCEEDED:
|
326
326
|
return FunctionExecutorInitializationResult(
|
327
327
|
is_timeout=True,
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import asyncio
|
2
|
+
from typing import Any, Optional
|
3
|
+
|
4
|
+
|
5
|
+
async def shielded_await(task: asyncio.Task, logger: Any) -> Any:
|
6
|
+
"""Awaits the supplied task and ignores cancellations until it's done.
|
7
|
+
|
8
|
+
Cancels itself if the task is cancelled once the task is done.
|
9
|
+
"""
|
10
|
+
cancelled_error: Optional[asyncio.CancelledError] = None
|
11
|
+
|
12
|
+
while not task.done():
|
13
|
+
try:
|
14
|
+
# Shield to make sure that task is not cancelled.
|
15
|
+
await asyncio.shield(task)
|
16
|
+
except asyncio.CancelledError as e:
|
17
|
+
logger.info(
|
18
|
+
"ignoring aio task cancellation until it's finished",
|
19
|
+
task_name=task.get_name(),
|
20
|
+
)
|
21
|
+
cancelled_error = e
|
22
|
+
|
23
|
+
if cancelled_error is not None:
|
24
|
+
raise cancelled_error
|
25
|
+
else:
|
26
|
+
return task.result()
|
@@ -25,6 +25,7 @@ from indexify.proto.executor_api_pb2 import (
|
|
25
25
|
FunctionExecutorTerminationReason,
|
26
26
|
)
|
27
27
|
|
28
|
+
from .aio_utils import shielded_await
|
28
29
|
from .downloads import download_graph
|
29
30
|
from .events import FunctionExecutorCreated
|
30
31
|
|
@@ -82,8 +83,13 @@ async def create_function_executor(
|
|
82
83
|
logger=logger,
|
83
84
|
)
|
84
85
|
if fe_created_event.function_executor is None:
|
86
|
+
# _to_fe_created_event doesn't like the FE, destroy it.
|
87
|
+
fe_destroy_task: asyncio.Task = asyncio.create_task(
|
88
|
+
function_executor.destroy(),
|
89
|
+
name=f"destroy function executor {function_executor_description.id}",
|
90
|
+
)
|
85
91
|
try:
|
86
|
-
await
|
92
|
+
await shielded_await(fe_destroy_task, logger)
|
87
93
|
except asyncio.CancelledError:
|
88
94
|
# destroy() finished due to the shield, return fe_created_event.
|
89
95
|
pass
|
@@ -230,9 +236,16 @@ async def _create_function_executor(
|
|
230
236
|
)
|
231
237
|
)
|
232
238
|
return (function_executor, result)
|
233
|
-
except BaseException:
|
239
|
+
except BaseException:
|
240
|
+
fe_destroy_task: asyncio.Task = asyncio.create_task(
|
241
|
+
function_executor.destroy(),
|
242
|
+
name=f"destroy function executor {function_executor_description.id}",
|
243
|
+
)
|
234
244
|
# This await is a cancellation point, need to shield to ensure we destroyed the FE.
|
235
|
-
await
|
245
|
+
await shielded_await(
|
246
|
+
fe_destroy_task,
|
247
|
+
logger,
|
248
|
+
)
|
236
249
|
raise
|
237
250
|
|
238
251
|
|
@@ -407,7 +407,7 @@ class FunctionExecutorController:
|
|
407
407
|
"""Spawns an aio task for the supplied coroutine.
|
408
408
|
|
409
409
|
The coroutine should return an event that will be added to the FE controller events.
|
410
|
-
The coroutine should not raise any exceptions including BaseException
|
410
|
+
The coroutine should not raise any exceptions including BaseException.
|
411
411
|
on_exception event will be added to the FE controller events if the aio task raises an unexpected exception.
|
412
412
|
on_exception is required to not silently stall the task processing due to an unexpected exception.
|
413
413
|
If task_info is not None, the aio task will be associated with the task_info while the aio task is running.
|
@@ -422,6 +422,14 @@ class FunctionExecutorController:
|
|
422
422
|
async def coroutine_wrapper() -> None:
|
423
423
|
try:
|
424
424
|
self._add_event(await aio, source=aio_task_name)
|
425
|
+
except asyncio.CancelledError:
|
426
|
+
# Workaround for scenario when coroutine_wrapper gets cancelled at `await aio` before aio starts.
|
427
|
+
# In this case aio doesn't handle the cancellation and doesn't return the right event.
|
428
|
+
# A fix for this is to cancel aio instead of coroutine_wrapper. We'll need to keep
|
429
|
+
# references to both coroutine_wrapper and aio, cause event loop uses weak references to
|
430
|
+
# tasks. Not doing this for now. Using on_exception is good enough because not started aios don't
|
431
|
+
# need to do anything special on cancellation.
|
432
|
+
self._add_event(on_exception, source=aio_task_name)
|
425
433
|
except BaseException as e:
|
426
434
|
logger.error(
|
427
435
|
"unexpected exception in aio task",
|
@@ -4,6 +4,7 @@ from typing import Any, List, Optional
|
|
4
4
|
from indexify.executor.function_executor.function_executor import FunctionExecutor
|
5
5
|
from indexify.proto.executor_api_pb2 import FunctionExecutorTerminationReason
|
6
6
|
|
7
|
+
from .aio_utils import shielded_await
|
7
8
|
from .events import FunctionExecutorTerminated
|
8
9
|
|
9
10
|
|
@@ -18,7 +19,7 @@ async def terminate_function_executor(
|
|
18
19
|
|
19
20
|
The supplied lock is used to ensure that if a destroy operation is in progress,
|
20
21
|
then another caller won't return immediately assuming that the destroy is complete
|
21
|
-
due to its idempotency.
|
22
|
+
due to its idempotency. Ignores cancellations while destroying the function executor.
|
22
23
|
|
23
24
|
Doesn't raise any exceptions.
|
24
25
|
"""
|
@@ -29,9 +30,12 @@ async def terminate_function_executor(
|
|
29
30
|
logger.info(
|
30
31
|
"destroying function executor",
|
31
32
|
)
|
33
|
+
fe_destroy_task: asyncio.Task = asyncio.create_task(
|
34
|
+
function_executor.destroy(),
|
35
|
+
name="destroy function executor",
|
36
|
+
)
|
32
37
|
try:
|
33
|
-
|
34
|
-
await asyncio.shield(function_executor.destroy())
|
38
|
+
await shielded_await(fe_destroy_task, logger)
|
35
39
|
except asyncio.CancelledError:
|
36
40
|
# We actually destroyed the FE so we can return without error.
|
37
41
|
pass
|
@@ -193,6 +193,8 @@ class ExecutorStateReconciler:
|
|
193
193
|
timeout=_DESIRED_EXECUTOR_STATES_TIMEOUT_SEC,
|
194
194
|
)
|
195
195
|
except asyncio.TimeoutError:
|
196
|
+
# These log lines really help to debug networking issues. When there are
|
197
|
+
# no networking issues and the fleet is not idle we don't get excessive logging here.
|
196
198
|
self._logger.info(
|
197
199
|
f"No desired state received from Server within {_DESIRED_EXECUTOR_STATES_TIMEOUT_SEC} sec, recreating the stream to ensure it is healthy"
|
198
200
|
)
|
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.4.26 → indexify-0.4.27}/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
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/__init__.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/downloads.py
RENAMED
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/events.py
RENAMED
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/loggers.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.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/run_task.py
RENAMED
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/task_info.py
RENAMED
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/function_executor_controller/task_input.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/host_resources/nvidia_gpu_allocator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/health_check_handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/prometheus_metrics_handler.py
RENAMED
File without changes
|
File without changes
|
{indexify-0.4.26 → indexify-0.4.27}/src/indexify/executor/monitoring/startup_probe_handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|