Skip to content

Commit 638876b

Browse files
committed
add shell and python scripts directories, add update stability test
1 parent 327c283 commit 638876b

File tree

7 files changed

+61
-1
lines changed

7 files changed

+61
-1
lines changed

benchmarker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
FROM golang:alpine
2-
RUN apk add --no-cache hdf5-dev gcc libc-dev python3
2+
RUN apk add --no-cache hdf5-dev gcc libc-dev python3 bash
33
WORKDIR /app
44
COPY . .
55
RUN CGO_ENABLED=1 go build -o benchmarker .
File renamed without changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import os
2+
import glob
3+
import json
4+
import unittest
5+
6+
7+
PATH = "./results"
8+
REQUIRED_RECALL = .992
9+
10+
11+
class TestResults(unittest.TestCase):
12+
13+
def setUp(self):
14+
self.datapoints = []
15+
16+
for result_filename in glob.glob(os.path.join(PATH, "*.json")):
17+
with open(os.path.join(os.getcwd(), result_filename), "r") as result_file:
18+
self.datapoints.append(json.load(result_file))
19+
20+
def test_max_recall(self):
21+
22+
rr_env = os.getenv("REQUIRED_RECALL")
23+
24+
if rr_env:
25+
required_recall = float(rr_env)
26+
else:
27+
required_recall = REQUIRED_RECALL
28+
29+
for run_iteration in self.datapoints:
30+
31+
max_recall = max([run_config["recall"] for run_config in run_iteration])
32+
self.assertTrue(
33+
max_recall >= required_recall,
34+
f"need to achieve at least {required_recall} recall, got only {max_recall}",
35+
)
36+
37+
38+
if __name__ == "__main__":
39+
unittest.main()
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
set -eou pipefail
4+
5+
echo "Run benchmark script"
6+
/app/benchmarker ann-benchmark \
7+
-v /app/datasets/${DATASET}.hdf5 \
8+
--distance $DISTANCE \
9+
--indexType $INDEX_TYPE \
10+
--updatePercentage $UPDATE_PERCENTAGE \
11+
--cleanupIntervalSeconds $CLEANUP_INTERVAL_SECONDS \
12+
--updateIterations $UPDATE_ITERATIONS \
13+
--grpcOrigin "${WEAVIATE_URL}:50051" \
14+
--httpOrigin "${WEAVIATE_URL}:8080" \
15+
--updateRandomized
16+
17+
18+
echo "Run complete, now analyze the results"
19+
python3 /app/scripts/python/update_stability.py
20+
21+
echo "Passed!"

0 commit comments

Comments
 (0)