Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions examples/07_stackoverflow_tables_oltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2167,21 +2167,19 @@ def run_in_docker(args):
if args.db == "postgresql":
packages.append("psycopg[binary]")

packages_str = " ".join(packages)

inner_cmd_parts = []
python_cmd = "python"
if args.db == "postgresql":
inner_cmd_parts.append(
"apt-get update && apt-get install -y postgresql python3 python3-venv && rm -rf /var/lib/apt/lists/*"
"apt-get update && apt-get install -y postgresql python3 && rm -rf /var/lib/apt/lists/*"
)
python_cmd = "python3"
inner_cmd_parts.append(f"{python_cmd} -m venv /tmp/bench-venv")
inner_cmd_parts.append(". /tmp/bench-venv/bin/activate")
inner_cmd_parts.extend(uv_bootstrap_commands(python_cmd))
inner_cmd_parts.append(f"uv pip install {packages_str}")
uv_run_cmd = "uv run --no-project " + " ".join(
f'--with "{package}"' for package in packages
)
if arcadedb_wheel_mount_path is not None:
inner_cmd_parts.append(f'uv pip install "{arcadedb_wheel_mount_path}"')
uv_run_cmd += f' --with "{arcadedb_wheel_mount_path}"'
inner_cmd_parts.append("echo 'Starting benchmark...'")
if args.db == "postgresql":
db_name = build_benchmark_db_name(
Expand All @@ -2192,15 +2190,15 @@ def run_in_docker(args):
)
inner_cmd_parts.append(
"status=0; "
f"{python_cmd} -u 07_stackoverflow_tables_oltp.py {' '.join(filtered_args)} "
f"{uv_run_cmd} python -u 07_stackoverflow_tables_oltp.py {' '.join(filtered_args)} "
"|| status=$?; "
"chown -R $HOST_UID:$HOST_GID "
f"/workspace/examples/my_test_databases/{db_name} || true; "
"exit $status"
)
else:
inner_cmd_parts.append(
f"{python_cmd} -u 07_stackoverflow_tables_oltp.py {' '.join(filtered_args)}"
f"{uv_run_cmd} python -u 07_stackoverflow_tables_oltp.py {' '.join(filtered_args)}"
)

inner_cmd = " && ".join(inner_cmd_parts)
Expand Down
13 changes: 6 additions & 7 deletions examples/08_stackoverflow_tables_olap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1467,24 +1467,23 @@ def run_in_docker(args):
packages.append("duckdb")
if args.db == "postgresql":
packages.append("psycopg[binary]")
packages_str = " ".join(packages)

