Skip to content

Commit

Permalink
Add workflow to build and install security analytics dashboards plugin (
Browse files Browse the repository at this point in the history
#899)

* Initial commit to try using workflow from other fork

Signed-off-by: Derek Ho <[email protected]>

* setup with backend or job scheduler

Signed-off-by: Derek Ho <[email protected]>

* Use generalized workflows

Signed-off-by: Derek Ho <[email protected]>

* Extra dash

Signed-off-by: Derek Ho <[email protected]>

* Correct directory

Signed-off-by: Derek Ho <[email protected]>

* Revert "Add missing modules common and types (#875)"

This reverts commit ba9c4f6.

Signed-off-by: Derek Ho <[email protected]>

* Revert "Revert "Add missing modules common and types (#875)""

This reverts commit 17cff14.

Signed-off-by: Derek Ho <[email protected]>

* Single version loose to fix bootstrapping issues

Signed-off-by: Derek Ho <[email protected]>

* Add v1 tag

Signed-off-by: Derek Ho <[email protected]>

* Remove security specific settings

Signed-off-by: Derek Ho <[email protected]>

* Remove references to security

Signed-off-by: Derek Ho <[email protected]>

* Add loose for windows

Signed-off-by: Derek Ho <[email protected]>

---------

Signed-off-by: Derek Ho <[email protected]>
(cherry picked from commit 6bb078b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Mar 18, 2024
1 parent ad037db commit 25ea113
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin
yarn osd bootstrap
yarn osd bootstrap --single-version=loose
- name: Run OpenSearch-Dashboards server
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
cd ./OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/security-analytics-dashboards-plugin &&
whoami && yarn osd bootstrap && yarn run test:jest --coverage"
whoami && yarn osd bootstrap --single-version=loose && yarn run test:jest --coverage"
- name: Uploads coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin
yarn osd bootstrap
yarn osd bootstrap --single-version=loose
- name: Run tests
run: |
cd OpenSearch-Dashboards/plugins/security-analytics-dashboards-plugin
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/verify-binary-installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: 'Install Dashboards with Plugin via Binary'

on: [push, pull_request]
env:
OPENSEARCH_VERSION: '3.0.0'
CI: 1
# avoid warnings like "tput: No value for $TERM and no -T specified"
TERM: xterm

jobs:
verify-binary-installation:
name: Run binary installation
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# TODO: add windows support when OSD core is stable on windows
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Set env
run: |
opensearch_version=$(node -p "require('./opensearch_dashboards.json').opensearchDashboardsVersion")
plugin_version=$(node -p "require('./opensearch_dashboards.json').version")
echo "OPENSEARCH_VERSION=$opensearch_version" >> $GITHUB_ENV
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
shell: bash

- name: Run Opensearch
uses: derek-ho/start-opensearch@v2
with:
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
security-enabled: false

- name: Run Dashboard
id: setup-dashboards
uses: derek-ho/setup-opensearch-dashboards@v1
with:
plugin_name: security-analytics-dashboards-plugin
built_plugin_name: security-analytics-dashboards
install_zip: true

- name: Start the binary
run: |
nohup ./bin/opensearch-dashboards &
working-directory: ${{ steps.setup-dashboards.outputs.dashboards-binary-directory }}
shell: bash

- name: Health check
run: |
timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
shell: bash

0 comments on commit 25ea113

Please sign in to comment.