Skip to content

Commit

Permalink
Merge branch '2.x' into backport-1195
Browse files Browse the repository at this point in the history
  • Loading branch information
Hailong-am authored Sep 25, 2024
2 parents bce2eb9 + abb1679 commit 93f016a
Show file tree
Hide file tree
Showing 42 changed files with 445 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @bowenlan-amzn @getsaurabh02 @lezzago @praveensameneni @xluo-aws @gaobinlong @Hailong-am @amsiglan @sbcd90 @eirsep @AWSHurneyt
* @bowenlan-amzn @Hailong-am @vikasvb90
8 changes: 5 additions & 3 deletions .github/workflows/bwc-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ jobs:
steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
Expand All @@ -25,8 +26,9 @@ jobs:
echo "Running backwards compatibility tests..."
./gradlew bwcTestSuite
- name: Upload failed logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
overwrite: 'true'
path: build/testclusters/indexmanagementBwcCluster*/logs/*
11 changes: 7 additions & 4 deletions .github/workflows/docker-security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
- name: Checkout Branch
uses: actions/checkout@v2
- name: Build Index Management
Expand Down Expand Up @@ -83,10 +84,11 @@ jobs:
echo "Security plugin is NOT available skipping this run as tests without security have already been run"
fi
- name: Upload failed logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
overwrite: 'true'
path: build/testclusters/integTest-*/logs/*
- name: Collect docker logs on failure
uses: jwalton/gh-docker-logs@v2
Expand All @@ -95,8 +97,9 @@ jobs:
- name: Tar logs
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs.tgz
overwrite: 'true'
path: ./logs.tgz
3 changes: 2 additions & 1 deletion .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ jobs:
export SONATYPE_PASSWORD=$(aws secretsmanager get-secret-value --secret-id maven-snapshots-password --query SecretString --output text)
echo "::add-mask::$SONATYPE_USERNAME"
echo "::add-mask::$SONATYPE_PASSWORD"
./gradlew publishPluginZipPublicationToSnapshotsRepository
./gradlew publishPluginZipPublicationToSnapshotsRepository
./gradlew publishShadowPublicationToSnapshotsRepository
5 changes: 4 additions & 1 deletion .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- "**"
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
Get-CI-Image-Tag:
Expand Down Expand Up @@ -50,8 +52,9 @@ jobs:
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew integTest -PnumNodes=3 ${{ env.TEST_FILTER }}"
- name: Upload failed logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: logs
overwrite: 'true'
path: build/testclusters/integTest-*/logs/*
12 changes: 8 additions & 4 deletions .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ on:
push:
branches:
- "**"
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
Get-CI-Image-Tag:
Expand All @@ -28,19 +30,21 @@ jobs:
steps:
# This step uses the setup-java Github action: https://github.com/actions/setup-java
- name: Set Up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 17
distribution: temurin # Temurin is a distribution of adoptium
java-version: 21
# index-management
- name: Checkout Branch
uses: actions/checkout@v2
- name: Run integration tests
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*SecurityBehaviorIT'"
su `id -un 1000` -c "./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*IT'"
- name: Upload failed logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: failure()
with:
name: logs
overwrite: 'true'
path: build/testclusters/integTest-*/logs/*
17 changes: 11 additions & 6 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
push:
branches:
- "**"
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true

jobs:
Get-CI-Image-Tag:
Expand Down Expand Up @@ -54,10 +56,10 @@ jobs:
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew build ${{ env.TEST_FILTER }}"
- name: Upload failed logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: logs
name: logs-${{ matrix.java }}-${{ matrix.feature }}
path: build/testclusters/integTest-*/logs/*
- name: Create Artifact Path
run: |
Expand All @@ -69,10 +71,12 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v1
# v4 requires node.js 20 which is not supported
uses: actions/upload-artifact@v3
with:
name: index-management-plugin-ubuntu-latest
name: index-management-plugin-ubuntu-latest-${{ matrix.java }}
path: index-management-artifacts
overwrite: 'true'

test-and-build-windows-macos:
env:
Expand Down Expand Up @@ -124,7 +128,8 @@ jobs:
cp ./build/distributions/*.zip index-management-artifacts
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: index-management-plugin-${{ matrix.os }}
name: index-management-plugin-${{ matrix.os }}-${{ matrix.java }}
path: index-management-artifacts
overwrite: 'true'
20 changes: 14 additions & 6 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,23 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| --------------------- | ----------------------------------------------------- | ----------- |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
|-----------------------|-------------------------------------------------------| ----------- |
| Vikas Bansal | [vikasvb90](https://github.com/vikasvb90) | Amazon |
| Bowen Lan | [bowenlan-amzn](https://github.com/bowenlan-amzn) | Amazon |
| Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon |
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02/) | Amazon |
| Xuesong Luo | [xluo-aws](https://github.com/xluo-aws) | Amazon |
| Hailong Cui | [Hailong-am](https://github.com/Hailong-am) | Amazon |
| Binlong Gao | [gaobinlong](https://github.com/gaobinlong) | Amazon |

## Emeritus

| Maintainer | GitHub ID | Affiliation |
|-----------------------|-------------------------------------------------------| ----------- |
| Amardeepsingh Siglani | [amsiglan](https://github.com/amsiglan) | Amazon |
| Binlong Gao | [gaobinlong](https://github.com/gaobinlong) | Amazon |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
| Joanne Wang | [jowg-amazon](https://github.com/jowg-amazon) | Amazon |
| Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon |
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02/) | Amazon |
| Subhobrata Dey | [sbcd90](https://github.com/sbcd90) | Amazon |
| Surya Sashank Nistala | [eirsep](https://github.com/eirsep) | Amazon |
| Thomas Hurney | [AWSHurneyt](https://github.com/AWSHurneyt) | Amazon |
| Xuesong Luo | [xluo-aws](https://github.com/xluo-aws) | Amazon |
| Rohit Ashiwal | [r1walz](https://github.com/r1walz) | Independent |
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import java.util.concurrent.TimeUnit
buildscript {
ext {
isSnapshot = "true" == System.getProperty("build.snapshot", "true")
opensearch_version = System.getProperty("opensearch.version", "2.15.0-SNAPSHOT")
opensearch_version = System.getProperty("opensearch.version", "2.18.0-SNAPSHOT")
buildVersionQualifier = System.getProperty("build.version_qualifier", "")
// 2.2.0-SNAPSHOT -> 2.2.0.0-SNAPSHOT
version_tokens = opensearch_version.tokenize('-')
Expand Down Expand Up @@ -271,6 +271,8 @@ publishing {
}
}

tasks.generatePomFileForPluginZipPublication.dependsOn publishNebulaPublicationToMavenLocal

plugins.withId('java') {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Version 2.16.0.0 2024-07-29

Compatible with OpenSearch 2.16.0

### Maintenance
* Increment version to 2.16.0-SNAPSHOT ([#1187](https://github.com/opensearch-project/index-management/pull/1187))
* Add publish in spi build.gradle ([#1207](https://github.com/opensearch-project/index-management/pull/1207))
* Fix github action ([#1208](https://github.com/opensearch-project/index-management/pull/1208))
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Version 2.17.0.0 2024-09-05

Compatible with OpenSearch 2.17.0

### Bug fixes
* Skipping execution based on cluster service ([#1219](https://github.com/opensearch-project/index-management/pull/1219))

### Maintenance
* Increment version to 2.17.0-SNAPSHOT ([#1221](https://github.com/opensearch-project/index-management/pull/1221))
* Use adminClient instead of client when interacting with system index in integTests ([#1222](https://github.com/opensearch-project/index-management/pull/1222))
* Move non-active maintainers to emeritus ([#1233](https://github.com/opensearch-project/index-management/pull/1233))
58 changes: 58 additions & 0 deletions spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ apply plugin: 'kotlin'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'
apply plugin: 'idea'
apply plugin: 'maven-publish'

ext {
projectSubstitutions = [:]
Expand Down Expand Up @@ -83,6 +84,11 @@ tasks.register("sourcesJar", Jar) {
from sourceSets.main.allSource
}

task javadocJar(type: Jar) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}

test {
doFirst {
test.classpath -= project.files(project.tasks.named('shadowJar'))
Expand All @@ -103,3 +109,55 @@ check.dependsOn integTest
testClusters.javaRestTest {
testDistribution = 'INTEG_TEST'
}

publishing {
repositories {
maven {
name = 'staging'
url = "${rootProject.buildDir}/local-staging-repo"
}
maven {
name = "Snapshots"
url = "https://aws.oss.sonatype.org/content/repositories/snapshots"
credentials {
username "$System.env.SONATYPE_USERNAME"
password "$System.env.SONATYPE_PASSWORD"
}
}
}
publications {
shadow(MavenPublication) {
project.shadow.component(it)

artifact sourcesJar
artifact javadocJar

pom {
name = "OpenSearch Index Management SPI"
packaging = "jar"
url = "https://github.com/opensearch-project/index-management"
description = "OpenSearch Index Management SPI"
scm {
connection = "scm:[email protected]:opensearch-project/index-management.git"
developerConnection = "scm:[email protected]:opensearch-project/index-management.git"
url = "[email protected]:opensearch-project/index-management.git"
}
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
name = "OpenSearch"
url = "https://github.com/opensearch-project/index-management"
}
}
}
}
}

gradle.startParameter.setShowStacktrace(ShowStacktrace.ALWAYS)
gradle.startParameter.setLogLevel(LogLevel.DEBUG)
}
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ class IndexManagementPlugin : JobSchedulerExtension, NetworkPlugin, ActionPlugin
fieldCapsFilter = FieldCapsFilter(clusterService, settings, indexNameExpressionResolver)
this.indexNameExpressionResolver = indexNameExpressionResolver

val skipFlag = SkipExecution(client)
val skipFlag = SkipExecution()
RollupFieldValueExpressionResolver.registerServices(scriptService, clusterService)
val rollupRunner = RollupRunner
.registerClient(client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class PluginVersionSweepCoordinator(
private val skipExecution: SkipExecution,
settings: Settings,
private val threadPool: ThreadPool,
clusterService: ClusterService,
var clusterService: ClusterService,
) : CoroutineScope by CoroutineScope(SupervisorJob() + Dispatchers.Default + CoroutineName("ISMPluginSweepCoordinator")),
LifecycleListener(),
ClusterStateListener {
Expand Down Expand Up @@ -58,7 +58,7 @@ class PluginVersionSweepCoordinator(

override fun clusterChanged(event: ClusterChangedEvent) {
if (event.nodesChanged() || event.isNewCluster) {
skipExecution.sweepISMPluginVersion()
skipExecution.sweepISMPluginVersion(clusterService)
initBackgroundSweepISMPluginVersionExecution()
}
}
Expand All @@ -76,7 +76,7 @@ class PluginVersionSweepCoordinator(
logger.info("Canceling sweep ism plugin version job")
scheduledSkipExecution?.cancel()
} else {
skipExecution.sweepISMPluginVersion()
skipExecution.sweepISMPluginVersion(clusterService)
}
} catch (e: Exception) {
logger.error("Failed to sweep ism plugin version", e)
Expand Down
Loading

0 comments on commit 93f016a

Please sign in to comment.