Skip to content

Commit

Permalink
[PR2]Ensure Github workflow runs on docker image used by Production D…
Browse files Browse the repository at this point in the history
…istribution Build (#1264)

* Update get image workflow to use the yml from opensearch-build repo

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Update more

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Remove usages

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Add more

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

* Restore security test to original as it is not good to run dind for docker

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>

---------

Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit b195c59)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 13, 2023
1 parent 579e248 commit 8a15045
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 65 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/get-ci-image-tag.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ 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@main
with:
platform: centos7
usage: opensearch
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,20 @@ on:
- "*"

jobs:
Get-CI-Image-Tag:
uses: ./.github/workflows/get-ci-image-tag.yml
with:
platform: centos7
usage: opensearch

build-linux:
needs: Get-CI-Image-Tag
build:
strategy:
matrix:
java: [ 11, 17 ]
# Job name
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
Expand All @@ -42,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)`
Expand Down Expand Up @@ -97,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
5 changes: 2 additions & 3 deletions .github/workflows/test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ 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@main
with:
platform: centos7
usage: opensearch
product: opensearch

build-linux:
needs: Get-CI-Image-Tag
Expand Down

0 comments on commit 8a15045

Please sign in to comment.