Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Resolve KNN Lib Version Hard Coding Issues and Upgrades #359

Merged
merged 1 commit into from
Aug 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions elasticsearch/docker/templates/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ RUN java -version
# Compile the C-library for kNN
USER 1000
RUN set -ex; \
export KNN_VERSION=`.github/scripts/plugin_tag.sh opendistro-for-elasticsearch/k-NN $(echo {{version_tag}} | sed -E "s/.[0-9]+$//g")` \

export KNN_VERSION=`git ls-remote --tags "https://github.com/opendistro-for-elasticsearch/k-NN" v* | grep $(echo {{version_tag}} | sed -E "s/.[0-9]+$//g") | grep -oh "v[0-9.]*" | sort | tail -n 1` \
\
&& git ls-remote --tags https://github.com/opendistro-for-elasticsearch/k-NN.git v* \
\
Expand Down Expand Up @@ -184,7 +185,7 @@ RUN mkdir -p /usr/share/supervisor/performance_analyzer/ && \

WORKDIR /usr/share/elasticsearch
COPY --from=prep_es_files --chown=1000:0 /usr/share/elasticsearch /usr/share/elasticsearch
COPY --from=prep_es_files /tmp/jni/libKNNIndexV1_7_3_6.so /usr/lib
COPY --from=prep_es_files /tmp/jni/libKNNIndex*.so /usr/lib

ENV PATH /usr/share/elasticsearch/bin:$PATH

Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/linux_distributions/opendistro-tar-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ echo "downloading $knnlib_latest"
aws s3 cp "s3://artifacts.opendistroforelasticsearch.amazon.com/${knnlib_latest}" ./
unzip opendistro-knnlib*.zip
mkdir -p $PACKAGE_NAME-$OD_VERSION/plugins/opendistro-knn/knn-lib/
mv opendistro-knnlib*/libKNNIndexV1_7_3_6.so $PACKAGE_NAME-$OD_VERSION/plugins/opendistro-knn/knn-lib/
mv -v opendistro-knnlib*/libKNNIndex*.so $PACKAGE_NAME-$OD_VERSION/plugins/opendistro-knn/knn-lib/

# Tar generation
echo "generating tar"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo "done plugins"

##Check KNN lib existence in ES TAR distribution
echo "Checking kNN library"
FILE=$ES_KNN_LIB_DIR/libKNNIndexV1_7_3_6.so
FILE=`ls $ES_KNN_LIB_DIR/libKNNIndex*.so`
peterzhuamazon marked this conversation as resolved.
Show resolved Hide resolved
if test -f "$FILE"; then
echo "FILE EXISTS $FILE"
else
Expand Down
17 changes: 0 additions & 17 deletions elasticsearch/linux_distributions/scripts/preInstall.sh

This file was deleted.