From 7b9f346907162f43efc403ab9508660c86ef2810 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Mon, 26 Feb 2024 12:18:14 -0500 Subject: [PATCH 1/4] Add workflow to verify binary installaiton Signed-off-by: Derek Ho --- .../workflows/verify-binary-installation.yml | 55 +++++++++++++++++++ 1 file changed, 55 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..049bd8a9 --- /dev/null +++ b/.github/workflows/verify-binary-installation.yml @@ -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@v2 + with: + plugin_name: dashboards-maps + built_plugin_name: mapsDashboards + built_plugin_suffix: ${{ env.OPENSEARCH_VERSION }} + 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 007c6d8ff051789663bc4ffdfd49a93f4a23d803 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Mon, 26 Feb 2024 13:12:07 -0500 Subject: [PATCH 2/4] Single version loose Signed-off-by: Derek Ho --- .github/workflows/cypress-workflow.yml | 2 +- .github/workflows/unit-tests-workflow.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index cd2bf864..3023daa2 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -106,7 +106,7 @@ jobs: - name: Bootstrap plugin run: | cd OpenSearch-Dashboards/plugins/dashboards-maps - yarn osd bootstrap + yarn osd bootstrap --single-version=loose - name: Run OpenSearch Dashboards server run: | diff --git a/.github/workflows/unit-tests-workflow.yml b/.github/workflows/unit-tests-workflow.yml index f28413f3..2f817b27 100644 --- a/.github/workflows/unit-tests-workflow.yml +++ b/.github/workflows/unit-tests-workflow.yml @@ -51,7 +51,7 @@ jobs: cd ./OpenSearch-Dashboards/ su `id -un 1000` -c "source $NVM_DIR/nvm.sh && nvm use && node -v && yarn -v && cd ./plugins/dashboards-maps && - whoami && yarn osd bootstrap && yarn run test:jest --coverage" + whoami && yarn osd bootstrap --single-version=loose && yarn run test:jest --coverage" - name: Uploads coverage uses: codecov/codecov-action@v1 @@ -104,7 +104,7 @@ jobs: - name: Bootstrap plugin run: | cd OpenSearch-Dashboards/plugins/dashboards-maps - yarn osd bootstrap + yarn osd bootstrap --single-version=loose - name: Run tests with coverage run: | From af0bff23ecc3e1855df41b1d89224be2f6f9f33e Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Mon, 26 Feb 2024 13:45:03 -0500 Subject: [PATCH 3/4] Update built zip name Signed-off-by: Derek Ho --- .github/workflows/verify-binary-installation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml index 049bd8a9..7472c8da 100644 --- a/.github/workflows/verify-binary-installation.yml +++ b/.github/workflows/verify-binary-installation.yml @@ -39,7 +39,7 @@ jobs: uses: derek-ho/setup-opensearch-dashboards@v2 with: plugin_name: dashboards-maps - built_plugin_name: mapsDashboards + built_plugin_name: customImportMapDashboards built_plugin_suffix: ${{ env.OPENSEARCH_VERSION }} install_zip: true From 38878d1c95fbeb7b70491a5befe6adae93814be3 Mon Sep 17 00:00:00 2001 From: Derek Ho Date: Mon, 26 Feb 2024 13:49:05 -0500 Subject: [PATCH 4/4] Add s Signed-off-by: Derek Ho --- .github/workflows/verify-binary-installation.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml index 7472c8da..4bc2a864 100644 --- a/.github/workflows/verify-binary-installation.yml +++ b/.github/workflows/verify-binary-installation.yml @@ -34,7 +34,7 @@ jobs: opensearch-version: ${{ env.OPENSEARCH_VERSION }} security-enabled: false - - name: Run Dashboard + - name: Run Dashboards id: setup-dashboards uses: derek-ho/setup-opensearch-dashboards@v2 with: