Skip to content

Commit

Permalink
Update 2.x to be same as Reporting Repo (opensearch-project#2)
Browse files Browse the repository at this point in the history
* Use front-end report generation instead of chromium (opensearch-project#586)

* Increment version to 2.4.1-SNAPSHOT (opensearch-project#540)

Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>

Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com>

* --wip--

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add initial implementation of client reporting generation

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Fix url with basepath

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update header footer height

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update dialog text to not close dialog

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Remove console.log

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Remove unused components

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Remove chromium references

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add report generation error handling

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Minor refactors

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add postinstall patch to support safari for html2canvas

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Add dompurify

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Fix build error

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Remove chromium from CI

Signed-off-by: Joshua Li <joshuali925@gmail.com>

* Update CI artifact name

Signed-off-by: Joshua Li <joshuali925@gmail.com>

Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com>

* Fix workflow

Signed-off-by: Rupal Mahajan <maharup@amazon.com>

* Fix build artifact name in workflow

Signed-off-by: Rupal Mahajan <maharup@amazon.com>

* Add missing bracket

Signed-off-by: Rupal Mahajan <maharup@amazon.com>

* Change nick-invision to nick-fields to fix worklfow actions

Signed-off-by: Rupal Mahajan <maharup@amazon.com>

Signed-off-by: opensearch-ci-bot <opensearch-infra@amazon.com>
Signed-off-by: Joshua Li <joshuali925@gmail.com>
Signed-off-by: Rupal Mahajan <maharup@amazon.com>
Co-authored-by: Joshua Li <joshuali925@gmail.com>
Co-authored-by: opensearch-trigger-bot[bot] <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com>
Co-authored-by: opensearch-ci-bot <opensearch-infra@amazon.com>
  • Loading branch information
4 people authored Jan 5, 2023
1 parent 425f8df commit 18bb1e7
Show file tree
Hide file tree
Showing 29 changed files with 647 additions and 1,243 deletions.
155 changes: 38 additions & 117 deletions .github/workflows/dashboards-reports-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
linux-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Plugin
uses: actions/checkout@v1

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
Expand All @@ -25,90 +22,54 @@ jobs:

- name: Get node version
id: versions_step
run:
echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
run: echo "::set-output name=node_version::$(node -p "(require('../OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"

- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ steps.versions_step.outputs.node_version }}
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
sudo apt update
sudo apt install -y libnss3-dev fonts-liberation libfontconfig1
cd ../OpenSearch-Dashboards/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: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
command: yarn osd bootstrap

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

- name: Upload coverage
uses: codecov/codecov-action@v1
with:
flags: dashboards-reports
directory: ../OpenSearch-Dashboards/plugins/
flags: dashboards-report
directory: ./OpenSearch-Dashboards/plugins/
token: ${{ secrets.CODECOV_TOKEN }}

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
cd build
mkdir -p ./{linux-x64,linux-arm64}/opensearch-dashboards/${{ env.PLUGIN_NAME }}
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip
cp ./${{ env.PLUGIN_NAME }}-*.zip ./linux-arm64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-arm64.zip
cd linux-x64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-x64.zip
unzip chromium-linux-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..
cd linux-arm64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-linux-arm64.zip
unzip chromium-linux-arm64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..
- name: Upload Artifact For Linux x64
- name: Upload Artifact For Linux
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-linux-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-linux-x64.zip

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

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

# Enable longer filenames for windows
- name: Enable longer filenames
Expand All @@ -133,63 +94,39 @@ jobs:
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
Expand-Archive -Path 'chromium-windows-x64.zip'
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./.chromium"
rd chromium-windows-x64.zip
rd chromium-windows-x64
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }} && yarn osd bootstrap
command: yarn osd bootstrap

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

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build
cd build
mkdir -p ./windows-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
mv ./${{ env.PLUGIN_NAME }}-*.zip ./windows-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
cd windows-x64
curl.exe -LO https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-windows-x64.zip
Expand-Archive -Path 'chromium-windows-x64.zip'
Move-Item -Path "./chromium-windows-x64/.chromium" -Destination "./opensearch-dashboards/${{ env.PLUGIN_NAME }}"
rd chromium-windows-x64.zip
rd chromium-windows-x64
Compress-Archive -Path "./${{ env.ARTIFACT_NAME }}-*.zip" -Destination "./opensearch-dashboards"
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
- name: Upload Artifact For Windows
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-windows-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-windows-x64.zip
name: dashboards-reports-windows
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip

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

- name: Checkout OpenSearch Dashboards
uses: actions/checkout@v1
with:
Expand All @@ -209,48 +146,32 @@ jobs:
registry-url: 'https://registry.npmjs.org'


- name: Move Dashboards Reports to Plugins Dir
run: mv dashboards-reports ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: Add Chromium Binary to Reporting for Testing
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
wget https://github.com/opendistro-for-elasticsearch/kibana-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
unzip chromium-macos-x64.zip
rm chromium-macos-x64.zip
- name: Checkout Plugin
uses: actions/checkout@v1
with:
path: OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}

- name: OpenSearch Dashboards Plugin Bootstrap
uses: nick-invision/retry@v1
uses: nick-fields/retry@v1
with:
timeout_minutes: 30
max_attempts: 3
command: cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}; yarn osd bootstrap
command: yarn osd bootstrap

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

- name: Build Artifact
run: |
cd ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}
yarn build
mv ./build/*.zip ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
cd build
mkdir -p ./macos-x64/opensearch-dashboards/${{ env.PLUGIN_NAME }}
mv ./${{ env.PLUGIN_NAME }}-*.zip ./macos-x64/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip
cd macos-x64
wget https://github.com/opensearch-project/dashboards-reports/releases/download/chromium-1.12.0.0/chromium-macos-x64.zip
unzip chromium-macos-x64.zip -d ./opensearch-dashboards/${{ env.PLUGIN_NAME }}
zip -ur ./${{ env.ARTIFACT_NAME }}-*.zip ./opensearch-dashboards
mv ./${{ env.ARTIFACT_NAME }}-*.zip ..
cd ..
- name: Upload Artifact For MacOS x64
- name: Upload Artifact For MacOS
uses: actions/upload-artifact@v1
with:
name: dashboards-reports-macosx-x64
path: ../OpenSearch-Dashboards/plugins/${{ env.PLUGIN_NAME }}/build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}-macos-x64.zip
name: dashboards-reports-macosx
path: ./build/${{ env.ARTIFACT_NAME }}-${{ env.OPENSEARCH_PLUGIN_VERSION }}.zip
55 changes: 0 additions & 55 deletions .github/workflows/reports-scheduler-release-workflow.yml

This file was deleted.

Loading

0 comments on commit 18bb1e7

Please sign in to comment.