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

[Refactor] From legacy build-tools to opensearch build-tools #26

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ repositories {
// For some reason the root dirs all point to the buildSrc folder. The local Repo will be one above that.
flatDir { dirs new File(project.rootDir, "../localRepo") }
} else {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
maven { url "https://aws.oss.sonatype.org/content/repositories/snapshots" }
}
}

Expand All @@ -69,13 +69,13 @@ dependencies {
compileOnly localGroovy()

// Required for dependency licenses task
implementation 'org.apache.rat:apache-rat:0.11'
implementation 'org.apache.rat:apache-rat:0.13'
implementation 'commons-codec:commons-codec:1.12'

if (localRepo) {
implementation name: "build-tools-${buildToolsVersion}"
} else {
implementation group: 'org.elasticsearch.gradle', name: 'build-tools', version: buildToolsVersion
implementation group: 'org.opensearch.gradle', name: 'build-tools', version: buildToolsVersion
}
}

Expand Down
8 changes: 4 additions & 4 deletions buildSrc/opensearch-hadoop-version.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
opensearch_hadoop = 8.6.0
opensearch = 8.6.0
lucene = 9.0.0
build-tools = 8.6.0
opensearch_hadoop = 3.0.0
opensearch = 3.0.0
lucene = 9.5.0-snapshot-a4ef70f
build-tools = 3.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package org.opensearch.hadoop.gradle
import org.opensearch.hadoop.gradle.buildtools.DependenciesInfoPlugin
import org.opensearch.hadoop.gradle.buildtools.DependencyLicensesTask
import org.opensearch.hadoop.gradle.buildtools.LicenseHeadersTask
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.opensearch.hadoop.gradle.buildtools.UpdateShasTask
import org.opensearch.hadoop.gradle.buildtools.info.BuildParams
import org.opensearch.hadoop.gradle.scala.SparkVariantPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@

package org.opensearch.hadoop.gradle.fixture

import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
import org.elasticsearch.gradle.testclusters.TestDistribution
import org.opensearch.gradle.testclusters.OpenSearchCluster
nknize marked this conversation as resolved.
Show resolved Hide resolved
import org.opensearch.gradle.testclusters.StandaloneRestIntegTestTask
import org.opensearch.gradle.testclusters.TestClustersPlugin
import org.opensearch.gradle.testclusters.TestDistribution
import org.gradle.api.NamedDomainObjectContainer
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -60,8 +60,8 @@ class OpenSearchFixturePlugin implements Plugin<Project> {
}

