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

Fix snapshot build, build against OpenSearch 1.1. #119

Closed
wants to merge 1 commit into from
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
48 changes: 31 additions & 17 deletions .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal
# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
Expand All @@ -39,32 +39,46 @@ jobs:
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
path: job-scheduler
ref: '1.0'
ref: 'main'
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# dependencies: alerting-notification
- name: Checkout alerting
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../src/test/resources/job-scheduler
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler
ls ../src/test/resources/job-scheduler
# dependencies: notifications
- name: Checkout notifications
uses: actions/checkout@v2
with:
repository: 'opensearch-project/alerting'
path: alerting
ref: '1.0'
- name: Build alerting
working-directory: ./alerting
run: ./gradlew :alerting-notification:publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
repository: 'dblock/notifications'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this leftover for testing? Can we change this back to the official repo?

path: notifications
ref: 'fix-snapshot-build'
- name: Build notifications
working-directory: ./notifications/notifications
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble notifications
working-directory: ./notifications/notifications
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../../src/test/resources/notifications
cp ./notifications/build/distributions/*.zip ../../src/test/resources/notifications
ls ../../src/test/resources/notifications
- name: Run integration tests with multi node config
run: ./gradlew integTest -PnumNodes=3
run: ./gradlew integTest -PnumNodes=3 -Dopensearch.version=1.1.0-SNAPSHOT
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
49 changes: 32 additions & 17 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal
# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
Expand All @@ -39,32 +39,47 @@ jobs:
ref: 'main'
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
# check out index-management
- name: Checkout Branch
uses: actions/checkout@v2
# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
path: job-scheduler
ref: '1.0'
ref: 'main'
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# dependencies: alerting-notification
- name: Checkout alerting
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../src/test/resources/job-scheduler
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler
ls ../src/test/resources/job-scheduler
# dependencies: notifications
- name: Checkout notifications
uses: actions/checkout@v2
with:
repository: 'opensearch-project/alerting'
path: alerting
ref: '1.0'
- name: Build alerting
working-directory: ./alerting
run: ./gradlew :alerting-notification:publishToMavenLocal -Dopensearch.version=1.0.0 -Dbuild.snapshot=false
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
repository: 'dblock/notifications'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above

path: notifications
ref: 'fix-snapshot-build'
- name: Build notifications
working-directory: ./notifications/notifications
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble notifications
working-directory: ./notifications/notifications
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
mkdir -p ../../src/test/resources/notifications
cp ./notifications/build/distributions/*.zip ../../src/test/resources/notifications
ls ../../src/test/resources/notifications
# build index management
- name: Build with Gradle
run: ./gradlew build
run: ./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ out/
*.iws
.DS_Store
*.log
http
http
.project
.settings
24 changes: 14 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ import java.util.function.Predicate

buildscript {
ext {
opensearch_version = System.getProperty("opensearch.version", "1.0.0")
opensearch_version = System.getProperty("opensearch.version", "1.1.0-SNAPSHOT")
// 1.1.0 -> 1.1.0.0, and 1.1.0-SNAPSHOT -> 1.1.0.0-SNAPSHOT
opensearch_build = opensearch_version.replaceAll(/(\.\d)([^\d]*)$/, '$1.0$2')
common_utils_version = System.getProperty("common_utils.version", opensearch_build)
job_scheduler_version = System.getProperty("job_scheduler_version.version", opensearch_build)
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
}

Expand Down Expand Up @@ -139,25 +143,29 @@ configurations.testCompile {

ext {
projectSubstitutions = [:]
opensearchVersion = "${version}"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
licenseFile = rootProject.file('LICENSE')
noticeFile = rootProject.file('NOTICE')
}

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

dependencies {
compileOnly "org.opensearch:opensearch:${opensearch_version}"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:1.0.0.0"
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${job_scheduler_version}"
compile group: 'commons-codec', name: 'commons-codec', version: '1.13'
compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
compile 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9'
compile "org.jetbrains:annotations:13.0"
compile "org.opensearch:common-utils:1.0.0.0"
compile "org.opensearch:common-utils:${common_utils_version}"
compile "com.github.seancfoley:ipaddress:5.3.3"

testCompile "org.opensearch.test:framework:${opensearch_version}"
Expand All @@ -176,10 +184,6 @@ repositories {
mavenLocal()
}

if (isSnapshot) {
version += "-SNAPSHOT"
}

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/job-scheduler/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build and copy opensearch-job-scheduler-1.x-SNAPSHOT.zip from https://github.com/opensearch-project/job-scheduler here.

*.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions src/test/resources/notifications/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Build and copy opensearch-notifications-1.x-SNAPSHOT.zip from https://github.com/opensearch-project/notifications/notifications here.

*.zip
Binary file not shown.
Binary file not shown.