Skip to content

Commit dcc8587

Browse files
committed
Revert "Improve and simplify the microbenchmarks CI setup (#7571)"
This reverts commit 6e87745.
1 parent 6e87745 commit dcc8587

File tree

3 files changed

+68
-116
lines changed

3 files changed

+68
-116
lines changed

.github/chainguard/gitlab.github-access.read-contents.sts.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.gitlab/benchmarks/macrobenchmarks.yml

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,13 +467,6 @@ profiler_cpu_timer_create-arm64:
467467
- platform/artifacts/
468468
expire_in: 3 months
469469
variables:
470-
AWS_REGION: "us-east-1"
471-
472-
# Branch containing 1. scripts to launch Windows benchmarks on ephemeral
473-
# instances (to be used by GitLab CI runners) and 2. scripts to run Windows
474-
# benchmarks (to be used by the ephemeral instances).
475-
BP_INFRA_BENCHMARKING_PLATFORM_BRANCH: "dd-trace-dotnet/macro"
476-
477470
# Whether to cleanup ephemeral instances after benchmarks are run
478471
CLEANUP: "true"
479472

@@ -496,17 +489,14 @@ profiler_cpu_timer_create-arm64:
496489
script:
497490
- source build-id.txt
498491
- echo "Building for the following build https://dev.azure.com/datadoghq/dd-trace-dotnet/_build/results?buildId=$buildId&view=results"
492+
- export BP_INFRA_BENCHMARKING_PLATFORM_BRANCH=dd-trace-dotnet/macro
499493
- git clone --branch $BP_INFRA_BENCHMARKING_PLATFORM_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform && cd platform
500494
- ./ephemeral-infra/run-windows-benchmarks.sh
501495
after_script:
502496
- |
503-
if [ "$CLEANUP" == "true" ]; then
504-
bp-infra cleanup --provision ./platform/ephemeral-infra/provisions/macrobenchmark-ephemeral-instance.yaml \
505-
--region "${AWS_REGION}" \
506-
--bypass-stack-destroy
507-
else
508-
echo "'CLEANUP' is set to 'false'. Will not cleanup."
509-
fi
497+
bp-infra cleanup --provision ./platform/ephemeral-infra/provisions/macrobenchmark-ephemeral-instance.yaml \
498+
--region "${AWS_REGION}" \
499+
--bypass-stack-destroy
510500
511501
baseline-win:
512502
extends: .benchmarks-win
Lines changed: 64 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,133 +1,101 @@
1-
.dd-octo-sts-setup:
2-
before_script:
3-
- |
4-
set +e
5-
error_output=$({ dd-octo-sts token --scope DataDog/dd-trace-dotnet --policy gitlab.github-access.read-contents > "/tmp/github-token"; } 2>&1)
6-
exit_code=$?
7-
if [ $exit_code -ne 0 ]; then
8-
echo "ERROR: Failed to retrieve a GitHub token with dd-octo-sts gitlab.github-access.read-contents policy."
9-
echo "Original error: $error_output"
10-
echo "Continuing execution anyway..."
11-
fi
12-
set -e
1+
.setup:
2+
script:
3+
- mkdir -p ~/.aws
4+
- /app/bp-infra/tools/fetch-ssm-parameter.sh $AWS_EPHEMERAL_INFRA_PROFILE_SSM_PARAMETER > ~/.aws/config || exit $?
5+
- export AWS_PROFILE=ephemeral-infra-ci
6+
- export BP_INFRA_KEY_PAIR_NAME=$(cat ~/.aws/key-pair-name.txt)
7+
- export BP_INFRA_KEY_PAIR_PRIVATE_KEY_PATH=~/.aws/key-pair-private-key.pem
138

149
stages:
15-
- build
10+
- infra-update
1611
- benchmarks
1712

18-
build-dd-trace-dotnet-microbenchmarks-ami:
19-
stage: build
20-
tags: ["arch:amd64"]
13+
update-bp-infra:
14+
stage: infra-update
2115
timeout: 3h
16+
tags: ["arch:amd64"]
2217
allow_failure: true
23-
when: manual
18+
# Image created in the following job https://gitlab.ddbuild.io/DataDog/benchmarking-platform-tools/-/jobs/869830045
2419
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:dd-trace-dotnet-micro
25-
id_tokens:
26-
DDOCTOSTS_ID_TOKEN:
27-
aud: dd-octo-sts
28-
variables:
29-
AWS_REGION: "us-east-1"
30-
31-
# Branch containing a provision for building the AMI
32-
BP_INFRA_BENCHMARKING_PLATFORM_BRANCH: "dd-trace-dotnet/micro"
33-
34-
PROVISION_FILE: "platform/ephemeral-infra/ami.yaml"
3520

