-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor BWC framework into sub-projects (#362)
Signed-off-by: Naveen Tatikonda <navtat@amazon.com>
- Loading branch information
1 parent
e1aad3e
commit 978675f
Showing
11 changed files
with
576 additions
and
205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
|
||
apply plugin: 'opensearch.testclusters' | ||
apply plugin: 'opensearch.build' | ||
apply plugin: 'opensearch.rest-test' | ||
|
||
// Disable a few tasks that come with build | ||
build.enabled = false | ||
integTest.enabled = false | ||
test.enabled = false | ||
assemble.enabled = false | ||
dependenciesInfo.enabled = false | ||
|
||
dependencies { | ||
api "org.opensearch:opensearch:${opensearch_version}" | ||
compileOnly "org.opensearch.plugin:opensearch-scripting-painless-spi:${versions.opensearch}" | ||
api group: 'commons-lang', name: 'commons-lang', version: '2.6' | ||
|
||
api "org.apache.logging.log4j:log4j-api:${versions.log4j}" | ||
api "org.apache.logging.log4j:log4j-core:${versions.log4j}" | ||
|
||
testImplementation "org.opensearch.test:framework:${opensearch_version}" | ||
testImplementation(testFixtures(rootProject)) | ||
} | ||
|
||
def tmp_dir = project.file('build/private/artifact_tmp').absoluteFile | ||
tmp_dir.mkdirs() | ||
String knn_bwc_version = System.getProperty("bwc.version") | ||
|
||
// Task to pull k-NN plugin from archive | ||
task pullBwcPlugin { | ||
doFirst { | ||
delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-*") | ||
} | ||
|
||
doLast { | ||
ant.get( | ||
src: "https://artifacts.opensearch.org/releases/bundle/opensearch/${knn_bwc_version}/opensearch-${knn_bwc_version}-linux-x64.tar.gz", | ||
dest: tmp_dir.absolutePath, | ||
httpusecaches: false | ||
) | ||
copy { | ||
from tarTree(java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-${knn_bwc_version}-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")) | ||
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") | ||
} | ||
} | ||
|
||
// Task to zip plugin from archive | ||
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" | ||
doLast { | ||
delete java.nio.file.Path.of(tmp_dir.absolutePath, "opensearch-knn") | ||
} | ||
} | ||
|
||
task bwcTestSuite { | ||
dependsOn ":qa:restart-upgrade:testRestartUpgrade" | ||
dependsOn ":qa:rolling-upgrade:testRollingUpgrade" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask | ||
|
||
apply from : "$rootDir/qa/build.gradle" | ||
|
||
String knn_bwc_version = System.getProperty("bwc.version") | ||
String baseName = "knnBwcCluster-restart" | ||
|
||
// Creates a test cluster of previous version and loads k-NN plugin of bwcVersion | ||
testClusters { | ||
"${baseName}" { | ||
testDistribution = "ARCHIVE" | ||
versions = [knn_bwc_version, opensearch_version] | ||
numberOfNodes = 3 | ||
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" | ||
systemProperty "java.library.path", "${buildDir}/testclusters/${baseName}-0/distro/${knn_bwc_version}-ARCHIVE/plugins/opensearch-knn/knnlib" | ||
} | ||
} | ||
|
||
// Task to run BWC tests against the old cluster | ||
task "testAgainstOldCluster"(type: StandaloneRestIntegTestTask) { | ||
dependsOn "zipBwcPlugin" | ||
useCluster testClusters."${baseName}" | ||
systemProperty 'tests.rest.bwcsuite_cluster', 'old_cluster' | ||
systemProperty 'tests.rest.bwcsuite_round', 'old' | ||
systemProperty 'tests.plugin_bwc_version', knn_bwc_version | ||
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") | ||
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") | ||
systemProperty 'tests.security.manager', 'false' | ||
} | ||
|
||
// All nodes are upgraded to latest version and run the tests | ||
task testRestartUpgrade(type: StandaloneRestIntegTestTask) { | ||
dependsOn "testAgainstOldCluster" | ||
dependsOn rootProject.tasks.buildJniLib | ||
dependsOn rootProject.tasks.assemble | ||
useCluster testClusters."${baseName}" | ||
doFirst { | ||
testClusters."${baseName}".environment("LD_LIBRARY_PATH", "$rootDir/jni/release") | ||
testClusters."${baseName}".systemProperty("java.library.path", "$rootDir/jni/release") | ||
testClusters."${baseName}".upgradeAllNodesAndPluginsToNextVersion([rootProject.tasks.bundlePlugin.archiveFile]) | ||
} | ||
systemProperty 'tests.rest.bwcsuite_cluster', 'upgraded_cluster' | ||
systemProperty 'tests.rest.bwcsuite_round', 'fullrestart' | ||
systemProperty 'tests.plugin_bwc_version', knn_bwc_version | ||
nonInputProperties.systemProperty('tests.rest.cluster', "${-> testClusters."${baseName}".allHttpSocketURI.join(",")}") | ||
nonInputProperties.systemProperty('tests.clustername', "${-> testClusters."${baseName}".getName()}") | ||
systemProperty 'tests.security.manager', 'false' | ||
} |
File renamed without changes.
Oops, something went wrong.