-
Notifications
You must be signed in to change notification settings - Fork 52
264 lines (257 loc) · 12 KB
/
build-test-publish-images.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
261
262
263
264
name: build and publish imgs workflow
on:
workflow_call:
inputs:
build_type:
required: true
type: string
run_tests:
required: false
default: false
type: boolean
defaults:
run:
shell: bash
permissions:
actions: read
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:
compute-matrix:
runs-on: ubuntu-latest
container:
image: rapidsai/ci-conda:latest
outputs:
BASE_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.BASE_IMAGE_REPO }}
NOTEBOOKS_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.NOTEBOOKS_IMAGE_REPO }}
RAFT_ANN_BENCH_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.RAFT_ANN_BENCH_IMAGE_REPO }}
RAFT_ANN_BENCH_DATASETS_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.RAFT_ANN_BENCH_DATASETS_IMAGE_REPO }}
RAFT_ANN_BENCH_CPU_IMAGE_REPO: ${{ steps.compute-image-repo.outputs.RAFT_ANN_BENCH_CPU_IMAGE_REPO }}
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }}
TEST_MATRIX: ${{ steps.compute-test-matrix.outputs.TEST_MATRIX }}
BASE_TAG_PREFIX: ${{ steps.compute-tag-prefix.outputs.BASE_TAG_PREFIX }}
NOTEBOOKS_TAG_PREFIX: ${{ steps.compute-tag-prefix.outputs.NOTEBOOKS_TAG_PREFIX }}
RAFT_ANN_BENCH_TAG_PREFIX: ${{ steps.compute-tag-prefix.outputs.RAFT_ANN_BENCH_TAG_PREFIX }}
RAFT_ANN_BENCH_DATASETS_TAG_PREFIX: ${{ steps.compute-tag-prefix.outputs.RAFT_ANN_BENCH_DATASETS_TAG_PREFIX }}
RAFT_ANN_BENCH_CPU_TAG_PREFIX: ${{ steps.compute-tag-prefix.outputs.RAFT_ANN_BENCH_CPU_TAG_PREFIX }}
RAPIDS_VER: ${{ steps.compute-rapids-ver.outputs.RAPIDS_VER }}
ALPHA_TAG: ${{ steps.compute-rapids-ver.outputs.ALPHA_TAG }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Compute matrix
id: compute-matrix
run: |
MATRIX=$(ci/compute-matrix.sh)
echo "MATRIX=${MATRIX}" | tee -a ${GITHUB_OUTPUT}
- name: Compute tag prefix
id: compute-tag-prefix
run: |
TAG_PREFIX=""
if [ "${{ inputs.build_type }}" = "pull-request" ]; then
pr_num="${GITHUB_REF_NAME##*/}"
BASE_TAG_PREFIX="docker-${pr_num}-"
NOTEBOOKS_TAG_PREFIX="docker-notebooks-${pr_num}-"
RAFT_ANN_BENCH_TAG_PREFIX="docker-raft-ann-bench-${pr_num}-"
RAFT_ANN_BENCH_DATASETS_TAG_PREFIX="docker-raft-ann-bench-datasets-${pr_num}-"
RAFT_ANN_BENCH_CPU_TAG_PREFIX="docker-raft-ann-bench-cpu-${pr_num}-"
fi
echo "BASE_TAG_PREFIX=${BASE_TAG_PREFIX}" | tee -a ${GITHUB_OUTPUT}
echo "NOTEBOOKS_TAG_PREFIX=${NOTEBOOKS_TAG_PREFIX}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_TAG_PREFIX=${RAFT_ANN_BENCH_TAG_PREFIX}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_DATASETS_TAG_PREFIX=${RAFT_ANN_BENCH_DATASETS_TAG_PREFIX}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_CPU_TAG_PREFIX=${RAFT_ANN_BENCH_CPU_TAG_PREFIX}" | tee -a ${GITHUB_OUTPUT}
- name: Compute image repo
id: compute-image-repo
run: |
base_repo="base"
notebooks_repo="notebooks"
raft_ann_bench_repo="raft-ann-bench"
raft_ann_bench_datasets_repo="raft-ann-bench-datasets"
raft_ann_bench_cpu_repo="raft-ann-bench-cpu"
if [ "${{ inputs.build_type }}" = "pull-request" ]; then
base_repo="staging"
notebooks_repo="staging"
raft_ann_bench_repo="staging"
raft_ann_bench_datasets_repo="staging"
raft_ann_bench_cpu_repo="staging"
fi
echo "BASE_IMAGE_REPO=${base_repo}" | tee -a ${GITHUB_OUTPUT}
echo "NOTEBOOKS_IMAGE_REPO=${notebooks_repo}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_IMAGE_REPO=${raft_ann_bench_repo}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_DATASETS_IMAGE_REPO=${raft_ann_bench_datasets_repo}" | tee -a ${GITHUB_OUTPUT}
echo "RAFT_ANN_BENCH_CPU_IMAGE_REPO=${raft_ann_bench_cpu_repo}" | tee -a ${GITHUB_OUTPUT}
- name: Compute RAPIDS_VER
id: compute-rapids-ver
run: |
GIT_DESCRIBE_TAG="$(git describe --tags --abbrev=0)"
GIT_DESCRIBE_TAG="${GIT_DESCRIBE_TAG:1}" # remove leading 'v'
ALPHA_TAG=""
if [[ $GIT_DESCRIBE_TAG =~ [a-z] ]]; then
rapids-logger "Most recent tag is an alpha tag"
ALPHA_TAG="a"
fi
RAPIDS_VER="$(echo $GIT_DESCRIBE_TAG | awk 'BEGIN{FS=OFS="."} NF--')" # Convert full tag to YY.MM
echo "RAPIDS_VER=${RAPIDS_VER}" | tee -a ${GITHUB_OUTPUT}
echo "ALPHA_TAG=${ALPHA_TAG}" | tee -a ${GITHUB_OUTPUT}
- name: Compute test matrix
id: compute-test-matrix
run: |
TEST_MATRIX=$(yq '.${{ inputs.build_type }}' matrix-test.yaml)
export TEST_MATRIX
echo "TEST_MATRIX=$(yq -n -o json 'env(TEST_MATRIX)' | jq -c '{include: .}')" | tee --append "${GITHUB_OUTPUT}"
build:
needs: compute-matrix
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
fail-fast: false
secrets: inherit
uses: ./.github/workflows/build-image.yml
with:
ARCHES: ${{ toJSON(matrix.ARCHES) }}
CUDA_VER: ${{ matrix.CUDA_VER }}
LINUX_DISTRO: ${{ matrix.LINUX_DISTRO }}
LINUX_DISTRO_VER: ${{ matrix.LINUX_DISTRO_VER }}
LINUX_VER: ${{ matrix.LINUX_VER }}
PYTHON_VER: ${{ matrix.PYTHON_VER }}
RAPIDS_VER: ${{ needs.compute-matrix.outputs.RAPIDS_VER }}
BASE_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.BASE_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.BASE_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
cuda${{ matrix.CUDA_TAG }}-\
py${{ matrix.PYTHON_VER }}"
NOTEBOOKS_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.NOTEBOOKS_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.NOTEBOOKS_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
cuda${{ matrix.CUDA_TAG }}-\
py${{ matrix.PYTHON_VER }}"
RAFT_ANN_BENCH_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
cuda${{ matrix.CUDA_TAG }}-\
py${{ matrix.PYTHON_VER }}"
RAFT_ANN_BENCH_DATASETS_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
cuda${{ matrix.CUDA_TAG }}-\
py${{ matrix.PYTHON_VER }}"
RAFT_ANN_BENCH_CPU_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
py${{ matrix.PYTHON_VER }}"
test:
needs: [build, compute-matrix]
if: inputs.run_tests
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.TEST_MATRIX) }}
fail-fast: false
secrets: inherit
uses: ./.github/workflows/test-notebooks.yml
with:
BUILD_TYPE: ${{ inputs.build_type }}
ARCH: ${{ matrix.ARCH }}
GPU: ${{ matrix.GPU }}
DRIVER: ${{ matrix.DRIVER }}
CUDA_VER: ${{ matrix.CUDA_VER }}
PYTHON_VER: ${{ matrix.PYTHON_VER }}
NOTEBOOKS_TAG:
"rapidsai/${{ needs.compute-matrix.outputs.NOTEBOOKS_IMAGE_REPO }}:\
${{ needs.compute-matrix.outputs.NOTEBOOKS_TAG_PREFIX }}\
${{ needs.compute-matrix.outputs.RAPIDS_VER }}\
${{ needs.compute-matrix.outputs.ALPHA_TAG }}-\
cuda${{ matrix.CUDA_VER }}-\
py${{ matrix.PYTHON_VER }}-\
${{ matrix.ARCH }}"
build-multiarch-manifest:
if: '!cancelled()'
needs: [build, compute-matrix]
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }}
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }}
- name: Create multiarch manifest
shell: bash
env:
BASE_IMAGE_REPO: ${{ needs.compute-matrix.outputs.BASE_IMAGE_REPO }}
BASE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.BASE_TAG_PREFIX }}
RAPIDS_VER: ${{ needs.compute-matrix.outputs.RAPIDS_VER }}
ALPHA_TAG: ${{ needs.compute-matrix.outputs.ALPHA_TAG }}
CUDA_TAG: ${{ matrix.CUDA_TAG }}
PYTHON_VER: ${{ matrix.PYTHON_VER }}
NOTEBOOKS_IMAGE_REPO: ${{ needs.compute-matrix.outputs.NOTEBOOKS_IMAGE_REPO }}
NOTEBOOKS_TAG_PREFIX: ${{ needs.compute-matrix.outputs.NOTEBOOKS_TAG_PREFIX }}
RAFT_ANN_BENCH_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_IMAGE_REPO }}
RAFT_ANN_BENCH_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_TAG_PREFIX }}
RAFT_ANN_BENCH_DATASETS_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_IMAGE_REPO }}
RAFT_ANN_BENCH_DATASETS_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_TAG_PREFIX }}
RAFT_ANN_BENCH_CPU_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_IMAGE_REPO }}
RAFT_ANN_BENCH_CPU_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_TAG_PREFIX }}
GPUCIBOT_DOCKERHUB_USER: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }}
GPUCIBOT_DOCKERHUB_TOKEN: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }}
ARCHES: ${{ toJSON(matrix.ARCHES) }}
run: ci/create-multiarch-manifest.sh
delete-temp-images:
if: !cancelled() && needs.test.result == 'success'
needs: [compute-matrix, test, build-multiarch-manifest]
strategy:
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }}
fail-fast: false
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Remove temporary images
shell: bash
env:
BASE_IMAGE_REPO: ${{ needs.compute-matrix.outputs.BASE_IMAGE_REPO }}
BASE_TAG_PREFIX: ${{ needs.compute-matrix.outputs.BASE_TAG_PREFIX }}
RAPIDS_VER: ${{ needs.compute-matrix.outputs.RAPIDS_VER }}
ALPHA_TAG: ${{ needs.compute-matrix.outputs.ALPHA_TAG }}
CUDA_TAG: ${{ matrix.CUDA_TAG }}
PYTHON_VER: ${{ matrix.PYTHON_VER }}
NOTEBOOKS_IMAGE_REPO: ${{ needs.compute-matrix.outputs.NOTEBOOKS_IMAGE_REPO }}
NOTEBOOKS_TAG_PREFIX: ${{ needs.compute-matrix.outputs.NOTEBOOKS_TAG_PREFIX }}
RAFT_ANN_BENCH_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_IMAGE_REPO }}
RAFT_ANN_BENCH_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_TAG_PREFIX }}
RAFT_ANN_BENCH_DATASETS_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_IMAGE_REPO }}
RAFT_ANN_BENCH_DATASETS_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_DATASETS_TAG_PREFIX }}
RAFT_ANN_BENCH_CPU_IMAGE_REPO: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_IMAGE_REPO }}
RAFT_ANN_BENCH_CPU_TAG_PREFIX: ${{ needs.compute-matrix.outputs.RAFT_ANN_BENCH_CPU_TAG_PREFIX }}
GPUCIBOT_DOCKERHUB_USER: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }}
GPUCIBOT_DOCKERHUB_TOKEN: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }}
ARCHES: ${{ toJSON(matrix.ARCHES) }}
run: ci/delete-temp-images.sh