36-
# Where AMI creation artifacts will be stored
37-
BP_INFRA_ARTIFACTS_BUCKET_NAME: "windows-benchmarking-results-us-east-1"
38-
39-
# Whether to cleanup instances after building the AMI, since the AMI is
40-
# based on an instance that is created in this job
41-
CLEANUP: "true"
42-
before_script:
43-
- !reference [.dd-octo-sts-setup, before_script]
4421
script:
45-
- git clone --branch $BP_INFRA_BENCHMARKING_PLATFORM_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
46-
- echo "GITHUB_TOKEN=$(cat /tmp/github-token)" > .env
47-
- CLEANUP_ARG=$([[ "$CLEANUP" == "false" ]] && echo "--no-cleanup" || echo "")
48-
- |
49-
bp-infra launch --region "${AWS_REGION}" --os "windows" \
50-
--provision "${PROVISION_FILE}" \
51-
--bypass-stack-destroy \
52-
--env .env \
53-
$CLEANUP_ARG
22+
- git clone --branch dd-trace-dotnet/micro https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
23+
- mkdir -p ~/.aws
24+
- /app/bp-infra/tools/fetch-ssm-parameter.sh $AWS_EPHEMERAL_INFRA_PROFILE_SSM_PARAMETER >> ~/.aws/config || exit $?
25+
- aws ssm get-parameter --region "$AWS_REGION" --name "ci.${CI_PROJECT_NAME}.ephemeral-infra-ci.windows-benchmarking-key-pair-name" --with-decryption --query "Parameter.Value" --out text >> ~/.aws/key-pair-name.txt
26+
- aws ssm get-parameter --region "$AWS_REGION" --name "ci.${CI_PROJECT_NAME}.ephemeral-infra-ci.windows-benchmarking-key-private-key" --with-decryption --query "Parameter.Value" --out text >> ~/.aws/key-pair-private-key.pem
27+
- export AWS_PROFILE=ephemeral-infra-ci
28+
- export BP_INFRA_KEY_PAIR_NAME=$(cat ~/.aws/key-pair-name.txt)
29+
- export BP_INFRA_KEY_PAIR_PRIVATE_KEY_PATH=~/.aws/key-pair-private-key.pem
30+
- bp-infra launch --provision ./platform/ephemeral-infra/base-instance.yaml --region "${AWS_REGION}" --bypass-stack-destroy
5431
after_script:
55-
# Makes sure the instance is cleaned up.
56-
# Note: This does not clean up the created AMI.
32+
- !reference [.setup, script]
5733
- |
58-
if [ "$CLEANUP" == "true" ]; then
59-
bp-infra cleanup --region "${AWS_REGION}" --os "windows" \
60-
--provision "${PROVISION_FILE}" \
61-
--bypass-stack-destroy
62-
else
63-
echo "'CLEANUP' is set to 'false'. Will not cleanup."
64-
fi
34+
bp-infra cleanup --provision ./platform/ephemeral-infra/base-instance.yaml \
35+
--region "${AWS_REGION}" \
36+
--bypass-stack-destroy
37+
38+
rules:
39+
- when: manual
40+
variables:
41+
AWS_REGION: "us-east-1"
42+
CLEANUP: "false"
43+
AWS_EPHEMERAL_INFRA_PROFILE_SSM_PARAMETER: "ci.dd-trace-dotnet.ephemeral-infra-ci.dd-trace-dotnet-profile"
44+
AWS_EPHEMERAL_INFRA_PROFILE_NAME: "ephemeral-infra-ci"
45+
AWS_EPHEMERAL_INFRA_ARTIFACTS_BUCKET_URI: "s3://windows-benchmarking-results/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/$CI_JOB_ID"
46+
AWS_EPHEMERAL_INFRA_REGION: "us-east-1"
6547

6648
run-benchmarks:
6749
stage: benchmarks
6850
tags: ["arch:amd64"]
6951
timeout: 2h
7052
# Image created in the following job https://gitlab.ddbuild.io/DataDog/benchmarking-platform-tools/-/jobs/869830045
7153
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:dd-trace-dotnet-micro
72-
id_tokens:
73-
DDOCTOSTS_ID_TOKEN:
74-
aud: dd-octo-sts
75-
rules:
76-
- when: on_success
77-
variables:
78-
AWS_REGION: "us-east-1"
79-
80-
# Branch containing 1. scripts to launch Windows benchmarks on ephemeral
81-
# instances (to be used by GitLab CI runners) and 2. scripts to run Windows
82-
# benchmarks (to be used by the ephemeral instances).
83-
BP_INFRA_BENCHMARKING_PLATFORM_BRANCH: "dd-trace-dotnet/micro"
8454

