-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.gitlab-ci.yml
351 lines (319 loc) · 9.9 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
#################################################################
# #
# Copyright (c) 2019-2023 YottaDB LLC and/or its subsidiaries. #
# All rights reserved. #
# #
# This source code contains the intellectual property #
# of its copyright holder(s), and is made available #
# under a license. If you do not know the terms of #
# the license, please stop and do not read further. #
# #
#################################################################
stages:
- docker-baseline
- build
- docs
- docker-create
- docker-manifest
variables:
MYSQL_ROOT_PASSWORD: ydbrocks
UBUNTU_REL_BASELINE_REPO: registry.gitlab.com/yottadb/dbms/ydbocto:ubuntu-release
UBUNTU_MAS_BASELINE_REPO: registry.gitlab.com/yottadb/dbms/ydbocto:ubuntu-master
ROCKY_REL_BASELINE_REPO: registry.gitlab.com/yottadb/dbms/ydbocto:rocky-release
ROCKY_MAS_BASELINE_REPO: registry.gitlab.com/yottadb/dbms/ydbocto:rocky-master
# Shared build config
.make:
stage: build
artifacts:
paths:
- build/
expire_in: 1 month
when: always
interruptible: true
.docker-baseline-shared:
stage: docker-baseline
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
interruptible: true
services:
- docker:dind
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker image build --pull -f ${FILE} --build-arg imagetag=${TAG} --progress=plain -t ${REPO} .
- docker push ${REPO}
octo-ubuntu-master-base-image:
extends:
- .docker-baseline-shared
variables:
FILE: tools/misc-dockerfiles/Dockerfile-Ubuntu-Tests.baseline
REPO: ${UBUNTU_MAS_BASELINE_REPO}
TAG: latest-master
octo-ubuntu-release-base-image:
extends:
- .docker-baseline-shared
variables:
FILE: tools/misc-dockerfiles/Dockerfile-Ubuntu-Tests.baseline
REPO: ${UBUNTU_REL_BASELINE_REPO}
TAG: latest
octo-rocky-master-base-image:
extends:
- .docker-baseline-shared
variables:
FILE: tools/misc-dockerfiles/Dockerfile-Rocky-Tests.baseline
REPO: ${ROCKY_MAS_BASELINE_REPO}
TAG: latest-master
octo-rocky-release-base-image:
extends:
- .docker-baseline-shared
variables:
FILE: tools/misc-dockerfiles/Dockerfile-Rocky-Tests.baseline
REPO: ${ROCKY_REL_BASELINE_REPO}
TAG: latest
commit-verify:
image: ubuntu:22.04
stage: build
interruptible: true
before_script:
- apt-get update -qq && apt-get install -y -qq git wget gnupg
script:
# Copy commit gpg key verify script to build directory and execute
- wget https://gitlab.com/YottaDB/DB/YDB/-/raw/master/ci/commit_verify.sh
- chmod +x commit_verify.sh
- ./commit_verify.sh tools/ci/needs_copyright.sh https://gitlab.com/YottaDB/DBMS/YDBOcto
# This is against the latest released version of YottaDB
release-ubuntu:
image: ${UBUNTU_REL_BASELINE_REPO}
# Run Release job only if this is a scheduled pipeline
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
services:
- mysql:8.0
extends:
- .make
script:
- ./tools/ci/build.sh "make-ubuntu" "none"
# This is against the latest released version of YottaDB
release-rocky:
image: ${ROCKY_REL_BASELINE_REPO}
# Run Release job only if this is a scheduled pipeline
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
services:
- mysql:8.0
extends:
- .make
script: ./tools/ci/build.sh "make-rocky" "none"
make-ubuntu:
image: ${UBUNTU_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script:
- ./tools/ci/build.sh "make-ubuntu" "none"
only:
- master@YottaDB/DBMS/YDBOcto
make-rocky:
image: ${ROCKY_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script: ./tools/ci/build.sh "make-rocky" "none"
only:
- master@YottaDB/DBMS/YDBOcto
asan-ubuntu:
image: ${UBUNTU_MAS_BASELINE_REPO}
# Override default runner timeout
timeout: 3h
# This ASAN job always runs
extends:
- .make
services:
- mysql:8.0
script:
- ./tools/ci/build.sh "make-ubuntu" "asan"
asan-rocky:
image: ${ROCKY_MAS_BASELINE_REPO}
# Override default runner timeout
timeout: 3h
# Run this ASAN job only if this is a scheduled pipeline or if we are on a ASAN branch
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_BRANCH =~ /asan/'
extends:
- .make
services:
- mysql:8.0
script:
- ./tools/ci/build.sh "make-rocky" "asan"
# This job runs for branches and on master
make-tls-ubuntu:
image: ${UBUNTU_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script:
- ./tools/ci/install-tls.sh
- ./tools/ci/build.sh "make-tls-ubuntu" "none"
make-tls-rocky:
image: ${ROCKY_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script:
- ./tools/ci/install-tls.sh
- ./tools/ci/build.sh "make-tls-rocky" "none"
only:
- master@YottaDB/DBMS/YDBOcto
test-force-upgrade:
# This job tests auto upgrade functionality of binary table/function definitions by forcing an auto upgrade
image: ${UBUNTU_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script:
- ./tools/ci/build.sh "test-auto-upgrade" "force"
test-auto-upgrade:
# This job tests that auto upgrade functionality of binary table/function definitions and plan definitions (physical plans,
# xref plans, triggers etc.) works fine relative to a random older commit
image: ${UBUNTU_MAS_BASELINE_REPO}
services:
- mysql:8.0
extends:
- .make
script:
# We previously used netstat and xxd, and that's why we install net-tools
- apt-get install -y -qq --no-install-recommends net-tools xxd
- ./tools/ci/build.sh "test-auto-upgrade" "binary"
test-vista:
# This job tests that various Octo tests run inside of a VistA instance
image:
name: yottadb/octo-vehu:latest-master
entrypoint: [""] # override the default entry point, which starts VistA and Octo etc.
extends:
- .make
script:
- ./tools/ci/vistatest.sh
rules:
# 1) We want to run the test-vista job only in pre-merge pipelines (not post-merge pipelines).
# Hence the $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH check below.
# 2) Additionally, we want to allow for failures in the pre-merge pipeline in rare cases
# (like was seen in https://gitlab.com/YottaDB/DBMS/YDBOcto/-/merge_requests/1484#note_1643676118)
# Hence the check for the special branch name that starts with "test_vista_fail_expected" in which
# case we skip running this job even in the pre-merge pipeline.
# 3) Additionally, we want to run this job only for push pipelines, not for scheduled or merge_request_event
# pipelines (the act of using "rules:" causes this job to be enabled for "Merge request pipelines" which
# we don't want to run this job) hence the $CI_PIPELINE_SOURCE == "push" check below.
- if: $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH && $CI_COMMIT_BRANCH !~ /^test_vista_fail_expected/ && $CI_PIPELINE_SOURCE == "push"
############################################################
.docker-octo-common:
image: docker:latest
stage: docker-create
before_script:
- ""
services:
- docker:dind
script:
- docker build --pull -t yottadb/${REPO}:${DOCKERHUBTAG} .
# Suppress Docker warning advising against using the --password flag
- echo -n $HUB_PASSWORD | docker login -u $HUB_USERNAME --password-stdin
- docker push yottadb/${REPO}:${DOCKERHUBTAG}
only:
- master@YottaDB/DBMS/YDBOcto
docker-octo-amd64:
extends: .docker-octo-common
variables:
REPO: octo
DOCKERHUBTAG: latest-amd64
tags:
- amd64
docker-octo-aarch64:
extends: .docker-octo-common
variables:
REPO: octo
DOCKERHUBTAG: latest-aarch64
tags:
- aarch64
.docker-vista-common:
image: docker:latest
stage: docker-create
before_script:
- ""
services:
- docker:dind
script:
- apk add git
- ./tools/ci/vistabuild.sh
- docker tag yottadb/octo-vehu:latest-master yottadb/${REPO}:${DOCKERHUBTAG}
- docker rmi yottadb/octo-vehu:latest-master
- echo -n $HUB_PASSWORD | docker login -u $HUB_USERNAME --password-stdin
- docker push yottadb/${REPO}:${DOCKERHUBTAG}
only:
- master@YottaDB/DBMS/YDBOcto
docker-vista-amd64:
extends: .docker-vista-common
variables:
REPO: octo-vehu
DOCKERHUBTAG: latest-master-amd64
tags:
- amd64
docker-vista-aarch64:
extends: .docker-vista-common
variables:
REPO: octo-vehu
DOCKERHUBTAG: latest-master-aarch64
tags:
- aarch64
.docker-manifest-common:
stage: docker-manifest
services:
- docker:dind
script:
- echo -n $HUB_PASSWORD | docker login -u $HUB_USERNAME --password-stdin
- docker pull yottadb/${REPO}:${DOCKERHUBTAG}-amd64
- docker pull yottadb/${REPO}:${DOCKERHUBTAG}-aarch64
- docker manifest create yottadb/${REPO}:${DOCKERHUBTAG} yottadb/${REPO}:${DOCKERHUBTAG}-amd64 yottadb/${REPO}:${DOCKERHUBTAG}-aarch64
- docker manifest inspect yottadb/${REPO}:${DOCKERHUBTAG}
- docker manifest push yottadb/${REPO}:${DOCKERHUBTAG}
tags:
- amd64
only:
- master@YottaDB/DBMS/YDBOcto
docker-manifest-octo:
extends: .docker-manifest-common
variables:
REPO: octo
DOCKERHUBTAG: latest
docker-manifest-vista:
extends: .docker-manifest-common
variables:
REPO: octo-vehu
DOCKERHUBTAG: latest-master
pages:
stage: docs
image: bitnami/minideb
interruptible: true
script:
- apt-get update && apt-get install -y make python3 tcsh wget jq sphinx-common python3-sphinx-rtd-theme
- ./tools/ci/docs.sh
- export DEADLINKS_VERSION=$(wget -q -O - https://api.github.com/repos/deadlinks/cargo-deadlinks/releases/latest | jq --raw-output .tag_name)
- wget https://github.com/deadlinks/cargo-deadlinks/releases/download/$DEADLINKS_VERSION/deadlinks-linux -O deadlinks
- chmod +x ./deadlinks
- ./deadlinks -v public
artifacts:
paths:
- public
expire_in: 1 month
when: always
docs.yottadb.net:
stage: docs
trigger: YottaDB/DB/YDBDoc
only:
refs:
- master@YottaDB/DBMS/YDBOcto
changes:
- doc/**/*