Skip to content

Commit

Permalink
Update bwc tests for 2.5.0 (#661)
Browse files Browse the repository at this point in the history
* Update rolling bwc to 2.5.0

Signed-off-by: John Mazanec <jmazane@amazon.com>
  • Loading branch information
jmazanec15 authored Dec 12, 2022
1 parent 79ae6c2 commit 01e1c7f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/backwards_compatibility_tests_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java: [ 11, 17 ]
bwc_version : [ "2.0.0", "2.1.0", "2.2.0", "2.3.0", "2.4.0" ]
bwc_version : [ "2.0.0", "2.1.0", "2.2.0", "2.3.0", "2.4.0", "2.5.0-SNAPSHOT" ]
opensearch_version : [ "3.0.0-SNAPSHOT" ]

name: k-NN Restart-Upgrade BWC Tests
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
strategy:
matrix:
java: [ 11, 17 ]
bwc_version: [ "2.4.0" ]
bwc_version: [ "2.5.0-SNAPSHOT" ]
opensearch_version: [ "3.0.0-SNAPSHOT" ]

name: k-NN Rolling-Upgrade BWC Tests
Expand Down
15 changes: 8 additions & 7 deletions qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ def tmp_dir = project.file('build/private/artifact_tmp').absoluteFile
tmp_dir.mkdirs()
String default_bwc_version = System.getProperty("bwc.version")
String knn_bwc_version = System.getProperty("tests.bwc.version", default_bwc_version)

boolean isSnapshot = knn_bwc_version.contains("-SNAPSHOT")
String knn_bwc_version_no_qualifier = isSnapshot ? knn_bwc_version - "-SNAPSHOT" : knn_bwc_version
// Task to pull k-NN plugin from archive
task pullBwcPlugin {
doFirst {
Expand All @@ -40,8 +41,8 @@ task pullBwcPlugin {

doLast {
ext{
if (knn_bwc_version == "2.4.0") {
srcUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${knn_bwc_version}/latest/linux/x64/tar/dist/opensearch/opensearch-${knn_bwc_version}-linux-x64.tar.gz"
if (isSnapshot) {
srcUrl = "https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/${knn_bwc_version_no_qualifier}/latest/linux/x64/tar/dist/opensearch/opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz"
} else {
srcUrl = "https://artifacts.opensearch.org/releases/bundle/opensearch/${knn_bwc_version}/opensearch-${knn_bwc_version}-linux-x64.tar.gz"
}
Expand All @@ -52,14 +53,14 @@ task pullBwcPlugin {
httpusecaches: false
)
copy {
from tarTree(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}-linux-x64.tar.gz"))
from tarTree(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz"))
into tmp_dir.absolutePath
}
copy {
from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}", "plugins", "opensearch-knn"))
from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}", "plugins", "opensearch-knn"))
into java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn")
}
delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}"), java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}-linux-x64.tar.gz")
delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}"), java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version_no_qualifier}-linux-x64.tar.gz")
}
}

Expand All @@ -68,7 +69,7 @@ task zipBwcPlugin(type: Zip) {
dependsOn "pullBwcPlugin"
from(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn"))
destinationDirectory = tmp_dir
archiveFileName = "opensearch-knn-${knn_bwc_version}.zip"
archiveFileName = "opensearch-knn-${knn_bwc_version_no_qualifier}.zip"
doLast {
delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn")
}
Expand Down
6 changes: 4 additions & 2 deletions qa/restart-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ apply from : "$rootDir/qa/build.gradle"

String default_bwc_version = System.getProperty("bwc.version")
String knn_bwc_version = System.getProperty("tests.bwc.version", default_bwc_version)
boolean isSnapshot = knn_bwc_version.contains("-SNAPSHOT")
String knn_bwc_version_no_qualifier = isSnapshot ? knn_bwc_version - "-SNAPSHOT" : knn_bwc_version
String baseName = "knnBwcCluster-restart"

// Creates a test cluster of previous version and loads k-NN plugin of bwcVersion
Expand All @@ -20,8 +22,8 @@ testClusters {
plugin(project.tasks.zipBwcPlugin.archiveFile)
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'http.content_type.required', 'true'
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/knnlib;${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/lib"
systemProperty "java.library.path", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/knnlib:${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/lib"
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/knnlib;${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
systemProperty "java.library.path", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/knnlib:${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
}
}

Expand Down
7 changes: 5 additions & 2 deletions qa/rolling-upgrade/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ apply from : "$rootDir/qa/build.gradle"

String default_bwc_version = System.getProperty("bwc.version")
String knn_bwc_version = System.getProperty("tests.bwc.version", default_bwc_version)
boolean isSnapshot = knn_bwc_version.contains("-SNAPSHOT")
String knn_bwc_version_no_qualifier = isSnapshot ? knn_bwc_version - "-SNAPSHOT" : knn_bwc_version
String baseName = "knnBwcCluster-rolling"

// Creates a test cluster of previous version and loads k-NN plugin of bwcVersion
Expand All @@ -20,8 +22,8 @@ testClusters {
plugin(project.tasks.zipBwcPlugin.archiveFile)
setting 'path.repo', "${buildDir}/cluster/shared/repo/${baseName}"
setting 'http.content_type.required', 'true'
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/knnlib;${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/lib"
systemProperty "java.library.path", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/knnlib:${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/lib"
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/knnlib;${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
systemProperty "java.library.path", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/knnlib:${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
}
}

Expand Down Expand Up @@ -97,3 +99,4 @@ task testRollingUpgrade(type: StandaloneRestIntegTestTask) {
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}")
systemProperty 'tests.security.manager', 'false'
}

0 comments on commit 01e1c7f

Please sign in to comment.