inner_cmd_parts = []
python_cmd = "python"
if args.db == "postgresql":
inner_cmd_parts.append(
"apt-get update && apt-get install -y postgresql python3 python3-venv && rm -rf /var/lib/apt/lists/*"
"apt-get update && apt-get install -y postgresql python3 && rm -rf /var/lib/apt/lists/*"
)
python_cmd = "python3"
inner_cmd_parts.append(f"{python_cmd} -m venv /tmp/bench-venv")
inner_cmd_parts.append(". /tmp/bench-venv/bin/activate")
inner_cmd_parts.extend(uv_bootstrap_commands(python_cmd))
inner_cmd_parts.append(f"uv pip install {packages_str}")
uv_run_cmd = "uv run --no-project " + " ".join(
f'--with "{package}"' for package in packages
)
if arcadedb_wheel_mount_path is not None:
inner_cmd_parts.append(f'uv pip install "{arcadedb_wheel_mount_path}"')
uv_run_cmd += f' --with "{arcadedb_wheel_mount_path}"'
inner_cmd_parts.append("echo 'Starting benchmark...'")
inner_cmd_parts.append(
f"{python_cmd} -u 08_stackoverflow_tables_olap.py {' '.join(filtered_args)}"
f"{uv_run_cmd} python -u 08_stackoverflow_tables_olap.py {' '.join(filtered_args)}"
)
if args.db == "postgresql":
db_name = build_benchmark_db_name(
Expand Down
20 changes: 9 additions & 11 deletions examples/09_stackoverflow_graph_oltp.py
Original file line number Diff line number Diff line change
Expand Up @@ -9766,12 +9766,12 @@ def run_in_docker(args) -> bool:
"apt-get update",
"DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends docker-cli",
"rm -rf /var/lib/apt/lists/*",
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install lxml neo4j",
"echo 'Starting benchmark...'",
f"python -u 09_stackoverflow_graph_oltp.py {' '.join(filtered_args)}",
(
"uv run --no-project --with lxml --with neo4j "
f"python -u 09_stackoverflow_graph_oltp.py {' '.join(filtered_args)}"
),
]
if host_uid is not None and host_gid is not None:
inner_cmd_parts.insert(
Expand All @@ -9796,19 +9796,17 @@ def run_in_docker(args) -> bool:
if args.db == "duckdb":
packages.append("duckdb")

packages_str = " ".join(packages)

inner_cmd_parts = []
python_cmd = "python"
inner_cmd_parts.append(f"{python_cmd} -m venv /tmp/bench-venv")
inner_cmd_parts.append(". /tmp/bench-venv/bin/activate")
inner_cmd_parts.extend(uv_bootstrap_commands(python_cmd))
inner_cmd_parts.append(f"uv pip install {packages_str}")
uv_run_cmd = "uv run --no-project " + " ".join(
f'--with "{package}"' for package in packages
)
if arcadedb_wheel_mount_path is not None:
inner_cmd_parts.append(f'uv pip install "{arcadedb_wheel_mount_path}"')
uv_run_cmd += f' --with "{arcadedb_wheel_mount_path}"'
inner_cmd_parts.append("echo 'Starting benchmark...'")
inner_cmd_parts.append(
f"{python_cmd} -u 09_stackoverflow_graph_oltp.py {' '.join(filtered_args)}"
f"{uv_run_cmd} python -u 09_stackoverflow_graph_oltp.py {' '.join(filtered_args)}"
)

inner_cmd = " && ".join(inner_cmd_parts)
Expand Down
20 changes: 9 additions & 11 deletions examples/10_stackoverflow_graph_olap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6539,12 +6539,12 @@ def run_in_docker(args) -> bool:
"apt-get update",
"DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends docker-cli",
"rm -rf /var/lib/apt/lists/*",
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install lxml neo4j",
"echo 'Starting benchmark...'",
f"python -u 10_stackoverflow_graph_olap.py {' '.join(filtered_args)}",
(
"uv run --no-project --with lxml --with neo4j "
f"python -u 10_stackoverflow_graph_olap.py {' '.join(filtered_args)}"
),
]
if host_uid is not None and host_gid is not None:
inner_cmd_parts.insert(
Expand All @@ -6569,19 +6569,17 @@ def run_in_docker(args) -> bool:
if args.db == "duckdb":
packages.append("duckdb")

packages_str = " ".join(packages)

inner_cmd_parts = []
python_cmd = "python"
inner_cmd_parts.append(f"{python_cmd} -m venv /tmp/bench-venv")
inner_cmd_parts.append(". /tmp/bench-venv/bin/activate")
inner_cmd_parts.extend(uv_bootstrap_commands(python_cmd))
inner_cmd_parts.append(f"uv pip install {packages_str}")
uv_run_cmd = "uv run --no-project " + " ".join(
f'--with "{package}"' for package in packages
)
if arcadedb_wheel_mount_path is not None:
inner_cmd_parts.append(f'uv pip install "{arcadedb_wheel_mount_path}"')
uv_run_cmd += f' --with "{arcadedb_wheel_mount_path}"'
inner_cmd_parts.append("echo 'Starting benchmark...'")
inner_cmd_parts.append(
f"{python_cmd} -u 10_stackoverflow_graph_olap.py {' '.join(filtered_args)}"
f"{uv_run_cmd} python -u 10_stackoverflow_graph_olap.py {' '.join(filtered_args)}"
)

inner_cmd = " && ".join(inner_cmd_parts)
Expand Down
69 changes: 36 additions & 33 deletions examples/11_vector_index_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
docker-compose \\
&& rm -rf /var/lib/apt/lists/*

RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh \
&& uv pip install --system numpy pymilvus psutil
RUN curl -LsSf https://astral.sh/uv/install.sh | env UV_INSTALL_DIR=/usr/local/bin sh
"""


Expand Down Expand Up @@ -1553,7 +1552,7 @@ def resolve_arcadedb_heap_size(


def ensure_milvus_runner_image(docker_bin: str) -> str:
image_tag = "arcadedb-milvus-bench-runner:py312-v1"
image_tag = "arcadedb-milvus-bench-runner:py312-v2"
inspect = subprocess.run(
[docker_bin, "image", "inspect", image_tag],
stdout=subprocess.DEVNULL,
Expand Down Expand Up @@ -1708,37 +1707,37 @@ def run_in_docker(args) -> bool:
if args.backend == "arcadedb_sql":
inner_cmd = " && ".join(
[
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install numpy psutil",
f'uv pip install "{arcadedb_wheel_mount_path}"',
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with numpy --with psutil "
f'--with "{arcadedb_wheel_mount_path}" '
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
run_user_args = ["-u", user_spec] if user_spec is not None else []
elif args.backend == "faiss":
inner_cmd = " && ".join(
[
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install faiss-cpu numpy psutil",
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with faiss-cpu --with numpy --with psutil "
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
run_user_args = ["-u", user_spec] if user_spec is not None else []
elif args.backend == "lancedb":
inner_cmd = " && ".join(
[
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install lancedb numpy psutil",
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with lancedb --with numpy --with psutil "
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
run_user_args = ["-u", user_spec] if user_spec is not None else []
Expand All @@ -1748,12 +1747,12 @@ def run_in_docker(args) -> bool:
"apt-get update",
"apt-get install -y --no-install-recommends docker.io docker-cli",
"rm -rf /var/lib/apt/lists/*",
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install numpy qdrant-client psutil",
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with numpy --with qdrant-client --with psutil "
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
run_user_args = []
Expand All @@ -1763,21 +1762,25 @@ def run_in_docker(args) -> bool:
inner_cmd = " && ".join(
[
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with numpy --with pymilvus "
"--with psutil "
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
else:
inner_cmd = " && ".join(
[
"apt-get update",
"apt-get install -y --no-install-recommends python3 python3-venv docker.io docker-cli docker-compose",
"apt-get install -y --no-install-recommends python3 ca-certificates docker.io docker-cli docker-compose",
"rm -rf /var/lib/apt/lists/*",
"python -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install numpy pymilvus psutil",
*uv_bootstrap_commands("python3"),
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
"uv run --no-project --with numpy --with pymilvus --with psutil "
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
run_user_args = []
Expand All @@ -1787,20 +1790,20 @@ def run_in_docker(args) -> bool:
bench_user = "benchusr"
user_inner_cmd = " && ".join(
[
"python3 -m venv /tmp/bench-venv",
". /tmp/bench-venv/bin/activate",
*uv_bootstrap_commands("python"),
"uv pip install numpy psycopg[binary] psutil",
*uv_bootstrap_commands("python3"),
"echo 'Starting vector build benchmark...'",
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}",
(
'uv run --no-project --with numpy --with "psycopg[binary]" --with psutil '
f"python -u 11_vector_index_build.py {' '.join(filtered_args)}"
),
]
)
inner_cmd = " && ".join(
[
"apt-get update",
(
"apt-get install -y --no-install-recommends "
"python3 python3-venv gosu"
"python3 ca-certificates gosu"
),
"rm -rf /var/lib/apt/lists/*",
(
Expand Down
Loading
Loading