Skip to content

Commit

Permalink
test binary installation workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Chenyang Ji <[email protected]>
  • Loading branch information
ansjcy committed Jan 30, 2025
1 parent 7315cf8 commit a8c5a32
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
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 Query Insights 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
OPENSEARCH_INITIAL_ADMIN_PASSWORD: myStrongPassword123!

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('./package.json').opensearchDashboards.version")
plugin_version=$(node -p "require('./package.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@v6
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: query-insights-dashboards
built_plugin_name: queryInsightsDashboards
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 -u admin:${{ env.OPENSEARCH_INITIAL_ADMIN_PASSWORD }} -k http://localhost:5601/api/status | jq -r '.status.overall.state')" != "green" ]]; do sleep 5; done'
shell: bash
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"version": "3.0.0.0",
"description": "OpenSearch Dashboards plugin for Query Insights",
"main": "index.js",
"opensearchDashboards": {
"version": "3.0.0",
"templateVersion": "3.0.0"
},
"license": "Apache-2.0",
"homepage": "https://github.com/opensearch-project/query-insights-dashboards",
"config": {
Expand Down Expand Up @@ -65,4 +69,4 @@
"node_modules/*",
"target/*"
]
}
}

0 comments on commit a8c5a32

Please sign in to comment.