Skip to content

Commit c2ac9e6

Browse files
authored
update github workflow (NVIDIA#2943)
cherry-picks aa1c52f Signed-off-by: Tyler Burt <[email protected]>
1 parent 3aa6b11 commit c2ac9e6

File tree

2 files changed

+94
-45
lines changed

2 files changed

+94
-45
lines changed

.github/workflows/blossom-ci.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
17+
name: Blossom-CI
18+
on:
19+
issue_comment:
20+
types: [created]
21+
workflow_dispatch:
22+
inputs:
23+
platform:
24+
description: 'runs-on argument'
25+
required: false
26+
args:
27+
description: 'argument'
28+
required: false
29+
jobs:
30+
Authorization:
31+
name: Authorization
32+
runs-on: blossom
33+
outputs:
34+
args: ${{ env.args }}
35+
36+
# This job only runs for pull request comments
37+
if: |
38+
startsWith( github.event.comment.body, '/bot' ) && contains(
39+
fromJson('["byshiue","chuangz0","funatiq","hypdeb","jdemouth-nvidia","joyang-nv","lowsfer","Tabrizian","yweng0828","Shixiaowei02","MartinMarciniszyn","schetlur-nv","dcampora","pcastonguay","Naveassaf","lfr-0531","nekorobov","PerkzZheng","kaiyux","nv-guomingz","LinPoly","thorjohnsen","jiahanc","latency1024","tburt-nv","zeroepoch","chzblych","niukuo","ZhanruiSunCh","EmmaQiaoCh","yiqingy0","achartier","suyoggupta","amukkara","mk-nvidia","QiJune","lucaslie","davidmlw","hlu1","nvzhou","syuoni","NVGaryJi","symphonylyh","hello-11","zongfeijing","Jackch-NV","jinyangyuan-nvidia","LarryXFly","crazydemo","jaedeok-nvidia","wm2012011492","rosenrodt","zhuoyao1012","xinhe-nv","Yuening-wa","Shunkangz","zhengd-nv","yibinl-nvidia","StanleySun639","KingsleyLiu-NV","kxdc","yingcanw","BestJuly","ChristinaZ","bobboli","xueweilnvidia","kunlunl","cherichy","lucifer1004","Autumn1998","litaotju","peaceh-nv","liji-nv","SimengLiu-nv","yuxianq","yechank-nvidia","vallis-neria","DylanChen-NV","Tracin","zhhuang-nv","ISEEKYAN","xupinjie","tongyuantongyu","laikhtewari","zhuolingwang","dominicshanshan","jershi425","shifangx","StudyingShao","Superjomn","dongjiyingdjy","guangyunh-nv","wili-65535","tiffany940107","DanBlanaru","mikeiovine","djns99","ruodil","xiaoweiw-nv","xuwchen","bashimao","yizhang-nv","hyukn","nvpohanh","yuki-666","juney-nvidia","barry-delaney","Kefeng-Duan","MinaHuai","yilin-void","jtchen0528","jmydurant","katec846","CarstyYou","Njuapp","Jie-Fang","nvbrantz","inocsin","ruoqianguo","chenfeiz0326","ming-wei","eopXD","longlee0622","dongfengy","georgeliu95","evezhier","rakib-hasan","shangz-ai","JyChang012","wangsiping1997","yuanjings-nvda","tomeras91","roikoren755","amirkl94","shaharmor98","danielafrimi","amitz-nv","hijkzzz","rzilberstein-nvidia","dc3671","hchings","yuhengxnv","dongxuy04","qiaoxj07","omera-nv"]'),
40+
github.actor)
41+
steps:
42+
- name: Check if comment is issued by authorized person
43+
run: blossom-ci
44+
env:
45+
OPERATION: 'AUTH'
46+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
48+
49+
Vulnerability-scan:
50+
name: Vulnerability scan
51+
needs: [Authorization]
52+
runs-on: ubuntu-latest
53+
steps:
54+
- name: Checkout code
55+
uses: actions/checkout@v2
56+
with:
57+
repository: ${{ fromJson(needs.Authorization.outputs.args).repo }}
58+
ref: ${{ fromJson(needs.Authorization.outputs.args).ref }}
59+
lfs: 'true'
60+
61+
- name: Run blossom action
62+
uses: NVIDIA/blossom-action@main
63+
env:
64+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
REPO_KEY_DATA: ${{ secrets.BLOSSOM_KEY }}
66+
with:
67+
args1: ${{ fromJson(needs.Authorization.outputs.args).args1 }}
68+
args2: ${{ fromJson(needs.Authorization.outputs.args).args2 }}
69+
args3: ${{ fromJson(needs.Authorization.outputs.args).args3 }}
70+
71+
Job-trigger:
72+
name: Start ci job
73+
needs: [Vulnerability-scan]
74+
runs-on: blossom
75+
steps:
76+
- name: Start ci job
77+
run: blossom-ci
78+
env:
79+
OPERATION: 'START-CI-JOB'
80+
CI_SERVER: ${{ secrets.CI_SERVER }}
81+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
83+
Upload-Log:
84+
name: Upload log
85+
runs-on: blossom
86+
if : github.event_name == 'workflow_dispatch'
87+
steps:
88+
- name: Jenkins log for pull request ${{ fromJson(github.event.inputs.args).pr }} (click here)
89+
run: blossom-ci
90+
env:
91+
OPERATION: 'POST-PROCESSING'
92+
CI_SERVER: ${{ secrets.CI_SERVER }}
93+
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/l0-test.yml

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
# A workflow to trigger ci on hybrid infra (github + self hosted runner)
1717
name: L0-Test
1818
on:
19-
issue_comment:
20-
types: [created]
2119
workflow_dispatch:
2220
inputs:
2321
sha:
@@ -30,48 +28,6 @@ on:
3028
description: 'test results url'
3129
required: true
3230
jobs:
33-
Authorization:
34-
runs-on: ubuntu-latest
35-
name: Authorization
36-
if: startsWith( github.event.comment.body, '/bot' )
37-
steps:
38-
- name: Check Team Membership
39-
uses: actions/github-script@v6
40-
with:
41-
github-token: ${{ secrets.CI_TEAM_TOKEN }}
42-
script: |
43-
try {
44-
const { data: membership } = await github.rest.teams.getMembershipForUserInOrg({
45-
org: context.repo.owner,
46-
team_slug: 'trt-llm-ci-approvers',
47-
username: context.actor,
48-
});
49-
if (membership.state != 'active') {
50-
core.setFailed('only member in [trt-llm-ci-approvers] can run', membership)
51-
}
52-
} catch (error) {
53-
console.log('check membership failed:', error);
54-
core.setFailed('only member in [trt-llm-ci-approvers] can run')
55-
}
56-
57-
Job-trigger:
58-
name: Start ci job
59-
needs: [Authorization]
60-
runs-on: [self-hosted, Linux, Jenkins]
61-
steps:
62-
- name: Start ci job
63-
run: |
64-
CI_SERVER="${{ secrets.CI_SERVER }}"
65-
JENKINS_URL=$(echo "$CI_SERVER" | cut -d '@' -f 1)
66-
TOKEN=$(echo "$CI_SERVER" | cut -d '@' -f 2)
67-
68-
echo '${{ toJson(github.event) }}' > githubData.json
69-
70-
curl -s --fail-with-body -X POST \
71-
-H "Content-Type: application/json" \
72-
-d @githubData.json \
73-
"$JENKINS_URL/generic-webhook-trigger/invoke?token=$TOKEN"
74-
7531
Upload-Test:
7632
name: Upload test results
7733
runs-on: linux-amd64-cpu4
@@ -83,7 +39,7 @@ jobs:
8339
script: |
8440
state = 'pending'
8541
description = 'collecting test results'
86-
if ('${{ github.event.inputs.test_result }}' == 'SUCCESS') {
42+
if ('${{ github.event.inputs.test_result }}' == 'success') {
8743
state = 'success'
8844
description = 'test passed, collecting test results'
8945
}

0 commit comments

Comments
 (0)