85-
# Where benchmarking results will be stored
86-
BP_INFRA_ARTIFACTS_BUCKET_NAME: "windows-benchmarking-results-us-east-1"
87-
88-
# Whether to cleanup ephemeral instances after benchmarks are run
89-
CLEANUP: "true"
90-
91-
before_script:
92-
- !reference [.dd-octo-sts-setup, before_script]
9355
script:
94-
- git clone --branch $BP_INFRA_BENCHMARKING_PLATFORM_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
95-
- ./platform/steps/run-windows-benchmarks.sh
56+
- git clone --branch dd-trace-dotnet/micro https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
57+
- AWS_REGION=${AWS_REGION} ./platform/steps/launch-instance.sh
9658
after_script:
97-
# Future improvement: Ideally, should be in a script.
9859
- |
99-
if [ "$CLEANUP" == "true" ]; then
100-
bp-infra cleanup --provision ./platform/ephemeral-infra/instance.yaml \
101-
--region "${AWS_REGION}" \
102-
--bypass-stack-destroy
103-
else
104-
echo "'CLEANUP' is set to 'false'. Will not cleanup."
105-
fi
60+
bp-infra cleanup --provision ./platform/ephemeral-infra/ephemeral-instance-main.yaml \
61+
--region "${AWS_REGION}" \
62+
--bypass-stack-destroy
10663
- ./platform/steps/post-pr-comment.sh
107-
# TODO: Uncomment this when the issue with sending files to backend is resolved
64+
# Temporarily commented out pending issue resolution with sending files to backend
10865
# - ./platform/steps/upload-to-bp-ui.sh
10966

110-
# TODO: Remove if unnecessary
67+
rules:
68+
- when: on_success
69+
variables:
70+
AWS_REGION: "us-east-1"
71+
11172
upload-to-bp-ui:
11273
stage: benchmarks
11374
tags: ["arch:amd64"]
11475
timeout: 1h
115-
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:dd-trace-dotnet-micro
116-
when: manual
76+
# Image created in the following job https://gitlab.ddbuild.io/DataDog/benchmarking-platform-tools/-/jobs/869830045
77+
image: registry.ddbuild.io/images/benchmarking-platform-tools-ubuntu:dotnet-microbenchmarks
78+
79+
script:
80+
- git clone --branch fayssal/test-micro-delivery https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
81+
# - ./platform/steps/launch-instance.sh
82+
# - ./platform/steps/post-pr-comment.sh
83+
# Temporarely commented out pending issue resolution with sending files to backend
84+
- ./platform/steps/upload-to-bp-ui.sh
85+
11786
artifacts:
11887
name: "artifacts"
11988
when: always
12089
paths:
12190
- candidate-results/
12291
expire_in: 3 months
92+
93+
rules:
94+
- when: manual
12395
variables:
12496
AWS_REGION: "us-east-1"
125-
126-
# Here, we don't include BP_INFRA since we don't use BP_INFRA in this job.
127-
BENCHMARKING_PLATFORM_BRANCH: "dd-trace-dotnet/micro"
128-
129-
# Where to fetch results from
130-
BP_INFRA_ARTIFACTS_BUCKET_NAME: "windows-benchmarking-results-us-east-1"
131-
script:
132-
- git clone --branch $BENCHMARKING_PLATFORM_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
133-
- ./platform/steps/upload-to-bp-ui.sh
97+
CLEANUP: "false"
98+
AWS_EPHEMERAL_INFRA_PROFILE_SSM_PARAMETER: "ci.dd-trace-dotnet.ephemeral-infra-ci.dd-trace-dotnet-profile"
99+
AWS_EPHEMERAL_INFRA_PROFILE_NAME: "ephemeral-infra-ci"
100+
AWS_EPHEMERAL_INFRA_ARTIFACTS_BUCKET_URI: "s3://windows-benchmarking-results/$CI_PROJECT_NAME/$CI_COMMIT_REF_NAME/$CI_JOB_ID"
101+
AWS_EPHEMERAL_INFRA_REGION: "us-east-1"

0 commit comments

Comments
 (0)