From e168039a0b673a5cf7cd6824fe56ea70a71048b9 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Fri, 23 Feb 2024 16:29:48 -0500 Subject: [PATCH 1/2] Add workflow to verify binary installation is successful Signed-off-by: Derek Ho --- .../workflows/verify-binary-installation.yml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/verify-binary-installation.yml diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml new file mode 100644 index 00000000..c2ebd415 --- /dev/null +++ b/.github/workflows/verify-binary-installation.yml @@ -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: dashboards-reporting + built_plugin_name: reportsDashboards + 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 \ No newline at end of file From 133af78c13031d542c3e0381a001f618bc401273 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Fri, 23 Feb 2024 16:38:43 -0500 Subject: [PATCH 2/2] Use new version to pass in custom suffix Signed-off-by: Derek Ho --- .github/workflows/verify-binary-installation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml index c2ebd415..d8264c49 100644 --- a/.github/workflows/verify-binary-installation.yml +++ b/.github/workflows/verify-binary-installation.yml @@ -36,10 +36,11 @@ jobs: - name: Run Dashboard id: setup-dashboards - uses: derek-ho/setup-opensearch-dashboards@v1 + uses: derek-ho/setup-opensearch-dashboards@v2 with: plugin_name: dashboards-reporting built_plugin_name: reportsDashboards + built_plugin_suffix: ${{ env.OPENSEARCH_VERSION }} install_zip: true - name: Start the binary