private static void createClusterFor(TaskCollection<StandaloneRestIntegTestTask> integrationTests, Project project, String version) {
def clustersContainer = project.extensions.getByName(TestClustersPlugin.EXTENSION_NAME) as NamedDomainObjectContainer<ElasticsearchCluster>
def integTestCluster = clustersContainer.create("integTest") { ElasticsearchCluster cluster ->
def clustersContainer = project.extensions.getByName(TestClustersPlugin.EXTENSION_NAME) as NamedDomainObjectContainer<OpenSearchCluster>
def integTestCluster = clustersContainer.create("integTest") { OpenSearchCluster cluster ->
cluster.version = version
cluster.testDistribution = TestDistribution.DEFAULT
nknize marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
package org.opensearch.hadoop.gradle.fixture.hadoop

import org.apache.tools.ant.DefaultLogger
import org.elasticsearch.gradle.Version
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.gradle.Version
import org.opensearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.hadoop.gradle.buildtools.Fixture
import org.opensearch.hadoop.gradle.buildtools.LoggedExec
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.HadoopClusterConfiguration
Expand Down Expand Up @@ -327,8 +327,8 @@ class HadoopClusterFormationTasks {
// Add all node level configs to node Configuration
return project.tasks.create(name: name, type: DefaultTestClustersTask, dependsOn: setup) {
group = 'hadoopFixture'
if (node.elasticsearchCluster != null) {
useCluster(node.elasticsearchCluster)
if (node.opensearchCluster != null) {
useCluster(node.opensearchCluster)
}
doFirst {
// Write each config file needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.opensearch.hadoop.gradle.fixture.hadoop

import org.apache.tools.ant.taskdefs.condition.Os
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.opensearch.gradle.testclusters.OpenSearchCluster
import org.opensearch.hadoop.gradle.util.WaitForURL
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.InstanceConfiguration
import org.gradle.api.GradleException
Expand Down Expand Up @@ -110,8 +110,8 @@ class InstanceInfo {
/** buffer for ant output when starting this node */
ByteArrayOutputStream buffer = new ByteArrayOutputStream()

/** Elasticsearch cluster dependency for tasks **/
ElasticsearchCluster elasticsearchCluster
/** OpenSearch cluster dependency for tasks **/
OpenSearchCluster opensearchCluster

/**
* A closure to call before the cluster is considered ready. The closure is passed the node info,
Expand Down Expand Up @@ -211,7 +211,7 @@ class InstanceInfo {
args.add('"') // end the entire command, quoted
}

this.elasticsearchCluster = config.getElasticsearchCluster()
this.opensearchCluster = config.getOpenSearchCluster()
}

Path binPath() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop

import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.InstanceConfiguration
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.ServiceConfiguration

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.conf

import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.opensearch.gradle.testclusters.OpenSearchCluster
import org.gradle.api.Project

/**
Expand Down Expand Up @@ -87,7 +87,7 @@ class EndProcessConfiguration extends ProcessConfiguration {
}

@Override
ElasticsearchCluster getElasticsearchCluster() {
OpenSearchCluster getOpenSearchCluster() {
return null
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.conf

import org.elasticsearch.gradle.testclusters.ElasticsearchCluster
import org.opensearch.gradle.testclusters.OpenSearchCluster
import org.gradle.api.InvalidUserDataException
import org.gradle.api.Project
import org.gradle.api.Task
Expand Down Expand Up @@ -50,7 +50,7 @@ abstract class ProcessConfiguration {
private String javaHome = null
private String jvmArgs = ''
private boolean debug = false
private ElasticsearchCluster elasticsearchCluster = null
private OpenSearchCluster opensearchCluster = null

void addSystemProperty(String key, String value) {
systemProperties.put(key, value)
Expand Down Expand Up @@ -198,17 +198,17 @@ abstract class ProcessConfiguration {
return debug
}

void useElasticsearchCluster(ElasticsearchCluster elasticsearchCluster) {
this.elasticsearchCluster = elasticsearchCluster
void useOpenSearchCluster(OpenSearchCluster opensearchCluster) {
this.opensearchCluster = opensearchCluster
}

ElasticsearchCluster getElasticsearchCluster() {
if (this.elasticsearchCluster != null) {
return this.elasticsearchCluster
OpenSearchCluster getOpenSearchCluster() {
if (this.opensearchCluster != null) {
return this.opensearchCluster
} else {
ProcessConfiguration parent = parent()
if (parent != null) {
return parent.getElasticsearchCluster()
return parent.getOpenSearchCluster()
} else {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.conf

import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.RoleDescriptor
import org.opensearch.hadoop.gradle.fixture.hadoop.ServiceDescriptor
import org.gradle.api.GradleException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
package org.opensearch.hadoop.gradle.fixture.hadoop.services

import org.apache.tools.ant.taskdefs.condition.Os
import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.ConfigFormats
import org.opensearch.hadoop.gradle.fixture.hadoop.RoleDescriptor
import org.opensearch.hadoop.gradle.fixture.hadoop.ServiceDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.services

import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.ConfigFormats
import org.opensearch.hadoop.gradle.fixture.hadoop.SetupTaskFactory
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.HadoopClusterConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.services

import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.ConfigFormats
import org.opensearch.hadoop.gradle.fixture.hadoop.RoleDescriptor
import org.opensearch.hadoop.gradle.fixture.hadoop.ServiceDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.services

import org.elasticsearch.gradle.Version
import org.opensearch.gradle.Version
import org.opensearch.hadoop.gradle.fixture.hadoop.ConfigFormats
import org.opensearch.hadoop.gradle.fixture.hadoop.RoleDescriptor
import org.opensearch.hadoop.gradle.fixture.hadoop.ServiceDescriptor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.fixture.hadoop.tasks

import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.HadoopClusterConfiguration
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.InstanceConfiguration
import org.gradle.api.tasks.Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.buildtools;

import org.elasticsearch.gradle.dependencies.CompileOnlyResolvePlugin;
import org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ public void runRat() {
matchers.add(subStringMatcher(category, family, additional.getValue()));
}

reportConfiguration.setHeaderMatcher(new HeaderMatcherMultiplexer(matchers.toArray(IHeaderMatcher[]::new)));
reportConfiguration.setHeaderMatcher(new HeaderMatcherMultiplexer(matchers));
reportConfiguration.setApprovedLicenseNames(approvedLicenses.stream().map(license -> {
SimpleLicenseFamily simpleLicenseFamily = new SimpleLicenseFamily();
simpleLicenseFamily.setFamilyName(license);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.opensearch.hadoop.gradle.buildtools;

import org.elasticsearch.gradle.FileSystemOperationsAware;
import org.opensearch.gradle.FileSystemOperationsAware;
import org.gradle.api.Action;
import org.gradle.api.GradleException;
import org.gradle.api.Task;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

package org.opensearch.hadoop.gradle.buildtools;

import org.elasticsearch.gradle.util.GradleUtils;
import org.opensearch.gradle.util.GradleUtils;
import org.opensearch.hadoop.gradle.buildtools.info.GlobalBuildInfoPlugin;
import org.gradle.api.Action;
import org.gradle.api.GradleException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.opensearch.hadoop.gradle.buildtools.info;

import org.elasticsearch.gradle.OS;
import org.opensearch.gradle.OS;
import org.opensearch.hadoop.gradle.buildtools.Util;
import org.gradle.api.GradleException;
import org.gradle.api.JavaVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public void execute(ComponentMetadataContext componentMetadataContext) {
if (SCALA_LIBRARY.equals(details.getId().getName())) {
details.allVariants(variantMetadata -> {
variantMetadata.withCapabilities(capabilityMetadata -> {
capabilityMetadata.addCapability("org.elasticsearch.gradle", SCALA_LIBRARY, details.getId().getVersion());
capabilityMetadata.addCapability("org.opensearch.gradle", SCALA_LIBRARY, details.getId().getVersion());
});
});
}
Expand Down
6 changes: 3 additions & 3 deletions dist/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import org.opensearch.hadoop.gradle.buildtools.ConcatFilesTask
import org.opensearch.hadoop.gradle.buildtools.DependenciesInfoTask
import org.opensearch.hadoop.gradle.buildtools.DependencyLicensesTask
import org.opensearch.gradle.ConcatFilesTask
import org.opensearch.gradle.DependenciesInfoTask
import org.opensearch.gradle.precommit.DependencyLicensesTask
import org.opensearch.hadoop.gradle.BuildPlugin

apply plugin: 'opensearch.hadoop.build'
Expand Down
2 changes: 1 addition & 1 deletion qa/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ subprojects {
if (localRepo) {
classpath name: "build-tools-${version}"
} else {
classpath group: 'org.elasticsearch.gradle', name: 'build-tools', version: project.ext.buildToolsVersion
classpath group: 'org.opensearch.gradle', name: 'build-tools', version: project.ext.buildToolsVersion
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions qa/kerberos/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import org.opensearch.hadoop.gradle.buildtools.AntFixture
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.gradle.testclusters.DefaultTestClustersTask
import org.opensearch.hadoop.gradle.fixture.hadoop.HadoopFixturePlugin
import org.opensearch.hadoop.gradle.fixture.hadoop.ServiceDescriptor
import org.opensearch.hadoop.gradle.fixture.hadoop.conf.HadoopClusterConfiguration
Expand Down Expand Up @@ -292,7 +292,7 @@ if (disableTests) {
HadoopClusterConfiguration config = project.hadoop.cluster("hadoopFixture") { HadoopClusterConfiguration config ->
// Hadoop cluster depends on KDC Fixture being up and running
config.addDependency(kdcFixture)
config.useElasticsearchCluster(testClusters.integTest)
config.useOpenSearchCluster(testClusters.integTest)

config.service('hadoop') { ServiceConfiguration s ->
s.addSystemProperty("java.security.krb5.conf", krb5Conf.toString())
Expand Down