redisbench-admin 0.11.64__py3-none-any.whl → 0.11.66__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.
Files changed (134) hide show
  1. redisbench_admin/run/ann/pkg/.dockerignore +2 -0
  2. redisbench_admin/run/ann/pkg/.git +1 -0
  3. redisbench_admin/run/ann/pkg/.github/workflows/benchmarks.yml +100 -0
  4. redisbench_admin/run/ann/pkg/.gitignore +21 -0
  5. redisbench_admin/run/ann/pkg/LICENSE +21 -0
  6. redisbench_admin/run/ann/pkg/README.md +157 -0
  7. redisbench_admin/run/ann/pkg/algos.yaml +1294 -0
  8. redisbench_admin/run/ann/pkg/algosP.yaml +67 -0
  9. redisbench_admin/run/ann/pkg/ann_benchmarks/__init__.py +2 -0
  10. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/__init__.py +0 -0
  11. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/annoy.py +26 -0
  12. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/balltree.py +22 -0
  13. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/base.py +36 -0
  14. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/bruteforce.py +110 -0
  15. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/ckdtree.py +17 -0
  16. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/datasketch.py +29 -0
  17. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/definitions.py +187 -0
  18. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/diskann.py +190 -0
  19. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dolphinnpy.py +31 -0
  20. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/dummy_algo.py +25 -0
  21. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elasticsearch.py +107 -0
  22. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/elastiknn.py +124 -0
  23. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss.py +124 -0
  24. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_gpu.py +61 -0
  25. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/faiss_hnsw.py +39 -0
  26. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/flann.py +27 -0
  27. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/hnswlib.py +36 -0
  28. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kdtree.py +22 -0
  29. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/kgraph.py +39 -0
  30. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/lshf.py +25 -0
  31. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/milvus.py +99 -0
  32. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/mrpt.py +41 -0
  33. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/n2.py +28 -0
  34. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nearpy.py +48 -0
  35. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/nmslib.py +74 -0
  36. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/onng_ngt.py +100 -0
  37. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/opensearchknn.py +107 -0
  38. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/panng_ngt.py +79 -0
  39. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pinecone.py +39 -0
  40. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/puffinn.py +45 -0
  41. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/pynndescent.py +115 -0
  42. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/qg_ngt.py +102 -0
  43. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/redisearch.py +90 -0
  44. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/rpforest.py +20 -0
  45. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/scann.py +34 -0
  46. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/sptag.py +28 -0
  47. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/subprocess.py +246 -0
  48. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vald.py +149 -0
  49. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vecsim-hnsw.py +43 -0
  50. redisbench_admin/run/ann/pkg/ann_benchmarks/algorithms/vespa.py +47 -0
  51. redisbench_admin/run/ann/pkg/ann_benchmarks/constants.py +1 -0
  52. redisbench_admin/run/ann/pkg/ann_benchmarks/data.py +48 -0
  53. redisbench_admin/run/ann/pkg/ann_benchmarks/datasets.py +620 -0
  54. redisbench_admin/run/ann/pkg/ann_benchmarks/distance.py +53 -0
  55. redisbench_admin/run/ann/pkg/ann_benchmarks/main.py +325 -0
  56. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/__init__.py +2 -0
  57. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/metrics.py +183 -0
  58. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/plot_variants.py +17 -0
  59. redisbench_admin/run/ann/pkg/ann_benchmarks/plotting/utils.py +165 -0
  60. redisbench_admin/run/ann/pkg/ann_benchmarks/results.py +71 -0
  61. redisbench_admin/run/ann/pkg/ann_benchmarks/runner.py +333 -0
  62. redisbench_admin/run/ann/pkg/create_dataset.py +12 -0
  63. redisbench_admin/run/ann/pkg/create_hybrid_dataset.py +147 -0
  64. redisbench_admin/run/ann/pkg/create_text_to_image_ds.py +117 -0
  65. redisbench_admin/run/ann/pkg/create_website.py +272 -0
  66. redisbench_admin/run/ann/pkg/install/Dockerfile +11 -0
  67. redisbench_admin/run/ann/pkg/install/Dockerfile.annoy +5 -0
  68. redisbench_admin/run/ann/pkg/install/Dockerfile.datasketch +4 -0
  69. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann +29 -0
  70. redisbench_admin/run/ann/pkg/install/Dockerfile.diskann_pq +31 -0
  71. redisbench_admin/run/ann/pkg/install/Dockerfile.dolphinn +5 -0
  72. redisbench_admin/run/ann/pkg/install/Dockerfile.elasticsearch +45 -0
  73. redisbench_admin/run/ann/pkg/install/Dockerfile.elastiknn +61 -0
  74. redisbench_admin/run/ann/pkg/install/Dockerfile.faiss +18 -0
  75. redisbench_admin/run/ann/pkg/install/Dockerfile.flann +10 -0
  76. redisbench_admin/run/ann/pkg/install/Dockerfile.hnswlib +10 -0
  77. redisbench_admin/run/ann/pkg/install/Dockerfile.kgraph +6 -0
  78. redisbench_admin/run/ann/pkg/install/Dockerfile.mih +4 -0
  79. redisbench_admin/run/ann/pkg/install/Dockerfile.milvus +27 -0
  80. redisbench_admin/run/ann/pkg/install/Dockerfile.mrpt +4 -0
  81. redisbench_admin/run/ann/pkg/install/Dockerfile.n2 +5 -0
  82. redisbench_admin/run/ann/pkg/install/Dockerfile.nearpy +5 -0
  83. redisbench_admin/run/ann/pkg/install/Dockerfile.ngt +13 -0
  84. redisbench_admin/run/ann/pkg/install/Dockerfile.nmslib +10 -0
  85. redisbench_admin/run/ann/pkg/install/Dockerfile.opensearchknn +43 -0
  86. redisbench_admin/run/ann/pkg/install/Dockerfile.puffinn +6 -0
  87. redisbench_admin/run/ann/pkg/install/Dockerfile.pynndescent +4 -0
  88. redisbench_admin/run/ann/pkg/install/Dockerfile.redisearch +18 -0
  89. redisbench_admin/run/ann/pkg/install/Dockerfile.rpforest +5 -0
  90. redisbench_admin/run/ann/pkg/install/Dockerfile.scann +5 -0
  91. redisbench_admin/run/ann/pkg/install/Dockerfile.scipy +4 -0
  92. redisbench_admin/run/ann/pkg/install/Dockerfile.sklearn +4 -0
  93. redisbench_admin/run/ann/pkg/install/Dockerfile.sptag +30 -0
  94. redisbench_admin/run/ann/pkg/install/Dockerfile.vald +8 -0
  95. redisbench_admin/run/ann/pkg/install/Dockerfile.vespa +17 -0
  96. redisbench_admin/run/ann/pkg/install.py +70 -0
  97. redisbench_admin/run/ann/pkg/logging.conf +34 -0
  98. redisbench_admin/run/ann/pkg/multirun.py +298 -0
  99. redisbench_admin/run/ann/pkg/plot.py +159 -0
  100. redisbench_admin/run/ann/pkg/protocol/bf-runner +10 -0
  101. redisbench_admin/run/ann/pkg/protocol/bf-runner.py +204 -0
  102. redisbench_admin/run/ann/pkg/protocol/ext-add-query-metric.md +51 -0
  103. redisbench_admin/run/ann/pkg/protocol/ext-batch-queries.md +77 -0
  104. redisbench_admin/run/ann/pkg/protocol/ext-prepared-queries.md +77 -0
  105. redisbench_admin/run/ann/pkg/protocol/ext-query-parameters.md +47 -0
  106. redisbench_admin/run/ann/pkg/protocol/specification.md +194 -0
  107. redisbench_admin/run/ann/pkg/requirements.txt +14 -0
  108. redisbench_admin/run/ann/pkg/requirements_py38.txt +11 -0
  109. redisbench_admin/run/ann/pkg/results/fashion-mnist-784-euclidean.png +0 -0
  110. redisbench_admin/run/ann/pkg/results/gist-960-euclidean.png +0 -0
  111. redisbench_admin/run/ann/pkg/results/glove-100-angular.png +0 -0
  112. redisbench_admin/run/ann/pkg/results/glove-25-angular.png +0 -0
  113. redisbench_admin/run/ann/pkg/results/lastfm-64-dot.png +0 -0
  114. redisbench_admin/run/ann/pkg/results/mnist-784-euclidean.png +0 -0
  115. redisbench_admin/run/ann/pkg/results/nytimes-256-angular.png +0 -0
  116. redisbench_admin/run/ann/pkg/results/sift-128-euclidean.png +0 -0
  117. redisbench_admin/run/ann/pkg/run.py +12 -0
  118. redisbench_admin/run/ann/pkg/run_algorithm.py +3 -0
  119. redisbench_admin/run/ann/pkg/templates/chartjs.template +102 -0
  120. redisbench_admin/run/ann/pkg/templates/detail_page.html +23 -0
  121. redisbench_admin/run/ann/pkg/templates/general.html +58 -0
  122. redisbench_admin/run/ann/pkg/templates/latex.template +30 -0
  123. redisbench_admin/run/ann/pkg/templates/summary.html +60 -0
  124. redisbench_admin/run/ann/pkg/test/__init__.py +0 -0
  125. redisbench_admin/run/ann/pkg/test/test-jaccard.py +19 -0
  126. redisbench_admin/run/ann/pkg/test/test-metrics.py +99 -0
  127. redisbench_admin/run/args.py +2 -1
  128. redisbench_admin/run_remote/run_remote.py +1 -1
  129. {redisbench_admin-0.11.64.dist-info → redisbench_admin-0.11.66.dist-info}/METADATA +2 -5
  130. redisbench_admin-0.11.66.dist-info/RECORD +243 -0
  131. {redisbench_admin-0.11.64.dist-info → redisbench_admin-0.11.66.dist-info}/WHEEL +1 -1
  132. redisbench_admin-0.11.64.dist-info/RECORD +0 -117
  133. {redisbench_admin-0.11.64.dist-info/licenses → redisbench_admin-0.11.66.dist-info}/LICENSE +0 -0
  134. {redisbench_admin-0.11.64.dist-info → redisbench_admin-0.11.66.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,272 @@
1
+ import matplotlib as mpl
2
+ mpl.use('Agg') # noqa
3
+ import argparse
4
+ import os
5
+ import json
6
+ import pickle
7
+ import yaml
8
+ import numpy
9
+ import hashlib
10
+ from jinja2 import Environment, FileSystemLoader
11
+
12
+ from ann_benchmarks import results
13
+ from ann_benchmarks.datasets import get_dataset
14
+ from ann_benchmarks.plotting.plot_variants import (all_plot_variants
15
+ as plot_variants)
16
+ from ann_benchmarks.plotting.metrics import all_metrics as metrics
17
+ from ann_benchmarks.plotting.utils import (get_plot_label, compute_metrics,
18
+ compute_all_metrics,
19
+ create_pointset,
20
+ create_linestyles)
21
+ import plot
22
+
23
+ colors = [
24
+ "rgba(166,206,227,1)",
25
+ "rgba(31,120,180,1)",
26
+ "rgba(178,223,138,1)",
27
+ "rgba(51,160,44,1)",
28
+ "rgba(251,154,153,1)",
29
+ "rgba(227,26,28,1)",
30
+ "rgba(253,191,111,1)",
31
+ "rgba(255,127,0,1)",
32
+ "rgba(202,178,214,1)"
33
+ ]
34
+
35
+ point_styles = {
36
+ "o": "circle",
37
+ "<": "triangle",
38
+ "*": "star",
39
+ "x": "cross",
40
+ "+": "rect",
41
+ }
42
+
43
+
44
+ def convert_color(color):
45
+ r, g, b, a = color
46
+ return "rgba(%(r)d, %(g)d, %(b)d, %(a)d)" % {
47
+ "r": r * 255, "g": g * 255, "b": b * 255, "a": a}
48
+
49
+
50
+ def convert_linestyle(ls):
51
+ new_ls = {}
52
+ for algo in ls.keys():
53
+ algostyle = ls[algo]
54
+ new_ls[algo] = (convert_color(algostyle[0]),
55
+ convert_color(algostyle[1]),
56
+ algostyle[2], point_styles[algostyle[3]])
57
+ return new_ls
58
+
59
+
60
+ def get_run_desc(properties):
61
+ return "%(dataset)s_%(count)d_%(distance)s" % properties
62
+
63
+
64
+ def get_dataset_from_desc(desc):
65
+ return desc.split("_")[0]
66
+
67
+
68
+ def get_count_from_desc(desc):
69
+ return desc.split("_")[1]
70
+
71
+
72
+ def get_distance_from_desc(desc):
73
+ return desc.split("_")[2]
74
+
75
+
76
+ def get_dataset_label(desc):
77
+ return "{} (k = {})".format(get_dataset_from_desc(desc),
78
+ get_count_from_desc(desc))
79
+
80
+
81
+ def directory_path(s):
82
+ if not os.path.isdir(s):
83
+ raise argparse.ArgumentTypeError("'%s' is not a directory" % s)
84
+ return s + "/"
85
+
86
+
87
+ def prepare_data(data, xn, yn):
88
+ """Change format from (algo, instance, dict) to (algo, instance, x, y)."""
89
+ res = []
90
+ for algo, algo_name, result in data:
91
+ res.append((algo, algo_name, result[xn], result[yn]))
92
+ return res
93
+
94
+
95
+ parser = argparse.ArgumentParser()
96
+ parser.add_argument(
97
+ '--plottype',
98
+ help='Generate only the plots specified',
99
+ nargs='*',
100
+ choices=plot_variants.keys(),
101
+ default=plot_variants.keys())
102
+ parser.add_argument(
103
+ '--outputdir',
104
+ help='Select output directory',
105
+ default='.',
106
+ type=directory_path,
107
+ action='store')
108
+ parser.add_argument(
109
+ '--latex',
110
+ help='generates latex code for each plot',
111
+ action='store_true')
112
+ parser.add_argument(
113
+ '--scatter',
114
+ help='create scatterplot for data',
115
+ action='store_true')
116
+ parser.add_argument(
117
+ '--recompute',
118
+ help='Clears the cache and recomputes the metrics',
119
+ action='store_true')
120
+ args = parser.parse_args()
121
+
122
+
123
+ def get_lines(all_data, xn, yn, render_all_points):
124
+ """ For each algorithm run on a dataset, obtain its performance
125
+ curve coords."""
126
+ plot_data = []
127
+ for algo in sorted(all_data.keys(), key=lambda x: x.lower()):
128
+ xs, ys, ls, axs, ays, als = \
129
+ create_pointset(prepare_data(all_data[algo], xn, yn), xn, yn)
130
+ if render_all_points:
131
+ xs, ys, ls = axs, ays, als
132
+ plot_data.append({"name": algo, "coords": zip(xs, ys), "labels": ls,
133
+ "scatter": render_all_points})
134
+ return plot_data
135
+
136
+
137
+ def create_plot(all_data, xn, yn, linestyle, j2_env, additional_label="",
138
+ plottype="line"):
139
+ xm, ym = (metrics[xn], metrics[yn])
140
+ render_all_points = plottype == "bubble"
141
+ plot_data = get_lines(all_data, xn, yn, render_all_points)
142
+ latex_code = j2_env.get_template("latex.template").\
143
+ render(plot_data=plot_data, caption=get_plot_label(xm, ym),
144
+ xlabel=xm["description"], ylabel=ym["description"])
145
+ plot_data = get_lines(all_data, xn, yn, render_all_points)
146
+ button_label = hashlib.sha224((get_plot_label(xm, ym) + additional_label)
147
+ .encode("utf-8")).hexdigest()
148
+ return j2_env.get_template("chartjs.template").\
149
+ render(args=args, latex_code=latex_code, button_label=button_label,
150
+ data_points=plot_data,
151
+ xlabel=xm["description"], ylabel=ym["description"],
152
+ plottype=plottype, plot_label=get_plot_label(xm, ym),
153
+ label=additional_label, linestyle=linestyle,
154
+ render_all_points=render_all_points)
155
+
156
+
157
+ def build_detail_site(data, label_func, j2_env, linestyles, batch=False):
158
+ for (name, runs) in data.items():
159
+ print("Building '%s'" % name)
160
+ all_runs = runs.keys()
161
+ label = label_func(name)
162
+ data = {"normal": [], "scatter": []}
163
+
164
+ for plottype in args.plottype:
165
+ xn, yn = plot_variants[plottype]
166
+ data["normal"].append(create_plot(
167
+ runs, xn, yn, convert_linestyle(linestyles), j2_env))
168
+ if args.scatter:
169
+ data["scatter"].append(
170
+ create_plot(runs, xn, yn, convert_linestyle(linestyles),
171
+ j2_env, "Scatterplot ", "bubble"))
172
+
173
+ # create png plot for summary page
174
+ data_for_plot = {}
175
+ for k in runs.keys():
176
+ data_for_plot[k] = prepare_data(runs[k], 'k-nn', 'qps')
177
+ plot.create_plot(
178
+ data_for_plot, False,
179
+ 'linear', 'log', 'k-nn', 'qps',
180
+ args.outputdir + name + '.png',
181
+ linestyles, batch)
182
+ output_path = \
183
+ args.outputdir + name + '.html'
184
+ with open(output_path, "w") as text_file:
185
+ text_file.write(j2_env.get_template("detail_page.html").
186
+ render(title=label, plot_data=data,
187
+ args=args, batch=batch))
188
+
189
+
190
+ def build_index_site(datasets, algorithms, j2_env, file_name):
191
+ dataset_data = {'batch': [], 'non-batch': []}
192
+ for mode in ['batch', 'non-batch']:
193
+ distance_measures = sorted(
194
+ set([get_distance_from_desc(e) for e in datasets[mode].keys()]))
195
+ sorted_datasets = sorted(
196
+ set([get_dataset_from_desc(e) for e in datasets[mode].keys()]))
197
+
198
+ for dm in distance_measures:
199
+ d = {"name": dm.capitalize(), "entries": []}
200
+ for ds in sorted_datasets:
201
+ matching_datasets = [e for e in datasets[mode].keys()
202
+ if get_dataset_from_desc(e) == ds and # noqa
203
+ get_distance_from_desc(e) == dm]
204
+ sorted_matches = sorted(
205
+ matching_datasets,
206
+ key=lambda e: int(get_count_from_desc(e)))
207
+ for idd in sorted_matches:
208
+ d["entries"].append(
209
+ {"name": idd, "desc": get_dataset_label(idd)})
210
+ dataset_data[mode].append(d)
211
+
212
+ with open(args.outputdir + "index.html", "w") as text_file:
213
+ text_file.write(j2_env.get_template("summary.html").
214
+ render(title="ANN-Benchmarks",
215
+ dataset_with_distances=dataset_data,
216
+ algorithms=algorithms))
217
+
218
+
219
+ def load_all_results():
220
+ """Read all result files and compute all metrics"""
221
+ all_runs_by_dataset = {'batch': {}, 'non-batch': {}}
222
+ all_runs_by_algorithm = {'batch': {}, 'non-batch': {}}
223
+ cached_true_dist = []
224
+ old_sdn = None
225
+ for mode in ["non-batch", "batch"]:
226
+ for properties, f in results.load_all_results(batch_mode=(mode == "batch")):
227
+ sdn = get_run_desc(properties)
228
+ if sdn != old_sdn:
229
+ dataset, _ = get_dataset(properties["dataset"])
230
+ cached_true_dist = list(dataset["distances"])
231
+ old_sdn = sdn
232
+ algo_ds = get_dataset_label(sdn)
233
+ desc_suffix = ("-batch" if mode == "batch" else "")
234
+ algo = properties["algo"] + desc_suffix
235
+ sdn += desc_suffix
236
+ ms = compute_all_metrics(
237
+ cached_true_dist, f, properties, args.recompute)
238
+ all_runs_by_algorithm[mode].setdefault(
239
+ algo, {}).setdefault(algo_ds, []).append(ms)
240
+ all_runs_by_dataset[mode].setdefault(
241
+ sdn, {}).setdefault(algo, []).append(ms)
242
+
243
+ return (all_runs_by_dataset, all_runs_by_algorithm)
244
+
245
+
246
+ j2_env = Environment(loader=FileSystemLoader("./templates/"), trim_blocks=True)
247
+ j2_env.globals.update(zip=zip, len=len)
248
+ runs_by_ds, runs_by_algo = load_all_results()
249
+ dataset_names = [get_dataset_label(x) for x in list(
250
+ runs_by_ds['batch'].keys()) + list(runs_by_ds['non-batch'].keys())]
251
+ algorithm_names = list(runs_by_algo['batch'].keys(
252
+ )) + list(runs_by_algo['non-batch'].keys())
253
+
254
+ linestyles = {**create_linestyles(dataset_names),
255
+ **create_linestyles(algorithm_names)}
256
+
257
+ build_detail_site(
258
+ runs_by_ds['non-batch'],
259
+ lambda label: get_dataset_label(label), j2_env, linestyles, False)
260
+
261
+ build_detail_site(
262
+ runs_by_ds['batch'],
263
+ lambda label: get_dataset_label(label), j2_env, linestyles, True)
264
+
265
+ build_detail_site(
266
+ runs_by_algo['non-batch'],
267
+ lambda x: x, j2_env, linestyles, False)
268
+
269
+ build_detail_site(
270
+ runs_by_algo['batch'], lambda x: x, j2_env, linestyles, True)
271
+
272
+ build_index_site(runs_by_ds, runs_by_algo, j2_env, "index.html")
@@ -0,0 +1,11 @@
1
+ FROM ubuntu:18.04
2
+
3
+ RUN apt-get update
4
+ RUN apt-get install -y python3-numpy python3-scipy python3-pip build-essential git
5
+ RUN pip3 install -U pip
6
+
7
+ WORKDIR /home/app
8
+ COPY requirements.txt run_algorithm.py ./
9
+ RUN pip3 install -r requirements.txt
10
+
11
+ ENTRYPOINT ["python3", "-u", "run_algorithm.py"]
@@ -0,0 +1,5 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN git clone https://github.com/spotify/annoy
4
+ RUN cd annoy && python3 setup.py install
5
+ RUN python3 -c 'import annoy'
@@ -0,0 +1,4 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN pip3 install datasketch
4
+ RUN python3 -c 'import datasketch'
@@ -0,0 +1,29 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update
4
+ RUN apt-get install -y wget git cmake g++ libaio-dev libgoogle-perftools-dev clang-format-4.0 libboost-dev python3 python3-setuptools python3-pip
5
+ RUN pip3 install pybind11 numpy
6
+
7
+ RUN cd /tmp && wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
8
+ RUN cd /tmp && apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
9
+ RUN cd /tmp && rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
10
+ RUN cd /tmp && sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
11
+ RUN apt-get update
12
+ RUN apt-get install -y intel-mkl-64bit-2020.0-088
13
+
14
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so libblas.so-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
15
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so.3 libblas.so.3-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
16
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/liblapack.so liblapack.so-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
17
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/liblapack.so.3 liblapack.so.3-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
18
+
19
+ RUN echo "/opt/intel/lib/intel64" > /etc/ld.so.conf.d/mkl.conf
20
+ RUN echo "/opt/intel/mkl/lib/intel64" >> /etc/ld.so.conf.d/mkl.conf
21
+ RUN ldconfig
22
+ RUN echo "MKL_THREADING_LAYER=GNU" >> /etc/environment
23
+
24
+ RUN git clone --single-branch --branch python_bindings https://github.com/microsoft/diskann
25
+ RUN mkdir -p diskann/build
26
+ RUN cd diskann/build && cmake -DCMAKE_BUILD_TYPE=Release ..
27
+ RUN cd diskann/build && make -j
28
+ RUN cd diskann/python && pip install -e .
29
+ RUN python3 -c 'import vamanapy'
@@ -0,0 +1,31 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update
4
+ RUN apt-get install -y wget git cmake g++ libaio-dev libgoogle-perftools-dev clang-format-4.0 libboost-dev python3 python3-setuptools python3-pip
5
+ RUN pip3 install pybind11 numpy
6
+
7
+ RUN cd /tmp && wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
8
+ RUN cd /tmp && apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
9
+ RUN cd /tmp && rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB
10
+ RUN cd /tmp && sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
11
+ RUN apt-get update
12
+ RUN apt-get install -y intel-mkl-64bit-2020.0-088
13
+
14
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so libblas.so-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
15
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/libblas.so.3 libblas.so.3-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
16
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/liblapack.so liblapack.so-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
17
+ RUN update-alternatives --install /usr/lib/x86_64-linux-gnu/liblapack.so.3 liblapack.so.3-x86_64-linux-gnu /opt/intel/mkl/lib/intel64/libmkl_rt.so 150
18
+
19
+ RUN echo "/opt/intel/lib/intel64" > /etc/ld.so.conf.d/mkl.conf
20
+ RUN echo "/opt/intel/mkl/lib/intel64" >> /etc/ld.so.conf.d/mkl.conf
21
+ RUN ldconfig
22
+ RUN echo "MKL_THREADING_LAYER=GNU" >> /etc/environment
23
+ RUN export LD_LIBRARY_PATH="$PATH:/opt/intel/compilers_and_libraries/linux/lib/intel64"
24
+ RUN export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/"
25
+
26
+ RUN git clone --single-branch --branch python_bindings_quantized https://github.com/microsoft/diskann
27
+ RUN mkdir -p diskann/build
28
+ RUN cd diskann/build && cmake -DCMAKE_BUILD_TYPE=Release ..
29
+ RUN cd diskann/build && make -j
30
+ RUN cd diskann/python && pip install -e .
31
+ RUN python3 -c 'import vamanapy'
@@ -0,0 +1,5 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN git clone https://github.com/ipsarros/DolphinnPy lib-dolphinnpy
4
+ ENV PYTHONPATH lib-dolphinnpy
5
+ RUN python3 -c 'import dolphinn'
@@ -0,0 +1,45 @@
1
+ FROM ann-benchmarks
2
+
3
+ WORKDIR /home/app
4
+
5
+ # Install elasticsearch.
6
+ ENV DEBIAN_FRONTEND noninteractive
7
+ RUN apt install -y wget curl htop
8
+ RUN wget --quiet https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.2-amd64.deb \
9
+ && dpkg -i elasticsearch-7.9.2-amd64.deb \
10
+ && rm elasticsearch-7.9.2-amd64.deb
11
+
12
+ # Install python client.
13
+ RUN python3 -m pip install --upgrade elasticsearch==7.9.1
14
+
15
+ # Configure elasticsearch and JVM for single-node, single-core.
16
+ RUN echo '\
17
+ discovery.type: single-node\n\
18
+ network.host: 0.0.0.0\n\
19
+ node.master: true\n\
20
+ node.data: true\n\
21
+ node.processors: 1\n\
22
+ thread_pool.write.size: 1\n\
23
+ thread_pool.search.size: 1\n\
24
+ thread_pool.search.queue_size: 1\n\
25
+ path.data: /var/lib/elasticsearch\n\
26
+ path.logs: /var/log/elasticsearch\n\
27
+ ' > /etc/elasticsearch/elasticsearch.yml
28
+
29
+ RUN echo '\
30
+ -Xms3G\n\
31
+ -Xmx3G\n\
32
+ -XX:+UseG1GC\n\
33
+ -XX:G1ReservePercent=25\n\
34
+ -XX:InitiatingHeapOccupancyPercent=30\n\
35
+ -XX:+HeapDumpOnOutOfMemoryError\n\
36
+ -XX:HeapDumpPath=/var/lib/elasticsearch\n\
37
+ -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log\n\
38
+ -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m' > /etc/elasticsearch/jvm.options
39
+
40
+ # Make sure you can start the service.
41
+ RUN service elasticsearch start && service elasticsearch stop
42
+
43
+ # Custom entrypoint that also starts the Elasticsearch server.
44
+ RUN echo 'service elasticsearch start && python3 -u run_algorithm.py "$@"' > entrypoint.sh
45
+ ENTRYPOINT ["/bin/bash", "/home/app/entrypoint.sh"]
@@ -0,0 +1,61 @@
1
+ FROM ann-benchmarks
2
+
3
+ WORKDIR /home/app
4
+
5
+ # Install elasticsearch.
6
+ ENV DEBIAN_FRONTEND noninteractive
7
+ RUN apt install -y wget curl htop
8
+ RUN wget --quiet https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-oss-7.9.2-amd64.deb \
9
+ && dpkg -i elasticsearch-oss-7.9.2-amd64.deb \
10
+ && rm elasticsearch-oss-7.9.2-amd64.deb
11
+
12
+ # Install python client.
13
+ RUN python3 -m pip install --upgrade elastiknn-client==0.1.0rc47
14
+
15
+ # Install plugin.
16
+ RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch \
17
+ https://github.com/alexklibisz/elastiknn/releases/download/0.1.0-PRE47/elastiknn-0.1.0-PRE47_es7.9.2.zip
18
+
19
+ # Configure elasticsearch and JVM for single-node, single-core.
20
+ RUN cp /etc/elasticsearch/jvm.options /etc/elasticsearch/jvm.options.bak
21
+ RUN cp /etc/elasticsearch/elasticsearch.yml /etc/elasticsearch/elasticsearch.yml.bak
22
+
23
+ RUN echo '\
24
+ discovery.type: single-node\n\
25
+ network.host: 0.0.0.0\n\
26
+ node.master: true\n\
27
+ node.data: true\n\
28
+ node.processors: 1\n\
29
+ thread_pool.write.size: 1\n\
30
+ thread_pool.search.size: 1\n\
31
+ thread_pool.search.queue_size: 1\n\
32
+ path.data: /var/lib/elasticsearch\n\
33
+ path.logs: /var/log/elasticsearch\n\
34
+ ' > /etc/elasticsearch/elasticsearch.yml
35
+
36
+ RUN echo '\
37
+ -Xms3G\n\
38
+ -Xmx3G\n\
39
+ -XX:+UseG1GC\n\
40
+ -XX:G1ReservePercent=25\n\
41
+ -XX:InitiatingHeapOccupancyPercent=30\n\
42
+ -XX:+HeapDumpOnOutOfMemoryError\n\
43
+ -XX:HeapDumpPath=/var/lib/elasticsearch\n\
44
+ -XX:ErrorFile=/var/log/elasticsearch/hs_err_pid%p.log\n\
45
+ -Xlog:gc*,gc+age=trace,safepoint:file=/var/log/elasticsearch/gc.log:utctime,pid,tags:filecount=32,filesize=64m\n\
46
+ -Dcom.sun.management.jmxremote.ssl=false\n\
47
+ -Dcom.sun.management.jmxremote.authenticate=false\n\
48
+ -Dcom.sun.management.jmxremote.local.only=false\n\
49
+ -Dcom.sun.management.jmxremote.port=8097\n\
50
+ -Dcom.sun.management.jmxremote.rmi.port=8097\n\
51
+ -Djava.rmi.server.hostname=localhost' > /etc/elasticsearch/jvm.options
52
+
53
+ # JMX port. Need to also map the port when running.
54
+ EXPOSE 8097
55
+
56
+ # Make sure you can start the service.
57
+ RUN service elasticsearch start && service elasticsearch stop
58
+
59
+ # Custom entrypoint that also starts the Elasticsearch server.\
60
+ RUN echo 'service elasticsearch start && python3 -u run_algorithm.py "$@"' > entrypoint.sh
61
+ ENTRYPOINT ["/bin/bash", "/home/app/entrypoint.sh"]
@@ -0,0 +1,18 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt update && apt install -y wget
4
+ RUN wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh
5
+ RUN bash Anaconda3-2020.11-Linux-x86_64.sh -b
6
+
7
+ ENV PATH /root/anaconda3/bin:$PATH
8
+
9
+ RUN python3 -m pip install ansicolors==1.1.8 docker==5.0.2
10
+ RUN conda install -c pytorch faiss-cpu h5py numpy
11
+
12
+ # https://developpaper.com/a-pit-of-mkl-library-in-linux-anaconda/
13
+ ENV LD_PRELOAD /root/anaconda3/lib/libmkl_core.so:/root/anaconda3/lib/libmkl_sequential.so
14
+
15
+ RUN python3 -c 'import faiss; print(faiss.IndexFlatL2)'
16
+
17
+
18
+
@@ -0,0 +1,10 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update && apt-get install -y cmake pkg-config liblz4-dev
4
+ RUN git clone https://github.com/mariusmuja/flann
5
+ RUN mkdir flann/build
6
+ RUN cd flann/build && cmake ..
7
+ RUN cd flann/build && make -j4
8
+ RUN cd flann/build && make install
9
+ RUN pip3 install sklearn
10
+ RUN python3 -c 'import pyflann'
@@ -0,0 +1,10 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get install -y python-setuptools python-pip
4
+ RUN pip3 install pybind11 numpy setuptools
5
+ RUN git clone https://github.com/nmslib/hnsw.git;cd hnsw; git checkout denorm
6
+
7
+ RUN cd hnsw/python_bindings; python3 setup.py install
8
+
9
+ RUN python3 -c 'import hnswlib'
10
+
@@ -0,0 +1,6 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update && apt-get install -y libboost-timer-dev libboost-chrono-dev libboost-program-options-dev libboost-system-dev libboost-python-dev
4
+ RUN git clone https://github.com/aaalgo/kgraph
5
+ RUN cd kgraph && python3 setup.py build && python3 setup.py install
6
+ RUN python3 -c 'import pykgraph'
@@ -0,0 +1,4 @@
1
+ FROM ann-benchmarks
2
+ RUN apt-get update && apt-get install -y cmake libhdf5-dev
3
+ RUN git clone https://github.com/maumueller/mih
4
+ RUN cd mih && mkdir bin && cd bin && cmake ../ && make -j4
@@ -0,0 +1,27 @@
1
+ # Install Milvus
2
+ FROM milvusdb/milvus:0.6.0-cpu-d120719-2b40dd as milvus
3
+ RUN apt-get update && apt-get install -y wget
4
+ RUN wget https://raw.githubusercontent.com/milvus-io/docs/master/v0.6.0/assets/server_config.yaml
5
+ RUN sed -i 's/cpu_cache_capacity: 16/cpu_cache_capacity: 4/' server_config.yaml # otherwise my Docker blows up
6
+ RUN mv server_config.yaml /var/lib/milvus/conf/server_config.yaml
7
+
8
+ # Switch back to ANN-benchmarks base image and copy all files
9
+ FROM ann-benchmarks
10
+ COPY --from=milvus /var/lib/milvus /var/lib/milvus
11
+ ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/var/lib/milvus/lib"
12
+ RUN apt-get update
13
+ RUN apt-get install -y libmysqlclient-dev
14
+
15
+ # Python client
16
+ RUN pip3 install pymilvus==0.2.7
17
+
18
+ # Fixing some version incompatibility thing
19
+ RUN pip3 install numpy==1.18 scipy==1.1.0 scikit-learn==0.21
20
+
21
+ # Dumb entrypoint thing that runs the daemon as well
22
+ RUN echo '#!/bin/bash' >> entrypoint.sh
23
+ RUN echo '/var/lib/milvus/bin/milvus_server -d -c /var/lib/milvus/conf/server_config.yaml -l /var/lib/milvus/conf/log_config.conf' >> entrypoint.sh
24
+ RUN echo 'sleep 5' >> entrypoint.sh
25
+ RUN echo 'python3 -u run_algorithm.py "$@"' >> entrypoint.sh
26
+ RUN chmod u+x entrypoint.sh
27
+ ENTRYPOINT ["/home/app/entrypoint.sh"]
@@ -0,0 +1,4 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN pip3 install sklearn
4
+ RUN pip3 install git+https://github.com/vioshyvo/mrpt
@@ -0,0 +1,5 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN pip3 install cython
4
+ RUN pip3 install n2
5
+ RUN python3 -c 'import n2'
@@ -0,0 +1,5 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get install -y libhdf5-openmpi-dev cython
4
+ RUN pip3 install nearpy bitarray redis sklearn
5
+ RUN python3 -c 'import nearpy'
@@ -0,0 +1,13 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update
4
+ RUN apt-get install -y git cmake g++ python3 python3-setuptools python3-pip
5
+ RUN pip3 install wheel pybind11
6
+ RUN git clone https://github.com/yahoojapan/ngt.git
7
+ RUN mkdir -p ngt/build
8
+ RUN cd ngt/build && cmake ..
9
+ RUN cd ngt/build && make && make install
10
+ RUN ldconfig
11
+ RUN cd ngt/python && python3 setup.py bdist_wheel
12
+ RUN pip3 install ngt/python/dist/ngt-*-linux_x86_64.whl
13
+
@@ -0,0 +1,10 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN apt-get update && apt-get install -y cmake libboost-all-dev libeigen3-dev libgsl0-dev
4
+ RUN git clone https://github.com/searchivarius/nmslib.git
5
+ RUN cd nmslib/similarity_search && cmake . -DWITH_EXTRAS=1
6
+ RUN cd nmslib/similarity_search && make -j4
7
+ RUN pip3 install pybind11
8
+ RUN cd nmslib/python_bindings && python3 setup.py build
9
+ RUN cd nmslib/python_bindings && python3 setup.py install
10
+ RUN python3 -c 'import nmslib'
@@ -0,0 +1,43 @@
1
+ # Warning! Do not use this config in production!
2
+ # This is only for testing and security has been turned off.
3
+
4
+ FROM ann-benchmarks
5
+
6
+ WORKDIR /home/app
7
+
8
+ # Install Opensearch following instructions from https://opensearch.org/docs/opensearch/install/tar/
9
+ # and https://opensearch.org/docs/opensearch/install/important-settings/
10
+ RUN apt-get install tmux wget gosu -y
11
+ RUN wget https://artifacts.opensearch.org/releases/bundle/opensearch/1.0.0/opensearch-1.0.0-linux-x64.tar.gz
12
+ RUN tar -zxf opensearch-1.0.0-linux-x64.tar.gz
13
+ RUN rm -r opensearch-1.0.0-linux-x64.tar.gz opensearch-1.0.0/plugins/opensearch-security
14
+ RUN chmod -R 777 opensearch-1.0.0
15
+ RUN sysctl -w vm.max_map_count=262144
16
+
17
+ # Install python client.
18
+ RUN python3 -m pip install --upgrade elasticsearch==7.13.4 tqdm
19
+
20
+ # Configure opensearch for single-node, single-core.
21
+ RUN echo '\
22
+ discovery.type: single-node\n\
23
+ network.host: 0.0.0.0\n\
24
+ node.roles: [ data, master ]\n\
25
+ node.processors: 1\n\
26
+ thread_pool.write.size: 1\n\
27
+ thread_pool.search.size: 1\n\
28
+ thread_pool.search.queue_size: 1' > opensearch-1.0.0/config/opensearch.yml
29
+
30
+ RUN echo '\
31
+ -Xms3G\n\
32
+ -Xmx3G\n\
33
+ -XX:InitiatingHeapOccupancyPercent=30\n\
34
+ -XX:+HeapDumpOnOutOfMemoryError\n\
35
+ -XX:HeapDumpPath=data\n\
36
+ -XX:ErrorFile=logs/hs_err_pid%p.log\n\
37
+ -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m' > opensearch-1.0.0/config/jvm.options
38
+
39
+ # Custom entrypoint that also starts the Opensearch server
40
+ RUN useradd -m opensearch
41
+ RUN echo 'tmux new-session -d -s opensearch """exec gosu opensearch "./opensearch-1.0.0/opensearch-tar-install.sh""""' > entrypoint.sh
42
+ RUN echo 'python3 -u run_algorithm.py "$@"' >> entrypoint.sh
43
+ ENTRYPOINT ["/bin/bash", "/home/app/entrypoint.sh"]
@@ -0,0 +1,6 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN pip3 install pypandoc
4
+ RUN git clone https://github.com/puffinn/puffinn
5
+ RUN cd puffinn && python3 setup.py install
6
+ RUN python3 -c 'import puffinn'
@@ -0,0 +1,4 @@
1
+ FROM ann-benchmarks
2
+
3
+ RUN pip3 install numpy==1.16.4 pynndescent>=0.5
4
+ RUN python3 -c 'import pynndescent'