Skip to content

Commit c9cedb1

Browse files
Merge branch 'opensearch-project:main' into main
2 parents 31d2e3e + fd87947 commit c9cedb1

File tree

96 files changed

+780
-544
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+780
-544
lines changed

.github/workflows/build-and-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
build-test-linux:
1919
strategy:
2020
matrix:
21-
java: [21]
21+
java: [21, 23]
2222

2323
name: Build CCR Plugin on Linux using Container Image
2424
runs-on: ubuntu-latest

.github/workflows/bwc.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ jobs:
1313
# Job name
1414
name: Run BWC Test
1515
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
java: [21, 23]
1619
steps:
1720
# This step uses the setup-java Github action: https://github.com/actions/setup-java
18-
- name: Set Up JDK 21
21+
- name: Set Up JDK ${{ matrix.java }}
1922
uses: actions/setup-java@v1
2023
with:
21-
java-version: 21
24+
java-version: ${{ matrix.java }}
2225
# This step uses the checkout Github action: https://github.com/actions/checkout
2326
- name: Checkout Branch
2427
uses: actions/checkout@v4

.github/workflows/dco-check.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/maven-publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish snapshots to maven
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- '[0-9]+.[0-9]+'
9+
- '[0-9]+.x'
10+
jobs:
11+
build-and-publish-snapshots:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
contents: write
16+
steps:
17+
- uses: actions/setup-java@v4
18+
with:
19+
distribution: temurin # Temurin is a distribution of adoptium
20+
java-version: 21
21+
- uses: actions/checkout@v4
22+
- uses: aws-actions/configure-aws-credentials@v4
23+
with:
24+
role-to-assume: ${{ secrets.PUBLISH_SNAPSHOTS_ROLE }}
25+
aws-region: us-east-1
26+
- name: publish snapshots to maven
27+
run: |
28+
export SONATYPE_USERNAME=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-username --query SecretString --output text)
29+
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
30+
echo "::add-mask::$SONATYPE_USERNAME"
31+
echo "::add-mask::$SONATYPE_PASSWORD"
32+
./gradlew publishPluginZipPublicationToSnapshotsRepository

