Skip to content

Instantly share code, notes, and snippets.

@freakeinstein
Created December 14, 2020 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freakeinstein/8d39f4e433925753a76922f69af09461 to your computer and use it in GitHub Desktop.
Save freakeinstein/8d39f4e433925753a76922f69af09461 to your computer and use it in GitHub Desktop.
AquilaDB installation script
#!/bin/bash -e
apt update
mkdir -p /data/
cd ~
# system packs install
apt install -y git wget nano python3.8 python3-pip libblas-dev liblapack-dev swig libssl-dev
# setup venv
pip3 install virtualenv
virtualenv env
source ./env/bin/activate
# install python packages
pip3 install numpy pycryptodome base58 chardet Flask requests flask_cors PyYAML bson fastjsonschema annoy plyvel
# install cmake
apt purge --auto-remove cmake
version=3.19
build=1
mkdir -p ~/temp
cd ~/temp
wget https://cmake.org/files/v$version/cmake-$version.$build.tar.gz
tar -xzvf cmake-$version.$build.tar.gz
cd cmake-$version.$build/
./bootstrap
make -j$(nproc)
make install
cmake --version
# install faiss
cd ~
mkdir -p faiss
cd faiss
git clone https://github.com/facebookresearch/faiss.git .
cmake -DFAISS_ENABLE_GPU=OFF -B build .
make -C build
# For the Python interface:
cd build/faiss/python
python setup.py install
cp -r ~/faiss/build/faiss/python/ /root/env/lib/python3.8/site-packages/faiss
# clone & test AquilaDB
cd ~
mkdir -p adb
cd adb
git clone https://github.com/a-mma/ADBRefactor.git .
mkdir -p /ossl/
openssl genrsa -des3 -out /ossl/private.pem 2048
openssl rsa -in /ossl/private.pem -outform PEM -pubout -out /ossl/public.pem
openssl rsa -in /ossl/private.pem -out /ossl/private_unencrypted.pem -outform PEM
cd src
chmod +x run_tests.sh
./run_tests.sh
echo "=========================================="
echo " AquilaDB install complete, Enjoy.. "
echo "=========================================="
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment