-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix build/CI and add backport workflow (#161)
* fix build/CI and add backport workflow Signed-off-by: Yaliang Wu <[email protected]> * fix flaky test Signed-off-by: Yaliang Wu <[email protected]>
- Loading branch information
Showing
36 changed files
with
245 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Backport | ||
on: | ||
pull_request_target: | ||
types: | ||
- closed | ||
- labeled | ||
|
||
jobs: | ||
backport: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
name: Backport | ||
steps: | ||
- name: GitHub App token | ||
id: github_app_token | ||
uses: tibdex/[email protected] | ||
with: | ||
app_id: ${{ secrets.APP_ID }} | ||
private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
installation_id: 22958780 | ||
|
||
- name: Backport | ||
uses: VachaShah/[email protected] | ||
with: | ||
github_token: ${{ steps.github_app_token.outputs.token }} | ||
branch_name: backport/backport-${{ github.event.number }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Delete merged branch of the backport PRs | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
delete-branch: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.event.pull_request.head.ref,'backport/') | ||
steps: | ||
- name: Delete merged branch | ||
uses: SvanBoxel/delete-merged-branch@main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ ext { | |
} | ||
|
||
opensearchplugin { | ||
name 'opensearch-ml-plugin' | ||
name 'opensearch-ml' | ||
description 'machine learning plugin for opensearch' | ||
classname 'org.opensearch.ml.plugin.MachineLearningPlugin' | ||
} | ||
|
@@ -57,7 +57,7 @@ compileJava { | |
} | ||
|
||
//TODO: check which one should be enabled | ||
licenseHeaders.enabled = false | ||
licenseHeaders.enabled = true | ||
testingConventions.enabled = false | ||
checkstyleTest.enabled = false | ||
forbiddenApis.ignoreFailures = false | ||
|
@@ -247,6 +247,71 @@ configurations.all { | |
resolutionStrategy.force 'commons-logging:commons-logging:1.2' | ||
} | ||
|
||
apply plugin: 'nebula.ospackage' | ||
|
||
// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name | ||
afterEvaluate { | ||
ospackage { | ||
packageName = "${name}" | ||
release = isSnapshot ? "0.1" : '1' | ||
version = "${project.version}" - "-SNAPSHOT" | ||
|
||
into '/usr/share/opensearch/plugins' | ||
from(zipTree(bundlePlugin.archivePath)) { | ||
into opensearchplugin.name | ||
} | ||
|
||
user 'root' | ||
permissionGroup 'root' | ||
fileMode 0644 | ||
dirMode 0755 | ||
|
||
requires('opensearch-oss', versions.opensearch, EQUAL) | ||
packager = 'Amazon' | ||
vendor = 'Amazon' | ||
os = 'LINUX' | ||
prefix '/usr' | ||
|
||
license 'ASL-2.0' | ||
maintainer 'OpenSearch <[email protected]>' | ||
url 'https://opensearch.org/downloads.html' | ||
summary ''' | ||
ML plugin for OpenSearch. | ||
Github https://github.com/opensearch-project/ml-commons. | ||
'''.stripIndent().replace('\n', ' ').trim() | ||
} | ||
|
||
buildRpm { | ||
arch = 'NOARCH' | ||
dependsOn 'assemble' | ||
finalizedBy 'renameRpm' | ||
task renameRpm(type: Copy) { | ||
from("$buildDir/distributions") | ||
into("$buildDir/distributions") | ||
include archiveName | ||
rename archiveName, "${packageName}-${version}.rpm" | ||
doLast { delete file("$buildDir/distributions/$archiveName") } | ||
} | ||
} | ||
|
||
buildDeb { | ||
arch = 'all' | ||
dependsOn 'assemble' | ||
finalizedBy 'renameDeb' | ||
task renameDeb(type: Copy) { | ||
from("$buildDir/distributions") | ||
into("$buildDir/distributions") | ||
include archiveName | ||
rename archiveName, "${packageName}-${version}.deb" | ||
doLast { delete file("$buildDir/distributions/$archiveName") } | ||
} | ||
} | ||
|
||
task buildPackages(type: GradleBuild) { | ||
tasks = ['build', 'buildRpm', 'buildDeb'] | ||
} | ||
} | ||
|
||
spotless { | ||
java { | ||
removeUnusedImports() | ||
|
@@ -256,6 +321,10 @@ spotless { | |
} | ||
} | ||
|
||
tasks.withType(licenseHeaders.class) { | ||
additionalLicense 'AL ', 'Apache', 'Licensed under the Apache License, Version 2.0 (the "License")' | ||
} | ||
|
||
checkstyle { | ||
toolVersion = '8.29' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
plugin/src/main/java/org/opensearch/ml/rest/AbstractMLSearchAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
plugin/src/main/java/org/opensearch/ml/rest/RestMLSearchTaskAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.