Skip to content

Commit

Permalink
Merge dev to master for ODFE 1.12.0 release (#227)
Browse files Browse the repository at this point in the history
Merge dev to master for ODFE 1.12.0 release
  • Loading branch information
joshuali925 authored Dec 2, 2020
2 parents c1ea86d + b0b335b commit 852e568
Show file tree
Hide file tree
Showing 293 changed files with 46,330 additions and 19 deletions.
99 changes: 99 additions & 0 deletions .github/workflows/kibana-reports-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Release Kibana Reports Artifacts

on:
push:
tags:
- "v*"

env:
PLUGIN_NAME: opendistroReportsKibana
OD_VERSION: 1.12.0.0

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout Kibana
uses: actions/checkout@v1
with:
repository: elastic/kibana
ref: v7.10.0
path: kibana-reports/kibana

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd kibana/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/${{ env.PLUGIN_NAME }}
yarn build
cd build
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/kibana/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
cd linux-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd linux-arm64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd windows-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
unzip chromium-windows-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
artifact=`ls ./${{ env.PLUGIN_NAME }}-*.zip`
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/kibana-plugins/opendistro-reports/
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths "/downloads/*"
101 changes: 101 additions & 0 deletions .github/workflows/kibana-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: Test and Build Kibana Reports

on: [pull_request, push]

env:
PLUGIN_NAME: opendistroReportsKibana
OD_VERSION: 1.12.0.0

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout Kibana
uses: actions/checkout@v1
with:
repository: elastic/kibana
ref: v7.10.0
path: kibana-reports/kibana

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: "10.22.1"

- name: Move Kibana Reports to Plugins Dir
run: mv kibana-reports kibana/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd kibana/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip
rm chromium-linux-x64.zip
- name: Kibana Plugin Bootstrap
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn kbn bootstrap

- name: Test
uses: nick-invision/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd kibana/plugins/${{ env.PLUGIN_NAME }}; yarn test

- name: Build Artifact
run: |
cd kibana/plugins/${{ env.PLUGIN_NAME }}
yarn build
cd build
mkdir -p ./{linux-x64,linux-arm64,windows-x64}/kibana/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
cd linux-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd linux-arm64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
cd windows-x64
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
unzip chromium-windows-x64.zip -d ./kibana/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.PLUGIN_NAME }}-*.zip ./kibana
mv ./${{ env.PLUGIN_NAME }}-*.zip ..
cd ..
- name: Upload Artifact For Linux x64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-x64.zip

- name: Upload Artifact For Linux arm64
uses: actions/upload-artifact@v1
with:
name: kibana-reports-linux-arm64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-linux-arm64.zip

- name: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: kibana-reports-windows-x64
path: kibana/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.PLUGIN_NAME }}-${{ env.OD_VERSION }}-windows-x64.zip
40 changes: 40 additions & 0 deletions .github/workflows/reports-scheduler-release-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Reports Scheduler Artifacts
# This workflow is triggered on creating tags to master or an opendistro release branch
on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Checkout Plugin
uses: actions/checkout@v1

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

- name: Run build
run: |
cd reports-scheduler
./gradlew build buildDeb buildRpm --no-daemon --refresh-dependencies -Dbuild.snapshot=false
artifact=`ls plugin/build/distributions/*.zip`
rpm_artifact=`ls plugin/build/distributions/*.rpm`
deb_artifact=`ls plugin/build/distributions/*.deb`
# TODO: rename S3 bucket path after infra team assigns one
aws s3 cp $artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/elasticsearch-plugins/opendistro-sql/
aws s3 cp $rpm_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/rpms/opendistro-sql/
aws s3 cp $deb_artifact s3://artifacts.opendistroforelasticsearch.amazon.com/downloads/debs/opendistro-sql/
aws cloudfront create-invalidation --distribution-id E1VG5HMIWI4SA2 --paths "/downloads/*"
31 changes: 31 additions & 0 deletions .github/workflows/reports-scheduler-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Test and Build Reports Scheduler

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

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

