-
Notifications
You must be signed in to change notification settings - Fork 87
229 lines (211 loc) · 8.43 KB
/
gh-build-and-test.yml
File metadata and controls
229 lines (211 loc) · 8.43 KB
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
on:
workflow_call:
inputs:
platform:
type: string
required: true
target-device:
type: string
required: true
build-type:
type: string
required: true
upload-enabled:
type: boolean
required: true
python-version:
required: false
type: string
default: "3.12"
refname:
required: true
type: string
default-branch:
required: true
type: string
jobs:
setup-build:
name: Setup build
runs-on: linux-amd64-cpu4
outputs:
runner_type: ${{ steps.set_runner.outputs.runner_type }}
steps:
- id: set_runner
run: |
if [ "${{ inputs.platform }}" = "linux" ]; then
if [ "${{ github.repository_owner }}" = "nv-legate" ]; then
echo "runner_type=linux-amd64-cpu16" >> $GITHUB_OUTPUT
else
echo "runner_type=ubuntu-latest" >> $GITHUB_OUTPUT
fi
elif [ "${{ inputs.platform }}" = "linux-aarch64" ]; then
echo "runner_type=linux-arm64-cpu16" >> $GITHUB_OUTPUT
elif [ "${{ inputs.platform }}" = "mac" ]; then
echo "runner_type=macos-latest" >> $GITHUB_OUTPUT
fi
build:
needs: setup-build
name: "Build (${{ inputs.platform }}, ${{ inputs.target-device }}, ${{ inputs.build-type }}, Python ${{ inputs.python-version }})"
uses:
nv-legate/legate-gh-ci/.github/workflows/gh-build.yml@v1.29
with:
build-has-tests: ${{ !inputs.upload-enabled }}
build-mode: ""
build-type: ${{ inputs.build-type }}
client-repo: ${{ github.event.repository.name }}
dependencies-file: ""
legate-gh-ci-tag: "v1.29"
network: "ucx"
platform: ${{ inputs.platform }}
python-version: ${{ inputs.python-version }}
runs-on: ${{ needs.setup-build.outputs.runner_type }}
target-device: ${{ inputs.target-device }}
upload-enabled: ${{ inputs.upload-enabled }}
use-container: ${{ inputs.platform == 'linux' || inputs.platform == 'linux-aarch64' }}
secrets: inherit
upload:
needs: build
if: ${{ github.repository_owner == 'nv-legate' && contains(github.workflow, 'release') && inputs.upload-enabled == true }}
name: Upload package to Server
uses:
nv-legate/legate-gh-ci/.github/workflows/gh-upload.yml@v1.29
with:
build-has-tests: ${{ !inputs.upload-enabled }}
build-mode: ""
build-type: ${{ inputs.build-type }}
client-repo: ${{ github.event.repository.name }}
legate-gh-ci-tag: "v1.29"
name: Upload package to Server
network: "ucx"
pkgSubString: "cupynumeric-"
platform: ${{ inputs.platform }}
python-version: ${{ inputs.python-version }}
repos-Root: "cupynumeric"
target-device: ${{ inputs.target-device }}
upload-action: "upload-package-Anaconda"
upload-enabled: ${{ inputs.upload-enabled }}
refname: ${{ inputs.refname }}
default-branch: ${{ inputs.default-branch }}
secrets: inherit
setup-test:
if: inputs.upload-enabled == false
name: Setup test
needs:
- build
runs-on: linux-amd64-cpu4
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
set -xeuo pipefail
MATRIX_JSON='{"include": ['
RUNNERS=(
'linux-amd64-gpu-l4-latest-1:gpu:gpu:linux' 'linux-amd64-2gpu:gpu:2gpu:linux'
'linux-amd64-cpu16:cpu:cpu:linux'
'linux-arm64-cpu16:cpu:cpu:linux-aarch64' 'linux-aarch64-2gpu:gpu:2gpu:linux-aarch64' 'linux-aarch64-2gpu:gpu:gpu:linux-aarch64'
'macos-latest:cpu:cpu:mac')
TEST_CONFIGS=(
'1 CPU test:test --cpus 1 --debug:cpu'
'1 CPU test:test --cpus 1 --debug:gpu'
'2 CPU test:test --cpus 2 --debug:cpu'
'2 CPU test:test --cpus 2 --debug:gpu'
# Set the number of workers manually because nvidia runners report 6
# gpus when only one is really available this workaround can be
# removed when the number of available gpus is reported correctly
# (when we run on VMs)
'GPU test:test --use cuda --gpus 1 --debug:gpu'
'2 GPU test:test --use cuda --gpus 2 --debug:2gpu'
'OpenMP test:test --use openmp --omps 1 --ompthreads 2 --debug:gpu'
'OpenMP test:test --use openmp --omps 1 --ompthreads 2 --debug:cpu'
'2 NUMA OpenMPs test:test --use openmp --omps 2 --ompthreads 2 --numamem 2048 --debug:gpu'
'2 NUMA OpenMPs test:test --use openmp --omps 2 --ompthreads 2 --numamem 2048 --debug:cpu'
'Eager execution test:test --use eager --debug:gpu'
'Eager execution test:test --use eager --debug:cpu'
'mypy:mypy:cpu'
'Unit tests:unit:cpu'
'CPP tests:cpp:cpu'
# TODO: Uncomment the following lines once
# https://github.com/nv-legate/cupynumeric.internal/issues/654 has
# been fixed.
# 'CPP tests:cpp:gpu'
# 'CPP tests:cpp:2gpu'
)
for RUNNER in "${RUNNERS[@]}"; do
IFS=':' read -ra RUNNER_INFO <<< "$RUNNER"
RUNNER_NAME=${RUNNER_INFO[0]}
RUNNER_TYPE=${RUNNER_INFO[1]}
RUNNER_DEVICE=${RUNNER_INFO[2]}
RUNNER_PLATFORM=${RUNNER_INFO[3]}
if [[ "$RUNNER_TYPE" == "${{ inputs.target-device }}" && "$RUNNER_PLATFORM" == "${{ inputs.platform }}" ]]; then
for TEST_CONFIG in "${TEST_CONFIGS[@]}"; do
IFS=':' read -ra CONFIG_INFO <<< "$TEST_CONFIG"
TEST_NAME=${CONFIG_INFO[0]}
TEST_OPTIONS=${CONFIG_INFO[1]}
TEST_TARGET_DEVICE=${CONFIG_INFO[2]}
# Note: we don't have enough linux-aarch64 GPU runners to
# support per commit testing. This is why these tests are waived
# here.
WAIVE_TEST="${{ inputs.target-device == 'gpu' && inputs.build-type == 'ci' && inputs.platform == 'linux-aarch64' }}"
if [[ "$TEST_TARGET_DEVICE" == "$RUNNER_DEVICE" ]]; then
if [[ "${WAIVE_TEST}" == "false" ]]; then
MATRIX_JSON+="{\"runner\": {\"name\": \"$RUNNER_NAME\", \"type\": \"$RUNNER_TYPE\", \"platform\": \"$RUNNER_PLATFORM\"}, \"test-config\": {\"name\": \"$TEST_NAME\", \"test-options\": \"$TEST_OPTIONS\"}},"
fi
fi
done
fi
done
# Remove the trailing comma
MATRIX_JSON=$(echo "$MATRIX_JSON" | sed 's/,$//')
# Terminate JSON expression
MATRIX_JSON+=']}'
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
test:
needs:
- setup-test
name: ${{ matrix.test-config.name }} (${{ inputs.platform }}, ${{ inputs.target-device }})
strategy:
fail-fast: false
matrix: ${{fromJson(needs.setup-test.outputs.matrix)}}
uses:
nv-legate/legate-gh-ci/.github/workflows/gh-test-within-container.yml@v1.29
with:
build-has-tests: ${{ !inputs.upload-enabled }}
build-mode: ""
build-type: ${{ inputs.build-type }}
client-repo: ${{ github.event.repository.name }}
has-gpu: ${{ matrix.runner.type == 'gpu' }}
legate-gh-ci-tag: "v1.29"
name: ${{ matrix.test-config.name }}
network: "ucx"
platform: ${{ inputs.platform }}
python-version: ${{ inputs.python-version }}
runs-on: ${{ matrix.runner.name }}
target-device: ${{ inputs.target-device }}
test-options: ${{ matrix.test-config.test-options }}
upload-enabled: ${{ inputs.upload-enabled }}
secrets: inherit
updateTestStatus:
needs: test
name: Update Test status on Server
if: ${{ false }}
uses:
nv-legate/legate-gh-ci/.github/workflows/gh-upload.yml@v1.29
with:
build-has-tests: ${{ !inputs.upload-enabled }}
build-mode: ""
build-type: ${{ inputs.build-type }}
client-repo: ${{ github.event.repository.name }}
legate-gh-ci-tag: "v1.29"
name: UpdateTestStatus
network: "ucx"
pkgSubString: "cupynumeric-"
platform: ${{ inputs.platform }}
python-version: ${{ inputs.python-version }}
repos-Root: "cupynumeric"
target-device: ${{ inputs.target-device }}
upload-action: "update-test-status"
upload-enabled: true
refname: ${{ inputs.refname }}
default-branch: ${{ inputs.default-branch }}
secrets: inherit