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

Removing default integtest.sh (1.x). #217

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
efeaff0
Update and add documentation files (#105) (#107)
ohltyler Jun 24, 2021
29cb78b
Add release notes for 1.0.0.0 (#111)
ohltyler Jun 30, 2021
c813fb8
Bump plugin version to 1.0.0.0 (#110)
ohltyler Jun 30, 2021
1896ce1
Bump plugin dependencies to 1.0.0.0 (#114)
ohltyler Jun 30, 2021
a50426d
add rc1 release notes to GA release (#118)
ylwu-amzn Jul 6, 2021
ac692e2
Merge pull request #100 from opensearch-project/opensearch-integtest-…
peterzhuamazon Jul 9, 2021
f65d070
multi-category support, rate limiting, and pagination (#121)
kaituo Jul 12, 2021
ea8485f
don't replace detector user when update (#126)
ylwu-amzn Jul 15, 2021
b53c349
Improve preview and exception handling in AnomalyResultTransportActio…
kaituo Jul 26, 2021
3d73050
Single flow feature change (#147)
ylwu-amzn Jul 27, 2021
0b4e516
Compact rcf integration (#149)
kaituo Jul 29, 2021
3b4e416
avoid sending back verbose error message and wrong 500 error to user;…
ylwu-amzn Jul 30, 2021
59bc011
enable junit 5
wnbts Aug 10, 2021
b9a2b64
Disable model splitting in single-stream detectors (#162)
kaituo Aug 11, 2021
e452e74
Bug fixes and disable BWC (#152)
kaituo Aug 12, 2021
e169347
Handle more AD exceptions thrown over the wire/network (#157)
kaituo Aug 12, 2021
e78f242
Adding mixed cluster, rolling upgrade, restart upgrade bwc tests (#158)
VachaShah Aug 12, 2021
81c0ae8
Add themed logo to README (#134)
Aug 13, 2021
3cc6b09
Bumping anomaly-detection to 1.1.0.0 to use OpenSearch (main) 1.1.0 (…
VachaShah Aug 16, 2021
966b1dd
Fix snapshot assemble and build 1.1.0. (#176)
dblock Aug 16, 2021
1726171
support historical analysis for multi-category HC (#159)
ylwu-amzn Aug 17, 2021
30ab325
Add bwc tests to run with CI (#181)
VachaShah Aug 17, 2021
573f236
Bug fixes and unit tests (#177)
kaituo Aug 19, 2021
ea19bfb
Adding a task for running bwc tests combined (#185)
VachaShah Aug 20, 2021
dbd5922
Limit the max models shown on the stats and profile API (#182)
kaituo Aug 25, 2021
169ee76
Enable shingle in HCAD (#187)
kaituo Aug 25, 2021
bb6acd2
add min score for labeling anomalies to thresholding (#193)
wnbts Aug 25, 2021
965f39b
support backward compatibility of historical analysis and realtime ta…
ylwu-amzn Aug 31, 2021
849fb14
block updating detector category field (#195)
ylwu-amzn Sep 1, 2021
8f66548
Adding support to run BWC tests for nightly and release builds (#189)
saratvemulapalli Sep 1, 2021
6c9722b
add deprecated detector type for bwc; add more test cases for histori…
ylwu-amzn Sep 2, 2021
424c62b
Add release notes for version 1.1.0.0 (#203)
ohltyler Sep 3, 2021
557cb6e
Removed integtest.sh (1.x).
dblock Sep 16, 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
54 changes: 37 additions & 17 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,37 +33,37 @@ jobs:
with:
repository: 'opensearch-project/OpenSearch'
path: OpenSearch
ref: '1.0'
ref: '1.x'
- name: Build OpenSearch
working-directory: ./OpenSearch
run: ./gradlew publishToMavenLocal -Dbuild.version_qualifier=rc1 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal

# dependencies: common-utils
- name: Checkout common-utils
uses: actions/checkout@v2
with:
ref: 'main' # TODO: update to the right branch name once it's ready. e.g. 1.x
ref: 'main'
repository: 'opensearch-project/common-utils'
path: common-utils
- name: Build common-utils
working-directory: ./common-utils
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-rc1
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT

# dependencies: job-scheduler
- name: Checkout job-scheduler
uses: actions/checkout@v2
with:
ref: 'main' # TODO: update to the right branch name once it's ready. e.g. 1.x
ref: 'main'
repository: 'opensearch-project/job-scheduler'
path: job-scheduler

- name: Build job-scheduler
working-directory: ./job-scheduler
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.0.0-rc1 -Dbuild.snapshot=false
run: ./gradlew publishToMavenLocal -Dopensearch.version=1.1.0-SNAPSHOT
- name: Assemble job-scheduler
working-directory: ./job-scheduler
run: |
./gradlew assemble -Dopensearch.version=1.0.0-rc1 -Dbuild.snapshot=false
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
echo "Creating ../src/test/resources/job-scheduler ..."
mkdir -p ../src/test/resources/job-scheduler
pwd
Expand All @@ -72,28 +72,43 @@ jobs:
cp ./build/distributions/*.zip ../src/test/resources/job-scheduler
echo "Copied ./build/distributions/*.zip to ../src/test/resources/job-scheduler ..."
ls ../src/test/resources/job-scheduler
echo "Creating ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..."
mkdir -p ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT
echo "Copying ./build/distributions/*.zip to ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..."
ls ./build/distributions/
cp ./build/distributions/*.zip ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT
echo "Copied ./build/distributions/*.zip to ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT ..."
ls ../src/test/resources/org/opensearch/ad/bwc/job-scheduler/1.1.0.0-SNAPSHOT

- name: Assemble anomaly-detection
run: |
./gradlew assemble -Dopensearch.version=1.1.0-SNAPSHOT
echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT ..."
mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT
echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT ..."
ls ./build/distributions/
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT
echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT ..."
ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/1.1.0.0-SNAPSHOT

- name: Build and Run Tests
run: |
./gradlew build -Dopensearch.version=1.0.0-rc1
./gradlew build -Dopensearch.version=1.1.0-SNAPSHOT

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

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

- name: Pull and Run Docker
run: |
## plugin=`ls build/distributions/*.zip`
## version=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-3`
## plugin_version=`echo $plugin|awk -F- '{print $4}'| cut -d. -f 1-4`
## TODO: remove these two hard code versions below after GA release
version=1.0.0-rc1
plugin_version=1.0.0.0-rc1
echo $version
plugin=`ls build/distributions/*.zip`
version=1.1.0-SNAPSHOT
plugin_version=1.1.0.0-SNAPSHOT
echo Using OpenSearch $version with AD $plugin_version
cd ..
if docker pull opensearchstaging/opensearch:$version
then
Expand Down Expand Up @@ -127,6 +142,11 @@ jobs:
./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
fi

- name: Run AD Backwards Compatibility Tests
run: |
echo "Running backwards compatibility tests ..."
./gradlew bwcTestSuite -Dtests.security.manager=false

- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
Expand Down
107 changes: 3 additions & 104 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,105 +1,4 @@
# Contributing Guidelines

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](../../issues), or [recently closed](../../issues?q=is%3Aissue+is%3Aclosed), 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 *master* 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'](../../labels/help%20wanted) issues is a great place to start.


## Code of Conduct

Please refer to [Code of Conduct](./CODE_OF_CONDUCT.md) on this repository.


## Developer Certificate of Origin

OpenSearch is an open source product released under the Apache 2.0 license (see either [the Apache site](https://www.apache.org/licenses/LICENSE-2.0) or the [LICENSE.txt file](./LICENSE.txt)). The Apache 2.0 license allows you to freely use, modify, distribute, and sell your own products that include Apache 2.0 licensed software.

We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that.

The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/).

```
Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the
best of my knowledge, is covered under an appropriate open
source license and I have the right under that license to
submit that work with modifications, whether created in whole
or in part by me, under the same open source license (unless
I am permitted to submit under a different license), as
Indicated in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including
all personal information I submit with it, including my
sign-off) is maintained indefinitely and may be redistributed
consistent with this project or the open source license(s)
involved.
```
We require that every contribution to OpenSearch is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms.

Each commit must include a DCO which looks like this

```
Signed-off-by: Jane Smith <jane.smith@email.com>
```
You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `– – signoff` to add the `Signed-off-by` line to the end of the commit message.

## 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.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
## Contributing to this Project

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.
61 changes: 39 additions & 22 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,58 @@
# Developer Guide
- [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)
- [Advanced: Launching multi node clusters locally](#advanced-launching-multi-node-clusters-locally)

## Setup
## Developer Guide

1. Checkout source code of this package from the Github repo.
1. Launch Intellij IDEA, Choose Import Project and select the settings.gradle file in the root of this package.
1. To build from command line set JAVA_HOME to point to a JDK 14 before running `./gradlew`.
### Forking and Cloning

* Unix System
* export JAVA_HOME=jdk-install-dir: Replace jdk-install-dir by the JAVA_HOME directory of your system.
* export PATH=$JAVA_HOME/bin:$PATH
* Windows System
* Find **My Computers** from file directory, right click and select **properties**.
* Select the **Advanced** tab, select **Environment variables**.
* Edit **JAVA_HOME** to path of where JDK software is installed.
Fork this repository on GitHub, and clone locally with `git clone`.

## Build
### 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 and select the settings.gradle file in the root of this package.

### 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.

Currently we just put RCF jar in lib as dependency. Plan to publish to Maven and we can import it later. Before publishing to Maven, you can still build this package directly and find source code in RCF Github package.

### Building from the command line
#### Building from the command line

1. `./gradlew build` builds and tests
1. `./gradlew :run` launches a single node cluster with anomaly-detection (and job-scheduler) plugin installed
1. `./gradlew :integTest` launches a single node cluster with anomaly-detection (and job-scheduler) plugin installed and runs all integration tests except security
1. ` ./gradlew :integTest --tests="**.test execute foo"` runs a single integration test class or method
1. `./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin` launches integration tests against a local cluster and run tests with security
1. `./gradlew spotlessApply` formats code. And/or import formatting rules in `.eclipseformat.xml` with IDE.
2. `./gradlew :run` launches a single node cluster with anomaly-detection (and job-scheduler) plugin installed
3. `./gradlew :integTest` launches a single node cluster with anomaly-detection (and job-scheduler) 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 integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin` launches integration tests against a local cluster and run tests with security
6. `./gradlew spotlessApply` formats code. And/or import formatting rules in `.eclipseformat.xml` with IDE.
7. `./gradlew adBwcCluster#mixedClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with anomaly-detection and job-scheduler and tests backwards compatibility by upgrading one of the nodes with the current version of OpenSearch with anomaly-detection and job-scheduler creating a mixed cluster.
8. `./gradlew adBwcCluster#rollingUpgradeClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with anomaly-detection and job-scheduler and tests backwards compatibility by performing rolling upgrade of each node with the current version of OpenSearch with anomaly-detection and job-scheduler.
9. `./gradlew adBwcCluster#fullRestartClusterTask -Dtests.security.manager=false` launches a cluster with three nodes of bwc version of OpenSearch with anomaly-detection and job-scheduler and tests backwards compatibility by performing a full restart on the cluster upgrading all the nodes with the current version of OpenSearch with anomaly-detection and job-scheduler.
10. `./gradlew bwcTestSuite -Dtests.security.manager=false` runs all the above bwc tests combined.

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
#### 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
#### 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:

Expand All @@ -55,7 +72,7 @@ To debug code running in an integ test (which exercises the server from a separa

The test runner JVM will start suspended and wait for a debugger to attach to `localhost:5005` before running the tests.

### Advanced: Launching multi node clusters locally
#### Advanced: Launching multi node clusters locally

Sometimes you need to launch a cluster with more than one OpenSearch server process.

Expand Down
Loading