-
Notifications
You must be signed in to change notification settings - Fork 407
Expand file tree
/
Copy pathgitlab-ci.yml
More file actions
188 lines (178 loc) · 6.43 KB
/
Copy pathgitlab-ci.yml
File metadata and controls
188 lines (178 loc) · 6.43 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
# The microbenchmarks CI image is built in-repo from container/ via the shared
# benchmarking-platform template (manual `build-benchmark-ci-images` job).
# @see https://github.com/DataDog/benchmarking-platform-tools/blob/main/images/templates/gitlab/build-ci-images.template.yml
include:
- project: 'DataDog/benchmarking-platform-tools'
file: 'images/templates/gitlab/build-ci-images.template.yml'
variables:
# Consumed by the benchmark jobs below. Repin after a `build-benchmark-ci-images`
# run to the tag it pushes; the @sha256 digest is what image-integrity verifies, so
# the pull can't be shifted by a tag rewrite.
# Built here: https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-js/-/jobs/1755904623
MICROBENCHMARKS_CI_IMAGE: registry.ddbuild.io/ci/benchmarking-platform:dd-trace-js-117825597@sha256:23a63e17211bb712a07494ccbbed86edb8f4a3c1c301310c217938dbe1b7284d
# Image build, consumed by the included build-ci-images template. The per-pipeline
# suffix pins each build to a unique tag so a rebuild can't shift what older
# pipelines pulled.
BASE_CI_IMAGE_SUFFIX: dd-trace-js-${CI_PIPELINE_ID}
BASE_CI_IMAGE_CONTAINER_DIR: .gitlab/benchmarks/container
# sirun and CPython are x86_64 only; the template defaults to multi-arch, which
# would build an arm64 leg with amd64 binaries (exec format error). Pin amd64.
BASE_CI_IMAGE_PLATFORM: linux/amd64
SLS_CI_IMAGE: registry.ddbuild.io/ci/serverless-tools:1
SLS_CI_BRANCH: main
# Benchmark's env variables. Modify to tweak benchmark parameters.
UNCONFIDENCE_THRESHOLD: "2.0"
MD_REPORT_ONLY_CHANGES: "1"
.benchmarks:
stage: benchmarks
needs: [ ]
tags: ["runner:apm-k8s-m7i-metal"]
image: $MICROBENCHMARKS_CI_IMAGE
variables:
KUBERNETES_POD_ANNOTATIONS_1: "beta.fabric.datadoghq.com/no-proxy-additions=registry.yarnpkg.com"
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^graphite-base\/.*$/'
when: never
- if: $CI_COMMIT_BRANCH == 'master'
interruptible: false
- interruptible: true
timeout: 30m # TODO: Reduce this once GitLab CI runner availability improves
script:
- cd .gitlab/benchmarks && bp-runner bp-runner.yml --debug
artifacts:
name: "artifacts"
when: always
paths:
- .gitlab/benchmarks/artifacts/
expire_in: 3 months
retry:
max: 2
when:
- unknown_failure
- data_integrity_failure
- runner_system_failure
- scheduler_failure
- api_failure
benchmarks-pr-comment:
stage: benchmarks-pr-comment
needs: [ benchmark, benchmark-serverless ]
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^graphite-base\/.*$/'
when: never
- when: on_success
tags: ["arch:amd64"]
image: $MICROBENCHMARKS_CI_IMAGE
script:
- cd .gitlab/benchmarks && bp-runner bp-runner.pr-comment.yml --debug
allow_failure: true
check-big-regressions:
stage: benchmarks-pr-comment
needs: [ benchmark, benchmark-serverless ]
rules:
- if: '$CI_COMMIT_REF_NAME =~ /^graphite-base\/.*$/'
when: never
- if: $CI_COMMIT_BRANCH == 'master'
interruptible: false
- interruptible: true
tags: ["arch:amd64"]
image: $MICROBENCHMARKS_CI_IMAGE
script:
- cd .gitlab/benchmarks && bp-runner bp-runner.fail-on-regression.yml --debug
benchmark:
extends: .benchmarks
# The number of GROUP rows per MAJOR_VERSION must equal SPLITS. If you change
# one, change the other — otherwise variants get silently skipped.
parallel:
matrix:
- MAJOR_VERSION: 20
GROUP: 1
- MAJOR_VERSION: 20
GROUP: 2
- MAJOR_VERSION: 20
GROUP: 3
- MAJOR_VERSION: 20
GROUP: 4
- MAJOR_VERSION: 20
GROUP: 5
- MAJOR_VERSION: 20
GROUP: 6
- MAJOR_VERSION: 24
GROUP: 1
- MAJOR_VERSION: 24
GROUP: 2
- MAJOR_VERSION: 24
GROUP: 3
- MAJOR_VERSION: 24
GROUP: 4
- MAJOR_VERSION: 24
GROUP: 5
- MAJOR_VERSION: 24
GROUP: 6
- MAJOR_VERSION: 26
GROUP: 1
- MAJOR_VERSION: 26
GROUP: 2
- MAJOR_VERSION: 26
GROUP: 3
- MAJOR_VERSION: 26
GROUP: 4
- MAJOR_VERSION: 26
GROUP: 5
- MAJOR_VERSION: 26
GROUP: 6
variables:
SPLITS: 6
benchmark-serverless:
stage: benchmarks
image: $SLS_CI_IMAGE
tags: ["arch:amd64"]
when: on_success
rules:
- if: $CI_COMMIT_BRANCH == 'master'
interruptible: false
- interruptible: true
needs:
- benchmark-serverless-trigger
script:
- curl -OL "https://binaries.ddbuild.io/dd-source/authanywhere/LATEST/authanywhere-linux-amd64"
- mv "authanywhere-linux-amd64" /bin/authanywhere
- chmod +x /bin/authanywhere
- BTI_CI_API_TOKEN=$(authanywhere --audience rapid-devex-ci)
- >-
BTI_RESPONSE=$(curl --silent --request GET \
--header "$BTI_CI_API_TOKEN" \ --header "Content-Type: application/vnd.api+json" \
"https://bti-ci-api.us1.ddbuild.io/internal/ci/gitlab/token?owner=DataDog&repository=serverless-tools")
- GITLAB_TOKEN=$(echo "$BTI_RESPONSE" | jq -r '.token // empty')
- git clone https://serverless-tools:${GITLAB_TOKEN}@gitlab.ddbuild.io/DataDog/serverless-tools.git ./serverless-tools && cd ./serverless-tools
- ./ci/check_trigger_status.sh
benchmark-serverless-trigger:
stage: benchmarks
needs: []
rules:
- if: $CI_COMMIT_BRANCH == 'master'
interruptible: false
- interruptible: true
trigger:
project: DataDog/serverless-tools
branch: $SLS_CI_BRANCH
strategy: depend
allow_failure: true
variables:
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
UPSTREAM_PROJECT_URL: $CI_PROJECT_URL
UPSTREAM_COMMIT_BRANCH: $CI_COMMIT_BRANCH
UPSTREAM_COMMIT_AUTHOR: $CI_COMMIT_AUTHOR
UPSTREAM_COMMIT_TITLE: $CI_COMMIT_TITLE
UPSTREAM_COMMIT_TAG: $CI_COMMIT_TAG
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_GITLAB_USER_LOGIN: $GITLAB_USER_LOGIN
UPSTREAM_GITLAB_USER_EMAIL: $GITLAB_USER_EMAIL
# only available on Merge Requests
UPSTREAM_MERGE_TARGET_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
# The downstream serverless-tools hard cap can lag current main layer sizes;
# keep PRs gated by size increase while allowing the largest measured current-main layer.
MAX_LAYER_UNCOMPRESSED_SIZE_KB: "25280"
KUBERNETES_POD_ANNOTATIONS_1: "beta.fabric.datadoghq.com/no-proxy-additions=registry.yarnpkg.com,registry.npmjs.org"
YARN_REGISTRY: "https://registry.npmjs.org"
YARN_NETWORK_TIMEOUT: "600000"
DD_TAGS: "SLS_CI_BRANCH:$SLS_CI_BRANCH"