Skip to content

Commit

Permalink
Merge pull request #2406 from peterzhuamazon/issues-2248-backport-2.x
Browse files Browse the repository at this point in the history
[Backport 2.x] Onboard jenkins prod docker images to github actions
  • Loading branch information
peterzhuamazon authored Nov 1, 2023
2 parents 45e58c5 + 9330158 commit 5365fdd
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 36 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/dco.yml

This file was deleted.

49 changes: 47 additions & 2 deletions .github/workflows/integ-tests-with-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,56 @@ on:
- '.github/workflows/integ-tests-with-security.yml'

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

security-it-linux:
needs: Get-CI-Image-Tag
strategy:
fail-fast: false
matrix:
java: [ 11, 17 ]

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:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}

- name: Build with Gradle
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew integTestWithSecurity"
- name: Upload test reports
if: ${{ always() }}
uses: actions/upload-artifact@v2
continue-on-error: true
with:
name: test-reports-${{ matrix.os }}-${{ matrix.java }}
path: |
integ-test/build/reports/**
integ-test/build/testclusters/*/logs/*
integ-test/build/testclusters/*/config/*
security-it-windows-macos:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ windows-latest, macos-latest ]
java: [ 11, 17 ]

runs-on: ${{ matrix.os }}
Expand Down
78 changes: 62 additions & 16 deletions .github/workflows/sql-test-and-build-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,27 @@ on:
- '.github/workflows/sql-test-and-build-workflow.yml'

jobs:
build:
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
strategy:
# Run all jobs
fail-fast: false
matrix:
entry:
- { os: ubuntu-latest, java: 11 }
- { os: windows-latest, java: 11, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 11}
- { os: ubuntu-latest, java: 17 }
- { os: windows-latest, java: 17, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 17 }
runs-on: ${{ matrix.entry.os }}
java:
- 11
- 17
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:
- uses: actions/checkout@v3
Expand All @@ -39,14 +47,17 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.entry.java }}
java-version: ${{ matrix.java }}

- name: Build with Gradle
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./gradlew --continue build"
- name: Run backward compatibility tests
if: ${{ matrix.entry.os == 'ubuntu-latest' }}
run: ./scripts/bwctest.sh
run: |
chown -R 1000:1000 `pwd`
su `id -un 1000` -c "./scripts/bwctest.sh"
- name: Create Artifact Path
run: |
Expand All @@ -55,7 +66,7 @@ jobs:
# This step uses the codecov-action Github action: https://github.com/codecov/codecov-action
- name: Upload SQL Coverage Report
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
if: always()
uses: codecov/codecov-action@v3
with:
flags: sql-engine
Expand All @@ -64,11 +75,11 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: opensearch-sql-${{ matrix.entry.os }}
name: opensearch-sql-ubuntu-latest
path: opensearch-sql-builds

- name: Upload test reports
if: ${{ always() && matrix.entry.os == 'ubuntu-latest' }}
if: always()
uses: actions/upload-artifact@v2
continue-on-error: true
with:
Expand All @@ -83,3 +94,38 @@ jobs:
protocol/build/reports/**
legacy/build/reports/**
plugin/build/reports/**
build-windows-macos:
strategy:
# Run all jobs
fail-fast: false
matrix:
entry:
- { os: windows-latest, java: 11, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 11}
- { os: windows-latest, java: 17, os_build_args: -x doctest -PbuildPlatform=windows }
- { os: macos-latest, java: 17 }
runs-on: ${{ matrix.entry.os }}

steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.entry.java }}

- name: Build with Gradle
run: ./gradlew --continue build ${{ matrix.entry.os_build_args }}

- name: Create Artifact Path
run: |
mkdir -p opensearch-sql-builds
cp -r ./plugin/build/distributions/*.zip opensearch-sql-builds/
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: opensearch-sql-${{ matrix.entry.os }}
path: opensearch-sql-builds

0 comments on commit 5365fdd

Please sign in to comment.