-
Notifications
You must be signed in to change notification settings - Fork 73
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
Add bwc tests to run with CI #181
Conversation
Signed-off-by: Vacha <vachshah@amazon.com>
Codecov Report
@@ Coverage Diff @@
## main #181 +/- ##
============================================
- Coverage 67.66% 67.25% -0.41%
- Complexity 2885 2896 +11
============================================
Files 270 270
Lines 14104 14241 +137
Branches 1418 1428 +10
============================================
+ Hits 9543 9578 +35
- Misses 3973 4070 +97
- Partials 588 593 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of questions, most of the changes look good to me.
.github/workflows/CI.yml
Outdated
./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 | ||
pwd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We should be able to remove this
pwd | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed it.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this?
Gradle plugin automatically can pick up the plugin from the build directory.
Take a look at: https://github.com/opensearch-project/anomaly-detection/blob/main/build.gradle#L235
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed since the upgradeNodeAndPluginToNextVersion
method is designed to take in a list of Provider<RegularFile>
for installing plugins on the node during the upgrade. The plugin
method is separate which has two implementations, one for taking in a file and one for taking in the path which is used for the node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. That makes sense. I think it worth overloading that function to have another method to take care of this.
We should avoid as much as possible manually copying artifacts for tests.
We can goahead with this change, but can you also make a change in OpenSearch to add this functionality?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this method has the file list as input since the job-scheduler
artifact would be a zip file and since AD has a dependency on that, we have to supply it at the same time so that the newer version plugins can be added when the node is upgraded. The new functionality can be useful for plugins that don't have any other plugins as dependency.
.github/workflows/CI.yml
Outdated
- name: Mixed cluster backwards compatibility tests | ||
run: | | ||
echo "Running mixed cluster backwards compatibility tests ..." | ||
./gradlew adBwcCluster#mixedClusterTask -DmixedCluster=123 -Dtests.security.manager=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand we are using mixedCluster variable to run some specific tests.
Can we use a boolean flag instead of an arbitrary number like 123?
./gradlew adBwcCluster#mixedClusterTask -DmixedCluster=123 -Dtests.security.manager=false | |
./gradlew adBwcCluster#mixedClusterTask -DmixedCluster=true -Dtests.security.manager=false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, updated it to true
for the flag.
echo "Running mixed cluster backwards compatibility tests ..." | ||
./gradlew adBwcCluster#mixedClusterTask -DmixedCluster=123 -Dtests.security.manager=false | ||
|
||
- name: Rolling upgrade backwards compatibility tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice to separate out dedicated tests but is there a way to run all BWC tests with a single command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is currently no task to run that, I can add one that runs all three of them together.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah definitely, I think its worth adding that task and will help us when we would want to publish nightly builds and run these tests in one go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely in agreement, I will work on adding a single task which can be invoked to run the bwc tests after this PR.
Signed-off-by: Vacha <vachshah@amazon.com>
0613533
to
8bf54ca
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @VachaShah for this change!
This is great.
I would like to get AD team to also take a look.
@ylwu-amzn can you review this change?
@@ -41,6 +41,9 @@ Currently we just put RCF jar in lib as dependency. Plan to publish to Maven and | |||
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 -DmixedCluster=true -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the three nodes run three different OpenSearch versions? Or 1 node runs old version, other 2 nodes run new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old version cluster will have 3 nodes of the old (same) version of OpenSearch and then one node will be upgraded to current version (for example 1.1) along with anomaly-detection and job-scheduler upgrade to 1.1 on that node. 2 other nodes will still be on the old version, this creates a mixed cluster.
@@ -41,6 +41,9 @@ Currently we just put RCF jar in lib as dependency. Plan to publish to Maven and | |||
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 -DmixedCluster=true -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 -DrollingUpgradeCluster=true -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 -DfullRestartCluster=true -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have some historical data of old version ready before full restart ? For AD, that will be create some detectors and run it to generate some AD result; then fully restart and test.
Same question for other 2 BWC tests: mixed cluster and rolling upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AD can definitely add more assertions to the tests according to the various scenarios.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the change!
* Adding support for BWC tests to run in CI Signed-off-by: Vacha <vachshah@amazon.com> * Adding bwc test commands in developer guide Signed-off-by: Vacha <vachshah@amazon.com>
* Adding support for BWC tests to run in CI Signed-off-by: Vacha <vachshah@amazon.com> * Adding bwc test commands in developer guide Signed-off-by: Vacha <vachshah@amazon.com>
* Adding support for BWC tests to run in CI Signed-off-by: Vacha <vachshah@amazon.com> * Adding bwc test commands in developer guide Signed-off-by: Vacha <vachshah@amazon.com>
Description
Adding bwc tests introduced in #158 to run with CI for
anomaly-detection
. Also adding the test run commands in the developer guide.Issues Resolved
opensearch-build#222
Check List
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.