Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

1.9 backport #220

Merged
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
c062263
Add release drafter (#178)
yizheliu-amazon Jun 25, 2020
0f53845
Add result indices retention period (#174)
kaituo Jun 29, 2020
94264eb
Add release notes for ODFE 1.9.0.0 (#181)
kaituo Jun 29, 2020
15f0a25
Add dyanmic setting for memory threshold (#175)
kaituo Jun 30, 2020
b36d7fc
Support security plugin enabled testing in CI (#182)
kaituo Jun 30, 2020
4bf1818
Create RFC for AD CLI (#185)
VijayanB Jul 9, 2020
cd3bdae
change to exhausive search for training data (#184)
wnbts Jul 10, 2020
3d2d420
Adds initialization progress to profile API (#164)
kaituo Jul 14, 2020
44a8bcd
Queries data from the index when insufficient data in buffer to form …
LiuJoyceC Jul 16, 2020
68429a8
Automate release notes to unified standard (#191)
ohltyler Jul 16, 2020
d6dd8ab
Merge esad cli into anomaly-detection (#196)
VijayanB Aug 5, 2020
d6235c2
Add badges to AD (#199)
yizheliu-amazon Aug 5, 2020
935409c
Adding multinode integration test support
saratvemulapalli Aug 5, 2020
821a9f1
Test code coverage (#202)
VijayanB Aug 6, 2020
199a1c2
Merge pull request #201 from opendistro-for-elasticsearch/ad-multinode
saratvemulapalli Aug 6, 2020
7d8463f
Change Profile List Format
VijayanB Aug 7, 2020
afa859b
Deleted binary file
VijayanB Aug 11, 2020
d36fe3e
Display message on empty profile list
VijayanB Aug 11, 2020
e440e8b
Refactor: Group Constants alphabetically
VijayanB Aug 11, 2020
f03f63f
Allows window size to be set per detector. (#203)
LiuJoyceC Aug 13, 2020
fed3b78
not return estimated minutes remaining until cold start is finished (…
kaituo Aug 18, 2020
981db87
minor edits to the short and long text strings
ashwinkumar12345 Aug 15, 2020
92a5867
Change to use callbacks in cold start (#208)
kaituo Aug 19, 2020
9a0166e
fix job index mapping (#212)
ylwu-amzn Aug 19, 2020
14a1bde
Include comments for gateway methods
VijayanB Aug 7, 2020
698782a
Add GetDetector Gateway
VijayanB Aug 4, 2020
275317d
Entity: Added entity to deserialize response
VijayanB Aug 5, 2020
02fe5d8
Mapper: function to map from json to structure
VijayanB Aug 7, 2020
e93a9cf
Controller: Get Detector based on Id and Name
VijayanB Aug 7, 2020
7a8c0f6
Handler: GetDetector handler to call controller
VijayanB Aug 7, 2020
4b52e24
Command: Cat command to concatenate and print detectors
VijayanB Aug 7, 2020
942a10a
Use goimports (#214)
VijayanB Aug 24, 2020
087e910
Install go get outside cli directory (#216)
VijayanB Aug 25, 2020
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
46 changes: 46 additions & 0 deletions .github/draft-release-notes-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# The overall template of the release notes
template: |
Compatible with Elasticsearch (**set version here**).
$CHANGES

# Setting the formatting and sorting for the release notes body
name-template: Version (set version here)
change-template: "* $TITLE (#$NUMBER)"
sort-by: merged_at
sort-direction: ascending
replacers:
- search: "##"
replace: "###"

# Organizing the tagged PRs into unified ODFE categories
categories:
- title: "Breaking changes"
labels:
- "breaking change"
- title: "Features"
labels:
- "feature"
- title: "Enhancements"
labels:
- "enhancement"
- title: "Bug Fixes"
labels:
- "bug"
- "bug fix"
- title: "Infrastructure"
labels:
- "infra"
- "test"
- "dependencies"
- "github actions"
- title: "Documentation"
labels:
- "documentation"
- title: "Maintenance"
labels:
- "version upgrade"
- "odfe release"
- title: "Refactoring"
labels:
- "refactor"
- "code quality"
18 changes: 15 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ jobs:

## The ESRestTest Client uses http by default.
## Need to disable the security plugin to call the rest api over http.
echo "RUN if [ -d /usr/share/elasticsearch/plugins/opendistro_security ]; then /usr/share/elasticsearch/bin/elasticsearch-plugin remove opendistro_security; fi" >> Dockerfile
echo "RUN if [ -d /usr/share/elasticsearch/plugins/opendistro-anomaly-detection ]; then /usr/share/elasticsearch/bin/elasticsearch-plugin remove opendistro-anomaly-detection; fi" >> Dockerfile
echo "ADD anomaly-detection/build/distributions/opendistro-anomaly-detection-$plugin_version.zip /tmp/" >> Dockerfile
echo "RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install --batch file:/tmp/opendistro-anomaly-detection-$plugin_version.zip" >> Dockerfile
Expand All @@ -63,9 +62,22 @@ jobs:
cd ..
docker run -p 9200:9200 -d -p 9600:9600 -e "discovery.type=single-node" odfe-ad:test
sleep 90
curl -XGET http://localhost:9200/_cat/plugins

- name: Run AD Test
if: env.imagePresent == 'true'
run: |
./gradlew :integTestRunner --tests "com.amazon.opendistroforelasticsearch.ad.rest.*IT" --tests "com.amazon.opendistroforelasticsearch.ad.e2e.*IT" -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster"
security=`curl -XGET https://localhost:9200/_cat/plugins?v -u admin:admin --insecure |grep opendistro_security|wc -l`
if [ $security -gt 0 ]
then
echo "Security plugin is available"
./gradlew :integTestRunner --tests "com.amazon.opendistroforelasticsearch.ad.rest.*IT" --tests "com.amazon.opendistroforelasticsearch.ad.e2e.*IT" -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -Dhttps=true -Duser=admin -Dpassword=admin -PnumNodes=2
else
echo "Security plugin is NOT available"
./gradlew :integTestRunner --tests "com.amazon.opendistroforelasticsearch.ad.rest.*IT" --tests "com.amazon.opendistroforelasticsearch.ad.e2e.*IT" -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="docker-cluster" -PnumNodes=2
fi
- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
file: ./build/reports/jacoco/test/jacocoTestReport.xml
flags: plugin

20 changes: 20 additions & 0 deletions .github/workflows/draft-release-notes-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Release Drafter

on:
push:
branches:
- master

jobs:
update_release_draft:
name: Update draft release notes
runs-on: ubuntu-latest
steps:
- name: Update draft release notes
uses: release-drafter/release-drafter@v5
with:
config-name: draft-release-notes-config.yml
name: Version (set here)
tag: (None)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/esad-cli-publish-artifact-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish AD CLI
on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- name: Set up Go ubuntu-latest
uses: actions/setup-go@v2
with:
go-version: 1.14

- name: Check out AD CLI
uses: actions/checkout@v2

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: --snapshot --skip-publish
workdir: cli
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload macOS(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: esad-darwin-amd64
path: cli/dist/esad_darwin_amd64/esad

- name: Upload Linux(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: esad-linux-amd64
path: cli/dist/esad_linux_amd64/esad

- name: Upload Linux(arm64) Artifact
uses: actions/upload-artifact@v2
with:
name: esad-linux-arm64
path: cli/dist/esad_linux_arm64/esad

- name: Upload Windows(i386) Artifact
uses: actions/upload-artifact@v2
with:
name: esad-windows-386
path: cli/dist/esad_windows_386/esad.exe

- name: Upload Windows(amd64) Artifact
uses: actions/upload-artifact@v2
with:
name: esad-windows-amd64
path: cli/dist/esad_windows_amd64/esad.exe

78 changes: 78 additions & 0 deletions .github/workflows/esad-cli-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: AD CLI Test and Build
on: [pull_request, push]

jobs:
build:
defaults:
run:
working-directory: cli
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
go-version: [1.14]
runs-on: ${{ matrix.platform }}
steps:
- name: Set up Go ${{ matrix.platform }}
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}

- name: Check out AD CLI
uses: actions/checkout@v2

- name: Build
env:
GOPROXY: "https://proxy.golang.org"
run: go build .

code-analysis:
defaults:
run:
working-directory: cli
runs-on: ubuntu-latest
steps:
- name: Set up Go ubuntu-latest
uses: actions/setup-go@v2
with:
go-version: 1.14

- name: Check out AD CLI
uses: actions/checkout@v2

- name: Format
run: |
cd ..
go get golang.org/x/tools/cmd/goimports
cd cli
goimports -w .
- name: Check for modified files
id: git-check
run: |
echo ::set-output name=modified::$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi)
- name: Display unformated changes
if: steps.git-check.outputs.modified == 'true'
run: |
echo "Failed to format using goimports".
git diff
exit 1
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.28
working-directory: cli

- name: Run coverage
env:
GOPROXY: "https://proxy.golang.org"
run: |
go test ./... -coverprofile=coverage.out
go tool cover -func=coverage.out

- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
token: ${{secrets.CODECOV_TOKEN}}
file: cli/coverage.out
flags: cli
name: codecov-umbrella
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
[![AD Test](https://github.com/opendistro-for-elasticsearch/anomaly-detection/workflows/Build%20and%20Test%20Anomaly%20detection/badge.svg)](https://github.com/opendistro-for-elasticsearch/anomaly-detection/actions?query=workflow%3A%22Build+and+Test+Anomaly+detection%22+branch%3A%22master%22)
[![codecov](https://codecov.io/gh/opendistro-for-elasticsearch/anomaly-detection/branch/master/graph/badge.svg?flag=plugin)](https://codecov.io/gh/opendistro-for-elasticsearch/anomaly-detection)
[![Documentation](https://img.shields.io/badge/doc-reference-blue)](https://opendistro.github.io/for-elasticsearch-docs/docs/ad/)
[![Forum](https://img.shields.io/badge/chat-on%20forums-blue)](https://discuss.opendistrocommunity.dev/c/Use-this-category-for-all-questions-around-machine-learning-plugins)
![PRs welcome!](https://img.shields.io/badge/PRs-welcome!-success)

## Open Distro for Elasticsearch Anomaly Detection

The Open Distro for Elasticsearch Anomaly Detection plugin enables you to leverage Machine Learning based algorithms to automatically detect anomalies as your log data is ingested. Combined with Alerting, you can monitor your data in near real time and automatically send alert notifications . With an intuitive Kibana interface and a powerful API, it is easy to set up, tune, and monitor your anomaly detectors.
Expand Down
14 changes: 13 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ integTest {
runner {
systemProperty 'tests.security.manager', 'false'
systemProperty 'java.io.tmpdir', es_tmp_dir.absolutePath

systemProperty "https", System.getProperty("https")
systemProperty "user", System.getProperty("user")
systemProperty "password", System.getProperty("password")

// The 'doFirst' delays till execution time.
doFirst {
// Tell the test JVM if the cluster JVM is running under a debugger so that tests can
Expand Down Expand Up @@ -268,6 +273,13 @@ jacocoTestCoverageVerification {
}
}

jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}

check.dependsOn jacocoTestCoverageVerification
jacocoTestCoverageVerification.dependsOn jacocoTestReport

Expand Down Expand Up @@ -371,4 +383,4 @@ validateNebulaPom.enabled = false

tasks.withType(licenseHeaders.class) {
additionalLicense 'AL ', 'Apache', 'Licensed under the Apache License, Version 2.0 (the "License")'
}
}
23 changes: 23 additions & 0 deletions cli/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# IDE Settings
.idea/*

#OS Settings
.DS_Store

# Test binary, built with `go test -c`
*.test

bin
.go
.push-*
.container-*
.dockerfile-*

/coverage.out
39 changes: 39 additions & 0 deletions cli/.goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
project_name: esad
dist: ./dist
before:
hooks:
# You may remove this if you don't use go modules.
- go mod download
builds:
- env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm
- arm64
ignore:
- goos: darwin
goarch: 386
archives:
-
name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
format_overrides:
- goos: windows
format: zip
checksum:
name_template: '{{ .ProjectName }}_checksums.txt'
snapshot:
name_template: '{{ .ProjectName }}_{{ .Version }}'
Binary file added cli/Create.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading