Skip to content

Commit

Permalink
[Migration] Reports-scheduler renaming, version reset, fix CI workflow (
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongnansu authored Apr 26, 2021
1 parent 99e07e9 commit 1e6b521
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 31 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,50 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- name: Set up JDK 1.14
uses: actions/setup-java@v1
with:
java-version: 1.14

# dependencies: OpenSearch
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0.0-alpha1'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=alpha1 -Dbuild.snapshot=false

# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
repository: 'opensearch-project/common-utils'
path: common-utils
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-alpha1

# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
repository: 'opensearch-project/job-scheduler'
path: job-scheduler
- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-alpha1 -Dbuild.snapshot=false

# reports-scheduler
- name: Checkout Reports Scheduler
uses: actions/checkout@v2

- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build
./gradlew build -Dopensearch.version=1.0.0-alpha1
- name: Create Artifact Path
run: |
Expand Down
2 changes: 1 addition & 1 deletion reports-scheduler/build-tools/pkgbuild.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ afterEvaluate {
maintainer 'OpenDistro for OpenSearch Team <[email protected]>'
url 'https://opendistro.github.io/opensearch/downloads'
summary '''
OpenSearch Report scheduler.
OpenSearch Reports scheduler.
Reference documentation can be found at https://opendistro.github.io/opensearch/docs.
'''.stripIndent().replace('\n', ' ').trim()
}
Expand Down
38 changes: 13 additions & 25 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,21 @@ import java.util.concurrent.Callable

buildscript {
ext {
es_group = "org.opensearch"
es_version = System.getProperty("es.version", "7.10.3-SNAPSHOT")
opensearch_group = "org.opensearch"
opensearch_version = System.getProperty("opensearch.version", "1.0.0-alpha1")
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
//TODO: temp, may need to change
plugin_version = "1.0.0.0"
}

repositories {
mavenLocal()
mavenCentral()
maven {
url = 's3://search-vemsarat/'
credentials(AwsCredentials) {
accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id')
secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key')
}
}
jcenter()
}

dependencies {
classpath "${es_group}.gradle:build-tools:${es_version}"
classpath "${opensearch_group}.gradle:build-tools:${opensearch_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.12.0"
Expand Down Expand Up @@ -76,9 +72,10 @@ def usingMultiNode = project.properties.containsKey('numNodes')
check.dependsOn jacocoTestReport

opensearchplugin {
name 'opendistro-reports-scheduler'
name 'opensearch-reports-scheduler'
description 'Scheduler for Dashboards Reports Plugin'
classname "com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin"
//TODO: rename after job-scheduler renames and publishes
extendedPlugins = ['opendistro-job-scheduler']
}

Expand Down Expand Up @@ -112,7 +109,6 @@ ext {
projectSubstitutions = [:]
licenseFile = rootProject.file('LICENSE.txt')
noticeFile = rootProject.file('NOTICE.txt')
opendistroVersion = "${version}"
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
}

Expand All @@ -130,30 +126,23 @@ plugins.withId('org.jetbrains.kotlin.jvm') {

allprojects {
group = "com.amazon.opendistroforelasticsearch"
version = "${opendistroVersion}.0"

plugins.withId('java') {
sourceCompatibility = targetCompatibility = "1.8"
}
}

repositories {
maven {
url = 's3://search-vemsarat/'
credentials(AwsCredentials) {
accessKey = System.env.AWS_ACCESS_KEY_ID ?: findProperty('aws_access_key_id')
secretKey = System.env.AWS_SECRET_ACCESS_KEY ?: findProperty('aws_secret_access_key')
}
}
mavenLocal()
}

dependencies {
compile "org.opensearch:opensearch:${es_version}"
compile "org.opensearch:opensearch:${opensearch_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
compile "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
compile "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9"
compile "${group}:common-utils:${opendistroVersion}.0"
compileOnly "${group}:opendistro-job-scheduler-spi:${opendistroVersion}.0-SNAPSHOT"
compile "${group}:common-utils:${plugin_version}"
compileOnly "${group}:opensearch-job-scheduler-spi:${plugin_version}-beta1"
compile group: 'com.google.guava', name: 'guava', version: '15.0'
compile "org.json:json:20180813"
compile group: 'com.github.wnameless', name: 'json-flattener', version: '0.1.0'
Expand All @@ -163,7 +152,7 @@ dependencies {
'org.junit.jupiter:junit-jupiter-api:5.6.2'
)
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.6.2')
testCompile "org.opensearch.test:framework:${es_version}"
testCompile "org.opensearch.test:framework:${opensearch_version}"
testCompile "org.jetbrains.kotlin:kotlin-test:${kotlin_version}"
testImplementation "com.nhaarman.mockitokotlin2:mockito-kotlin:2.2.0"
testCompile "org.mockito:mockito-core:2.23.0"
Expand Down Expand Up @@ -254,7 +243,6 @@ integTest.dependsOn(bundle)
integTest.getClusters().forEach{c -> c.plugin(project.getObjects().fileProperty().value(bundle.getArchiveFile()))}

testClusters.integTest {
testDistribution = 'OSS'
// need to install job-scheduler first, need to assemble job-scheduler first
plugin(provider(new Callable<RegularFile>(){
@Override
Expand Down
2 changes: 1 addition & 1 deletion reports-scheduler/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
#
##

version = 1.15.0
version = 1.0.0.0-beta1
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ class ReportsSchedulerPluginIT : OpenSearchIntegTestCase() {
.anyMatch { pluginInfo: PluginInfo -> pluginInfo.name == "opendistro-job-scheduler" })
assertTrue(
pluginInfos.stream()
.anyMatch { pluginInfo: PluginInfo -> pluginInfo.name == "opendistro-reports-scheduler" })
.anyMatch { pluginInfo: PluginInfo -> pluginInfo.name == "opensearch-reports-scheduler" })
}
}
Binary file not shown.
Binary file not shown.

0 comments on commit 1e6b521

Please sign in to comment.