Repository: erikbern/ann-benchmarks
Issue: Install.py reports multiple failures
Root cause: Environment Incompatibility

Hi, unfortunately install.py fails repeatedly (Mac Apple M2 Pro, Docker v 4.35.1). For instance, here is the output with faiss, what I was most interested in testing. Could you please help me to make this work? Thanks. 

```
❯ python install.py --algorithm faiss
Building base image...
[+] Building 1.1s (13/13) FINISHED                                                                                                                                                               docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
 => => transferring dockerfile: 412B                                                                                                                                                                             0.0s
 => [internal] load metadata for docker.io/library/ubuntu:22.04                                                                                                                                                  1.0s
 => [internal] load .dockerignore                                                                                                                                                                                0.0s
 => => transferring context: 90B                                                                                                                                                                                 0.0s
 => [1/8] FROM docker.io/library/ubuntu:22.04@sha256:0e5e4a57c2499249aafc3b40fcd541e9a456aab7296681a3994d631587203f97                                                                                            0.0s
 => [internal] load build context                                                                                                                                                                                0.0s
 => => transferring context: 419B                                                                                                                                                                                0.0s
 => CACHED [2/8] RUN apt-get update                                                                                                                                                                              0.0s
 => CACHED [3/8] RUN apt-get install -y python3-numpy python3-scipy python3-pip build-essential git                                                                                                              0.0s
 => CACHED [4/8] RUN pip3 install -U pip                                                                                                                                                                         0.0s
 => CACHED [5/8] RUN python3 --version | grep 'Python 3.10'                                                                                                                                                      0.0s
 => CACHED [6/8] WORKDIR /home/app                                                                                                                                                                               0.0s
 => CACHED [7/8] COPY requirements.txt run_algorithm.py ./                                                                                                                                                       0.0s
 => CACHED [8/8] RUN pip3 install -r requirements.txt                                                                                                                                                            0.0s
 => exporting to image                                                                                                                                                                                           0.0s
 => => exporting layers                                                                                                                                                                                          0.0s
 => => writing image sha256:640152e95772d9c434734175256b88df0d69d99a3ac4e28d0ee3e026e0f9f442                                                                                                                     0.0s
 => => naming to docker.io/library/ann-benchmarks                                                                                                                                                                0.0s

What's next:
    View a summary of image vulnerabilities and recommendations → docker scout quickview
Building algorithm images... with (1) processes
Building faiss...
[+] Building 1.4s (7/10)                                                                                                                                                                         docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                                                             0.0s
 => => transferring dockerfile: 625B                                                                                                                                                                             0.0s
 => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 7)                                                                                                 0.0s
 => WARN: LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 13)                                                                                                0.0s
 => [internal] load metadata for docker.io/library/ann-benchmarks:latest                                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                                                                                0.0s
 => => transferring context: 90B                                                                                                                                                                                 0.0s
 => [1/7] FROM docker.io/library/ann-benchmarks:latest                                                                                                                                                           0.0s
 => CACHED [2/7] RUN apt update && apt install -y wget                                                                                                                                                           0.0s
 => CACHED [3/7] RUN wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh                                                                                                                    0.0s
 => ERROR [4/7] RUN bash Anaconda3-2020.11-Linux-x86_64.sh -b                                                                                                                                                    1.4s
------
 > [4/7] RUN bash Anaconda3-2020.11-Linux-x86_64.sh -b:
0.124 PREFIX=/root/anaconda3
1.343 Unpacking payload ...
1.344 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
1.344  Anaconda3-2020.11-Linux-x86_64.sh: line 412:    27 Exit 141                { dd if="$THIS_PATH" bs=1 skip=15242979 count=10525 2> /dev/null; dd if="$THIS_PATH" bs=16384 skip=931 count=32915 2> /dev/null; dd if="$THIS_PATH" bs=1 skip=554532864 count=2716 2> /dev/null; }
1.344         28 Trace/breakpoint trap   | "$CONDA_EXEC" constructor --extract-tar --prefix "$PREFIX"
1.345 rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
1.345  Anaconda3-2020.11-Linux-x86_64.sh: line 414:    32 Trace/breakpoint trap   "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-conda-pkgs
------

 2 warnings found (use docker --debug to expand):
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 7)
 - LegacyKeyValueFormat: "ENV key=value" should be used instead of legacy "ENV key value" format (line 13)
Dockerfile:5
--------------------
   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
--------------------
ERROR: failed to solve: process "/bin/sh -c bash Anaconda3-2020.11-Linux-x86_64.sh -b" did not complete successfully: exit code: 1


Install Status:
{'faiss': 'fail'}
```

Here is the complete list of what fails and what not. I've seen that several of these fail for the same error above.

```
Install Status:
{'kgn': 'fail'}
{'kdtree': 'success'}
{'faiss_gpu': 'fail'}
{'qsg_ngt': 'fail'}
{'vearch': 'fail'}
{'flann': 'success'}
{'redisearch': 'success'}
{'vespa': 'success'}
{'vald': 'success'}
{'panng_ngt': 'fail'}
{'hnswlib': 'fail'}
{'opensearchknn': 'success'}
{'pg_embedding': 'success'}
{'puffinn': 'fail'}
{'pgvector': 'success'}
{'nearpy': 'fail'}
{'scann': 'fail'}
{'voyager': 'success'}
{'pynndescent': 'success'}
{'onng_ngt': 'fail'}
{'bruteforce': 'success'}
{'elastiknn': 'fail'}
{'rpforest': 'fail'}
{'diskann': 'fail'}
{'py': 'fail'}
{'annoy': 'success'}
{'faiss_hnsw': 'fail'}
{'balltree': 'success'}
{'__pycache__': 'fail'}
{'tinyknn': 'fail'}
{'luceneknn': 'fail'}
{'glass': 'fail'}
{'subprocess': 'fail'}
{'expann': 'fail'}
{'dummy_algo': 'success'}
{'ckdtree': 'success'}
{'datasketch': 'success'}
{'qdrant': 'success'}
{'pgvecto_rs': 'success'}
{'dolphinnpy': 'success'}
{'nmslib': 'success'}
{'faiss': 'fail'}
{'n2': 'fail'}
{'nndescent': 'success'}
{'sptag': 'fail'}
{'weaviate': 'success'}
{'qg_ngt': 'fail'}
{'kgraph': 'fail'}
{'elasticsearch': 'success'}
{'milvus': 'success'}
{'mrpt': 'success'}
{'base': 'success'}
{'parlayann': 'fail'}
{'vsag': 'fail'}
{'descartes': 'fail'}
```

Most implementations in this benchmark are targeting an Intel architecture, sometimes even requiring AVX512. You will need to provide a manual dockerfile for your arm64 architecture to get started with benchmarking faiss on your setup.