Skip to content

Commit 4485a51

Browse files
authored
ci: sets benchmarking jobs as interruptible outside master (#3489)
* set microbenchmarks as interruptible outside master * set macrobenchmarks as interruptible outside master/releases * use yaml anchors for default benchmarks rules * move benchmarks-tracer-rules upwards * rename benchamrks-rules to benchmarks-profiler-rulesd * move macrobenchmarks_rules upwards * rename macrobenchmarks_rules to macrobenchmarks-rules and remove vestige interruptible key * merge existing benchmarks-profiler rules with those in benchmarks-profiler-rules * use benchmarks-profiler-rules yaml anchor * set up benchmarks-tracer-rules * use benchmarks-tracer-rules yaml anchor * use benchmarks-tracer-rules for check-big-regressions * set up and use benchmarks-appsec-rules and use its yaml anchor * test interruptibility * set workflow:auto_cancel:on_new_commit to interruptible * test interruptibility * set workflow autocancellation rules on benchmarks.yml instead * test interruptibility
1 parent 86c8b84 commit 4485a51

1 file changed

Lines changed: 78 additions & 38 deletions

File tree

.gitlab/benchmarks.yml

Lines changed: 78 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,84 @@ variables:
1212
# The Dockerfile to this image is located at:
1313
# https://github.com/DataDog/benchmarking-platform/tree/php/laravel-realworld
1414

15+
workflow:
16+
auto_cancel:
17+
on_new_commit: interruptible
18+
19+
.benchmarks-profiler-rules: &benchmarks-profiler-rules
20+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME == "master"
21+
changes:
22+
paths:
23+
- profiling/**/*
24+
compare_to: "master"
25+
when: on_success
26+
interruptible: false
27+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME != "master"
28+
changes:
29+
paths:
30+
- profiling/**/*
31+
compare_to: "master"
32+
when: on_success
33+
interruptible: true
34+
- if: $CI_COMMIT_REF_NAME == "master"
35+
when: manual
36+
interruptible: false
37+
- when: manual
38+
interruptible: true
39+
40+
.benchmarks-appsec-rules: &benchmarks-appsec-rules
41+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME == "master"
42+
changes:
43+
paths:
44+
- appsec/src/**/*
45+
compare_to: "master"
46+
when: on_success
47+
interruptible: false
48+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME != "master"
49+
changes:
50+
paths:
51+
- appsec/src/**/*
52+
compare_to: "master"
53+
when: on_success
54+
interruptible: true
55+
- if: $CI_COMMIT_REF_NAME == "master"
56+
when: manual
57+
interruptible: false
58+
- when: manual
59+
interruptible: true
60+
61+
.benchmarks-tracer-rules: &benchmarks-tracer-rules
62+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME == "master"
63+
when: on_success
64+
interruptible: false
65+
- if: $CI_PIPELINE_SOURCE != "schedule" && $CI_COMMIT_REF_NAME != "master"
66+
when: on_success
67+
interruptible: true
68+
- if: $CI_COMMIT_REF_NAME == "master"
69+
when: manual
70+
interruptible: false
71+
- when: manual
72+
interruptible: true
73+
74+
.macrobenchmarks-rules: &macrobenchmarks-rules
75+
- if: $CI_COMMIT_REF_NAME == "master" && $NIGHTLY_BENCHMARKS
76+
when: always
77+
interruptible: false
78+
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE != "schedule"
79+
when: always
80+
interruptible: false
81+
- if: $CI_COMMIT_REF_NAME =~ /^ddtrace-/
82+
when: always
83+
interruptible: false
84+
- when: manual
85+
interruptible: true
86+
1587
.microbenchmarks:
1688
stage: benchmarks
1789
tags: ["runner:apm-k8s-tweaked-metal"]
1890
needs: []
1991
image:
2092
name: $BASE_CI_IMAGE
21-
interruptible: true
2293
timeout: 90m
2394
script:
2495
- export ARTIFACTS_DIR="$(pwd)/reports" && (mkdir "${ARTIFACTS_DIR}" || :)
@@ -53,27 +124,13 @@ variables:
53124

54125
benchmarks-profiler:
55126
extends: .microbenchmarks
56-
rules:
57-
- if: $CI_PIPELINE_SOURCE != "schedule"
58-
changes:
59-
paths:
60-
- profiling/**/*
61-
compare_to: "master"
62-
when: on_success
63-
- when: manual
127+
rules: *benchmarks-profiler-rules
64128
variables:
65129
SCENARIO: "profiler"
66130

67-
.benchmarks-tracer-rules:
68-
rules:
69-
- if: $CI_PIPELINE_SOURCE != "schedule"
70-
when: on_success
71-
- when: manual
72-
73131
benchmarks-tracer:
74-
extends:
75-
- .microbenchmarks
76-
- .benchmarks-tracer-rules
132+
extends: .microbenchmarks
133+
rules: *benchmarks-tracer-rules
77134
artifacts:
78135
name: "reports"
79136
when: always
@@ -86,14 +143,7 @@ benchmarks-tracer:
86143

87144
benchmarks-appsec:
88145
extends: .microbenchmarks
89-
rules:
90-
- if: $CI_PIPELINE_SOURCE != "schedule"
91-
changes:
92-
paths:
93-
- appsec/src/**/*
94-
compare_to: "master"
95-
when: on_success
96-
- when: manual
146+
rules: *benchmarks-appsec-rules
97147
artifacts:
98148
name: "logs"
99149
paths:
@@ -104,9 +154,9 @@ benchmarks-appsec:
104154
SCENARIO: "appsec"
105155

106156
check-big-regressions:
157+
rules: *benchmarks-tracer-rules
107158
stage: gate
108159
needs: [ "benchmarks-tracer" ]
109-
extends: .benchmarks-tracer-rules
110160
tags: [ "arch:amd64" ]
111161
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:latest
112162
script: |
@@ -130,25 +180,15 @@ check-big-regressions:
130180
# Gitlab and BP specific env vars. Do not modify.
131181
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: dd-trace-php
132182

133-
.macrobenchmarks_rules: &macrobenchmarks_rules
134-
- if: $CI_COMMIT_REF_NAME == "master" && $NIGHTLY_BENCHMARKS
135-
when: always
136-
- if: $CI_COMMIT_REF_NAME == "master" && $CI_PIPELINE_SOURCE != "schedule"
137-
when: always
138-
- if: $CI_COMMIT_REF_NAME =~ /^ddtrace-/
139-
when: always
140-
- when: manual
141-
142183
.macrobenchmarks:
143184
stage: benchmarks
144-
rules: *macrobenchmarks_rules
185+
rules: *macrobenchmarks-rules
145186
tags: ["runner:apm-k8s-same-cpu"]
146187
needs:
147188
- job: "package extension: [amd64, x86_64-unknown-linux-gnu]"
148189
artifacts: true
149190
- job: datadog-setup.php
150191
artifacts: true
151-
interruptible: true
152192
timeout: 1h
153193
image: $MACROBENCHMARKS_CI_IMAGE
154194
script:

0 commit comments

Comments
 (0)