Skip to content

Commit 0d5e553

Browse files
Switch sandbox deps to analytics-api (JDK 21 surface) (#5426)
1 parent 109375d commit 0d5e553

10 files changed

Lines changed: 113 additions & 22 deletions

File tree

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Analytics Engine Compatibility
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches-ignore:
7+
- 'backport/**'
8+
- 'dependabot/**'
9+
paths:
10+
- '**/*.java'
11+
- '**gradle*'
12+
- 'integ-test/**'
13+
- '.github/workflows/analytics-engine-compat.yml'
14+
merge_group:
15+
16+
jobs:
17+
Get-CI-Image-Tag:
18+
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
19+
with:
20+
product: opensearch
21+
22+
analytics-engine-compat:
23+
needs: Get-CI-Image-Tag
24+
runs-on: ubuntu-latest
25+
container:
26+
image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }}
27+
options: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-options }}
28+
29+
steps:
30+
- name: Run start commands
31+
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
32+
33+
- uses: actions/checkout@v4
34+
35+
- name: Set up JDK 25
36+
uses: actions/setup-java@v4
37+
with:
38+
distribution: 'temurin'
39+
java-version: 25
40+
41+
- name: Run analytics-engine compatibility smoke test
42+
run: |
43+
chown -R 1000:1000 `pwd`
44+
su `id -un 1000` -c "./gradlew :integ-test:analyticsEngineCompatIT"

build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ allprojects {
127127
version += "-SNAPSHOT"
128128
}
129129

130-
// Path to the analytics-engine plugin ZIP. Override with
131-
// `-PanalyticsEngineZip=/path/to/zip` if needed.
132-
ext.analyticsEngineZip = project.findProperty('analyticsEngineZip') ?:
133-
"${rootDir}/libs/analytics-engine-3.7.0-SNAPSHOT.zip"
134-
135130
plugins.withId('java') {
136131
java {
137132
sourceCompatibility = JavaVersion.VERSION_21

core/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ dependencies {
6464
}
6565
api 'org.apache.calcite:calcite-linq4j:1.41.0'
6666
api project(':common')
67-
compileOnly files("${rootDir}/libs/analytics-framework-3.7.0-SNAPSHOT.jar")
68-
// Needed because the analytics-framework's QueryPlanExecutor signature uses
67+
compileOnly 'org.opensearch.sandbox:analytics-api:3.7.0-SNAPSHOT'
68+
// Needed because analytics-api's QueryPlanExecutor signature uses
6969
// org.opensearch.core.action.ActionListener; AnalyticsExecutionEngine references that type.
7070
compileOnly group: 'org.opensearch', name: 'opensearch-core', version: "${opensearch_version}"
71-
testImplementation files("${rootDir}/libs/analytics-framework-3.7.0-SNAPSHOT.jar")
71+
testImplementation 'org.opensearch.sandbox:analytics-api:3.7.0-SNAPSHOT'
7272
testImplementation group: 'org.opensearch', name: 'opensearch-core', version: "${opensearch_version}"
7373
implementation "com.github.seancfoley:ipaddress:5.4.2"
7474
implementation "com.jayway.jsonpath:json-path:2.9.0"

doctest/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins {
1515

1616
apply plugin: 'opensearch.testclusters'
1717

18+
1819
def path = project(':').projectDir
1920
// temporary fix, because currently we are under migration to new architecture. Need to run ./gradlew run from
2021
// plugin module, and will only build ppl in it.
@@ -195,7 +196,6 @@ testClusters {
195196
}))
196197
*/
197198
plugin(getJobSchedulerPlugin(jsPlugin, bwcOpenSearchJSDownload))
198-
plugin provider { (RegularFile) (() -> file("${rootDir}/libs/analytics-engine-3.7.0-SNAPSHOT.zip")) }
199199
plugin ':opensearch-sql-plugin'
200200
testDistribution = 'archive'
201201
}

integ-test/build.gradle

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,43 +270,72 @@ def getGeoSpatialPlugin() {
270270
}
271271
}
272272

273+
// fetch from the feature-build artifact for now (linux/x64 only; for local dev pass -PanalyticsEngineZip=/path instead).
274+
ext.pluginVersion = opensearch_version.tokenize('-')[0]
275+
ext.featureBuildBase = "https://ci.opensearch.org/ci/dbc/feature-build-opensearch/feature-datafusion/latest/linux/x64/tar/builds/opensearch/plugins"
276+
ext.analyticsEngineZipDest = "${buildDir}/distributions/analytics-engine-${pluginVersion}-SNAPSHOT.zip"
277+
ext.arrowFlightRpcZipDest = "${buildDir}/distributions/arrow-flight-rpc-${pluginVersion}-SNAPSHOT.zip"
278+
279+
task downloadAnalyticsEngineZip(type: Download) {
280+
src "${featureBuildBase}/1-analytics-engine-${pluginVersion}.zip"
281+
dest analyticsEngineZipDest
282+
overwrite false
283+
onlyIfModified true
284+
onlyIf { !project.findProperty('analyticsEngineZip') }
285+
}
286+
287+
task downloadArrowFlightRpcZip(type: Download) {
288+
src "${featureBuildBase}/0-arrow-flight-rpc-${pluginVersion}.zip"
289+
dest arrowFlightRpcZipDest
290+
overwrite false
291+
onlyIfModified true
292+
onlyIf { !project.findProperty('arrowFlightRpcZip') }
293+
}
294+
273295
def getAnalyticsEnginePlugin() {
274-
provider { (RegularFile) (() -> file("${rootDir}/libs/analytics-engine-3.7.0-SNAPSHOT.zip")) }
296+
provider { (RegularFile) (() -> file(project.findProperty('analyticsEngineZip') ?: analyticsEngineZipDest)) }
297+
}
298+
299+
def getArrowFlightRpcPlugin() {
300+
provider { (RegularFile) (() -> file(project.findProperty('arrowFlightRpcZip') ?: arrowFlightRpcZipDest)) }
275301
}
276302

