Skip to content

Commit 41a1703

Browse files
authored
Add workflow to verify binary installation works (#693)
* 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>
1 parent e5cf2d8 commit 41a1703

File tree

3 files changed

+57
-3
lines changed

3 files changed

+57
-3
lines changed

.github/workflows/build-and-test-workflow.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
cd ./OpenSearch-Dashboards/
4444
su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v &&
4545
cd ./plugins/anomaly-detection-dashboards-plugin &&
46-
whoami && yarn osd bootstrap && yarn build && yarn run test:jest --coverage"
46+
whoami && yarn osd bootstrap --single-version=loose && yarn build && yarn run test:jest --coverage"
4747
- name: Uploads coverage
4848
uses: codecov/codecov-action@v1
4949

@@ -87,7 +87,7 @@ jobs:
8787
- name: Bootstrap the plugin
8888
run: |
8989
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
90-
yarn osd bootstrap
90+
yarn osd bootstrap --single-version=loose
9191
- name: Build the plugin
9292
run: |
9393
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin

.github/workflows/remote-integ-tests-workflow.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- name: Bootstrap the plugin
8383
run: |
8484
cd OpenSearch-Dashboards/plugins/anomaly-detection-dashboards-plugin
85-
yarn osd bootstrap
85+
yarn osd bootstrap --single-version=loose
8686
8787
- name: Run OpenSearch Dashboards server
8888
run: |
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: 'Install Dashboards with Plugin via Binary'
2+
3+
on: [push, pull_request]
4+
env:
5+
OPENSEARCH_VERSION: '3.0.0'
6+
CI: 1
7+
# avoid warnings like "tput: No value for $TERM and no -T specified"
8+
TERM: xterm
9+
10+
jobs:
11+
verify-binary-installation:
12+
name: Run binary installation
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
os: [ubuntu-latest]
17+
# TODO: add windows support when OSD core is stable on windows
18+
runs-on: ${{ matrix.os }}
19+
steps:
20+
- name: Checkout Branch
21+
uses: actions/checkout@v3
22+
23+
- name: Set env
24+
run: |
25+
opensearch_version=$(node -p "require('./opensearch_dashboards.json').opensearchDashboardsVersion")
26+
plugin_version=$(node -p "require('./opensearch_dashboards.json').version")
27+
echo "OPENSEARCH_VERSION=$opensearch_version" >> $GITHUB_ENV
28+
echo "PLUGIN_VERSION=$plugin_version" >> $GITHUB_ENV
29+
shell: bash
30+
31+
- name: Run Opensearch
32+
uses: derek-ho/start-opensearch@v2
33+
with:
34+
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
35+
security-enabled: false
36+
37+
- name: Run Dashboard
38+
id: setup-dashboards
39+
uses: derek-ho/setup-opensearch-dashboards@v1
40+
with:
41+
plugin_name: anomaly-detection-dashboards-plugin
42+
built_plugin_name: anomaly-detection-dashboards
43+
install_zip: true
44+
45+
- name: Start the binary
46+
run: |
47+
nohup ./bin/opensearch-dashboards &
48+
working-directory: ${{ steps.setup-dashboards.outputs.dashboards-binary-directory }}
49+
shell: bash
50+
51+
- name: Health check
52+
run: |
53+
timeout 300 bash -c 'while [[ "$(curl http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
54+
shell: bash

0 commit comments

Comments
 (0)