indexify 0.3.8__py3-none-any.whl → 0.3.9__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.
indexify/cli/cli.py CHANGED
@@ -158,25 +158,6 @@ def build_image(
158
158
  _create_image(obj, python_sdk_path)
159
159
 
160
160
 
161
- @app.command(help="Build default image for indexify")
162
- def build_default_image(
163
- python_version: Optional[str] = typer.Option(
164
- f"{sys.version_info.major}.{sys.version_info.minor}",
165
- help="Python version to use in the base image",
166
- )
167
- ):
168
- image = GetDefaultPythonImage(python_version)
169
-
170
- _build_image(image=image)
171
-
172
- console.print(
173
- Text(f"Built default indexify image with hash {image.hash()}\n", style="cyan"),
174
- Text(
175
- f"Don't forget to update your executors to run this image!", style="yellow"
176
- ),
177
- )
178
-
179
-
180
161
  @app.command(
181
162
  help="Runs Executor that connects to the Indexify server and starts running its tasks"
182
163
  )
@@ -307,57 +288,7 @@ def _create_image(image: Image, python_sdk_path):
307
288
 
308
289
 
309
290
  def _build_image(image: Image, python_sdk_path: Optional[str] = None):
310
- docker_file = _generate_dockerfile(image, python_sdk_path=python_sdk_path)
311
- image_name = f"{image._image_name}:{image._tag}"
312
-
313
- # low_level_client = docker.APIClient(base_url=docker_client.api.base_url)
314
- docker_host = os.getenv("DOCKER_HOST", "unix:///var/run/docker.sock")
315
- low_level_client = docker.APIClient(base_url=docker_host)
316
- docker.api.build.process_dockerfile = lambda dockerfile, path: (
317
- "Dockerfile",
318
- dockerfile,
319
- )
320
- generator = low_level_client.build(
321
- dockerfile=docker_file,
322
- rm=True,
323
- path=".",
324
- tag=image_name,
325
- )
326
-
291
+ built_image, generator = image.build(python_sdk_path=python_sdk_path)
327
292
  for output in generator:
328
- for line in output.decode().splitlines():
329
- json_line = json.loads(line)
330
- if "stream" in json_line:
331
- print(json_line["stream"], end="")
332
-
333
- elif "errorDetail" in json_line:
334
- print(json_line["errorDetail"]["message"])
335
-
336
-
337
- def _generate_dockerfile(image, python_sdk_path: Optional[str] = None):
338
- docker_contents = [
339
- f"FROM {image._base_image}",
340
- "RUN mkdir -p ~/.indexify",
341
- f"RUN echo {image._image_name} > ~/.indexify/image_name", # TODO: Do we still use this in executors?
342
- f"RUN echo {image.hash()} > ~/.indexify/image_hash", # TODO: Do we still use this in executors?
343
- "WORKDIR /app",
344
- ]
345
-
346
- for build_op in image._build_ops:
347
- docker_contents.append(build_op.render())
348
-
349
- if python_sdk_path is not None:
350
- print(f"Building image {image._image_name} with local version of the SDK")
351
-
352
- if not os.path.exists(python_sdk_path):
353
- print(f"error: {python_sdk_path} does not exist")
354
- os.exit(1)
355
- docker_contents.append(f"COPY {python_sdk_path} /app/python-sdk")
356
- docker_contents.append("RUN (cd /app/python-sdk && pip install .)")
357
- else:
358
- docker_contents.append(
359
- f"RUN pip install indexify=={importlib.metadata.version('indexify')}"
360
- )
361
-
362
- docker_file = "\n".join(docker_contents)
363
- return docker_file
293
+ print(output)
294
+ print(f"built image: {built_image.tags[0]}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: indexify
3
- Version: 0.3.8
3
+ Version: 0.3.9
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
@@ -1,4 +1,4 @@
1
- indexify/cli/cli.py,sha256=Um413vABP7i-UgH5-AUgt0O5oO2n13os_VdzE9JD4Vg,11972
1
+ indexify/cli/cli.py,sha256=Pk7DwzoaMfHyF-M8CoorBB1iCDUl6Gsh_kf4Dc7SLsM,9551
2
2
  indexify/executor/README.md,sha256=ozC6_hMkhQQNVCMEpBxwiUALz6lwErPQxNxQfQDqnG4,2029
3
3
  indexify/executor/api_objects.py,sha256=k5tKYxaWml0sSECoEDzamCYeJnlD7zO2M7E_qGwyMrg,1032
4
4
  indexify/executor/downloader.py,sha256=a4f7M_Npfvy5Y-XLqmrPRUdPYvonl4qbK0dDw3EvpZ8,6460
@@ -19,7 +19,7 @@ indexify/executor/runtime_probes.py,sha256=bo6Dq6AGZpJH099j0DHtVSDEH80tv3j9MXf3V
19
19
  indexify/executor/task_fetcher.py,sha256=hng1moUwRl4bUMwKum8eGgcAd9djU5PJqHT9hxFnhtU,2912
20
20
  indexify/executor/task_reporter.py,sha256=7VgHA5W1He9Ur0s1bPgXKP75GWhtnIMoUz3_HRPpajE,6882
21
21
  indexify/executor/task_runner.py,sha256=w_om0LloMd5cV-K4NrMOJai0vjP7ebsjVEwvP-jDGgg,5500
22
- indexify-0.3.8.dist-info/METADATA,sha256=Zty_YeCUe6inMfaSoABWn_2CDqBvb5tKLBSK1F4_SVA,1334
23
- indexify-0.3.8.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
24
- indexify-0.3.8.dist-info/entry_points.txt,sha256=GU9wmsgvN7nQw3N2X0PMYn1RSvF6CrhH9RuC2D8d3Gk,53
25
- indexify-0.3.8.dist-info/RECORD,,
22
+ indexify-0.3.9.dist-info/METADATA,sha256=2WZDAjnyCJ7imbyvM9fS3MV2hxQ8_3eCDhdZ_3ehKkM,1334
23
+ indexify-0.3.9.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
24
+ indexify-0.3.9.dist-info/entry_points.txt,sha256=GU9wmsgvN7nQw3N2X0PMYn1RSvF6CrhH9RuC2D8d3Gk,53
25
+ indexify-0.3.9.dist-info/RECORD,,