Skip to content
Merged
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
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ buildscript {
// TODO: Migrate following to Gradle version catalog || Read from OpenSearch BOM in the future.
// See: https://github.com/opensearch-project/sql/issues/3257
aws_java_sdk_version = "1.12.651"
guava_version = "32.1.3-jre"
guava_version = "33.3.0-jre"
resilience4j_version = "1.5.0"
hamcrest_version = "2.1"
mockito_version = "5.7.0"
Expand Down
3 changes: 0 additions & 3 deletions integ-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,6 @@ integTest {

// Exclude this IT, because they executed in another task (:integTestWithSecurity)
exclude 'org/opensearch/sql/security/**'

// TODO. Exclude Remote IT.
exclude 'org/opensearch/sql/calcite/remote/**'
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

package org.opensearch.sql.calcite.remote.fallback;

import org.junit.Ignore;
import org.opensearch.sql.ppl.InformationSchemaCommandIT;

@Ignore("https://github.com/opensearch-project/sql/issues/3455")
public class CalciteInformationSchemaCommandIT extends InformationSchemaCommandIT {
@Override
public void init() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

package org.opensearch.sql.calcite.remote.fallback;

import org.junit.Ignore;
import org.opensearch.sql.ppl.PrometheusDataSourceCommandsIT;

@Ignore("https://github.com/opensearch-project/sql/issues/3455")
public class CalcitePrometheusDataSourceCommandsIT extends PrometheusDataSourceCommandsIT {
@Override
public void init() throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class OpenSearchSettings extends Settings {
public static final Setting<?> CALCITE_ENGINE_ENABLED_SETTING =
Setting.boolSetting(
Key.CALCITE_ENGINE_ENABLED.getKeyValue(),
true,
false,
Setting.Property.NodeScope,
Setting.Property.Dynamic);

Expand Down
72 changes: 68 additions & 4 deletions plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import java.util.concurrent.Callable
import org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin

/*
* Copyright OpenSearch Contributors
Expand Down Expand Up @@ -30,6 +31,7 @@ plugins {
id 'jacoco'
id 'opensearch.opensearchplugin'
id 'com.diffplug.spotless' version '6.22.0'
id 'com.gradleup.shadow'
}

apply plugin: 'opensearch.pluginzip'
Expand Down Expand Up @@ -148,8 +150,6 @@ spotless {

dependencies {
compileOnly "org.opensearch:opensearch-job-scheduler-spi:${opensearch_build}"
compileOnly "com.google.guava:guava:${guava_version}"
compileOnly 'com.google.guava:failureaccess:1.0.2'

api "com.fasterxml.jackson.core:jackson-core:${versions.jackson}"
api "com.fasterxml.jackson.core:jackson-databind:${versions.jackson_databind}"
Expand Down Expand Up @@ -220,12 +220,57 @@ testingConventions.enabled = false
// TODO: need to verify the thirdPartyAudit
// currently it complains missing classes like ibatis, mysql etc, should not be a problem
thirdPartyAudit.enabled = false

tasks.named("publishShadowPublicationToMavenLocal") {
dependsOn tasks.named("generatePomFileForNebulaPublication")
}
apply plugin: 'com.netflix.nebula.ospackage'
validateNebulaPom.enabled = false

generatePomFileForShadowPublication.enabled = false
validateShadowPom.enabled = false
//generatePomFileForShadowPublication.enabled = false
// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
afterEvaluate {
tasks.named("bundlePlugin", Zip).configure { zipTask ->
zipTask.doLast {
def zipFile = zipTask.archiveFile.get().asFile
println "Original bundlePlugin ZIP: ${zipFile.absolutePath}"

// Create a temporary directory for processing
def tempDir = file("$buildDir/tempBundle")
delete(tempDir)
tempDir.mkdirs()

// Extract the ZIP into the temporary directory
copy {
from zipTree(zipFile)
into tempDir
}
println "Extracted ZIP to: ${tempDir.absolutePath}"

// Determine the relocated jar produced by shadowJar.
def relocatedJar = shadowJar.archiveFile.get().asFile
def jarName = relocatedJar.getName()
println "Relocated jar to keep: ${jarName}"

// Delete all jar files (files ending with .jar) that are not the relocated jar.
fileTree(dir: tempDir, includes: ['**/*.jar']).each { File jarFile ->
if (!jarFile.getName().equals(jarName)) {
println "Deleting jar file: ${jarFile.absolutePath}"
jarFile.delete()
}
}

// Reassemble the ZIP using the remaining files
ant.zip(destfile: zipFile) {
fileset(dir: tempDir)
}
println "Final bundlePlugin ZIP updated: ${zipFile.absolutePath}"

// Clean up the temporary directory
delete(tempDir)
}
}

ospackage {
packageName = "${rootProject.name}"
release = isSnapshot ? "0.1" : '1'
Expand Down Expand Up @@ -317,3 +362,22 @@ run {
useCluster testClusters.integTest
}

def compileOnlyResolveableFiles = project.configurations.getByName(CompileOnlyResolvePlugin.RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME).files
shadowJar {
configurations = [project.configurations.runtimeClasspath]
exclude { details ->
def file = details.file
return compileOnlyResolveableFiles.contains(file)
}

destinationDirectory = file("${project.buildDir}/distributions")
archiveClassifier.set(null)

exclude 'META-INF/maven/com.google.guava/**'
exclude 'com/google/thirdparty/**'
exclude 'org/opensearch/jobscheduler/**'
exclude 'org/apache/lucene/**'

relocate 'com.google.common', 'shaded.com.google.common'
relocate 'org.joda.time', 'shaded.org.joda.time'
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@

import java.io.IOException;
import org.json.JSONObject;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.opensearch.action.ActionRequest;
import org.opensearch.action.ActionRequestValidationException;
import org.opensearch.core.common.io.stream.StreamOutput;

@Ignore("We ignore it because it conflicts with shadow Jar solution of calcite.")
public class TransportPPLQueryRequestTest {

@Rule public final ExpectedException exceptionRule = ExpectedException.none();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.opensearch.core.action.ActionResponse;

@Ignore("We ignore it because it conflicts with shadow Jar solution of calcite.")
public class TransportPPLQueryResponseTest {

@Rule public ExpectedException exceptionRule = ExpectedException.none();
Expand Down
Loading