forked from ROCm/rocThrust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
259 lines (247 loc) · 8.21 KB
/
.gitlab-ci.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
# ########################################################################
# Copyright 2019 Advanced Micro Devices, Inc.
# ########################################################################
image: rocm/rocm-terminal:latest
stages:
#- build:cmake_latest # Tests if builds succeed (CMake)
#- build:cmake_minimum # Tests if builds succeed (CMake)
- build # Tests if builds succeed (CMake)
- test # Tests if unit tests are passing (CTest)
- package
- deploy
variables:
# Tested CMake versions
CMAKE_MINIMUM_VERSION: 3.10.2
CMAKE_LATEST_VERSION: 3.17.0
# Cluster config
# Image-specific helper
SUDO_CMD: "sudo -E" # Must be "sudo" on images which don't use root user
# Helper variables
DEPS_DIR: $CI_PROJECT_DIR/deps
BUILD_DIR: $CI_PROJECT_DIR/build
CMAKE_MINIMUM_URL: "https://cmake.org/files/v3.10/cmake-3.10.2-Linux-x86_64.tar.gz"
CMAKE_MINIMUM_PATH: "$CI_PROJECT_DIR/deps/cmake-3.10.2"
CMAKE_LATEST_URL: "https://cmake.org/files/v3.16/cmake-3.16.0-Linux-x86_64.tar.gz"
CMAKE_LATEST_PATH: "$CI_PROJECT_DIR/deps/cmake-3.17.0"
BUILD_MINIMUM_DIR: $CI_PROJECT_DIR/build/cmake-3.10.2
BUILD_LATEST_DIR: $CI_PROJECT_DIR/build/cmake-3.17.0
PACKAGE_DIR: $CI_PROJECT_DIR/build/package
.deps:cmake-minimum:
#stage: build:cmake_minimum
stage: build
# Workaround tags until HAL is broken
tags:
- s9300
- rocm
before_script:
- $SUDO_CMD rm /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt update -qq
# | Used in the script | Build tools | Fetch from https:// | rocminfo calls lsmod
- $SUDO_CMD apt install -y -qq libidn11 wget tar xz-utils bzip2 libnuma-dev libunwind-dev git build-essential pkg-config ninja-build ca-certificates kmod
- $SUDO_CMD apt-get install -y -qq wget libidn11 libnuma-dev libunwind-dev git tar xz-utils bzip2 build-essential pkg-config ninja-build ca-certificates
- $SUDO_CMD wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | $SUDO_CMD apt-key add -
# Fetch CMake only if the cache has not been restored
- if [ ! -d $CMAKE_MINIMUM_PATH ]; then mkdir -p $CMAKE_MINIMUM_PATH; wget --no-check-certificate --quiet -O - $CMAKE_MINIMUM_URL | tar --strip-components=1 -xz -C $CMAKE_MINIMUM_PATH
- fi
- export PATH=$CMAKE_MINIMUM_PATH/bin:$PATH
# Debug printing of environment for context when errors occur
- hipconfig
# Setup ~/.netrc
- echo -e "machine projects.streamhpc.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
cache:
key: $CMAKE_MINIMUM_VERSION
paths:
- $CMAKE_MINIMUM_PATH
.deps:cmake-latest:
#stage: build:cmake_latest
stage: build
# Workaround tags until HAL is broken
tags:
- mi25
- rocm
before_script:
- $SUDO_CMD rm /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt update -qq
# | Used in the script | Build tools | Fetch from https:// | rocminfo calls lsmod
- $SUDO_CMD apt install -y -qq wget tar xz-utils bzip2 libnuma-dev libunwind-dev git build-essential pkg-config ninja-build ca-certificates kmod
- $SUDO_CMD apt-get install -y -qq wget libidn11 libnuma-dev libunwind-dev git tar xz-utils bzip2 build-essential pkg-config ninja-build ca-certificates
- $SUDO_CMD wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | $SUDO_CMD apt-key add -
# Fetch CMake only if the cache has not been restored
- if [ ! -d $CMAKE_LATEST_PATH ]; then mkdir -p $CMAKE_LATEST_PATH; wget --no-check-certificate --quiet -O - $CMAKE_LATEST_URL | tar --strip-components=1 -xz -C $CMAKE_LATEST_PATH;
- fi;
- export PATH=$CMAKE_LATEST_PATH/bin:$PATH
# Debug printing of environment for context when errors occur
- hipconfig
# Setup ~/.netrc
- echo -e "machine projects.streamhpc.com\nlogin gitlab-ci-token\npassword ${CI_JOB_TOKEN}" > ~/.netrc
# Setup env vars for testing
- rng_seed_count=0; prng_seeds="0";
- if [ $CI_COMMIT_BRANCH == develop_stream ] ; then rng_seed_count=3; prng_seeds="0 1000";
- fi;
cache:
key: $CMAKE_LATEST_VERSION
paths:
- $CMAKE_LATEST_PATH
build:cmake-latest:
extends:
- .deps:cmake-latest
script:
- mkdir -p $BUILD_LATEST_DIR
- cd $BUILD_LATEST_DIR
- git clone https://github.com/RadeonOpenCompute/rocm-cmake.git
- cd rocm-cmake && mkdir build && cd build
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
../
- $SUDO_CMD cmake
--build ./ --target install
- cd .. && cd ..
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=ON
-D BUILD_EXAMPLES=ON
-D BUILD_BENCHMARKS=ON
-D AMDGPU_TARGETS="gfx803;gfx900;gfx906"
-D AMDGPU_TEST_TARGETS="gfx803;gfx900;gfx906"
-D RNG_SEED_COUNT=$rng_seed_count
-D PRNG_SEEDS=$prng_seeds
-S $CI_PROJECT_DIR
-B $BUILD_LATEST_DIR
- cmake
--build $BUILD_LATEST_DIR
artifacts:
paths:
- $BUILD_LATEST_DIR/test/*
- $BUILD_LATEST_DIR/testing/*
- $BUILD_LATEST_DIR/deps/*
- $BUILD_LATEST_DIR/CMakeCache.txt
- $BUILD_LATEST_DIR/CTestTestfile.cmake
exclude:
- $BUILD_LATEST_DIR/**/*.o
expire_in: 2 weeks
build:cmake-minimum:
extends:
- .deps:cmake-minimum
#needs:
# - job: build:cmake-latest
# artifacts: false
script:
- mkdir -p $BUILD_MINIMUM_DIR
- cd $BUILD_MINIMUM_DIR
- git clone https://github.com/RadeonOpenCompute/rocm-cmake.git
- cd rocm-cmake && mkdir build && cd build
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
../
- $SUDO_CMD cmake
--build ./ --target install
- cd .. && cd ..
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D BUILD_TEST=ON
-D BUILD_EXAMPLES=ON
-D BUILD_BENCHMARKS=ON
-D DISABLE_WERROR=OFF
-B $BUILD_MINIMUM_DIR
../../.
- cmake
--build ./
artifacts:
paths:
- $BUILD_MINIMUM_DIR/*
exclude:
- $BUILD_MINIMUM_DIR/*test*/*
- $BUILD_MINIMUM_DIR/benchmarks/*
- $BUILD_MINIMUM_DIR/internal/*
- $BUILD_MINIMUM_DIR/examples/*
expire_in: 2 weeks
package:deb:
stage: package
extends:
- .deps:cmake-minimum
needs:
- job: build:cmake-minimum
artifacts: true
script:
- mkdir -p $PACKAGE_DIR
- cd $BUILD_MINIMUM_DIR
- $SUDO_CMD cpack
-G "DEB;ZIP"
-B $PACKAGE_DIR
artifacts:
paths:
- $PACKAGE_DIR/rocthrust*.deb
- $PACKAGE_DIR/rocthrust*.zip
expire_in: 2 weeks
include: '.gitlab-ci-gputest.yml'
deploy:deb:
stage: deploy
needs:
- package:deb
extends:
- .deps:cmake-minimum
script:
# Install rocPRIM package
- echo ${ROCPRIM_GIT_URL}
- echo $ROCPRIM_GIT_URL
- git clone https://github.com/RadeonOpenCompute/rocm-cmake.git
- cd rocm-cmake && mkdir build && cd build
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
../
- $SUDO_CMD cmake
--build ./ --target install
- cd .. && cd ..
- git clone -b develop_stream https://gitlab-ci-token:${CI_JOB_TOKEN}@${ROCPRIM_GIT_URL}
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-D ONLY_INSTALL=ON
-B $PACKAGE_DIR
./rocPRIM
- $SUDO_CMD cpack
-G "DEB;ZIP"
-B $PACKAGE_DIR
# Install rocPRIM and rocThrust
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocprim*.deb
- $SUDO_CMD dpkg -i $PACKAGE_DIR/rocthrust*.deb
# Test install
- mkdir -p package_test
- cd package_test
- cmake
-G Ninja
-D CMAKE_CXX_COMPILER=hipcc
-D CMAKE_BUILD_TYPE=Release
-B .
$CI_PROJECT_DIR/extra
- cmake
--build .
# Remove rocPRIM and rocThrust
- $SUDO_CMD dpkg -r rocthrust
- $SUDO_CMD dpkg -r rocprim
test:doc:
variables:
SUDO_CMD: "sudo -E"
tags:
- rocm # Do it on rocm machine
image: rocm/rocm-terminal:latest
stage: test
needs: []
before_script:
- $SUDO_CMD rm /etc/apt/sources.list.d/rocm.list
- $SUDO_CMD apt update -qq
- $SUDO_CMD apt install -y -qq texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended latexmk python-pip python3-sphinx doxygen
- $SUDO_CMD -H pip install sphinx_rtd_theme breathe==4.12.0 exhale
script:
- $SUDO_CMD bash -x ./docs/run_doc.sh