From 29a2361ce656b2665e69fc993722743077f95391 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 15:27:46 -0400 Subject: [PATCH 1/5] Update get image workflow to use the yml from opensearch-build repo Signed-off-by: Peter Zhu --- .github/workflows/get-ci-image-tag.yml | 39 ------------------- .../workflows/multi-node-test-workflow.yml | 2 +- .github/workflows/security-test-workflow.yml | 2 +- .github/workflows/test-workflow.yml | 2 +- 4 files changed, 3 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/get-ci-image-tag.yml diff --git a/.github/workflows/get-ci-image-tag.yml b/.github/workflows/get-ci-image-tag.yml deleted file mode 100644 index 81c42635a..000000000 --- a/.github/workflows/get-ci-image-tag.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Get CI Image Tag -on: - workflow_call: - inputs: - platform: - required: true - type: string - usage: - required: true - type: string - outputs: - ci-image-version-linux: - description: The ci image version for linux build - value: ${{ jobs.Get-CI-Image-Tag.outputs.output-ci-image-version-linux }} - -jobs: - Get-CI-Image-Tag: - runs-on: ubuntu-latest - outputs: - output-ci-image-version-linux: ${{ steps.step-ci-image-version-linux.outputs.ci-image-version-linux }} - steps: - - name: Install crane - uses: iarekylew00t/crane-installer@v1 - with: - crane-release: v0.15.2 - - name: Checkout opensearch-build repository - uses: actions/checkout@v2 - with: - repository: 'opensearch-project/opensearch-build' - ref: 'main' - path: 'opensearch-build' - - name: Get ci image version from opensearch-build repository scripts - id: step-ci-image-version-linux - run: | - crane version - CI_IMAGE_VERSION=`opensearch-build/docker/ci/get-ci-images.sh -p ${{ inputs.platform }} -u ${{ inputs.usage }} -t build | head -1` - echo $CI_IMAGE_VERSION - echo "ci-image-version-linux=$CI_IMAGE_VERSION" >> $GITHUB_OUTPUT - diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index b80f04a43..14840ea2a 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: ./.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml with: platform: centos7 usage: opensearch diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 9a8f45bf8..75ffdaece 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: ./.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml with: platform: centos7 usage: opensearch diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 6d248cfcb..0a092eb5c 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: ./.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml with: platform: centos7 usage: opensearch From 8e76adc076304c0610c58ba8e16ad6776f0ea0e2 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 15:31:55 -0400 Subject: [PATCH 2/5] Update more Signed-off-by: Peter Zhu --- .github/workflows/multi-node-test-workflow.yml | 2 +- .github/workflows/security-test-workflow.yml | 2 +- .github/workflows/test-workflow.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 14840ea2a..3d7901053 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: platform: centos7 usage: opensearch diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 75ffdaece..300921605 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: platform: centos7 usage: opensearch diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 0a092eb5c..4f3e967c9 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -10,7 +10,7 @@ on: jobs: Get-CI-Image-Tag: - uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml + uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: platform: centos7 usage: opensearch From fab98bb64fbe35c4f662e6c28ea36b7f2f75bd32 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 16:30:40 -0400 Subject: [PATCH 3/5] Remove usages Signed-off-by: Peter Zhu --- .github/workflows/multi-node-test-workflow.yml | 1 - .github/workflows/security-test-workflow.yml | 1 - .github/workflows/test-workflow.yml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index 3d7901053..ac59419c1 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -12,7 +12,6 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - platform: centos7 usage: opensearch build-linux: diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 300921605..2abb2e618 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -12,7 +12,6 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - platform: centos7 usage: opensearch build-linux: diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index 4f3e967c9..f6cdb83be 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -12,7 +12,6 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - platform: centos7 usage: opensearch build-linux: From b58ec76335aacf5595974227db31f68fff81e22a Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 16:37:06 -0400 Subject: [PATCH 4/5] Add more Signed-off-by: Peter Zhu --- .github/workflows/multi-node-test-workflow.yml | 2 +- .github/workflows/security-test-workflow.yml | 2 +- .github/workflows/test-workflow.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/multi-node-test-workflow.yml b/.github/workflows/multi-node-test-workflow.yml index ac59419c1..0531ebd46 100644 --- a/.github/workflows/multi-node-test-workflow.yml +++ b/.github/workflows/multi-node-test-workflow.yml @@ -12,7 +12,7 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - usage: opensearch + product: opensearch build-linux: needs: Get-CI-Image-Tag diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 2abb2e618..44d8c8492 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -12,7 +12,7 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - usage: opensearch + product: opensearch build-linux: needs: Get-CI-Image-Tag diff --git a/.github/workflows/test-workflow.yml b/.github/workflows/test-workflow.yml index f6cdb83be..6757d5c05 100644 --- a/.github/workflows/test-workflow.yml +++ b/.github/workflows/test-workflow.yml @@ -12,7 +12,7 @@ jobs: Get-CI-Image-Tag: uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main with: - usage: opensearch + product: opensearch build-linux: needs: Get-CI-Image-Tag From 6bea0b457e7cbdb28dd31525d8df06abb24f2214 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Thu, 12 Oct 2023 16:47:33 -0400 Subject: [PATCH 5/5] Restore security test to original as it is not good to run dind for docker Signed-off-by: Peter Zhu --- .github/workflows/security-test-workflow.yml | 27 ++++++-------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.github/workflows/security-test-workflow.yml b/.github/workflows/security-test-workflow.yml index 44d8c8492..127962210 100644 --- a/.github/workflows/security-test-workflow.yml +++ b/.github/workflows/security-test-workflow.yml @@ -9,13 +9,7 @@ on: - "*" jobs: - Get-CI-Image-Tag: - uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main - with: - product: opensearch - - build-linux: - needs: Get-CI-Image-Tag + build: strategy: matrix: java: [ 11, 17 ] @@ -23,14 +17,12 @@ jobs: name: Build and test Alerting # This job runs on Linux runs-on: ubuntu-latest - container: - # using the same image which is used by opensearch-build team to build the OpenSearch Distribution - # this image tag is subject to change as more dependencies and updates will arrive over time - image: ${{ needs.Get-CI-Image-Tag.outputs.ci-image-version-linux }} - # need to switch to root so that github actions can install runner binary on container without permission issues. - options: --user root - steps: + # This step uses the setup-java Github action: https://github.com/actions/setup-java + - name: Set Up JDK ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} # This step uses the checkout Github action: https://github.com/actions/checkout - name: Checkout Branch uses: actions/checkout@v2 @@ -41,9 +33,7 @@ jobs: java-version: ${{ matrix.java }} - name: Build Alerting # Only assembling since the full build is governed by other workflows - run: | - chown -R opensearch.opensearch `pwd` - su opensearch -c "whoami && java -version && ./gradlew assemble" + run: ./gradlew assemble - name: Pull and Run Docker run: | plugin=`basename $(ls alerting/build/distributions/*.zip)` @@ -96,8 +86,7 @@ jobs: if [ $security -gt 0 ] then echo "Security plugin is available" - chown -R opensearch.opensearch `pwd` - su opensearch -c "whoami && java -version && ./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin" + ./gradlew :alerting:integTest -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername=docker-cluster -Dsecurity=true -Dhttps=true -Duser=admin -Dpassword=admin else echo "Security plugin is NOT available skipping this run as tests without security have already been run" fi