Skip to content

Commit 3178479

Browse files
Use Linux image to execute E2E tests (#42832)
### What does this PR do? Use classic Linux image for E2E tests. This will make the maintenance easier by no longer need to maintain a dedicated e2e tests image. As a consequences we need to fetch the Pulumi plugins in the CI. It can be done easily in the go_e2e_deps jobs and the Pulumi are then cached. ### Motivation Ease maintenance of e2e tests image. This is also an unblocker for merging test-infra-definitions inside datadog-agent ### Describe how you validated your changes Complete CI running. ### Additional Notes Co-authored-by: kevin.fairise <kevin.fairise@datadoghq.com>
1 parent 0ff0007 commit 3178479

17 files changed

Lines changed: 74 additions & 75 deletions

File tree

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@
154154
/.gitlab/e2e_install_packages/windows.yml @DataDog/agent-onboarding @DataDog/windows-products
155155

156156
/.gitlab/common/ @DataDog/agent-devx
157-
/.gitlab/common/test_infra_version.yml @DataDog/agent-devx
158157

159158
/.gitlab/e2e/e2e.yml @DataDog/container-integrations @DataDog/agent-devx @DataDog/fleet
160159
/.gitlab/container_build/fakeintake.yml @DataDog/agent-e2e-testing @DataDog/agent-devx
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
issuer: https://gitlab.ddbuild.io
2+
3+
subject_pattern: "project_path:DataDog/.*"
4+
5+
claim_pattern:
6+
project_id: "4670"
7+
ref: "*"
8+
ref_protected: "true"
9+
permissions:
10+
contents: read

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ include:
99
- .gitlab/choco_build/choco_build.yml
1010
- .gitlab/common/shared.yml
1111
- .gitlab/common/skip_ci_check.yml
12-
- .gitlab/common/test_infra_version.yml
1312
- .gitlab/container_build/include.yml
1413
- .gitlab/container_scan/container_scan.yml
1514
- .gitlab/deploy_packages/include.yml

.gitlab/check_merge/do_not_merge.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ do-not-merge:
1919
[ -n "$CI_IMAGE_LINUX_RPM_X64_SUFFIX" ] ||
2020
[ -n "$CI_IMAGE_LINUX_RPM_ARM64_SUFFIX" ] ||
2121
[ -n "$CI_IMAGE_LINUX_RPM_ARMHF_SUFFIX" ] ||
22-
[ -n "$CI_IMAGE_LINUX_WIN_LTSC2022_X64_SUFFIX" ] ||
23-
[ -n "$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX" ]; then
22+
[ -n "$CI_IMAGE_LINUX_WIN_LTSC2022_X64_SUFFIX" ]; then
2423
echo "Pull request uses non-empty BUILDIMAGES_SUFFIX variable"
2524
echo "This workflow fails so that the pull request cannot be merged"
2625
exit 1

.gitlab/common/test_infra_version.yml

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

.gitlab/deps_fetch/deps_fetch.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
- mkdir -p $GOPATH/pkg/mod/cache && tar xJf modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache
1616
- rm -f modcache_e2e.tar.xz
1717

18+
.retrieve_linux_pulumi_plugins:
19+
- mkdir -p ~/.pulumi && tar xJf pulumi_plugins.tar.xz -C ~/.pulumi
20+
- rm -f pulumi_plugins.tar.xz
21+
1822
.cache:
1923
stage: deps_fetch
2024
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
@@ -89,15 +93,33 @@ go_tools_deps:
8993
- modcache_tools.tar.xz
9094

9195
go_e2e_deps:
96+
id_tokens:
97+
DDOCTOSTS_ID_TOKEN:
98+
aud: dd-octo-sts
9299
extends: .cache
100+
before_script:
101+
- dd-octo-sts version
102+
- dd-octo-sts debug --scope DataDog/datadog-agent --policy self.gitlab.deps-fetch
103+
- export GITHUB_TOKEN=$(dd-octo-sts token --scope DataDog/datadog-agent --policy self.gitlab.deps-fetch)
93104
script:
94-
- if [ -f modcache_e2e.tar.xz ]; then exit 0; fi
95-
- dda inv -- -e new-e2e-tests.deps
96-
- cd $GOPATH/pkg/mod/cache/ && tar c -I "xz -T${KUBERNETES_CPU_REQUEST}" -f $CI_PROJECT_DIR/modcache_e2e.tar.xz .
105+
- |
106+
if [ ! -f modcache_e2e.tar.xz ]; then
107+
dda inv -- -e new-e2e-tests.deps
108+
tar c -I "xz -T${KUBERNETES_CPU_REQUEST}" -f $CI_PROJECT_DIR/modcache_e2e.tar.xz -C $GOPATH/pkg/mod/cache/ .
109+
fi
110+
- |
111+
if [ ! -f pulumi_plugins.tar.xz ]; then
112+
# Pre-download Pulumi plugins used by e2e scenarios and components, should no longer be needed when we move test-infra-definitions to datadog-agent
113+
pushd ./test/new-e2e
114+
PULUMI_CONFIG_PASSPHRASE=dummy pulumi --non-interactive plugin install
115+
popd
116+
tar c -I "xz -T${KUBERNETES_CPU_REQUEST}" -f $CI_PROJECT_DIR/pulumi_plugins.tar.xz -C ~/.pulumi plugins
117+
fi
97118
artifacts:
98119
expire_in: 1 day
99120
paths:
100121
- $CI_PROJECT_DIR/modcache_e2e.tar.xz
122+
- $CI_PROJECT_DIR/pulumi_plugins.tar.xz
101123
cache:
102124
- key:
103125
files:
@@ -106,6 +128,13 @@ go_e2e_deps:
106128
prefix: "go_e2e_deps_modcache"
107129
paths:
108130
- modcache_e2e.tar.xz
131+
- key:
132+
files:
133+
- ./test/new-e2e/go.mod
134+
- .gitlab/deps_fetch/deps_fetch.yml
135+
prefix: "pulumi_plugins"
136+
paths:
137+
- pulumi_plugins.tar.xz
109138

110139
fetch_openjdk:
111140
needs: []

.gitlab/e2e/e2e.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
# Contains test jobs based on the new-e2e tests framework
44
.new_e2e_template:
55
stage: e2e
6-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
6+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
77
tags: ["arch:amd64", "specific:true"]
88
needs:
99
- !reference [.needs_new_e2e_template]
1010
before_script:
1111
- !reference [.retrieve_linux_go_e2e_deps]
12+
- !reference [.retrieve_linux_pulumi_plugins]
13+
- !reference [.retrieve_linux_go_tools_deps]
14+
- dda inv -- -e install-tools
1215
# Setup AWS Credentials
1316
- mkdir -p ~/.aws
1417
- |
@@ -121,6 +124,7 @@
121124
.needs_new_e2e_template:
122125
- go_e2e_deps
123126
- go_e2e_test_binaries
127+
- go_tools_deps
124128
- job: new-e2e-base-coverage
125129
optional: true
126130

@@ -142,6 +146,7 @@ new-e2e-base:
142146
extends: .new_e2e_template
143147
needs:
144148
- go_e2e_deps
149+
- go_tools_deps
145150
- go_e2e_test_binaries
146151
- agent_deb-x64-a7
147152
rules:
@@ -157,7 +162,7 @@ new-e2e-base:
157162
# This job runs early in the pipeline and creates artifacts that can be reused by test jobs
158163
go_e2e_test_binaries:
159164
stage: binary_build
160-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
165+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
161166
tags: ["arch:amd64", "specific:true"]
162167
needs:
163168
- go_e2e_deps
@@ -246,6 +251,7 @@ new-e2e-containers-eks-init:
246251
extends: .new_e2e_template
247252
needs:
248253
- go_e2e_deps
254+
- go_tools_deps
249255
rules:
250256
- !reference [.on_container_or_e2e_changes]
251257
- !reference [.manual]
@@ -454,6 +460,7 @@ new-e2e-npm-eks-init:
454460
extends: .new_e2e_template
455461
needs:
456462
- go_e2e_deps
463+
- go_tools_deps
457464
rules:
458465
- !reference [.on_npm_or_e2e_changes]
459466
- !reference [.manual]
@@ -844,6 +851,7 @@ new-e2e-otel-eks-init:
844851
- !reference [.manual]
845852
needs:
846853
- go_e2e_deps
854+
- go_tools_deps
847855
variables:
848856
TARGETS: ./tests/otel
849857
TEAM: otel
@@ -1068,7 +1076,7 @@ trigger-fips-e2e:
10681076
strategy: depend
10691077

10701078
new-e2e-cleanup-on-failure:
1071-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
1079+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
10721080
tags: ["arch:amd64", "specific:true"]
10731081
stage: e2e_cleanup
10741082
dependencies: [go_e2e_deps]

.gitlab/e2e_pre_test/e2e_pre_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ e2e_pre_test:
88
needs:
99
- go_e2e_deps
1010
- go_e2e_test_binaries
11+
- go_tools_deps
1112
- job: publish_fakeintake
1213
optional: true
1314
script:

.gitlab/kernel_matrix_testing/common.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
extends:
134134
- .kmt_ec2_location_us_east_1
135135
stage: kernel_matrix_testing_prepare
136-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
136+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
137137
needs: ["go_deps", "go_tools_deps"]
138138
tags: ["arch:amd64", "specific:true"]
139139
variables:
@@ -206,7 +206,7 @@
206206

207207
.kmt_cleanup:
208208
stage: kernel_matrix_testing_cleanup
209-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
209+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
210210
tags: ["arch:amd64", "specific:true"]
211211
before_script:
212212
- !reference [.kmt_new_profile]

.gitlab/source_test/linux.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ go_mod_tidy_check:
184184

185185
new-e2e-unit-tests:
186186
extends: .linux_tests
187-
image: registry.ddbuild.io/ci/test-infra-definitions/runner$TEST_INFRA_DEFINITIONS_BUILDIMAGES_SUFFIX:$TEST_INFRA_DEFINITIONS_BUILDIMAGES
187+
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
188188
tags: ["arch:amd64", "specific:true"]
189189
needs:
190190
- go_e2e_deps
@@ -201,6 +201,7 @@ new-e2e-unit-tests:
201201
# Use S3 backend
202202
- pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
203203
script:
204+
- dda inv -- -e install-tools
204205
- dda inv -- -e gitlab.generate-ci-visibility-links --output=$EXTERNAL_LINKS_PATH
205206
- dda inv -- -e new-e2e-tests.run --targets ./pkg/utils --junit-tar junit-${CI_JOB_ID}.tgz ${EXTRA_PARAMS}
206207
after_script:
@@ -209,6 +210,4 @@ new-e2e-unit-tests:
209210
KUBERNETES_MEMORY_REQUEST: 12Gi
210211
KUBERNETES_MEMORY_LIMIT: 16Gi
211212
KUBERNETES_CPU_REQUEST: 6
212-
# Not using the entrypoint script for the e2e runner image
213-
FF_KUBERNETES_HONOR_ENTRYPOINT: false
214213
timeout: 20m # Not less than 20m because job startup can take time.

0 commit comments

Comments
 (0)