Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opensearch 2.0.0 qualifier fix for PA #175

Closed
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
13 changes: 8 additions & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,16 @@ jobs:
./gradlew build -Dperformance-analyzer-rca.build=true \
-Dperformance-analyzer-rca.repo="https://github.com/opensearch-project/performance-analyzer-rca.git" \
-Dperformance-analyzer-rca.branch=main \
-Dopensearch.version=1.3.0-SNAPSHOT
- name: Assemble PA jar for BWC tests
working-directory: ./tmp/performance-analyzer
run: |
./gradlew assemble -Dopensearch.version=1.3.0-SNAPSHOT
mkdir -p ./src/test/resources/org/opensearch/performanceanalyzer/bwc/1.3.0.0-SNAPSHOT
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/performanceanalyzer/bwc/1.3.0.0-SNAPSHOT
./gradlew assemble
version=`./gradlew properties -q | grep "opensearch_version:" | awk '{print $2}'`
IFS='-' read -r -a version_array <<< "$version"
plugin_version="${version_array[0]}.0"; for entry in ${version_array[@]:1}; do plugin_version+="-$entry"; done
echo $plugin_version
mkdir -p ./src/test/resources/org/opensearch/performanceanalyzer/bwc/$plugin_version
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/performanceanalyzer/bwc/$plugin_version
- name: Generate Jacoco coverage report
working-directory: ./tmp/performance-analyzer
run: ./gradlew jacocoTestReport
Expand All @@ -58,7 +61,7 @@ jobs:
run: bash <(curl -s https://codecov.io/bash) -f ./build/reports/jacoco/test/jacocoTestReport.xml
- name: Run Integration Tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew integTest -Dtests.enableIT -Dtests.useDockerCluster -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew integTest -Dtests.enableIT -Dtests.useDockerCluster
- name: Run PerformanceAnalzyer Backwards Compatibility Tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew bwcTestSuite -Dtests.security.manager=false
38 changes: 28 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,19 @@
buildscript {

ext {
opensearch_version = System.getProperty("opensearch.version", "1.3.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.0.0-alpha1-SNAPSHOT")
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
buildVersionQualifier = System.getProperty("build.version_qualifier", "alpha1")

// 2.0.0-alpha1-SNAPSHOT -> 2.0.0.0-alpha1-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
opensearch_build = version_tokens[0] + '.0'
if (buildVersionQualifier) {
opensearch_build += "-${buildVersionQualifier}"
}
if (isSnapshot) {
opensearch_build += "-SNAPSHOT"
}
}

// Used to resolve build file dependencies
Expand Down Expand Up @@ -48,7 +60,6 @@ spotbugsTest {
}

ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")

// The RCA branch that will be built. Default branch is main.
rcaProjectRepo = System.getProperty("performance-analyzer-rca.repo", "https://github.com/opensearch-project/performance-analyzer-rca.git")
Expand All @@ -63,10 +74,7 @@ ext {

allprojects {
group = "org.opensearch"
version = opensearch_version - '-SNAPSHOT' + '.0'
if (isSnapshot) {
version += "-SNAPSHOT"
}
version = opensearch_build
}

apply plugin: 'opensearch.opensearchplugin'
Expand Down Expand Up @@ -363,11 +371,21 @@ task buildRca() {
doLast {
exec {
workingDir("$rcaProjectDir")
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
}
else {
commandLine './gradlew', 'build', '-x', 'test', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
}
}
exec {
workingDir("$rcaProjectDir")
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
}
else {
commandLine './gradlew', 'publishToMavenLocal', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
}
}
exec {
def licenseDir = "$projectDir/licenses"
Expand Down Expand Up @@ -515,7 +533,7 @@ String bwcFilePath = "src/test/resources/org/opensearch/performanceanalyzer/bwc/
testClusters {
"${baseName}$i" {
testDistribution = "ARCHIVE"
versions = ["7.10.2","1.3.0-SNAPSHOT"]
versions = ["7.10.2", opensearch_version]
numberOfNodes = 3
plugin(provider(new Callable<RegularFile>(){
@Override
Expand Down Expand Up @@ -655,7 +673,7 @@ afterEvaluate {
ospackage {
packageName = "opensearch-performance-analyzer"
release = isSnapshot ? "0.1" : '1'
version = "${project.version}" - "-SNAPSHOT"
version = "${project.version}"

into '/usr/share/opensearch/plugins'
from(zipTree(bundlePlugin.archivePath)) {
Expand Down