Skip to content

Commit 6285744

Browse files
committed
wip
1 parent 1aadb4b commit 6285744

2 files changed

Lines changed: 80 additions & 16 deletions

File tree

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ macrobenchmarks:
66
needs: []
77
trigger:
88
include: ".gitlab/benchmarks.yml"
9-
rules:
10-
- if: $NIGHTLY_BENCHMARKS || $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^release\/v/
11-
when: always
12-
- when: manual
9+
# rules:
10+
# - if: $NIGHTLY_BENCHMARKS || $CI_COMMIT_REF_NAME == "master" || $CI_COMMIT_REF_NAME =~ /^release\/v/
11+
# when: always
12+
# - when: manual

.gitlab/benchmarks.yml

Lines changed: 76 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ include:
99
file: 'images/templates/gitlab/notify-slo-breaches.template.yml'
1010

1111
variables:
12-
MACROBENCHMARKS_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:cpp-nginx
12+
MACROBENCHMARKS_CI_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:glopes-cpp-nginx
1313
BUILD_IMAGE: 486234852809.dkr.ecr.us-east-1.amazonaws.com/images/mirror/b1o7r7e0/nginx_musl_toolchain
14-
NGINX_VERSION: 1.26.0
14+
NGINX_VERSION: 1.28.0
1515

1616
build-nginx-module:
1717
stage: build
1818
tags: ["arch:amd64"]
1919
timeout: 20min
2020
image: $BUILD_IMAGE
2121
variables:
22-
WAF: OFF
22+
WAF: ON
2323
COVERAGE: OFF
2424
RUM: OFF
25-
BUILD_TYPE: Release
25+
BUILD_TYPE: RelWithDebInfo
2626
ARCH: x86_64
2727
script:
2828
- git submodule sync && git submodule update --init --recursive
2929
- export NGINX_SRC_DIR="$PWD/nginx"
30-
- make build-musl-aux
30+
- MAKE_JOB_COUNT=8 make build-musl-aux
3131
artifacts:
3232
name: "artifacts"
3333
when: always
@@ -44,14 +44,18 @@ build-nginx-module:
4444
image: $MACROBENCHMARKS_CI_IMAGE
4545
script:
4646
- cp .musl-build/ngx_http_datadog_module.so /usr/lib/nginx/modules/ngx_http_datadog_module.so
47-
- git clone --branch cpp/nginx https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
47+
- git clone --branch glopes/cpp/nginx https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
4848
- bp-runner bp-runner.yml --debug
49+
- mkdir -p artifacts
50+
- cp -v platform/artifacts/*.converted.json artifacts/
51+
- cp -v platform/artifacts/*.so artifacts/
52+
- cp -v platform/artifacts/lscpu.txt artifacts/
4953
artifacts:
50-
name: "artifacts"
54+
name: artifacts
5155
when: always
5256
paths:
53-
- platform/artifacts/
54-
expire_in: 3 months
57+
- artifacts
58+
expire_in: 1 month
5559
variables:
5660
# Benchmark's env variables. Modify to tweak benchmark parameters.
5761
DD_TRACE_DEBUG: "false"
@@ -71,20 +75,80 @@ build-nginx-module:
7175
K6_OPTIONS_HIGH_LOAD_PRE_ALLOCATED_VUS: 4
7276
K6_OPTIONS_HIGH_LOAD_MAX_VUS: 4
7377

78+
K6_OPTIONS_POST_NORMAL_OPERATION_PRE_ALLOCATED_VUS: 1500
79+
K6_OPTIONS_POST_NORMAL_OPERATION_MAX_VUS: 2000
80+
K6_OPTIONS_POST_HIGH_LOAD_PRE_ALLOCATED_VUS: 7500
81+
K6_OPTIONS_POST_HIGH_LOAD_MAX_VUS: 10000
82+
7483
# Workaround: Currently we're not running the benchmarks on every PR, but GitHub still shows them as pending.
7584
# By marking the benchmarks as allow_failure, the Github checks are not displayed.
7685
allow_failure: true
7786

78-
baseline:
87+
.candidate-benchmarks:
7988
extends: .benchmarks
8089
variables:
81-
DD_BENCHMARKS_CONFIGURATION: baseline
90+
ARTIFACT_ROLE: candidate
91+
TEST_ARTIFACT: $CI_PROJECT_DIR/.musl-build/ngx_http_datadog_module.so
8292

83-
only-tracing:
93+
.baseline-benchmarks:
8494
extends: .benchmarks
95+
before_script:
96+
- |
97+
echo "Installing vault"
98+
cd /tmp
99+
curl -o vault.zip https://releases.hashicorp.com/vault/1.20.0/vault_1.20.0_linux_amd64.zip
100+
unzip vault.zip
101+
cd -
102+
- CIRCLECI_TOKEN=$(/tmp/vault kv get --format=json kv/k8s/gitlab-runner/nginx-datadog/circleci | jq -r .data.data.token)
103+
# this is a token only giving read access to public data
104+
- GITHUB_TOKEN=$(/tmp/vault kv get --format=json kv/k8s/gitlab-runner/nginx-datadog/github_pub | jq -r .data.data.token)
105+
variables:
106+
ARTIFACT_ROLE: baseline
107+
rules:
108+
- if: '$CI_COMMIT_BRANCH != "master"'
109+
110+
# Candidate benchmarks
111+
candidate-baselineconf:
112+
extends: .candidate-benchmarks
113+
variables:
114+
DD_BENCHMARKS_CONFIGURATION: baseline
115+
rules:
116+
- if: '$CI_COMMIT_BRANCH == "master"'
117+
118+
candidate-only-tracing:
119+
extends: .candidate-benchmarks
120+
variables:
121+
DD_BENCHMARKS_CONFIGURATION: only-tracing
122+
123+
candidate-appsec:
124+
extends: .candidate-benchmarks
125+
variables:
126+
DD_BENCHMARKS_CONFIGURATION: appsec
127+
128+
# Baseline benchmarks (only non-master)
129+
baseline-only-tracing:
130+
extends: .baseline-benchmarks
85131
variables:
86132
DD_BENCHMARKS_CONFIGURATION: only-tracing
87133

134+
baseline-appsec:
135+
extends: .baseline-benchmarks
136+
variables:
137+
DD_BENCHMARKS_CONFIGURATION: appsec
138+
139+
# Comparison between candidate and baseline
140+
compare-candidate-baseline:
141+
stage: run-benchmarks
142+
tags: ["arch:amd64"]
143+
image: $MACROBENCHMARKS_CI_IMAGE
144+
needs: ["baseline-only-tracing", "candidate-only-tracing", "baseline-appsec", "candidate-appsec"]
145+
script:
146+
- git clone --branch glopes/cpp/nginx https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
147+
- cp -v artifacts/* platform/artifacts
148+
- cd platform
149+
- steps/analyze-results.sh
150+
- steps/post-pr-comment.sh
151+
88152
# This repository is using pre-release performance quality gates.
89153

90154
# On release/v{major}.{minor}.{patch} branch, verify that the latest CI pipeline passed the check-slo-breaches job.

0 commit comments

Comments
 (0)