Skip to content

Commit

Permalink
Add workflow to verify binary installation works (#693) (#733)
Browse files Browse the repository at this point in the history
* Add workflow to verify binary installation works

Signed-off-by: Derek Ho <dxho@amazon.com>

* Fix name of renamed zip

Signed-off-by: Derek Ho <dxho@amazon.com>

* Add single version = loose flag

Signed-off-by: Derek Ho <dxho@amazon.com>

---------

Signed-off-by: Derek Ho <dxho@amazon.com>
(cherry picked from commit 41a1703)

Co-authored-by: Derek Ho <derek01778@gmail.com>
  • Loading branch information
opensearch-trigger-bot[bot] and derek-ho committed Apr 24, 2024
1 parent 437b0ed commit 982b432
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
cd ./OpenSearch-Dashboards/
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
cd ./plugins/anomaly-detection-dashboards-plugin &&
whoami && yarn osd bootstrap && yarn build && yarn run test:jest --coverage"
whoami && yarn osd bootstrap --single-version=loose && yarn build && yarn run test:jest --coverage"
- name: Uploads coverage
uses: codecov/codecov-action@v1

Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Bootstrap the plugin
run: |
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
yarn osd bootstrap
yarn osd bootstrap --single-version=loose
- name: Build the plugin
run: |
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/remote-integ-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
- name: Bootstrap the plugin
run: |
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
yarn osd bootstrap
yarn osd bootstrap --single-version=loose
- name: Run OpenSearch Dashboards server
run: |
Expand Down
54 changes: 54 additions & 0 deletions .github/workflows/verify-binary-installation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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: anomaly-detection-dashboards-plugin
built_plugin_name: anomaly-detection-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 982b432

Please sign in to comment.