Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop branch into main branch #87

Merged
merged 64 commits into from
Nov 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
5db52fe
init the package structure (#1)
weicongs-amazon Apr 12, 2021
6db178d
Add data frame support (#2)
weicongs-amazon Apr 14, 2021
40a8be9
Add MLStats TransportAction Layer (#3)
zhanghg08 Apr 16, 2021
55d34ff
Add Predict and Training Transport action models (#5)
weicongs-amazon Apr 19, 2021
386a837
Stat REST API (#6)
zhanghg08 Apr 19, 2021
f7e90d5
Update license header (#7)
zhanghg08 Apr 19, 2021
a743dc0
udpate the docs for opensearch project (#8)
weicongs-amazon Apr 20, 2021
6ffa78f
Add issue templates (#9)
zhanghg08 Apr 20, 2021
a2ff1a8
Change ML Plugin Base Rest URI to _opensearch (#10)
zhanghg08 Apr 20, 2021
f239221
add client lib predict and train interfaces (#11)
weicongs-amazon Apr 21, 2021
fc5ce14
Add interface MLAlgo and AbstractMLAlgo (#4)
jngz-es Apr 21, 2021
15b2131
fix the excpetion verification in train UT (#14)
weicongs-amazon Apr 21, 2021
b8270c7
Add KMeans algorithm with train function (#13)
jngz-es Apr 23, 2021
f66eb2e
add SPDX license for build.gradle (#15)
jngz-es Apr 24, 2021
c766044
update README description (#18)
weicongs-amazon Apr 27, 2021
2a7ac99
refactor NOTICE (#16)
jngz-es Apr 28, 2021
685ef2a
update the rfc doc (#19)
weicongs-amazon Apr 28, 2021
523a43c
KMeans predict (#17)
jngz-es Apr 30, 2021
e5d7450
Update the RFC doc (#21)
weicongs-amazon May 3, 2021
bfe990f
update the UT coverage of ml-algorithms (#22)
weicongs-amazon May 3, 2021
69e1eb1
Adding MLTask (#24)
zhanghg08 May 6, 2021
78f3792
Add remove and select interface for DataFrame (#27)
weicongs-amazon May 7, 2021
e682a4f
Add query based input into interfaces (#25)
weicongs-amazon May 7, 2021
e25dbac
Add linear regression algorithm with train function. (#23)
jngz-es May 7, 2021
c846cbc
Add helper classes to check ML node type and persist model (#29)
zhanghg08 May 10, 2021
c71f4d8
use opensearch beta1 version (#30)
weicongs-amazon May 10, 2021
fff9719
Add CI workflow (#32)
weicongs-amazon May 10, 2021
6add96c
Add MLTaskManager and test cases. (#31)
zhanghg08 May 12, 2021
6c38e04
Add MLEngine interface (#33)
jngz-es May 14, 2021
2341996
remove unused exception catch, change RuntimeException to IllegalArgu…
jngz-es May 19, 2021
6a5ac00
add linear regression predict (#35)
jngz-es May 26, 2021
0f52c75
Add MLInputDatasetHandler to handle search query input (#36)
zhanghg08 May 26, 2021
e5e007f
Add MLTaskrunner and prediction/training transportaction (#37)
zhanghg08 Jun 2, 2021
648ae84
Upgrade dependency version, apply spotless formatter, checkstyle and …
spbjss Jun 3, 2021
9855267
Initialize the MLTaskRunner in MachineLearningPlugin. (#42)
spbjss Jun 7, 2021
5741336
add getMetaData interface for MLEngine and algorithms (#44)
jngz-es Jun 18, 2021
7c0ddea
Dispatch to all data nodes for now. Later we can add configuration fo…
zhanghg08 Jun 18, 2021
ba35ec2
Implement the training & prediction Rest APIs and enable ./gradlew ru…
spbjss Jun 22, 2021
b0c7786
Grant permissions to ml plugin, those permissions are required by the…
spbjss Jun 29, 2021
d7bcd36
Refactor the MLTaskRunner (#54)
spbjss Jul 2, 2021
e9b6f24
Enable fgac support for ml plugin. (#56)
spbjss Jul 11, 2021
77ad650
Update the Opensearch version to 1.0.0 (#57)
spbjss Jul 12, 2021
6b5302b
Enable integration test for CI workflow and gradlew build. (#58)
spbjss Jul 12, 2021
187a1a3
Add integration test for ml plugin. (#59)
spbjss Jul 13, 2021
6105c97
Fix an serialize issue of Node Stats API and update the integration t…
spbjss Jul 13, 2021
cfb89b3
Update the CI workflow to cover all branches (#61)
spbjss Jul 14, 2021
0437c19
Update the ml index name.
Jul 14, 2021
47d5317
Update the integration test max waiting time since the CI workflow host
Jul 14, 2021
0216490
Update the ml index name to be more unique to avoid customer using the
Jul 19, 2021
9f77cb1
Update the ml index name to avoid using os
Jul 20, 2021
7c0e643
Update index name and integration test configuration (#64)
spbjss Jul 20, 2021
bb86ec9
Update the ml plugin name.
Jul 21, 2021
3cb7458
Merge branch 'develop' into develop
spbjss Jul 21, 2021
4eac3f1
Update the build script to generate plugin zip file, and support
Jul 21, 2021
071f4d6
Create JvmService instance on demand. (#68)
spbjss Aug 11, 2021
5bbf8d9
Move the ml_parameters from XContent to the request parameters to avo…
spbjss Aug 25, 2021
1710140
Fix the risks found by PenTest (#76)
spbjss Oct 7, 2021
6efb951
Update readme to add more information (#81)
spbjss Oct 21, 2021
796c8d9
Update ml-rfc.md
sean-zheng-amazon Nov 4, 2021
814ff29
Add DCO Check Workflow
sean-zheng-amazon Nov 8, 2021
c431859
Fix failed integration tests, skip flaky ones
jackiehanyang Nov 15, 2021
6cd80c6
Correct github workflow CI yaml file format
jackiehanyang Nov 15, 2021
c95f0fd
Add a TODO on a flaky integration test
jackiehanyang Nov 15, 2021
45960f1
Remove ThreadLeakScope annotation added on integration test classes
jackiehanyang Nov 15, 2021
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
362 changes: 362 additions & 0 deletions .eclipseformat.xml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Plugins**
Please list all plugins currently enabled.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Host/Environment (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🎆 Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Description
[Describe what this change achieves]

### Issues Resolved
[List any issues this PR will resolve]

### Check List
- [ ] New functionality includes testing.
- [ ] All tests pass
- [ ] New functionality has been documented.
- [ ] New functionality has javadoc added
- [ ] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).
62 changes: 62 additions & 0 deletions .github/workflows/CI-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build and Test ML
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 1.14
uses: actions/setup-java@v1
with:
java-version: 1.14

- name: Checkout ML
uses: actions/checkout@v2

# Publish OpenSearch to local Maven repo for now
- name: Checkout OpenSearch
uses: actions/checkout@v2
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.snapshot=false

# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
ref: '1.0'
repository: 'opensearch-project/common-utils'
path: common-utils
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0


- name: Build with Gradle
run: ./gradlew build -Dopensearch.version=1.0.0

- name: Publish to Maven Local
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0

- name: Multi Nodes Integration Testing
run: ./gradlew integTest -PnumNodes=3

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
file: ./build/reports/jacoco/test/jacocoTestReport.xml
flags: plugin
18 changes: 18 additions & 0 deletions .github/workflows/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Developer Certificate of Origin Check

on: [pull_request]

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@v1.1.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: DCO Check
uses: tim-actions/dco@v1.1.0
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
29 changes: 25 additions & 4 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.

This code of conduct applies to all spaces provided by the OpenSource project including in code, documentation, issue trackers, mailing lists, chat channels, wikis, blogs, social media and any other communication channels used by the project.


**Our open source communities endeavor to:**

* Be Inclusive: We are committed to being a community where everyone can join and contribute. This means using inclusive and welcoming language.
* Be Welcoming: We are committed to maintaining a safe space for everyone to be able to contribute.
* Be Respectful: We are committed to encouraging differing viewpoints, accepting constructive criticism and work collaboratively towards decisions that help the project grow. Disrespectful and unacceptable behavior will not be tolerated.
* Be Collaborative: We are committed to supporting what is best for our community and users. When we build anything for the benefit of the project, we should document the work we do and communicate to others on how this affects their work.


**Our Responsibility. As contributors, members, or bystanders we each individually have the responsibility to behave professionally and respectfully at all times. Disrespectful and unacceptable behaviors include, but are not limited to:**

* The use of violent threats, abusive, discriminatory, or derogatory language;
* Offensive comments related to gender, gender identity and expression, sexual orientation, disability, mental illness, race, political or religious affiliation;
* Posting of sexually explicit or violent content;
* The use of sexualized language and unwelcome sexual attention or advances;
* Public or private harassment of any kind;
* Publishing private information, such as physical or electronic address, without permission;
* Other conduct which could reasonably be considered inappropriate in a professional setting;
* Advocating for or encouraging any of the above behaviors.
* Enforcement and Reporting Code of Conduct Issues:

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported. [Contact us](mailto:opensource-codeofconduct@amazon.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances.
61 changes: 3 additions & 58 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,4 @@
# Contributing Guidelines
## Contributing to this Project

Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
documentation, we greatly value feedback and contributions from our community.

Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
information to effectively respond to your bug report or contribution.


## Reporting Bugs/Feature Requests

We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:

* A reproducible test case or series of steps
* The version of our code being used
* Any modifications you've made relevant to the bug
* Anything unusual about your environment or deployment


## Contributing via Pull Requests
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:

1. You are working against the latest source on the *main* branch.
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.

To send us a pull request, please:

1. Fork the repository.
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
3. Ensure local tests pass.
4. Commit to your fork using clear commit messages.
5. Send us a pull request, answering any default questions in the pull request interface.
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.

GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).


## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start.


## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.


## Security issue notifications
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.


## Licensing

See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
OpenSearch is a community project that is built and maintained by people just like **you**.
[This document](https://github.com/opensearch-project/.github/blob/main/CONTRIBUTING.md) explains how you can contribute to this and related projects.
65 changes: 65 additions & 0 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
- [Developer Guide](#developer-guide)
- [Forking and Cloning](#forking-and-cloning)
- [Install Prerequisites](#install-prerequisites)
- [JDK 14](#jdk-14)
- [Setup](#setup)
- [Build](#build)
- [Building from the command line](#building-from-the-command-line)
- [Building from the IDE](#building-from-the-ide)
- [Debugging](#debugging)

## Developer Guide

### Forking and Cloning

Fork this repository on GitHub, and clone locally with `git clone`.

### Install Prerequisites

#### JDK 14

OpenSearch components build using Java 14 at a minimum. This means you must have a JDK 14 installed with the environment variable `JAVA_HOME` referencing the path to Java home for your JDK 14 installation, e.g. `JAVA_HOME=/usr/lib/jvm/jdk-14`.

### Setup

1. Clone the repository (see [Forking and Cloning](#forking-and-cloning))
2. Make sure `JAVA_HOME` is pointing to a Java 14 JDK (see [Install Prerequisites](#install-prerequisites))
3. Launch Intellij IDEA, Choose Import Project.

### Build

This package uses the [Gradle](https://docs.gradle.org/current/userguide/userguide.html) build system. Gradle comes with excellent documentation that should be your first stop when trying to figure out how to operate or modify the build. we also use the OpenSearch build tools for Gradle. These tools are idiosyncratic and don't always follow the conventions and instructions for building regular Java code using Gradle. Not everything in this package will work the way it's described in the Gradle documentation. If you encounter such a situation, the OpenSearch build tools [source code](https://github.com/opensearch-project/OpenSearch/tree/main/buildSrc/src/main/groovy/org/opensearch/gradle) is your best bet for figuring out what's going on.

#### Building from the command line

1. `./gradlew build` builds and tests
2. `./gradlew :run` launches a single node cluster with ml-commons plugin installed
3. `./gradlew :integTest` launches a single node cluster with ml-commons plugin installed and runs all integration tests except security
4. ` ./gradlew :integTest --tests="**.test execute foo"` runs a single integration test class or method
5. `./gradlew spotlessApply` formats code. And/or import formatting rules in `.eclipseformat.xml` with IDE.

When launching a cluster using one of the above commands logs are placed in `/build/cluster/run node0/opensearch-<version>/logs`. Though the logs are teed to the console, in practices it's best to check the actual log file.

#### Building from the IDE

Currently, the only IDE we support is IntelliJ IDEA. It's free, it's open source, it works. The gradle tasks above can also be launched from IntelliJ's Gradle toolbar and the extra parameters can be passed in via the Launch Configurations VM arguments.

#### Debugging

Sometimes it's useful to attach a debugger to either the OpenSearch cluster or the integ tests to see what's going on. When running unit tests you can just hit 'Debug' from the IDE's gutter to debug the tests. To debug code running in an actual server run:

```
./gradlew :integTest --debug-jvm # to start a cluster and run integ tests
OR
./gradlew :run --debug-jvm # to just start a cluster that can be debugged
```

The OpenSearch server JVM will launch suspended and wait for a debugger to attach to `localhost:8000` before starting the OpenSearch server.

To debug code running in an integ test (which exercises the server from a separate JVM) run:

```
./gradlew -Dtest.debug :integTest
```

The test runner JVM will start suspended and wait for a debugger to attach to `localhost:5005` before running the tests.
27 changes: 27 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,30 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
8 changes: 8 additions & 0 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# OpenSearch Machine Learning Maintainers

## Maintainers
| Maintainer | GitHub ID | Affiliation |
| --------------- | --------- | ----------- |
| Hanguang Zhang | [zhanghg08](https://github.com/zhanghg08) | Amazon |
| Jing Zhang | [jngz-es](https://github.com/jngz-es) | Amazon |
| Weicong Sun | [weicongs-amazon](https://github.com/weicongs-amazon) | Amazon |
1 change: 0 additions & 1 deletion NOTICE

This file was deleted.

12 changes: 12 additions & 0 deletions NOTICE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
OpenSearch
Copyright 2021 OpenSearch Contributors

This product includes software developed by
Elasticsearch (http://www.elastic.co).
Copyright 2009-2018 Elasticsearch

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).

This product includes software developed by
Oracle Labs (https://tribuo.org/).
Loading