277303
testClusters {
278304
integTest {
279305
testDistribution = 'archive'
280306
plugin(getJobSchedulerPlugin())
281307
plugin(getGeoSpatialPlugin())
282-
plugin(getAnalyticsEnginePlugin())
283308
plugin ":opensearch-sql-plugin"
284309
setting "plugins.query.datasources.encryption.masterkey", "1234567812345678"
285310
}
286311
yamlRestTest {
287312
testDistribution = 'archive'
288313
plugin(getJobSchedulerPlugin())
289314
plugin(getGeoSpatialPlugin())
290-
plugin(getAnalyticsEnginePlugin())
291315
plugin ":opensearch-sql-plugin"
292316
setting "plugins.query.datasources.encryption.masterkey", "1234567812345678"
293317
}
294318
remoteCluster {
295319
testDistribution = 'archive'
296320
plugin(getJobSchedulerPlugin())
297321
plugin(getGeoSpatialPlugin())
298-
plugin(getAnalyticsEnginePlugin())
299322
plugin ":opensearch-sql-plugin"
300323
}
301324
integTestWithSecurity {
302325
testDistribution = 'archive'
303326
plugin(getJobSchedulerPlugin())
304-
plugin(getAnalyticsEnginePlugin())
305327
plugin ":opensearch-sql-plugin"
306328
}
307329
remoteIntegTestWithSecurity {
308330
testDistribution = 'archive'
309331
plugin(getJobSchedulerPlugin())
332+
plugin ":opensearch-sql-plugin"
333+
}
334+
// Smoke test: verify sql loads cleanly alongside analytics-engine.
335+
analyticsEngineCompat {
336+
testDistribution = 'archive'
337+
plugin(getJobSchedulerPlugin())
338+
plugin(getArrowFlightRpcPlugin())
310339
plugin(getAnalyticsEnginePlugin())
311340
plugin ":opensearch-sql-plugin"
312341
}
@@ -360,9 +389,17 @@ task stopPrometheus(type: KillProcessTask) {
360389

361390
stopPrometheus.mustRunAfter startPrometheus
362391

392+
task analyticsEngineCompatIT(type: RestIntegTestTask) {
393+
useCluster testClusters.analyticsEngineCompat
394+
dependsOn downloadAnalyticsEngineZip, downloadArrowFlightRpcZip
395+
systemProperty 'tests.security.manager', 'false'
396+
filter {
397+
includeTestsMatching 'org.opensearch.sql.plugin.AnalyticsEngineCompatIT'
398+
}
399+
}
400+
363401
task integJdbcTest(type: RestIntegTestTask) {
364402
testClusters.findAll {c -> c.clusterName == "integJdbcTest"}.first().with {
365-
plugin(getAnalyticsEnginePlugin())
366403
plugin ":opensearch-sql-plugin"
367404
}
368405

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Copyright OpenSearch Contributors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package org.opensearch.sql.plugin;
7+
8+
import org.junit.Test;
9+
import org.opensearch.test.rest.OpenSearchRestTestCase;
10+
11+
/**
12+
* Smoke test: verifies that opensearch-sql loads cleanly alongside arrow-flight-rpc and
13+
* analytics-engine. A successful cluster start is the only assertion — no sql-specific logic runs.
14+
*/
15+
public class AnalyticsEngineCompatIT extends OpenSearchRestTestCase {
16+
17+
@Test
18+
public void testClusterStarted() {
19+
// If the cluster booted, all three plugins loaded without classloader errors.
20+
}
21+
}
-188 KB
Binary file not shown.
-22.9 MB
Binary file not shown.
-42.5 KB
Binary file not shown.

plugin/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import java.util.concurrent.Callable
2-
import org.opensearch.gradle.dependencies.CompileOnlyResolvePlugin
32

43
/*
54
* Copyright OpenSearch Contributors
@@ -161,10 +160,7 @@ dependencies {
161160

162161
api project(":ppl")
163162
api project(':api')
164-
// Bundled: analytics-framework interfaces must resolve even when the plugin is absent.
165-
api files("${rootDir}/libs/analytics-framework-3.7.0-SNAPSHOT.jar")
166-
// Not bundled: classes here (e.g. OpenSearchSchemaBuilder) only load when the plugin is installed.
167-
compileOnly files("${rootDir}/libs/analytics-engine-3.7.0-SNAPSHOT.jar")
163+
implementation("org.opensearch.sandbox:analytics-api:${opensearch_version}")
168164
api project(':legacy')
169165
api project(':opensearch')
170166
api project(':prometheus')
@@ -310,7 +306,6 @@ def getJobSchedulerPlugin() {
310306

311307
testClusters.integTest {
312308
plugin(getJobSchedulerPlugin())
313-
plugin provider { (RegularFile) (() -> file("${analyticsEngineZip}")) }
314309
plugin(project.tasks.bundlePlugin.archiveFile)
315310
testDistribution = "ARCHIVE"
316311

@@ -326,4 +321,3 @@ testClusters.integTest {
326321
run {
327322
useCluster testClusters.integTest
328323
}
329-

0 commit comments

Comments
 (0)