2
2
before_script :
3
3
- |
4
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)
5
+ echo "Attempting to retrieve a GitHub token for scope '$DDOCTOSTS_SCOPE' with policy '$DDOCTOSTS_POLICY' with dd-octo-sts..."
6
+ error_output=$({ dd-octo-sts token --scope $DDOCTOSTS_SCOPE --policy $DDOCTOSTS_POLICY > "/tmp/github-token"; } 2>&1)
6
7
exit_code=$?
7
8
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 "ERROR: Failed to retrieve GitHub token."
9
10
echo "Original error: $error_output"
10
11
echo "Continuing execution anyway..."
11
12
fi
@@ -26,6 +27,11 @@ build-dd-trace-dotnet-microbenchmarks-ami:
26
27
DDOCTOSTS_ID_TOKEN :
27
28
aud : dd-octo-sts
28
29
variables :
30
+ # Allows ephemeral instances to read content from dd-trace-dotnet
31
+ # This is not strictly necessary in the current AMI build
32
+ DDOCTOSTS_SCOPE : " DataDog/dd-trace-dotnet"
33
+ DDOCTOSTS_POLICY : " gitlab.github-access.read-contents"
34
+
29
35
AWS_REGION : " us-east-1"
30
36
31
37
# Branch containing a provision for building the AMI
@@ -75,6 +81,10 @@ run-benchmarks:
75
81
rules :
76
82
- when : on_success
77
83
variables :
84
+ # Allows ephemeral instances to read content from benchmarking-platform
85
+ DDOCTOSTS_SCOPE : " DataDog/benchmarking-platform"
86
+ DDOCTOSTS_POLICY : " gitlab.github-access.read-contents"
87
+
78
88
AWS_REGION : " us-east-1"
79
89
80
90
# Branch containing 1. scripts to launch Windows benchmarks on ephemeral
@@ -87,10 +97,10 @@ run-benchmarks:
87
97
88
98
# Whether to cleanup ephemeral instances after benchmarks are run
89
99
CLEANUP : " true"
90
-
91
100
before_script :
92
101
- !reference [.dd-octo-sts-setup, before_script]
93
102
script :
103
+ - export GITHUB_TOKEN=$(cat /tmp/github-token)
94
104
- git clone --branch $BP_INFRA_BENCHMARKING_PLATFORM_BRANCH https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/benchmarking-platform platform
95
105
- ./platform/steps/run-windows-benchmarks.sh
96
106
after_script :
0 commit comments