.github/workflows/security-knn-tests.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
if: ${{ 'True' == needs.req.outputs.isSecurityPluginAvailable }}
5656
# Job name
5757
name: Build and Run Security tests
58+
strategy:
59+
matrix:
60+
java: [21, 23]
5861
runs-on: ubuntu-latest
5962
container:
6063
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
@@ -67,10 +70,10 @@ jobs:
6770
- name: Run start commands
6871
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
6972
# This step uses the setup-java Github action: https://github.com/actions/setup-java
70-
- name: Set Up JDK 21
73+
- name: Set Up JDK ${{ matrix.java }}
7174
uses: actions/setup-java@v4
7275
with:
73-
java-version: 21
76+
java-version: ${{ matrix.java }}
7477
distribution: 'temurin'
7578
# This step uses the checkout Github action: https://github.com/actions/checkout
7679
- name: Checkout Branch
@@ -84,7 +87,7 @@ jobs:
8487
uses: actions/upload-artifact@v4
8588
if: failure()
8689
with:
87-
name: logs
90+
name: logs-build-${{ matrix.java }}
8891
path: |
8992
build/testclusters/integTest-*/logs/*
9093
build/testclusters/leaderCluster-*/logs/*
@@ -103,6 +106,9 @@ jobs:
103106
if: ${{ 'True' == needs.req.outputs.isKnnPluginAvailable }}
104107
# Job name
105108
name: Build and Run Knn tests
109+
strategy:
110+
matrix:
111+
java: [21, 23]
106112
runs-on: ubuntu-latest
107113
container:
108114
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
@@ -115,10 +121,10 @@ jobs:
115121
- name: Run start commands
116122
run: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-start-command }}
117123
# This step uses the setup-java Github action: https://github.com/actions/setup-java
118-
- name: Set Up JDK 21
124+
- name: Set Up JDK ${{ matrix.java }}
119125
uses: actions/setup-java@v4
120126
with:
121-
java-version: 21
127+
java-version: ${{ matrix.java }}
122128
distribution: 'temurin'
123129
# This step uses the checkout Github action: https://github.com/actions/checkout
124130
- name: Checkout Branch
@@ -131,7 +137,7 @@ jobs:
131137
uses: actions/upload-artifact@v4
132138
if: failure()
133139
with:
134-
name: logs
140+
name: logs-knnbuild-${{ matrix.java }}
135141
path: |
136142
build/testclusters/integTest-*/logs/*
137143
build/testclusters/leaderCluster-*/logs/*

build.gradle

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,11 @@ import org.opensearch.gradle.test.RestIntegTestTask
3535
buildscript {
3636
ext {
3737
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
38-
opensearch_version = System.getProperty("opensearch.version", "3.0.0-SNAPSHOT")
39-
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
38+
opensearch_version = System.getProperty("opensearch.version", "3.0.0-beta1-SNAPSHOT")
39+
buildVersionQualifier = System.getProperty("build.version_qualifier", "beta1")
4040
// e.g. 2.0.0-rc1-SNAPSHOT -> 2.0.0.0-rc1-SNAPSHOT
4141
version_tokens = opensearch_version.tokenize('-')
42+
opensearch_version_no_qualifier = version_tokens[0]
4243
opensearch_build = version_tokens[0] + '.0'
4344
if (buildVersionQualifier) {
4445
opensearch_build += "-${buildVersionQualifier}"
@@ -59,7 +60,12 @@ buildscript {
5960
if (!isSnapshot) {
6061
security_plugin_version = opensearch_build.replace("-SNAPSHOT","")
6162
}
62-
knn_plugin_version = security_plugin_version
63+
64+
opensearch_no_snapshot = opensearch_version.replace("-SNAPSHOT","")
65+
security_no_snapshot = opensearch_build.replace("-SNAPSHOT","")
66+
knn_plugin_path = "build/dependencies/knn"
67+
knn_plugin_download_url = 'https://ci.opensearch.org/ci/dbc/distribution-build-opensearch/' + opensearch_no_snapshot +
68+
'/latest/linux/x64/tar/builds/opensearch/plugins/opensearch-knn-' + security_no_snapshot + '.zip'
6369

6470
}
6571

@@ -241,21 +247,20 @@ def securityPluginFile = new Callable<RegularFile>() {
241247

242248
def knnEnabled = findProperty("knn") == "true"
243249

244-
if(knnEnabled == true ){
245-
dependencies{
246-
opensearchPlugin "org.opensearch.plugin:opensearch-knn:${knn_plugin_version}@zip"
247-
}
248-
}
249-
250250
def knnPluginFile = new Callable<RegularFile>() {
251251
@Override
252252
RegularFile call() throws Exception {
253253
return new RegularFile() {
254254
@Override
255255
File getAsFile() {
256-
return configurations.opensearchPlugin.resolvedConfiguration.resolvedArtifacts
257-
.find { ResolvedArtifact f -> f.name.contains('opensearch-knn') }
258-
.file
256+
if (new File("$project.rootDir/$knn_plugin_path").exists()) {
257+
project.delete(files("$project.rootDir/$knn_plugin_path"))
258+
}
259+
project.mkdir knn_plugin_path
260+
ant.get(src: knn_plugin_download_url,
261+
dest: knn_plugin_path,
262+
httpusecaches: false)
263+
return fileTree(knn_plugin_path).getSingleFile()
259264
}
260265
}
261266
}
@@ -382,6 +387,8 @@ testClusters {
382387
if(knnEnabled) {
383388
plugin(provider(knnPluginFile))
384389
testDistribution = "ARCHIVE"
390+
systemProperty "java.library.path", "${buildDir}/testclusters/leaderCluster-0/distro/${opensearch_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
391+
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/leaderCluster-0/distro/${opensearch_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
385392
}
386393
int debugPort = 5005
387394

@@ -399,6 +406,8 @@ testClusters {
399406
if(knnEnabled) {
400407
plugin(provider(knnPluginFile))
401408
testDistribution = "ARCHIVE"
409+
systemProperty "java.library.path", "${buildDir}/testclusters/followCluster-0/distro/${opensearch_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
410+
environment "LD_LIBRARY_PATH", "${buildDir}/testclusters/followCluster-0/distro/${opensearch_version_no_qualifier}-ARCHIVE/plugins/opensearch-knn/lib"
402411
}
403412
int debugPort = 5010
404413
if (_numNodes > 1) numberOfNodes = _numNodes
@@ -980,6 +989,16 @@ publishing {
980989
}
981990
}
982991
}
992+
repositories {
993+
maven {
994+
name = "Snapshots"
995+
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
996+
credentials {
997+
username "$System.env.SONATYPE_USERNAME"
998+
password "$System.env.SONATYPE_PASSWORD"
999+
}
1000+
}
1001+
}
9831002
}
9841003

9851004
// updateVersion: Task to auto increment to the next development iteration

gradle/wrapper/gradle-wrapper.jar

8.33 KB
Binary file not shown.
Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
1-
#
2-
# SPDX-License-Identifier: Apache-2.0
3-
#
4-
# The OpenSearch Contributors require contributions made to
5-
# this file be licensed under the Apache-2.0 license or a
6-
# compatible open source license.
7-
#
8-
# Modifications Copyright OpenSearch Contributors. See
9-
# GitHub history for details.
10-
#
11-
121
distributionBase=GRADLE_USER_HOME
132
distributionPath=wrapper/dists
14-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
3+
distributionSha256Sum=2ab88d6de2c23e6adae7363ae6e29cbdd2a709e992929b48b6530fd0c7133bd6
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
5+
networkTimeout=10000
6+
validateDistributionUrl=true
157
zipStoreBase=GRADLE_USER_HOME
168
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)