indexify 0.4.30__tar.gz → 0.4.31__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.30 → indexify-0.4.31}/PKG-INFO +1 -1
- {indexify-0.4.30 → indexify-0.4.31}/pyproject.toml +1 -1
- indexify-0.4.31/src/indexify/cli/build_image.py +124 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/cli/deploy.py +1 -1
- indexify-0.4.30/src/indexify/cli/build_image.py +0 -84
- {indexify-0.4.30 → indexify-0.4.31}/README.md +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/cli/__init__.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/cli/executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/README.md +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/blob_store/blob_store.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/blob_store/local_fs_blob_store.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/blob_store/metrics/blob_store.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/blob_store/s3_blob_store.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/channel_manager.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_allowlist.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/function_executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/health_checker.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/invocation_state_client.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/metrics/function_executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/metrics/health_checker.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/metrics/invocation_state_client.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/server/client_configuration.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/server/function_executor_server.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/__init__.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/aio_utils.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/completed_task_allocation_metrics.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/create_function_executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/debug_event_loop.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/downloads.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/events.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/finalize_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/function_executor_controller.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/loggers.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/message_validators.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/completed_task_allocation_metrics.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/downloads.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/finalize_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/function_executor_controller.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/prepare_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/metrics/run_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/prepare_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/run_task_allocation.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/task_allocation_info.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/task_allocation_input.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/task_allocation_output.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/terminate_function_executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/host_resources/host_resources.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/host_resources/nvidia_gpu.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/host_resources/nvidia_gpu_allocator.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/logging.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/metrics/channel_manager.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/metrics/executor.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/metrics/state_reconciler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/metrics/state_reporter.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/desired_state_handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/health_check_handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/health_checker/generic_health_checker.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/health_checker/health_checker.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/health_checker/metrics/health_checker.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/metrics.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/prometheus_metrics_handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/reported_state_handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/server.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/startup_probe_handler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/state_reconciler.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/state_reporter.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/proto/executor_api.proto +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/proto/executor_api_pb2.py +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/src/indexify/proto/executor_api_pb2.pyi +0 -0
- {indexify-0.4.30 → indexify-0.4.31}/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.31"
|
5
5
|
description = "Open Source Indexify components and helper tools"
|
6
6
|
authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
|
7
7
|
license = "Apache 2.0"
|
@@ -0,0 +1,124 @@
|
|
1
|
+
import importlib
|
2
|
+
from typing import Any, Generator, Tuple
|
3
|
+
|
4
|
+
import click
|
5
|
+
import docker
|
6
|
+
import docker.api.build
|
7
|
+
from docker.errors import BuildError
|
8
|
+
from tensorlake.functions_sdk.image import Image
|
9
|
+
from tensorlake.functions_sdk.workflow_module import (
|
10
|
+
WorkflowModuleInfo,
|
11
|
+
load_workflow_module_info,
|
12
|
+
)
|
13
|
+
|
14
|
+
|
15
|
+
@click.command(
|
16
|
+
short_help="Build images for graphs/workflows defined in the workflow file"
|
17
|
+
)
|
18
|
+
@click.argument(
|
19
|
+
"workflow-file-path",
|
20
|
+
type=click.Path(exists=True, file_okay=True, dir_okay=False),
|
21
|
+
)
|
22
|
+
@click.option(
|
23
|
+
"-i",
|
24
|
+
"--image-names",
|
25
|
+
multiple=True,
|
26
|
+
help="Names of images to build. Can be specified multiple times. If not provided, all images will be built.",
|
27
|
+
)
|
28
|
+
def build_image(
|
29
|
+
workflow_file_path: str,
|
30
|
+
image_names: tuple[str, ...] = None,
|
31
|
+
):
|
32
|
+
"""
|
33
|
+
Build the images associated to an Indexify workflow
|
34
|
+
|
35
|
+
A workflow is defined in a Python file, and the images are built using the local Docker daemon.
|
36
|
+
"""
|
37
|
+
try:
|
38
|
+
workflow_module_info: WorkflowModuleInfo = load_workflow_module_info(
|
39
|
+
workflow_file_path
|
40
|
+
)
|
41
|
+
except Exception as e:
|
42
|
+
click.secho(
|
43
|
+
f"Failed loading workflow file, please check the error message: {e}",
|
44
|
+
fg="red",
|
45
|
+
)
|
46
|
+
raise click.Abort
|
47
|
+
|
48
|
+
docker_client: docker.DockerClient = docker.from_env()
|
49
|
+
docker_client.ping()
|
50
|
+
|
51
|
+
indexify_version: str = importlib.metadata.version("indexify")
|
52
|
+
for image in workflow_module_info.images.keys():
|
53
|
+
image: Image
|
54
|
+
if len(image_names) > 0 and image.image_name not in image_names:
|
55
|
+
click.echo(
|
56
|
+
f"Skipping image `{image.image_name}` as it is not in the provided image names."
|
57
|
+
)
|
58
|
+
continue
|
59
|
+
|
60
|
+
click.echo(f"Building image `{image.image_name}`")
|
61
|
+
|
62
|
+
image.run(f"pip install 'indexify=={indexify_version}'")
|
63
|
+
built_image, logs_generator = _build(image=image, docker_client=docker_client)
|
64
|
+
try:
|
65
|
+
built_image, logs_generator = _build(
|
66
|
+
image=image, docker_client=docker_client
|
67
|
+
)
|
68
|
+
_print_build_log(logs_generator)
|
69
|
+
click.secho(f"built image: {built_image.tags[0]}", fg="green")
|
70
|
+
except BuildError as e:
|
71
|
+
raise click.Abort() from e
|
72
|
+
|
73
|
+
click.secho(f"built image: {built_image.tags[0]}", fg="green")
|
74
|
+
|
75
|
+
|
76
|
+
def _build(
|
77
|
+
image: Image, docker_client: docker.DockerClient
|
78
|
+
) -> Tuple[docker.models.images.Image, Generator[str, Any, None]]:
|
79
|
+
docker_file = image.dockerfile()
|
80
|
+
image_name = (
|
81
|
+
image.image_name
|
82
|
+
if ":" in image.image_name
|
83
|
+
else f"{image.image_name}:{image.image_tag}"
|
84
|
+
)
|
85
|
+
|
86
|
+
docker.api.build.process_dockerfile = lambda dockerfile, path: (
|
87
|
+
"Dockerfile",
|
88
|
+
dockerfile,
|
89
|
+
)
|
90
|
+
|
91
|
+
try:
|
92
|
+
built_image, logs_generator = docker_client.images.build(
|
93
|
+
path=".",
|
94
|
+
dockerfile=docker_file,
|
95
|
+
tag=image_name,
|
96
|
+
rm=True,
|
97
|
+
# pull=True, # optional: ensures fresh base images
|
98
|
+
# forcerm=True, # optional: always remove intermediate containers
|
99
|
+
)
|
100
|
+
return built_image, logs_generator
|
101
|
+
except BuildError as e:
|
102
|
+
click.secho("Docker build failed:", fg="red")
|
103
|
+
_print_build_log(e.build_log or [])
|
104
|
+
click.secho(str(e), fg="red")
|
105
|
+
raise
|
106
|
+
|
107
|
+
|
108
|
+
def _print_build_log(build_logs):
|
109
|
+
for log_entry in build_logs:
|
110
|
+
if isinstance(log_entry, dict):
|
111
|
+
if "stream" in log_entry:
|
112
|
+
click.echo(log_entry["stream"].rstrip("\n"))
|
113
|
+
elif "status" in log_entry:
|
114
|
+
if "id" in log_entry:
|
115
|
+
click.echo(f"{log_entry['status']}: {log_entry['id']}")
|
116
|
+
else:
|
117
|
+
click.echo(log_entry["status"])
|
118
|
+
if "errorDetail" in log_entry:
|
119
|
+
# This is the most useful bit when a RUN command fails
|
120
|
+
msg = log_entry["errorDetail"].get("message") or log_entry.get("error")
|
121
|
+
if msg:
|
122
|
+
click.secho(msg.rstrip("\n"), fg="red")
|
123
|
+
elif isinstance(log_entry, str):
|
124
|
+
click.echo(log_entry.rstrip("\n"))
|
@@ -18,7 +18,7 @@ from tensorlake.functions_sdk.workflow_module import (
|
|
18
18
|
)
|
19
19
|
@click.option(
|
20
20
|
"-u",
|
21
|
-
"--upgrade-queued-
|
21
|
+
"--upgrade-queued-invocations",
|
22
22
|
is_flag=True,
|
23
23
|
default=False,
|
24
24
|
help="Upgrade invocations that are already queued or running to use the deployed version of the graphs/workflows",
|
@@ -1,84 +0,0 @@
|
|
1
|
-
import importlib
|
2
|
-
from typing import Any, Generator, Tuple
|
3
|
-
|
4
|
-
import click
|
5
|
-
import docker
|
6
|
-
import docker.api.build
|
7
|
-
import docker.models
|
8
|
-
import docker.models.images
|
9
|
-
from tensorlake.functions_sdk.image import Image
|
10
|
-
from tensorlake.functions_sdk.workflow_module import (
|
11
|
-
WorkflowModuleInfo,
|
12
|
-
load_workflow_module_info,
|
13
|
-
)
|
14
|
-
|
15
|
-
|
16
|
-
@click.command(
|
17
|
-
short_help="Build images for graphs/workflows defined in the workflow file"
|
18
|
-
)
|
19
|
-
# Path to the file where the graphs/workflows are defined as global variables
|
20
|
-
@click.argument(
|
21
|
-
"workflow-file-path",
|
22
|
-
type=click.Path(exists=True, file_okay=True, dir_okay=False),
|
23
|
-
)
|
24
|
-
@click.option(
|
25
|
-
"-i",
|
26
|
-
"--image-names",
|
27
|
-
multiple=True,
|
28
|
-
help="Names of images to build. Can be specified multiple times. If not provided, all images will be built.",
|
29
|
-
)
|
30
|
-
def build_image(
|
31
|
-
workflow_file_path: str,
|
32
|
-
image_names: tuple[str, ...] = None,
|
33
|
-
):
|
34
|
-
try:
|
35
|
-
workflow_module_info: WorkflowModuleInfo = load_workflow_module_info(
|
36
|
-
workflow_file_path
|
37
|
-
)
|
38
|
-
except Exception as e:
|
39
|
-
click.secho(
|
40
|
-
f"Failed loading workflow file, please check the error message: {e}",
|
41
|
-
fg="red",
|
42
|
-
)
|
43
|
-
raise click.Abort
|
44
|
-
|
45
|
-
docker_client: docker.DockerClient = docker.from_env()
|
46
|
-
docker_client.ping()
|
47
|
-
|
48
|
-
indexify_version: str = importlib.metadata.version("indexify")
|
49
|
-
for image in workflow_module_info.images.keys():
|
50
|
-
image: Image
|
51
|
-
if image_names is not None and image.image_name not in image_names:
|
52
|
-
click.echo(
|
53
|
-
f"Skipping image `{image.image_name}` as it is not in the provided image names."
|
54
|
-
)
|
55
|
-
continue
|
56
|
-
|
57
|
-
click.echo(f"Building image `{image.image_name}`")
|
58
|
-
|
59
|
-
image.run(f"pip install 'indexify=={indexify_version}'")
|
60
|
-
built_image, logs_generator = image.build()
|
61
|
-
built_image: docker.models.images.Image
|
62
|
-
for output in logs_generator:
|
63
|
-
click.secho(output)
|
64
|
-
|
65
|
-
click.secho(f"built image: {built_image.tags[0]}", fg="green")
|
66
|
-
|
67
|
-
|
68
|
-
def build(
|
69
|
-
image: Image, docker_client: docker.DockerClient
|
70
|
-
) -> Tuple[docker.models.images.Image, Generator[str, Any, None]]:
|
71
|
-
docker_file = image.dockerfile()
|
72
|
-
image_name = f"{image.image_name}:{image.image_tag}"
|
73
|
-
|
74
|
-
docker.api.build.process_dockerfile = lambda dockerfile, path: (
|
75
|
-
"Dockerfile",
|
76
|
-
dockerfile,
|
77
|
-
)
|
78
|
-
|
79
|
-
return docker_client.images.build(
|
80
|
-
path=".",
|
81
|
-
dockerfile=docker_file,
|
82
|
-
tag=image_name,
|
83
|
-
rm=True,
|
84
|
-
)
|
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.30 → indexify-0.4.31}/src/indexify/executor/function_executor/function_executor.py
RENAMED
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/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.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/__init__.py
RENAMED
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/aio_utils.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/downloads.py
RENAMED
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/function_executor_controller/events.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/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
|
{indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/desired_state_handler.py
RENAMED
File without changes
|
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/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.30 → indexify-0.4.31}/src/indexify/executor/monitoring/prometheus_metrics_handler.py
RENAMED
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/src/indexify/executor/monitoring/reported_state_handler.py
RENAMED
File without changes
|
File without changes
|
{indexify-0.4.30 → indexify-0.4.31}/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
|
File without changes
|