- name: Build with Gradle
run: |
cd reports-scheduler
./gradlew build
- name: Create Artifact Path
run: |
mkdir -p reports-scheduler-builds
cp -r ./reports-scheduler/build/distributions/*.zip reports-scheduler-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: reports-scheduler
path: reports-scheduler-builds
21 changes: 21 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.DS_Store

*.iml
.gradle
out
local-test
.local-*

npm-debug.log*
node_modules
/build/
/public/app.css
.idea/
.vscode/
yarn-error.log
/coverage/
.history/
.eslintcache

# Kibana
.empty
1 change: 0 additions & 1 deletion NOTICE

This file was deleted.

38 changes: 31 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,37 @@
# Kibana Reports
# Kibana Reports for Open Distro

Kibana Reports for Open Distro allows ‘Report Owner’ (engineers, including but not limited to developers, DevOps, IT Engineer, and IT admin) export and share reports from Kibana dashboards, saved search, alerts and visualizations. It helps automate the process of scheduling reports on an on-demand or a periodical basis (on cron schedules as well). Further, it also automates the process of exporting and sharing reports triggered for various alerts. The feature is present in the Dashboard, Discover, and Visualization tabs. Scheduled reports can be sent to (shared with) self or various stakeholders within the organization such as, including but not limited to, executives, managers, engineers (developers, DevOps, IT Engineer) in the form of pdf, hyperlinks, csv, excel via various channels such as email, slack, Amazon Chime. However, in order to export, schedule and share reports, report owners should have the necessary permissions as defined under Roles and Privileges.

# Request for Comments ( RFC )
Please see the proposed Reporting design doc here: [ RFC ](https://github.com/opendistro-for-elasticsearch/kibana-reports/blob/master/docs/dev/Kibana-Reporting-Design-Proposal.md)

Comments and feedback is welcome - comment here [ New Requests ](https://github.com/opendistro-for-elasticsearch/kibana-reports/issues) and view project progress here [ Roadmap ](https://github.com/opendistro-for-elasticsearch/kibana-reports/projects/1).
# Request for Comments ( RFC )

# License
Please add your feature requests here [ New Requests ](https://github.com/opendistro-for-elasticsearch/kibana-reports/issues) and view project progress here [RFCs](https://github.com/opendistro-for-elasticsearch/kibana-reports/projects/1).

This project is licensed under the Apache-2.0 License.
## Setup & Build

Complete Kibana Reports is composed of 3 plugins. Refer to README in each plugin folder for more details.

- [Kibana reports plugin](./kibana-reports/README.md)
- [Reports scheduler ES plugin](./reports-scheduler/README.md)(TODO)
- [Reports notification ES plugin]() (TODO)

## Contributing to Kibana reports for Open Distro

We welcome you to get involved in development, documentation, testing the kibana reports plugin. See our [CONTRIBUTING.md](./CONTRIBUTING.md) and join in.

Since this is a Kibana plugin, it can be useful to review the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md) alongside the documentation around [Kibana plugins](https://www.elastic.co/guide/en/kibana/master/kibana-plugins.html) and [plugin development](https://www.elastic.co/guide/en/kibana/master/plugin-development.html).

## Code of Conduct

This project has adopted an [Open Source Code of Conduct](https://opendistro.github.io/for-elasticsearch/codeofconduct.html).

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

## License

See the [LICENSE](./LICENSE.txt) file for our project's licensing. We will ask you to confirm the licensing of your contribution.

## Copyright

Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
18 changes: 18 additions & 0 deletions kibana-reports/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": { "node": "10" }
}
],
"@babel/preset-react",
"@babel/preset-typescript"
],
"plugins": [
"@babel/plugin-transform-modules-commonjs",
["@babel/plugin-transform-runtime", { "regenerator": true }],
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-object-rest-spread"
]
}
9 changes: 9 additions & 0 deletions kibana-reports/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
extends: '@elastic/kibana'

settings:
import/resolver:
'@kbn/eslint-import-resolver-kibana':
rootPackageName: 'opendistro-kibana-reports'
pluginPaths:
- .
12 changes: 12 additions & 0 deletions kibana-reports/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
npm-debug.log*
node_modules
/build/
/public/app.css
.idea/
yarn-error.log
/coverage/
.DS_Store
.history/
.eslintcache
package-lock.json
/target/
11 changes: 11 additions & 0 deletions kibana-reports/.kibana-plugin-helpers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"serverSourcePatterns": [
"package.json",
"tsconfig.json",
"yarn.lock",
"kibana.json",
"common/**/*",
"public/**/*",
"server/**/*"
]
}
Loading

0 comments on commit 852e568

Please sign in to comment.