This repository has been archived by the owner on Jun 12, 2022. It is now read-only.
forked from travelping/upg-vpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
241 lines (217 loc) · 6.25 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
stages:
- prepare
- build
- test
variables:
REGISTRY: "quay.io"
IMAGE_NAME: travelping/upg-vpp
# this points to buildkitd k8s service
BUILDKITD_ADDR: tcp://buildkitd:1234
# This is needed to disable TLS in recent docker:...dind images.
# TLS there is not really needed as docker client connects
# to localhost, and all of the docker certs only cause problems
# here
DOCKER_TLS_CERTDIR: ""
# Make 'git am' work
GIT_AUTHOR_NAME: Dummy
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: Dummy
GIT_COMMITTER_EMAIL: [email protected]
# prepare build image
prepare:
stage: prepare
# image: moby/buildkit:v0.7.1@sha256:530396a0ef93eacc025dadeb6a8a69d8c87ca402f48df9bc7c8c767b46fe9cf3
image: docker:git
services:
- docker:19.03.8-dind
script:
- export DOCKER_HOST="tcp://localhost:2375"
- echo "quay.io login..."
- docker login -u ${QUAY_USER_ID} -p ${QUAY_TOKEN} ${REGISTRY}
- echo "Ensuring that proper build image exists ..."
# we don't use 'make' here b/c dind image doesn't have it
# and it's not strictly required
- sh hack/update-vpp.sh
- PUSH_BUILD_IMAGE=1 sh hack/ensure-build-image.sh
# FIXME: push from buildkit to quay.io fails with '401 UNAUTHORIZED'
# for some reason, and it only happens with build images
# - echo "registry login..."
# # 'docker' command not available in the buildkit image
# - >
# REGISTRY_LOGIN=${QUAY_USER_ID}
# REGISTRY_PASSWORD=${QUAY_TOKEN}
# hack/registry-login.sh "${REGISTRY}"
# - echo "Ensuring that proper build image exists ..."
# - USE_BUILDCTL=1 PUSH_BUILD_IMAGE=1 sh hack/ensure-build-image.sh
only:
changes:
- .gitlab-ci.yml
- Makefile
- Dockerfile.build
- build/external/**/*
# build container image
.build:
stage: build
image: quay.io/travelping/upg-build:90cf570f931007523db7085e7d867659 # XX_DO_NOT_REMOVE_THIS_COMMENT
script:
- |
export REGISTRY_LOGIN=${QUAY_USER_ID}
export REGISTRY_PASSWORD=${QUAY_TOKEN}
make ci-build
- mv /tmp/_out "${CI_BUILD_NAME##*:}"
dependencies:
- prepare
# build container image
build:release:
extends: .build
variables:
DOCKERFILE: Dockerfile
artifacts:
when: always
untracked: true
paths:
- release/debs
- release/testfiles.tar.gz
build:debug:
extends: .build
variables:
DOCKERFILE: Dockerfile.devel
artifacts:
when: always
untracked: true
paths:
- debug/debs
- debug/testfiles.tar.gz
.test:
stage: test
# the following is updated automatically by make update-build-image-tag
image: quay.io/travelping/upg-build:90cf570f931007523db7085e7d867659 # XX_DO_NOT_REMOVE_THIS_COMMENT
script:
- make update-vpp
- tar -C vpp -xvzf ${TEST_ARCHIVE}
# temporary workaround for the hugepages issue
- sysctl vm.nr_hugepages=0
- mkdir test-out
- export LC_ALL=C.UTF-8
- export LANG=C.UTF-8
- |
if ! make -C vpp -j8 ${TEST_TARGET} TEST=test_upf V=1; then
tar -C /tmp -cvzf test-out/vpp-test.tar.gz . || true
ls -l test-out/
exit 1
fi
artifacts:
when: on_failure
paths:
- test-out
test:patch-style:
stage: test
# the following is updated automatically by make update-build-image-tag
image: quay.io/travelping/upg-build:90cf570f931007523db7085e7d867659 # XX_DO_NOT_REMOVE_THIS_COMMENT
script:
- hack/checkstyle.sh
test:debug:
extends: .test
variables:
TEST_ARCHIVE: debug/testfiles.tar.gz
TEST_TARGET: retest-debug
dependencies:
- build:debug
test:release:
extends: .test
variables:
TEST_ARCHIVE: release/testfiles.tar.gz
TEST_TARGET: retest
dependencies:
- build:release
.test-ext:
stage: test
image: quay.io/travelping/upf-test:12b024a
services:
- docker:19.03.8-dind
script:
# https://github.com/docker/compose/issues/5696#issuecomment-377906769
- export COMPOSE_INTERACTIVE_NO_CLI=1
- IMAGE_VARIANT=debug
- IMAGE_BASE_NAME=${REGISTRY}/${IMAGE_NAME}
- |
. hack/version.sh
IMAGE_BASE_TAG=${UPG_IMAGE_TAG}
- IMAGE_FULL_NAME=${IMAGE_BASE_NAME}:${IMAGE_BASE_TAG}_${IMAGE_VARIANT}
- cd /test
# temporary workaround for the hugepages issue
- sysctl vm.nr_hugepages=0
- |
if bash -x scripts/test.sh "${IMAGE_FULL_NAME}" ${TEST_PROFILES}; then
r=0
else
r=1
fi
mv /test/pcaps "/builds/${CI_PROJECT_PATH}/pcaps"
ls -l "/builds/${CI_PROJECT_PATH}/pcaps"
exit ${r}
dependencies:
- build:debug
artifacts:
when: always
paths:
- pcaps
test:external-ipv4-ping:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy ping gdb-batch
test:external-ipv4-udp:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy udp gdb-batch
test:external-ipv4-curl:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy curl gdb-batch
# FIXME: traffic volume mismatch
# test:external-ipv4-app:
# extends: .test-ext
# variables:
# TEST_PROFILES: type-tdf dispatch-trace proxy app-detection gdb-batch
test:external-ipv4-udp-pgw:
extends: .test-ext
variables:
TEST_PROFILES: type-pgw dispatch-trace proxy udp gdb-batch
test:external-ipv4-curl-pgw:
extends: .test-ext
variables:
TEST_PROFILES: type-pgw dispatch-trace proxy curl gdb-batch
# FIXME: traffic volume mismatch
# test:external-ipv4-app-pgw:
# extends: .test-ext
# variables:
# TEST_PROFILES: type-pgw dispatch-trace proxy app-detection gdb-batch
# TODO: match app
test:external-ipv4-curl-noproxy:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace curl gdb-batch
test:external-ipv6-udp:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy udp gdb-batch ipv6
test:external-proxy-crash:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy wrk gdb-batch
test:external-proxy-crash-pgw:
extends: .test-ext
variables:
TEST_PROFILES: type-pgw dispatch-trace proxy wrk gdb-batch
test:external-proxy-crash-netem:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy wrk netem gdb-batch
test:external-proxy-crash-netem-40k:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy wrk40k netem gdb-batch
test:session-deletion:
extends: .test-ext
variables:
TEST_PROFILES: type-tdf dispatch-trace proxy repeat-session wrk gdb-batch