forked from nv-morpheus/Morpheus
-
Notifications
You must be signed in to change notification settings - Fork 2
260 lines (236 loc) · 7.21 KB
/
ci_pipe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# SPDX-FileCopyrightText: Copyright (c) 2022-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: CI Pipeline
on:
workflow_call:
inputs:
run_check:
required: true
type: boolean
conda_upload_label:
description: 'The label to use when uploading the morpheus conda packages. Leave empty to disable uploading'
required: true
type: string
conda_run_build:
description: 'Runs the conda-build stage to build the morpheus conda packages'
required: true
type: boolean
base_container:
required: true
type: string
container:
required: true
type: string
test_container:
required: true
type: string
secrets:
CONDA_TOKEN:
required: true
NGC_API_KEY:
required: true
env:
CHANGE_TARGET: "${{ github.base_ref }}"
CUDA_PATH: "/usr/local/cuda/"
CUDA_VER: "12.5"
GH_TOKEN: "${{ github.token }}"
GIT_COMMIT: "${{ github.sha }}"
MORPHEUS_ROOT: "${{ github.workspace }}/morpheus"
WORKSPACE: "${{ github.workspace }}/morpheus"
WORKSPACE_TMP: "${{ github.workspace }}/tmp"
permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: write
issues: none
packages: read
pages: none
pull-requests: read
repository-projects: none
security-events: none
statuses: none
jobs:
check:
if: ${{ inputs.run_check }}
name: Check
runs-on: linux-amd64-cpu4
timeout-minutes: 60
container:
credentials:
username: '$oauthtoken'
password: ${{ secrets.NGC_API_KEY }}
image: ${{ inputs.container }}
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'morpheus'
fetch-depth: 0
submodules: 'recursive'
- name: Get AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- name: Check
shell: bash
run: ./morpheus/ci/scripts/github/checks.sh
build:
name: Build
runs-on: linux-${{ matrix.arch }}-cpu16
timeout-minutes: 60
container:
credentials:
username: '$oauthtoken'
password: ${{ secrets.NGC_API_KEY }}
image: ${{ inputs.container }}
strategy:
fail-fast: true
matrix:
arch: ["amd64", "arm64"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'morpheus'
submodules: 'recursive'
- name: Get AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- name: Build:linux:${{ matrix.arch }}:gcc
shell: bash
run: ./morpheus/ci/scripts/github/build.sh
test:
name: Test
runs-on: ${{ matrix.runner }}
# Consider lowering this back down to 60 minutes per https://github.com/nv-morpheus/Morpheus/issues/1948
timeout-minutes: 90
container:
credentials:
username: '$oauthtoken'
password: ${{ secrets.NGC_API_KEY }}
image: ${{ inputs.test_container }}
options: --cap-add=sys_nice
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
PARALLEL_LEVEL: '10'
strategy:
fail-fast: true
matrix:
arch: ["amd64", "arm64"]
include:
- runner: linux-amd64-gpu-v100-latest-1
arch: "amd64"
- runner: linux-arm64-gpu-a100-latest-1
arch: "arm64"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'morpheus'
submodules: 'recursive'
- name: Get AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- name: Test:linux:${{ matrix.arch }}:gcc
shell: bash
run: ./morpheus/ci/scripts/github/test.sh
documentation:
name: Documentation
needs: [build]
runs-on: linux-amd64-cpu4
timeout-minutes: 60
container:
credentials:
username: '$oauthtoken'
password: ${{ secrets.NGC_API_KEY }}
image: ${{ inputs.container }}
strategy:
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'morpheus'
# Fetch tags so that documentation builds for releases will report the version number correctly
fetch-tags: true
submodules: 'recursive'
- name: Get AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- name: build_docs
shell: bash
run: ./morpheus/ci/scripts/github/docs.sh
package:
name: Conda Package
if: ${{ inputs.conda_run_build }}
needs: [documentation, test]
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
container:
image: ${{ inputs.base_container }}
options: --cap-add=sys_nice
env:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
PARALLEL_LEVEL: '10'
strategy:
fail-fast: true
matrix:
arch: ["amd64", "arm64"]
include:
- runner: linux-amd64-gpu-v100-latest-1
arch: "amd64"
- runner: linux-arm64-cpu16
arch: "arm64"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
lfs: false
path: 'morpheus'
fetch-depth: 0
submodules: 'recursive'
- name: Get AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@v1-node16
with:
role-to-assume: ${{ vars.AWS_ROLE_ARN }}
aws-region: ${{ vars.AWS_REGION }}
role-duration-seconds: 43200 # 12h
- name: Build morpheus-core:${{ matrix.arch }} conda package
shell: bash
env:
CONDA_TOKEN: "${{ secrets.CONDA_TOKEN }}"
SCRIPT_ARGS: "${{ inputs.conda_upload_label != '' && 'upload' || '' }}"
CONDA_PKG_LABEL: "${{ inputs.conda_upload_label }}"
run: ./morpheus/ci/scripts/github/conda_libs.sh $SCRIPT_ARGS