isearch/dockerfiles/install.sh
2022-06-01 17:54:56 +08:00

79 lines
3.1 KiB
Bash

#!/bin/sh
cd /usr/local
git clone https://gitee.com/jd-platform-opensource/isearch.git
mv isearch jdisearch
cd jdisearch
sh build.sh
srcdir="/usr/local/jdisearch"
dstdir="/usr/local/isearch"
mkdir -p $dstdir/index_storage/inverted_index
cd $dstdir/index_storage/inverted_index
mkdir rocksdb_data bin conf
cp $srcdir/resource/index_storage/inverted_index/conf/cache.conf conf
cp $srcdir/resource/index_storage/inverted_index/conf/table.conf conf
cp $srcdir/resource/dtcd.sh bin
cp $srcdir/src/search_local/index_storage/cache/dtcd bin
cp $srcdir/src/search_local/index_storage/rocksdb_helper/rocksdb_helper bin
cd bin
chmod +x dtcd.sh
mkdir -p $dstdir/index_storage/intelligent_index
cd $dstdir/index_storage/intelligent_index
mkdir rocksdb_data bin conf
cp $srcdir/resource/index_storage/intelligent_index/conf/cache.conf conf
cp $srcdir/resource/index_storage/intelligent_index/conf/table.conf conf
cp $srcdir/resource/dtcd.sh bin
cp $srcdir/src/search_local/index_storage/cache/dtcd bin
cp $srcdir/src/search_local/index_storage/rocksdb_helper/rocksdb_helper bin
cd bin
chmod +x dtcd.sh
mkdir -p $dstdir/index_storage/original_data
cd $dstdir/index_storage/original_data
mkdir bin conf
cp $srcdir/resource/index_storage/original_data/conf/cache.conf conf
cp $srcdir/resource/index_storage/original_data/conf/table.conf conf
cp $srcdir/resource/dtcd.sh bin
cp $srcdir/src/search_local/index_storage/cache/dtcd bin
cd bin
chmod +x dtcd.sh
ln -s $dstdir/src/search_local/index_storage/api/c_api_cc/libdtc-gcc-4.8-r4646582.so /lib64/libdtc.so.1
cd $dstdir
mkdir index_write index_read search_agent vector_index_helper
cd index_write
mkdir log bin stat conf
cp $srcdir/resource/index_write/conf/{index_gen.json,index_write.conf,localCluster.json} conf
cp $srcdir/resource/{app_field_define.json,character_map.txt,msr_training.utf8,phonetic_base.txt,phonetic_map.txt,stop_words.dict,words_base.txt} conf
cp $srcdir/src/search_local/index_write/bin/index_write bin
cd $dstdir/index_read
mkdir log bin stat conf data
cp $srcdir/resource/{app_field_define.txt,app_field_define.json,character_map.txt,en_intelligent_match.txt,en_stem.txt,en_words_base.txt} conf
cp $srcdir/resource/{intelligent_match.txt,msr_training.utf8,phonetic_base.txt,phonetic_map.txt,stop_words.dict,suggest_base.txt,words_base.txt} conf
cp $srcdir/resource/index_read/conf/{index_read.conf,cache.conf,table.conf} conf
cp $srcdir/resource/index_read/data/{analyze_data,relate_data,sensitive_data,synonym_data} data
cp $srcdir/src/search_local/index_read/bin/index_read bin
cd $dstdir/search_agent
mkdir log bin conf
cp $srcdir/resource/search_agent/conf/sa.conf conf
cp $srcdir/src/search_agent/bin/search_agent bin/
cd $dstdir/vector_index_helper
mkdir log bin conf rocksdb
cp $srcdir/resource/app_field_define.json conf
cp $srcdir/resource/vector_index/conf/vector_index.conf conf
cp $srcdir/resource/vector_index/conf/ivfflat.faissindex /tmp
cp $srcdir/resource/vector_index/conf/trained_index.faissindex /tmp
cp $srcdir/src/search_local/vector_index_helper/bin/vector_index bin/
yum install -y jq
cd /usr/local/isearch
mkdir tools
cp $srcdir/resource/tools/* tools