77 push :
88 branches :
99 - " *"
10+
11+ permissions :
12+ id-token : write
13+ contents : read
14+
1015jobs :
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 :
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
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)`
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"
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
0 commit comments