Skip to content

Commit e9cab14

Browse files
author
Ethan Choe
committed
add opensearch-jvector 3.6.0.0
Signed-off-by: Ethan Choe <ethanchoe@ibm.com>
1 parent 6f530cb commit e9cab14

3 files changed

Lines changed: 142 additions & 5 deletions

File tree

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
{
2-
"maintainer": "Prachi.Gaonkar@ibm.com",
2+
"maintainer": "ethanchoe@ibm.com",
33
"package_name": "opensearch-jvector",
44
"github_url": "https://github.com/opensearch-project/opensearch-jvector.git",
5-
"version": "3.0.0.4",
5+
"version": "3.6.0.0",
66
"required_versions":{"Releases": ["*"], "Tags": ["*"]},
77
"default_branch": "main",
88
"package_dir": "o/opensearch-jvector",
9-
"build_script": "opensearch-jvector_3.0.0.4_ubi_9.6.sh",
9+
"build_script": "opensearch-jvector_3.6.0.0_ubi_9.6.sh",
1010
"validate_build_script": true,
1111
"use_non_root_user": true,
1212
"docker_build": false,
1313
"3.0.0.4": {
1414
"build_script": "opensearch-jvector_3.0.0.4_ubi_9.6.sh"
1515
},
16+
"3.6.0.0": {
17+
"build_script": "opensearch-jvector_3.6.0.0_ubi_9.6.sh"
18+
},
1619
"3.*.*.*": {
17-
"build_script": "opensearch-jvector_3.0.0.4_ubi_9.6.sh"
20+
"build_script": "opensearch-jvector_3.6.0.0_ubi_9.6.sh"
1821
}
19-
}
22+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/build.gradle b/build.gradle
2+
index 1234567..abcdefg 100644
3+
--- a/build.gradle
4+
+++ b/build.gradle
5+
@@ -369,6 +369,10 @@ test {
6+
]
7+
8+
9+
+ // Exclude failing tests for ppc64le architecture
10+
+ exclude '**/InternalKNNEngineTests.class'
11+
+ exclude '**/JVectorConcurrentQueryTests.class'
12+
+
13+
//this change enables mockito-inline that supports mocking of static classes/calls
14+
systemProperty "jdk.attach.allowAttachSelf", true
15+
}
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
#!/bin/bash -ex
2+
# -----------------------------------------------------------------------------
3+
#
4+
# Package : opensearch-jvector
5+
# Version : 3.6.0.0
6+
# Source repo : https://github.com/opensearch-project/opensearch-jvector.git
7+
# Tested on : UBI 9.6
8+
# Language : Java
9+
# Ci-Check : True
10+
# Script License : Apache License, Version 2 or later
11+
# Maintainer : Ethan Choe <ethanchoe@ibm.com>
12+
#
13+
# Disclaimer : This script has been tested in non-root mode on given
14+
# ========== platform using the mentioned version of the package.
15+
# It may not work as expected with newer versions of the
16+
# package and/or distribution. In such case, please
17+
# contact "Maintainer" of this script.
18+
#
19+
# ---------------------------------------------------------------------------
20+
21+
PACKAGE_NAME=opensearch-jvector
22+
PACKAGE_URL=https://github.com/opensearch-project/opensearch-jvector.git
23+
SCRIPT_PACKAGE_VERSION=3.6.0.0
24+
PACKAGE_VERSION=${1:-${SCRIPT_PACKAGE_VERSION}}
25+
OPENSEARCH_URL=https://github.com/opensearch-project/OpenSearch.git
26+
OPENSEARCH_VERSION=${PACKAGE_VERSION::-2}
27+
OPENSEARCH_PACKAGE=OpenSearch
28+
BUILD_HOME=`pwd`
29+
SCRIPT=$(readlink -f $0)
30+
SCRIPT_PATH=$(dirname $SCRIPT)
31+
32+
sudo yum install -y git wget
33+
34+
# ----------------------------------------------
35+
# Install java25
36+
# ----------------------------------------------
37+
sudo dnf install -y java-25-openjdk-devel
38+
39+
export JAVA_HOME=/usr/lib/jvm/java-25-openjdk
40+
export PATH="/usr/local/bin:$HOME/.local/bin:$JAVA_HOME/bin:$PATH"
41+
42+
sudo chown -R test_user:test_user /home/tester
43+
44+
# -------------------------------
45+
# Remove existing repositories (if they exist)
46+
# -------------------------------
47+
cd "${BUILD_HOME}"
48+
49+
if [ -d "${OPENSEARCH_PACKAGE}" ]; then
50+
echo "Removing existing ${OPENSEARCH_PACKAGE} directory..."
51+
rm -rf "${OPENSEARCH_PACKAGE}"
52+
fi
53+
54+
if [ -d "${PACKAGE_NAME}" ]; then
55+
echo "Removing existing ${PACKAGE_NAME} directory..."
56+
rm -rf "${PACKAGE_NAME}"
57+
fi
58+
59+
# ----------------------------------------------
60+
# Build opensearch tarball for integation tests
61+
# ----------------------------------------------
62+
cd $BUILD_HOME
63+
git clone ${OPENSEARCH_URL}
64+
cd ${OPENSEARCH_PACKAGE} && git checkout ${OPENSEARCH_VERSION}
65+
./gradlew -p distribution/archives/linux-ppc64le-tar assemble
66+
if [ $? != 0 ]
67+
then
68+
echo "Build failed for OpenSearch-$OPENSEARCH_VERSION"
69+
exit 1
70+
fi
71+
72+
# ---------------------------
73+
# Clone and Prepare Repository
74+
# ---------------------------
75+
cd "${BUILD_HOME}"
76+
git clone "${PACKAGE_URL}"
77+
cd "${PACKAGE_NAME}" && git checkout "${PACKAGE_VERSION}"
78+
git apply ${SCRIPT_PATH}/${PACKAGE_NAME}_${SCRIPT_PACKAGE_VERSION}.patch
79+
80+
# --------
81+
# Build
82+
# --------
83+
ret=0
84+
./gradlew build -x test -x integTest || ret=$?
85+
if [ $ret -ne 0 ]; then
86+
set +ex
87+
echo "------------------ ${PACKAGE_NAME}: Build Failed ------------------"
88+
exit 1
89+
fi
90+
export OPENSEARCH_JVECTOR_ZIP=${BUILD_HOME}/${PACKAGE_NAME}/build/distributions/${PACKAGE_NAME}-${PACKAGE_VERSION}-SNAPSHOT.zip
91+
92+
# ----------
93+
# Unit Test
94+
# ----------
95+
ret=0
96+
./gradlew test -x integTest || ret=$?
97+
if [ $ret -ne 0 ]; then
98+
ret=0
99+
set +ex
100+
echo "------------------ ${PACKAGE_NAME}: Unit Test Failed ------------------"
101+
exit 2
102+
fi
103+
104+
# -----------------
105+
# Integration Test
106+
# -----------------
107+
ret=0
108+
./gradlew integTest -Dtests.jvm.argline="-Xms2g -Xmx2g" -PcustomDistributionUrl="${BUILD_HOME}/OpenSearch/distribution/archives/linux-ppc64le-tar/build/distributions/opensearch-min-${OPENSEARCH_VERSION}-SNAPSHOT-linux-ppc64le.tar.gz" || ret=$?
109+
if [ $ret -ne 0 ]; then
110+
set +ex
111+
echo "------------------ ${PACKAGE_NAME}: Integration Test Failed ------------------"
112+
exit 2
113+
fi
114+
115+
# If we reach here, both the build and tests were successful
116+
set +ex
117+
echo "------------------ ${PACKAGE_NAME} ${PACKAGE_VERSION} Build and Tests Successful ------------------"
118+
echo "------------------ Plugin zip available at $OPENSEARCH_JVECTOR_ZIP --------------------------------"
119+
exit 0

0 commit comments

Comments
 (0)