-
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
Adding windows and mac CI to 1.3 #745
Merged
+202
−109
Merged
Changes from 6 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f2aa40c
adding windows CI for 1.3
amitgalitz e01ccb1
fix workflow syntax bug and remove code coverage
amitgalitz a292bda
bump jackson and update github workflows
amitgalitz ddb5d7f
remove old CI.yml
amitgalitz e5b0f12
remove multinode integ for windows
amitgalitz 92f9aa3
fix window delay test and add macos to ci
amitgalitz 0e72c9a
fixed typo
amitgalitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Build and Test Anomaly detection | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
Build-ad-windows: | ||
strategy: | ||
matrix: | ||
java: [8, 11, 14] | ||
name: Build and Test Anomaly Detection Plugin on Windows | ||
runs-on: windows-latest | ||
steps: | ||
- name: Setup Java ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: Checkout Anomaly Detection | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build and Run Tests | ||
run: | | ||
./gradlew build | ||
- name: Publish to Maven Local | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- name: Upload Coverage Report | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./build/reports/jacoco/test/jacocoTestReport.xml | ||
flags: plugin | ||
Build-ad: | ||
strategy: | ||
matrix: | ||
java: [8, 11, 14] | ||
os: [ubuntu-latest, macos-latest] | ||
fail-fast: false | ||
|
||
name: Build and Test Anomaly detection Plugin on multipule platforms | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Setup Java ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
- name: Checkout AD | ||
uses: actions/checkout@v2 | ||
|
||
- name: Assemble anomaly-detection | ||
run: | | ||
./gradlew assemble | ||
- name: Build and Run Tests | ||
run: | | ||
./gradlew build -Dtest.logs=true | ||
- name: Publish to Maven Local | ||
run: | | ||
./gradlew publishToMavenLocal | ||
- 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 |
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,45 @@ | ||
name: Test Anomaly detection BWC | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
Build-ad: | ||
strategy: | ||
matrix: | ||
java: [8, 11, 14] | ||
fail-fast: false | ||
|
||
name: Test Anomaly detection BWC | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Java ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
# anomaly-detection | ||
- name: Checkout AD | ||
uses: actions/checkout@v2 | ||
|
||
- name: Assemble anomaly-detection | ||
run: | | ||
plugin_version=`./gradlew properties -q | grep "opensearch_build:" | awk '{print $2}'` | ||
echo plugin_version $plugin_version | ||
./gradlew assemble | ||
echo "Creating ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version ..." | ||
mkdir -p ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version | ||
echo "Copying ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version ..." | ||
ls ./build/distributions/ | ||
cp ./build/distributions/*.zip ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version | ||
echo "Copied ./build/distributions/*.zip to ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version ..." | ||
ls ./src/test/resources/org/opensearch/ad/bwc/anomaly-detection/$plugin_version | ||
- name: Run AD Backwards Compatibility Tests | ||
run: | | ||
echo "Running backwards compatibility tests ..." | ||
./gradlew bwcTestSuite -Dtests.security.manager=false |
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,78 @@ | ||
name: Security test workflow for Anomaly Detection | ||
on: | ||
push: | ||
branches: | ||
- "*" | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
Build-ad: | ||
strategy: | ||
matrix: | ||
java: [8, 11, 14] | ||
fail-fast: false | ||
|
||
name: Security test workflow for Anomaly Detection | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Setup Java ${{ matrix.java }} | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
|
||
# anomaly-detection | ||
- name: Checkout AD | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build Anomaly Detection | ||
run: | | ||
./gradlew assemble | ||
# example of variables: | ||
# plugin = opensearch-anomaly-detection-1.3.7.0-SNAPSHOT.zip | ||
# version = 1.3.7, plugin_version = 1.3.7.0, qualifier = SNAPSHOT | ||
- name: Pull and Run Docker | ||
run: | | ||
plugin=`basename $(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` | ||
qualifier=`echo $plugin|awk -F- '{print $5}'| cut -d. -f 1-1` | ||
if $qualifier!=SNAPSHOT | ||
then | ||
docker_version=$version-$qualifier | ||
else | ||
docker_version=$version | ||
fi | ||
echo plugin version plugin_version qualifier docker_version | ||
echo "($plugin) ($version) ($plugin_version) ($qualifier) ($docker_version)" | ||
cd .. | ||
if docker pull opensearchstaging/opensearch:$docker_version | ||
then | ||
echo "FROM opensearchstaging/opensearch:$docker_version" >> Dockerfile | ||
echo "RUN if [ -d /usr/share/opensearch/plugins/opensearch-anomaly-detection ]; then /usr/share/opensearch/bin/opensearch-plugin remove opensearch-anomaly-detection; fi" >> Dockerfile | ||
echo "ADD anomaly-detection/build/distributions/$plugin /tmp/" >> Dockerfile | ||
echo "RUN /usr/share/opensearch/bin/opensearch-plugin install --batch file:/tmp/$plugin" >> Dockerfile | ||
docker build -t opensearch-ad:test . | ||
echo "imagePresent=true" >> $GITHUB_ENV | ||
else | ||
echo "imagePresent=false" >> $GITHUB_ENV | ||
fi | ||
- name: Run Docker Image | ||
if: env.imagePresent == 'true' | ||
run: | | ||
cd .. | ||
docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" opensearch-ad:test | ||
sleep 90 | ||
- name: Run AD Test | ||
if: env.imagePresent == 'true' | ||
run: | | ||
security=`curl -XGET https://localhost:9200/_cat/plugins?v -u admin:admin --insecure |grep opensearch-security|wc -l` | ||
if [ $security -gt 0 ] | ||
then | ||
echo "Security plugin is available" | ||
./gradlew integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin | ||
else | ||
echo "Security plugin is NOT available, skipping integration tests" | ||
fi |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: typo in
multiple
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.
fixed