Skip to content

Commit

Permalink
Adding OS 2.0 related changes
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <[email protected]>
  • Loading branch information
sgup432 committed Apr 6, 2022
1 parent 5ae5003 commit 48eedf2
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gauntlet-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ jobs:
path: ./tmp/performance-analyzer-rca
- name: Build RCA and run Gauntlet tests
working-directory: ./tmp/performance-analyzer-rca
run: ./gradlew build -Drun.gauntlet.tests=true -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew build -Drun.gauntlet.tests=true
16 changes: 8 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
path: ./tmp/performance-analyzer-rca
- name: Build RCA
working-directory: ./tmp/performance-analyzer-rca
run: ./gradlew build --stacktrace -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew build --stacktrace
- name: Upload reports
uses: actions/upload-artifact@v2
with:
Expand All @@ -47,36 +47,36 @@ jobs:
run: bash <(curl -s https://codecov.io/bash) -f ./build/reports/jacoco/test/jacocoTestReport.xml
- name: Publish RCA jar to maven local
working-directory: ./tmp/performance-analyzer-rca
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew publishToMavenLocal

# PA in ./tmp/performance-analyzer
- name: Checkout Performance Analyzer
uses: actions/checkout@v2
with:
repository: opensearch-project/performance-analyzer
ref: main
repository: sgup432/performance-analyzer
ref: jdk_gradle_7_OS2
path: ./tmp/performance-analyzer
- name: Build PA gradle using the new RCA jar
working-directory: ./tmp/performance-analyzer
run: rm -f licenses/performanceanalyzer-rca-*.jar.sha1
- name: Update SHA
working-directory: ./tmp/performance-analyzer
run: ./gradlew updateShas -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew updateShas
- name: Set docker-compose path
run: echo "DOCKER_COMPOSE_LOCATION=$(which docker-compose)" >> $GITHUB_ENV
# Set the vm.max_map_count system property to the minimum required to run OpenSearch
- name: Set vm.max_map_count
run: sudo sysctl -w vm.max_map_count=262144
- name: Build PA and run Unit Tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew build -i -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew build

# Enable RCA for Integration Tests
- name: Spin up Docker cluster for integ testing
working-directory: ./tmp/performance-analyzer-rca
run: ./gradlew enableRca -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew enableRca

# Run Integration Tests in PA
- name: Run integration tests
working-directory: ./tmp/performance-analyzer
run: ./gradlew integTest --info --stacktrace -Dtests.enableIT=true -Dopensearch.version=1.3.0-SNAPSHOT
run: ./gradlew integTest --info --stacktrace -Dtests.enableIT=true
30 changes: 22 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,21 @@ distributions {
}

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")
gitPaBranch = 'main'
gitPaRepo = "https://github.com/opensearch-project/performance-analyzer.git"
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"
}
gitPaBranch = 'jdk_gradle_7_OS2.0'
gitPaRepo = "https://github.com/sgup432/performance-analyzer.git"
runGauntletTests = "true" == System.getProperty("run.gauntlet.tests", "false")
}

Expand Down Expand Up @@ -181,10 +192,7 @@ jacocoTestCoverageVerification {
// to run coverage verification during the build (and fail when appropriate)
check.dependsOn jacocoTestCoverageVerification

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

distZip {
archiveName "performance-analyzer-rca-${version}.zip"
Expand Down Expand Up @@ -411,7 +419,13 @@ task buildPa(type: Exec) {
dependsOn(assemble, publishToMavenLocal, regenerateLicenses)
workingDir paDir
println String.format('pa in dir: (%s) will be built.', paDir)
commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}"
println String.format('opensearch_version: (%s), plugin_version: (%s), snapshot: (%s), qualifier: (%s).', opensearch_version, version, isSnapshot, buildVersionQualifier)
if (buildVersionQualifier == null || buildVersionQualifier == '' || buildVersionQualifier == 'null') {
commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}"
}
else {
commandLine './gradlew', 'assemble', "-Dopensearch.version=${opensearch_version}", "-Dbuild.snapshot=${isSnapshot}", "-Dbuild.version_qualifier=${buildVersionQualifier}"
}
println "PA repo located at '" + paDir + "' will be used."
}

Expand Down

0 comments on commit 48eedf2

Please sign in to comment.