Skip to content

Commit

Permalink
Add support for knn to have qualifiers (#329)
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Mar 22, 2022
1 parent 87bc388 commit 9b8895b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ function usage() {
echo ""
echo "Arguments:"
echo -e "-v VERSION\t[Required] OpenSearch version."
echo -e "-q QUALIFIER\t[Optional] Version qualifier."
echo -e "-s SNAPSHOT\t[Optional] Build a snapshot, default is 'false'."
echo -e "-p PLATFORM\t[Optional] Platform, ignored."
echo -e "-a ARCHITECTURE\t[Optional] Build architecture, ignored."
echo -e "-o OUTPUT\t[Optional] Output path, default is 'artifacts'."
echo -e "-h help"
}

while getopts ":h:v:s:o:p:a:" arg; do
while getopts ":h:v:q:s:o:p:a:" arg; do
case $arg in
h)
usage
Expand All @@ -32,6 +33,9 @@ while getopts ":h:v:s:o:p:a:" arg; do
s)
SNAPSHOT=$OPTARG
;;
q)
QUALIFIER=$OPTARG
;;
o)
OUTPUT=$OPTARG
;;
Expand Down Expand Up @@ -59,6 +63,7 @@ if [ -z "$VERSION" ]; then
exit 1
fi

[[ ! -z "$QUALIFIER" ]] && VERSION=$VERSION-$QUALIFIER
[[ "$SNAPSHOT" == "true" ]] && VERSION=$VERSION-SNAPSHOT
[ -z "$OUTPUT" ] && OUTPUT=artifacts

Expand Down Expand Up @@ -94,7 +99,7 @@ cmake .
make opensearchknn_faiss opensearchknn_nmslib

cd $work_dir
./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT
./gradlew assemble --no-daemon --refresh-dependencies -DskipTests=true -Dopensearch.version=$VERSION -Dbuild.snapshot=$SNAPSHOT -Dbuild.version_qualifier=$QUALIFIER

# Add knnlib to zip
zipPath=$(find "$(pwd)" -path \*build/distributions/*.zip)
Expand Down

0 comments on commit 9b8895b

Please sign in to comment.