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

Onboard jenkins prod docker images to github actions #1025

Merged
merged 3 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 16 additions & 1 deletion .github/workflows/multi-node-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ on:
- "**"

jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

multi-node-test:
needs: Get-CI-Image-Tag
env:
TEST_FILTER: ${{ matrix.test_filter }}
strategy:
Expand All @@ -23,6 +29,13 @@ jobs:
test_filter: -PexcludeTests="org.opensearch.indexmanagement.indexstatemanagement*"
# 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
Expand All @@ -34,7 +47,9 @@ jobs:
- name: Checkout Branch
uses: actions/checkout@v2
- name: Run integration tests with multi node config
run: ./gradlew integTest -PnumNodes=3 ${{ env.TEST_FILTER }}
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew integTest -PnumNodes=3 ${{ env.TEST_FILTER }}"
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
122 changes: 0 additions & 122 deletions .github/workflows/release-workflow.yml

This file was deleted.

16 changes: 15 additions & 1 deletion .github/workflows/security-test-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@ on:
- "**"

jobs:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

security-test:
needs: Get-CI-Image-Tag
# 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
Expand All @@ -24,7 +37,8 @@ jobs:
uses: actions/checkout@v2
- name: Run integration tests
run: |
./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*SecurityBehaviorIT'
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew integTest -Dsecurity=true -Dhttps=true --tests '*SecurityBehaviorIT'"
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: failure()
Expand Down
100 changes: 78 additions & 22 deletions .github/workflows/test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,36 @@ on:
- "**"

jobs:
test-and-build:
Get-CI-Image-Tag:
uses: opensearch-project/opensearch-build/.github/workflows/get-ci-image-tag.yml@main
with:
product: opensearch

test-and-build-linux:
needs: Get-CI-Image-Tag
env:
BUILD_ARGS: ${{ matrix.os_build_args }}
WORKING_DIR: ${{ matrix.working_directory }}.
TEST_FILTER: ${{ matrix.test_filter }}
strategy:
# This setting says that all jobs should finish, even if one fails
fail-fast: false
# This starts three jobs, setting these environment variables uniquely for the different jobs
matrix:
java: [11, 17]
os: [ubuntu-latest, windows-latest, macos-latest]
java: [11]
#java: [11, 17]
feature: [ism, non-ism]
include:
- os: windows-latest
os_build_args: -x integTest -x jacocoTestReport
working_directory: X:\
os_java_options: -Xmx4096M
- os: macos-latest
os_build_args: -x integTest -x jacocoTestReport
- feature: ism
test_filter: -PincludeTests="org.opensearch.indexmanagement.indexstatemanagement*"
- feature: non-ism
test_filter: -PexcludeTests="org.opensearch.indexmanagement.indexstatemanagement*"
runs-on: ${{ matrix.os }}
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 }}
Expand All @@ -45,17 +50,13 @@ jobs:
uses: actions/checkout@v2
# This is a hack, but this step creates a link to the X: mounted drive, which makes the path
# short enough to work on Windows
- name: Shorten Path
if: ${{ matrix.os == 'windows-latest' }}
run: subst 'X:' .
- name: Build with Gradle
working-directory: ${{ env.WORKING_DIR }}
run: ./gradlew build ${{ env.BUILD_ARGS }} ${{ env.TEST_FILTER }}
env:
_JAVA_OPTIONS: ${{ matrix.os_java_options }}
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew build ${{ env.TEST_FILTER }}"
- name: Upload failed logs
uses: actions/upload-artifact@v2
if: ${{ failure() && matrix.os == 'ubuntu-latest' }}
if: ${{ failure() }}
with:
name: logs
path: build/testclusters/integTest-*/logs/*
Expand All @@ -64,13 +65,68 @@ jobs:
mkdir -p index-management-artifacts
cp ./build/distributions/*.zip index-management-artifacts
- name: Uploads coverage
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
# This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: index-management-plugin-${{ matrix.os }}
name: index-management-plugin-ubuntu-latest
path: index-management-artifacts

# test-and-build-windows-macos:
# env:
# BUILD_ARGS: ${{ matrix.os_build_args }}
# WORKING_DIR: ${{ matrix.working_directory }}.
# TEST_FILTER: ${{ matrix.test_filter }}
# strategy:
# # This setting says that all jobs should finish, even if one fails
# fail-fast: false
# # This starts three jobs, setting these environment variables uniquely for the different jobs
# matrix:
# java: [11, 17]
# os: [windows-latest, macos-latest]
# feature: [ism, non-ism]
# include:
# - os: windows-latest
# os_build_args: -x integTest -x jacocoTestReport
# working_directory: X:\
# os_java_options: -Xmx4096M
# - os: macos-latest
# os_build_args: -x integTest -x jacocoTestReport
# - feature: ism
# test_filter: -PincludeTests="org.opensearch.indexmanagement.indexstatemanagement*"
# - feature: non-ism
# test_filter: -PexcludeTests="org.opensearch.indexmanagement.indexstatemanagement*"
# runs-on: ${{ matrix.os }}
# 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@v2
# with:
# distribution: temurin # Temurin is a distribution of adoptium
# java-version: ${{ matrix.java }}
# # build index management
# - name: Checkout Branch
# uses: actions/checkout@v2
# # This is a hack, but this step creates a link to the X: mounted drive, which makes the path
# # short enough to work on Windows
# - name: Shorten Path
# if: ${{ matrix.os == 'windows-latest' }}
# run: subst 'X:' .
# - name: Build with Gradle
# working-directory: ${{ env.WORKING_DIR }}
# run: ./gradlew build ${{ env.BUILD_ARGS }} ${{ env.TEST_FILTER }}
# env:
# _JAVA_OPTIONS: ${{ matrix.os_java_options }}
# - name: Create Artifact Path
# run: |
# mkdir -p index-management-artifacts
# cp ./build/distributions/*.zip index-management-artifacts
# # This step uses the upload-artifact Github action: https://github.com/actions/upload-artifact
# - name: Upload Artifacts
# uses: actions/upload-artifact@v1
# with:
# name: index-management-plugin-${{ matrix.os }}
# path: index-management-artifacts
Loading