Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [PR2]Ensure Github workflow runs on docker image used by Production Distribution Build #1269

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading