Skip to content

Commit cd3144f

Browse files
Add test keys to CI related workflows (#1099) (#1103)
* Add test keys to CI related workflows Signed-off-by: Peter Zhu <[email protected]> * test more Signed-off-by: Peter Zhu <[email protected]> * more test Signed-off-by: Peter Zhu <[email protected]> * test Signed-off-by: Peter Zhu <[email protected]> --------- Signed-off-by: Peter Zhu <[email protected]> (cherry picked from commit 62d9f20) Co-authored-by: Peter Zhu <[email protected]>
1 parent c6e881d commit cd3144f

File tree

2 files changed

+32
-18
lines changed

2 files changed

+32
-18
lines changed

.github/workflows/CI-workflow.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,20 @@ on:
77
push:
88
branches:
99
- "*"
10+
11+
permissions:
12+
id-token: write
13+
contents: read
14+
1015
jobs:
1116
Build-ml:
1217
strategy:
1318
matrix:
1419
java: [11, 17]
1520

1621
name: Build and Test MLCommons Plugin
22+
if: github.repository == 'opensearch-project/ml-commons'
23+
environment: ml-commons-cicd-env
1724
runs-on: ubuntu-latest
1825

1926
steps:
@@ -22,6 +29,11 @@ jobs:
2229
with:
2330
java-version: ${{ matrix.java }}
2431

32+
- uses: aws-actions/configure-aws-credentials@v2
33+
with:
34+
role-to-assume: ${{ secrets.ML_ROLE }}
35+
aws-region: us-west-2
36+
2537
# ml-commons
2638
- name: Checkout MLCommons
2739
uses: actions/checkout@v2
@@ -34,7 +46,12 @@ jobs:
3446
./gradlew publishToMavenLocal
3547
- name: Multi Nodes Integration Testing
3648
run: |
49+
export OPENAI_KEY=$(aws secretsmanager get-secret-value --secret-id github_openai_key --query SecretString --output text)
50+
export COHERE_KEY=$(aws secretsmanager get-secret-value --secret-id github_cohere_key --query SecretString --output text)
51+
echo "::add-mask::$OPENAI_KEY"
52+
echo "::add-mask::$COHERE_KEY"
3753
./gradlew integTest -PnumNodes=3
54+
3855
- name: Pull and Run Docker
3956
run: |
4057
plugin=`basename $(ls plugin/build/distributions/*.zip)`
@@ -71,6 +88,10 @@ jobs:
7188
if: env.imagePresent == 'true'
7289
run: |
7390
security=`curl -XGET https://localhost:9200/_cat/plugins?v -u admin:admin --insecure |grep opensearch-security|wc -l`
91+
export OPENAI_KEY=$(aws secretsmanager get-secret-value --secret-id github_openai_key --query SecretString --output text)
92+
export COHERE_KEY=$(aws secretsmanager get-secret-value --secret-id github_cohere_key --query SecretString --output text)
93+
echo "::add-mask::$OPENAI_KEY"
94+
echo "::add-mask::$COHERE_KEY"
7495
if [ $security -gt 0 ]
7596
then
7697
echo "Security plugin is available"
@@ -91,6 +112,8 @@ jobs:
91112
matrix:
92113
java: [11, 17]
93114
name: Build and Test MLCommons Plugin on Windows
115+
if: github.repository == 'opensearch-project/ml-commons'
116+
environment: ml-commons-cicd-env
94117
runs-on: windows-latest
95118

96119
steps:
@@ -99,6 +122,11 @@ jobs:
99122
with:
100123
java-version: ${{ matrix.java }}
101124

125+
# - uses: aws-actions/configure-aws-credentials@v2
126+
# with:
127+
# role-to-assume: ${{ secrets.ML_ROLE }}
128+
# aws-region: us-west-2
129+
102130
# ml-commons
103131
- name: Checkout MLCommons
104132
uses: actions/checkout@v2
@@ -111,4 +139,8 @@ jobs:
111139
./gradlew publishToMavenLocal
112140
# - name: Multi Nodes Integration Testing
113141
# run: |
142+
# export OPENAI_KEY=$(aws secretsmanager get-secret-value --secret-id github_openai_key --query SecretString --output text)
143+
# export COHERE_KEY=$(aws secretsmanager get-secret-value --secret-id github_cohere_key --query SecretString --output text)
144+
# echo "::add-mask::$OPENAI_KEY"
145+
# echo "::add-mask::$COHERE_KEY"
114146
# ./gradlew integTest -PnumNodes=3

.github/workflows/dco.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)