-
Notifications
You must be signed in to change notification settings - Fork 9
/
.gitlab-ci.yml
333 lines (318 loc) · 14.7 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
include:
- remote: https://gitlab-templates.ddbuild.io/libdatadog/include/single-step-instrumentation-tests.yml
stages:
- ruby_tracer
- nodejs_tracer
- java_tracer
- python_tracer
- dotnet_tracer
- php_tracer
- stats_results
- parse_results
- before_tests
.base_job_onboarding_system_tests:
extends: .base_job_onboarding
after_script:
- SCENARIO_SUFIX=$(echo "$SCENARIO" | tr '[:upper:]' '[:lower:]')
- REPORTS_PATH="reports/"
- mkdir -p "$REPORTS_PATH"
- cp -R logs_"${SCENARIO_SUFIX}" $REPORTS_PATH/
- cp logs_"${SCENARIO_SUFIX}"/feature_parity.json "$REPORTS_PATH"/"${SCENARIO_SUFIX}".json
- mv "$REPORTS_PATH"/logs_"${SCENARIO_SUFIX}" "$REPORTS_PATH"/logs_"${TEST_LIBRARY}"_"${ONBOARDING_FILTER_WEBLOG}"_"${SCENARIO_SUFIX}_${DEFAULT_VMS}"
artifacts:
when: always
paths:
- reports/
variables:
# Do not modify this - must be the repository name for Kubernetes gitlab runners to run
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: system-tests #helm-charts
TEST: 1
KUBERNETES_CPU_REQUEST: "6"
KUBERNETES_CPU_LIMIT: "6"
AMI_UPDATE:
description: "Set to true to force the update the AMIs used in the system-tests"
ONBOARDING_FILTER_ENV: "prod"
ONLY_TEST_LIBRARY: ""
DD_INSTALLER_LIBRARY_VERSION:
description: "Set the version of the library to be installed. Use the pipeline id pipeline-${CI_PIPELINE_ID}"
DD_INSTALLER_INJECTOR_VERSION:
description: "Set the version of the injector to be installed. Use the pipeline id pipeline-${CI_PIPELINE_ID}"
onboarding_nodejs:
extends: .base_job_onboarding_system_tests
stage: nodejs_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "nodejs")
when: always
- when: manual
variables:
TEST_LIBRARY: "nodejs"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs-multicontainer]
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs,test-app-nodejs-container]
SCENARIO: [INSTALLER_AUTO_INJECTION,SIMPLE_AUTO_INJECTION_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs-16]
SCENARIO: [INSTALLER_NOT_SUPPORTED_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-nodejs-multicontainer]
SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_java:
extends: .base_job_onboarding_system_tests
stage: java_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "java")
when: always
- when: manual
variables:
TEST_LIBRARY: "java"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-java]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-java-multicontainer,test-app-java-multialpine]
SCENARIO: [CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-java,test-app-java-container,test-app-java-alpine,test-app-java-buildpack]
SCENARIO: [INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-java,test-app-java-multicontainer,test-app-java-multialpine]
SCENARIO: [SIMPLE_AUTO_INJECTION_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-java]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-java-multicontainer,test-app-java-multialpine]
SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_python:
extends: .base_job_onboarding_system_tests
stage: python_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "python")
when: always
- when: manual
variables:
TEST_LIBRARY: "python"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-python]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-python-container,test-app-python-alpine]
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [
test-app-python,
test-app-python-container,
test-app-python-alpine
]
SCENARIO: [INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-python]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-python-multicontainer,test-app-python-multialpine]
SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_dotnet:
extends: .base_job_onboarding_system_tests
stage: dotnet_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "dotnet")
when: always
- when: manual
variables:
TEST_LIBRARY: "dotnet"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-dotnet]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-dotnet-container]
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-dotnet,test-app-dotnet-container]
SCENARIO: [INSTALLER_AUTO_INJECTION, SIMPLE_AUTO_INJECTION_PROFILING]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-dotnet]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-dotnet-multicontainer,test-app-dotnet-multialpine]
SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_ruby:
extends: .base_job_onboarding_system_tests
stage: ruby_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "ruby")
when: always
- when: manual
variables:
TEST_LIBRARY: "ruby"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby-container]
SCENARIO: [ CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby,test-app-ruby-container]
SCENARIO: [INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-ruby]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
#- ONBOARDING_FILTER_WEBLOG: [test-app-ruby-multicontainer,test-app-ruby-multialpine]
# SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
# DEFAULT_VMS: ["True","False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_php:
extends: .base_job_onboarding_system_tests
stage: php_tracer
allow_failure: true
dependencies: []
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && ($ONLY_TEST_LIBRARY == "" || $ONLY_TEST_LIBRARY == "php")
when: always
- when: manual
variables:
TEST_LIBRARY: "php"
parallel:
matrix:
- ONBOARDING_FILTER_WEBLOG: [test-app-php]
SCENARIO: [HOST_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-php-container-83,test-app-php-alpine]
SCENARIO: [CONTAINER_AUTO_INJECTION_INSTALL_SCRIPT]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-php, test-app-php-container-83, test-app-php-alpine]
SCENARIO: [INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-php]
SCENARIO: [CHAOS_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-php-container-56]
SCENARIO: [INSTALLER_NOT_SUPPORTED_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
- ONBOARDING_FILTER_WEBLOG: [test-app-php-multicontainer, test-app-php-multialpine]
SCENARIO: [SIMPLE_INSTALLER_AUTO_INJECTION]
DEFAULT_VMS: ["True","False"]
script:
- ./build.sh -i runner
- timeout 2700s ./run.sh $SCENARIO --vm-weblog ${ONBOARDING_FILTER_WEBLOG} --vm-env ${ONBOARDING_FILTER_ENV} --vm-library ${TEST_LIBRARY} --vm-provider aws --report-run-url ${CI_PIPELINE_URL} --report-environment ${ONBOARDING_FILTER_ENV} --vm-default-vms ${DEFAULT_VMS}
onboarding_stats_results:
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner:a58cc31c
tags: ["arch:amd64"]
stage: stats_results
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
script:
- |
echo "---------------------"
echo "Caches/AMIs created"
echo "---------------------"
for folder in reports/logs*/ ; do
for filename in ./cache_created.log; do
if [ -e ${filename} ]
then
cat ${filename}
fi
done
done
echo "---------------------"
echo "Number of ec2 created"
echo "---------------------"
wc -l reports/logs*/vms_desc.log
onboarding_parse_results:
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner:a58cc31c
tags: ["arch:amd64"]
stage: parse_results
rules:
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == "main"
before_script:
#We need authenticate on git repository
- export FP_IMPORT_URL=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.fp-import-url --with-decryption --query "Parameter.Value" --out text)
- export FP_API_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.fp-api-key --with-decryption --query "Parameter.Value" --out text)
script:
- |
for folder in reports/logs*/ ; do
echo "Checking folder: ${folder}"
for filename in ./${folder}*_feature_parity.json; do
if [ -e ${filename} ]
then
echo "Processing report: ${filename}"
curl -X POST ${FP_IMPORT_URL} \
--fail \
--header "Content-Type: application/json" \
--header "FP_API_KEY: ${FP_API_KEY}" \
--data "@${filename}" \
--include
fi
done
done
check_merge_labels:
#Build docker images if it's needed. Check if the PR has the labels associated with the image build.
image: registry.ddbuild.io/images/ci_docker_base
tags: ["runner:docker"]
stage: before_tests
allow_failure: true
before_script:
- export GH_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gh-token --with-decryption --query "Parameter.Value" --out text)
- export DOCKER_LOGIN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login-write --with-decryption --query "Parameter.Value" --out text)
- export DOCKER_LOGIN_PASS=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login-pass-write --with-decryption --query "Parameter.Value" --out text)
script:
- echo $GH_TOKEN | docker login ghcr.io -u publisher --password-stdin
- ./utils/scripts/get_pr_merged_labels.sh
rules:
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
generate_system_tests_images:
image: registry.ddbuild.io/images/ci_docker_base
tags: ["runner:docker"]
stage: before_tests
allow_failure: true
before_script:
- export GH_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gh-token --with-decryption --query "Parameter.Value" --out text)
- export DOCKER_LOGIN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login-write --with-decryption --query "Parameter.Value" --out text)
- export DOCKER_LOGIN_PASS=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login-pass-write --with-decryption --query "Parameter.Value" --out text)
script:
- echo $GH_TOKEN | docker login ghcr.io -u publisher --password-stdin
- ./utils/build/build_tracer_buddies.sh --push
- ./utils/build/build_python_base_images.sh --push
- ./lib-injection/build/build_lib_injection_images.sh
when: manual