forked from DataDog/dd-trace-py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
212 lines (193 loc) · 5.62 KB
/
.gitlab-ci.yml
File metadata and controls
212 lines (193 loc) · 5.62 KB
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
stages:
- package
- tests
- shared-pipeline
- benchmarks
- release
variables:
REPO_LANG: python # "python" is used everywhere rather than "py"
REPO_NOTIFICATION_CHANNEL: "#apm-python-release"
RELEASE_ALLOW_TEST_FAILURES: false
RELEASE_ALLOW_BENCHMARK_FAILURES: false
# VPA Template configuration
DD_VPA_TEMPLATE: "vpa-template-cpu-p70-10percent-2x-oom-min-cap"
# CI_DEBUG_SERVICES: "true"
# Automatically managed, use scripts/update-system-tests-version to update
SYSTEM_TESTS_REF: "94529f681dcaf74382ed47c3b0c85acdb775b6c9"
default:
interruptible: true
# trigger new commit cancel
workflow:
auto_cancel:
on_new_commit: interruptible
rules:
- if: $CI_COMMIT_BRANCH == 'main'
auto_cancel:
on_new_commit: none
- if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+$/
auto_cancel:
on_new_commit: none
- when: always
include:
- local: ".gitlab/one-pipeline.locked.yml"
- local: ".gitlab/services.yml" # Include early so others can use the definitions
- local: ".gitlab/package.yml"
- local: ".gitlab/release.yml"
- local: ".gitlab/testrunner.yml"
- local: ".gitlab/benchmarks/serverless.yml"
- local: ".gitlab/native.yml"
tests-gen:
stage: tests
extends: .testrunner
id_tokens:
DDOCTOSTS_ID_TOKEN:
aud: dd-octo-sts
script:
- |
if [ -z ${GH_TOKEN} ]
then
# Use dd-octo-sts to get GitHub token
export GH_TOKEN=$(dd-octo-sts token --scope DataDog/dd-trace-py --policy gitlab.github-access.read)
fi
- scripts/gen_gitlab_config.py --verbose
needs: []
artifacts:
paths:
- .gitlab/tests-gen.yml
run-tests-trigger:
stage: tests
needs: [ tests-gen ]
# Allow the child job to fail if explicitly asked
rules:
- if: $RELEASE_ALLOW_TEST_FAILURES == "true"
allow_failure: true
- allow_failure: false
trigger:
include:
- artifact: .gitlab/tests-gen.yml
job: tests-gen
strategy: depend
# Validate the ast-grep rule's test suite in .sg/tests
"ast-grep rules":
extends: .testrunner
stage: tests
needs: []
script:
script:
- |
echo -e "\e[0Ksection_start:`date +%s`:sg_test[collapsed=true]\r\e[0KValidate ast-grep rules"
hatch run lint:sg-test
echo -e "\e[0Ksection_end:`date +%s`:sg_test\r\e[0K"
- |
echo -e "\e[0Ksection_start:`date +%s`:sg_scan[collapsed=true]\r\e[0Kast-grep scan"
hatch run lint:sg
echo -e "\e[0Ksection_end:`date +%s`:sg_scan\r\e[0K"
microbenchmarks:
stage: benchmarks
needs: [ "download_ddtrace_artifacts" ]
rules:
- if: $RELEASE_ALLOW_BENCHMARK_FAILURES == "true"
allow_failure: true
- allow_failure: false
trigger:
include: .gitlab/benchmarks/microbenchmarks.yml
strategy: depend
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
# Disable VPA for benchmarks
DD_DISABLE_VPA: true
macrobenchmarks:
stage: benchmarks
needs: [ "download_ddtrace_artifacts" ]
trigger:
include: .gitlab/benchmarks/macrobenchmarks.yml
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
# Disable VPA for benchmarks
DD_DISABLE_VPA: true
allow_failure: true
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: always
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+/
when: always
- when: manual
check_new_flaky_tests:
stage: tests
needs: ["run-tests-trigger"]
extends: .testrunner
script:
- export DD_SITE=datadoghq.com
- export DD_API_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.${CI_PROJECT_NAME}.dd-api-key-qualitygate --with-decryption --query "Parameter.Value" --out text)
- export DD_APP_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.${CI_PROJECT_NAME}.dd-app-key-qualitygate --with-decryption --query "Parameter.Value" --out text)
- datadog-ci gate evaluate
except:
- main
- '[0-9].[0-9]*'
- 'mq-working-branch**'
requirements_json_test:
rules:
- when: on_success
variables:
REQUIREMENTS_BLOCK_JSON_PATH: ".gitlab/requirements_block.json"
REQUIREMENTS_ALLOW_JSON_PATH: ".gitlab/requirements_allow.json"
package-oci:
needs: [ download_dependency_wheels, download_ddtrace_artifacts ]
promote-oci-to-prod:
stage: release
rules: null
only:
# TODO: Support publishing rc releases
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
needs:
- job: release_pypi_prod
- job: package-oci
artifacts: true
- job: oci-internal-publish
artifacts: true
promote-oci-to-prod-beta:
stage: release
needs:
- job: package-oci
artifacts: true
- job: oci-internal-publish
artifacts: true
promote-oci-to-staging:
stage: release
needs:
- job: package-oci
artifacts: true
- job: oci-internal-publish
artifacts: true
publish-lib-init-pinned-tags:
stage: release
rules: null
only:
# TODO: Support publishing rc releases
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
needs:
- job: release_pypi_prod
- job: create-multiarch-lib-injection-image
- job: generate-lib-init-pinned-tag-values
artifacts: true
configure_system_tests:
variables:
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,simple_onboarding_profiling,simple_onboarding_appsec,docker-ssi,lib-injection"
deploy_to_reliability_env:
needs: []
deploy_to_di_backend:manual:
stage: shared-pipeline
rules:
- when: manual
allow_failure: true
trigger:
project: DataDog/debugger-demos
branch: main
variables:
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_COMMIT_SHORT_SHA: $CI_COMMIT_SHORT_SHA
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
UPSTREAM_TAG: $CI_COMMIT_TAG
UPSTREAM_PACKAGE_JOB: build