-
Notifications
You must be signed in to change notification settings - Fork 4
/
installDiffSearch.sh
executable file
·87 lines (85 loc) · 2.42 KB
/
installDiffSearch.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash -e
# Script to install DiffSearch
# Run the script:
#chmod 754 installDiffSearch.sh
#./installDiffSearch.sh
echo Setting up virtual environment
if virtualenv -p /usr/bin/python3 diffsearch-env; then
echo Finished setting up virtual environment
else
rm -rf diffsearch-env
echo Failed to setup virtualenv..Aborting the setup 1>&2
exit 1
fi
echo Activating the virtual environment
if source diffsearch-env/bin/activate; then
echo Virtual environment activated
else
rm -rf diffsearch-env
echo Failed to activate virtualenv..Aborting the setup 1>&2
exit 1
fi
echo Installing faiss..
if pip3 install faiss-cpu; then
echo Installed faiss
else
rm -rf diffsearch-env
echo Failed to install Faiss..Aborting the setup 1>&2
exit 1
fi
echo Installing numpy
if pip3 install numpy; then
echo Installed numpy
else
rm -rf diffsearch-env
echo Failed to install numpy..Aborting the setup 1>&2
exit 1
fi
echo Installing pandas
if pip3 install pandas; then
echo Installed pandas
else
rm -rf diffsearch-env
echo Failed to install pandas..Aborting the setup 1>&2
exit 1
fi
echo Installing dask
if pip3 install dask[dataframe]; then
echo Installed dask
else
rm -rf diffsearch-env
echo Failed to install dask..Aborting the setup 1>&2
exit 1
fi
echo Creating and copying required folders and files
if mkdir -p src/main/resources/Features_Vectors; then
echo Created Features_Vectors folder in resources
else
echo Failed to create Features_Vectors folder in resources.. Aborting the setup
rm -rf diffsearch-env 1>&2
exit 1
fi
if touch src/main/resources/Features_Vectors/server_log.log; then
echo Created server_log file
else
echo Failed to create server_log file.. Aborting the setup
rm -rf diffsearch-env 1>&2
exit 1
fi
# To get the direct download link: https://bydik.com/onedrive-direct-link/
if wget -O src/main/resources/Features_Vectors/index.zip 'https://onedrive.live.com/download?cid=C19790BB35A78C2C&resid=C19790BB35A78C2C%2114267&authkey=AJp_CBLDdCH1X1A'; then
echo Downloaded the zip file
else
echo Failed to download the required files.. Aborting the setup
rm -rf diffsearch-env 1>&2
exit 1
fi
if unzip src/main/resources/Features_Vectors/index.zip -d src/main/resources/Features_Vectors/; then
rm -rf src/main/resources/Features_Vectors/index.zip
echo Extracted the files
else
echo Extraction failed.. Aborting the setup
rm -rf diffsearch-env 1>&2
exit 1
fi
echo Setup done... You can compile now.