indexify 0.3.2__tar.gz → 0.3.3__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.2 → indexify-0.3.3}/PKG-INFO +1 -1
- {indexify-0.3.2 → indexify-0.3.3}/pyproject.toml +1 -1
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/cli/cli.py +57 -4
- {indexify-0.3.2 → indexify-0.3.3}/README.md +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/README.md +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/api_objects.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/downloader.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/executor.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/function_executor.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/function_executor_state.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/invocation_state_client.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/server/function_executor_server.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/server/function_executor_server_factory.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/server/subprocess_function_executor_server.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/server/subprocess_function_executor_server_factory.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/single_task_runner.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/task_input.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/task_output.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/runtime_probes.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/task_fetcher.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/task_reporter.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/task_runner.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/README.md +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/handlers/run_function/function_inputs_loader.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/handlers/run_function/handler.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/handlers/run_function/request_validator.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/handlers/run_function/response_helper.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/initialize_request_validator.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/invocation_state/invocation_state_proxy_server.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/invocation_state/proxied_invocation_state.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/invocation_state/response_validator.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/main.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/configuration.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor.proto +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2.pyi +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2_grpc.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/message_validator.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/server.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/service.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/utils/README.md +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/utils/http_client.py +0 -0
- {indexify-0.3.2 → indexify-0.3.3}/src/indexify/utils/logging.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.3.
|
4
|
+
version = "0.3.3"
|
5
5
|
description = "Open Source Indexify components and helper tools"
|
6
6
|
authors = ["Tensorlake Inc. <support@tensorlake.ai>"]
|
7
7
|
license = "Apache 2.0"
|
@@ -6,6 +6,8 @@ from indexify.utils.logging import (
|
|
6
6
|
|
7
7
|
configure_logging_early()
|
8
8
|
|
9
|
+
import importlib.metadata
|
10
|
+
import json
|
9
11
|
import os
|
10
12
|
import shutil
|
11
13
|
import signal
|
@@ -17,6 +19,7 @@ from importlib.metadata import version
|
|
17
19
|
from pathlib import Path
|
18
20
|
from typing import Annotated, List, Optional, Tuple
|
19
21
|
|
22
|
+
import docker
|
20
23
|
import nanoid
|
21
24
|
import structlog
|
22
25
|
import typer
|
@@ -294,7 +297,57 @@ def _create_image(image: Image, python_sdk_path):
|
|
294
297
|
|
295
298
|
|
296
299
|
def _build_image(image: Image, python_sdk_path: Optional[str] = None):
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
300
|
+
docker_file = _generate_dockerfile(image, python_sdk_path=python_sdk_path)
|
301
|
+
image_name = f"{image._image_name}:{image._tag}"
|
302
|
+
|
303
|
+
# low_level_client = docker.APIClient(base_url=docker_client.api.base_url)
|
304
|
+
docker_host = os.getenv("DOCKER_HOST", "unix:///var/run/docker.sock")
|
305
|
+
low_level_client = docker.APIClient(base_url=docker_host)
|
306
|
+
docker.api.build.process_dockerfile = lambda dockerfile, path: (
|
307
|
+
"Dockerfile",
|
308
|
+
dockerfile,
|
309
|
+
)
|
310
|
+
generator = low_level_client.build(
|
311
|
+
dockerfile=docker_file,
|
312
|
+
rm=True,
|
313
|
+
path=".",
|
314
|
+
tag=image_name,
|
315
|
+
)
|
316
|
+
|
317
|
+
for output in generator:
|
318
|
+
for line in output.decode().splitlines():
|
319
|
+
json_line = json.loads(line)
|
320
|
+
if "stream" in json_line:
|
321
|
+
print(json_line["stream"], end="")
|
322
|
+
|
323
|
+
elif "errorDetail" in json_line:
|
324
|
+
print(json_line["errorDetail"]["message"])
|
325
|
+
|
326
|
+
|
327
|
+
def _generate_dockerfile(image, python_sdk_path: Optional[str] = None):
|
328
|
+
docker_contents = [
|
329
|
+
f"FROM {image._base_image}",
|
330
|
+
"RUN mkdir -p ~/.indexify",
|
331
|
+
f"RUN echo {image._image_name} > ~/.indexify/image_name", # TODO: Do we still use this in executors?
|
332
|
+
f"RUN echo {image.hash()} > ~/.indexify/image_hash", # TODO: Do we still use this in executors?
|
333
|
+
"WORKDIR /app",
|
334
|
+
]
|
335
|
+
|
336
|
+
for build_op in image._build_ops:
|
337
|
+
docker_contents.append(build_op.render())
|
338
|
+
|
339
|
+
if python_sdk_path is not None:
|
340
|
+
print(f"Building image {image._image_name} with local version of the SDK")
|
341
|
+
|
342
|
+
if not os.path.exists(python_sdk_path):
|
343
|
+
print(f"error: {python_sdk_path} does not exist")
|
344
|
+
os.exit(1)
|
345
|
+
docker_contents.append(f"COPY {python_sdk_path} /app/python-sdk")
|
346
|
+
docker_contents.append("RUN (cd /app/python-sdk && pip install .)")
|
347
|
+
else:
|
348
|
+
docker_contents.append(
|
349
|
+
f"RUN pip install indexify=={importlib.metadata.version('indexify')}"
|
350
|
+
)
|
351
|
+
|
352
|
+
docker_file = "\n".join(docker_contents)
|
353
|
+
return docker_file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/function_executor.py
RENAMED
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/function_executor_state.py
RENAMED
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/executor/function_executor/invocation_state_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/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.2 → indexify-0.3.3}/src/indexify/function_executor/handlers/run_function/handler.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/initialize_request_validator.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor.proto
RENAMED
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2.py
RENAMED
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2.pyi
RENAMED
File without changes
|
{indexify-0.3.2 → indexify-0.3.3}/src/indexify/function_executor/proto/function_executor_pb2_grpc.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|