Skip to content

Commit

Permalink
[migration] Rename elasticsearch to opensearch (#5)
Browse files Browse the repository at this point in the history
* [migration] rename elasticsearch to opensearch

* continue renaming

* address comments

* Address comments

Co-authored-by: Joshua Li <joshuali925@gmail.com>
  • Loading branch information
zhongnansu and joshuali925 authored Apr 19, 2021
1 parent 280ea54 commit f3eeac2
Show file tree
Hide file tree
Showing 83 changed files with 639 additions and 843 deletions.
3 changes: 3 additions & 0 deletions reports-scheduler/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

202 changes: 0 additions & 202 deletions reports-scheduler/LICENSE.txt

This file was deleted.

2 changes: 0 additions & 2 deletions reports-scheduler/NOTICE

This file was deleted.

2 changes: 1 addition & 1 deletion reports-scheduler/build-tools/esplugin-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

/**
* ES Plugin build tools don't work with the Gradle Jacoco Plugin to report coverage out of the box.
* https://github.com/elastic/elasticsearch/issues/28867.
* https://github.com/elastic/opensearch/issues/28867.
*
* This code sets up coverage reporting manually for ES plugin tests. This is complicated because:
* 1. The ES integTest Task doesn't implement Gradle's JavaForkOptions so we have to manually start the jacoco agent with the test JVM
Expand Down
14 changes: 7 additions & 7 deletions reports-scheduler/build-tools/pkgbuild.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,28 @@ afterEvaluate {
release = isSnapshot ? "0.1" : '1'
version = "${project.version}" - "-SNAPSHOT"

into '/usr/share/elasticsearch/plugins'
into '/usr/share/opensearch/plugins'
from(zipTree(bundlePlugin.archivePath)) {
into esplugin.name
into opensearchplugin.name
}

user 'root'
permissionGroup 'root'
fileMode 0644
dirMode 0755

requires('elasticsearch-oss', versions.elasticsearch, EQUAL)
requires('opensearch-oss', versions.opensearch, EQUAL)
packager = 'Amazon'
vendor = 'Amazon'
os = 'LINUX'
prefix '/usr'

license 'ASL-2.0'
maintainer 'OpenDistro for Elasticsearch Team <opendistro@amazon.com>'
url 'https://opendistro.github.io/elasticsearch/downloads'
maintainer 'OpenDistro for OpenSearch Team <opendistro@amazon.com>'
url 'https://opendistro.github.io/opensearch/downloads'
summary '''
Open Distro for Elasticsearch Report scheduler.
Reference documentation can be found at https://opendistro.github.io/elasticsearch/docs.
OpenSearch Report scheduler.
Reference documentation can be found at https://opendistro.github.io/opensearch/docs.
'''.stripIndent().replace('\n', ' ').trim()
}

Expand Down
58 changes: 34 additions & 24 deletions reports-scheduler/build.gradle
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
/*
* Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import org.elasticsearch.gradle.test.RestIntegTestTask
import org.opensearch.gradle.test.RestIntegTestTask
import java.util.concurrent.Callable

buildscript {
ext {
es_group = "org.elasticsearch"
es_version = System.getProperty("es.version", "7.10.2")
es_group = "org.opensearch"
es_version = System.getProperty("es.version", "7.10.3-SNAPSHOT")
kotlin_version = System.getProperty("kotlin.version", "1.4.0")
}

repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
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()
}

Expand All @@ -47,8 +49,8 @@ plugins {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'idea'
apply plugin: 'elasticsearch.esplugin'
apply plugin: 'elasticsearch.testclusters'
apply plugin: 'opensearch.opensearchplugin'
apply plugin: 'opensearch.testclusters'
apply plugin: 'io.gitlab.arturbosch.detekt'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'
Expand All @@ -58,9 +60,9 @@ def usingMultiNode = project.properties.containsKey('numNodes')

check.dependsOn jacocoTestReport

esplugin {
opensearchplugin {
name 'opendistro-reports-scheduler'
description 'Scheduler for ODFE Kibana Reports Plugin'
description 'Scheduler for Dashboards Reports Plugin'
classname "com.amazon.opendistroforelasticsearch.reportsscheduler.ReportsSchedulerPlugin"
extendedPlugins = ['opendistro-job-scheduler']
}
Expand Down Expand Up @@ -120,13 +122,23 @@ allprojects {
}
}

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')
}
}
}

dependencies {
compile "org.elasticsearch:elasticsearch:${es_version}"
compile "org.opensearch:opensearch:${es_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"
compileOnly "${group}:opendistro-job-scheduler-spi:${opendistroVersion}.0-SNAPSHOT"
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 @@ -136,7 +148,7 @@ dependencies {
'org.junit.jupiter:junit-jupiter-api:5.6.2'
)
testRuntime('org.junit.jupiter:junit-jupiter-engine:5.6.2')
testCompile "org.elasticsearch.test:framework:${es_version}"
testCompile "org.opensearch.test:framework:${es_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 All @@ -152,10 +164,8 @@ validateNebulaPom.enabled = false
dependencyLicenses.enabled = false
thirdPartyAudit.enabled = false
// Allow @Test to be used in test classes not inherited from LuceneTestCase.
// see https://github.com/elastic/elasticsearch/blob/master/buildSrc/src/main/resources/forbidden/es-test-signatures.txt
forbiddenApis.ignoreFailures = true
// Allow test cases to be named Tests without having to be inherited from LuceneTestCase.
// see https://github.com/elastic/elasticsearch/blob/323f312bbc829a63056a79ebe45adced5099f6e6/buildSrc/src/main/java/org/elasticsearch/gradle/precommit/TestingConventionsTasks.java
testingConventions.enabled = false
loggerUsageCheck.enabled = false

Expand Down Expand Up @@ -245,7 +255,7 @@ testClusters.integTest {
// Cluster shrink exception thrown if we try to set numberOfNodes to 1, so only apply if > 1
if (_numNodes > 1) numberOfNodes = _numNodes
// When running integration tests it doesn't forward the --debug-jvm to the cluster anymore
// i.e. we have to use a custom property to flag when we want to debug elasticsearch JVM
// i.e. we have to use a custom property to flag when we want to debug opensearch JVM
// since we also support multi node integration tests we increase debugPort per node
if (System.getProperty("cluster.debug") != null) {
def debugPort = 5005
Expand Down
Loading

0 comments on commit f3eeac2

Please sign in to comment.