Skip to content

Commit

Permalink
Fixed the github actions to use the image used by OpenSearch-build re…
Browse files Browse the repository at this point in the history
…po for building the distribution (#1069) (#1072)

* Fixed the github actions to use the image used by OpenSearch-build repo for building the distribution

Signed-off-by: Navneet Verma <navneev@amazon.com>

* Retry switch user on the CI using prod docker images

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

* Cleanup debug commands

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

---------

Signed-off-by: Navneet Verma <navneev@amazon.com>
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
Co-authored-by: Peter Zhu <zhujiaxi@amazon.com>
(cherry picked from commit 8994de6)

Co-authored-by: Navneet Verma <navneev@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and navneet1v committed Aug 30, 2023
1 parent 865f613 commit f7b4415
Showing 1 changed file with 36 additions and 13 deletions.
49 changes: 36 additions & 13 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,56 @@ jobs:
strategy:
matrix:
java: [11, 17]
os: [ubuntu-latest, macos-latest]

name: Build and Test k-NN Plugin
runs-on: ${{ matrix.os }}
name: Build and Test k-NN Plugin 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: public.ecr.aws/opensearchstaging/ci-runner:ci-runner-rockylinux8-opensearch-build-v4
# need to switch to root so that github actions can install runner binary on container without permission issues.
options: --user root

steps:
- name: Checkout k-NN
uses: actions/checkout@v1
with:
submodules: true

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Install dependencies on ubuntu
if: startsWith(matrix.os,'ubuntu')
- name: Run build
# switching the user, as OpenSearch cluster can only be started as root/Administrator on linux-deb/linux-rpm/windows-zip.
run: |
sudo apt-get install libopenblas-dev gfortran -y
chown -R opensearch.opensearch `pwd`
su opensearch -c "whoami && java -version && ./gradlew build"
- name: Upload Coverage Report
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

Build-k-NN-MacOS:
strategy:
matrix:
java: [ 11, 17 ]

name: Build and Test k-NN Plugin on MacOS
runs-on: macos-latest

steps:
- name: Checkout k-NN
uses: actions/checkout@v1

- name: Setup Java ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- name: Install dependencies on macos
if: startsWith(matrix.os, 'macos')
run: |
brew reinstall gcc
export FC=/usr/local/Cellar/gcc/12.2.0/bin/gfortran
Expand All @@ -45,12 +74,6 @@ jobs:
run: |
./gradlew build
- name: Upload Coverage Report
if: startsWith(matrix.os,'ubuntu')
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}

Build-k-NN-Windows:
strategy:
matrix:
Expand Down

0 comments on commit f7b4415

Please sign in to comment.