-
Notifications
You must be signed in to change notification settings - Fork 1k
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
98 lines (86 loc) · 4.44 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
98 lines (86 loc) · 4.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
stages:
- test
- e2e
variables:
# Image version from datadog-agent-buildimages (same as datadog-agent main branch)
CI_IMAGE_LINUX: v102144341-64dad9f8
CI_IMAGE_LINUX_SUFFIX: ""
noop:
stage: test
script:
- echo "No op job to get merge queue working"
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
tags: ["arch:amd64"]
e2e:
stage: e2e
rules:
# Run on merge queue branches; known-flaky test failures are ignored by the TestWasher.
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
changes:
paths:
- charts/datadog/templates/**
- charts/datadog/values.yaml
- charts/datadog/Chart.yaml
- charts/datadog-csi-driver/templates/**
- charts/datadog-csi-driver/values.yaml
- charts/datadog-csi-driver/Chart.yaml
- test/e2e/**/*
compare_to: "refs/heads/main"
when: always
- if: '$CI_COMMIT_BRANCH == "main"'
changes:
paths:
- charts/datadog/templates/**
- charts/datadog/values.yaml
- charts/datadog/Chart.yaml
- charts/datadog-csi-driver/templates/**
- charts/datadog-csi-driver/values.yaml
- charts/datadog-csi-driver/Chart.yaml
- test/e2e/**/*
when: always
- when: manual
image: registry.ddbuild.io/ci/datadog-agent-buildimages/linux$CI_IMAGE_LINUX_SUFFIX:$CI_IMAGE_LINUX
tags: ["arch:amd64"]
variables:
E2E_GCP_PUBLIC_KEY_PATH: /tmp/agent-qa-gcp-ssh-key.pub
E2E_GCP_PRIVATE_KEY_PATH: /tmp/agent-qa-gcp-ssh-key
E2E_KEY_PAIR_NAME: ci.helm-charts
KUBERNETES_MEMORY_REQUEST: 12Gi
KUBERNETES_MEMORY_LIMIT: 16Gi
parallel:
matrix:
- E2E_BUILD_TAGS:
- e2e
- e2e_autopilot
- e2e_autopilot_systemprobe
- e2e_autopilot_csi
E2E_AGENT_VERSION:
- "7-rc"
before_script:
# Install helm: the datadog-agent-buildimages/linux runner does not ship
# it, unlike the deprecated test-infra-definitions runner. The e2e tests
# shell out to the `helm` binary (directly and via terratest).
- curl -fsSL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | DESIRED_VERSION=v3.21.0 bash
# Initial credentials setup with default build-stable AWS profile
- echo "Starting setup for E2E testing..."
# TODO: Retrieve with datadog-agent-qa AWS profile when secret is moved to SSM in that account
- E2E_GCP_PRIVATE_KEY_PASSWORD=$(aws ssm get-parameter --region us-east-1 --name ci.helm-charts.ssh_private_key_password --with-decryption --query "Parameter.Value" --out text)
- export E2E_GCP_PRIVATE_KEY_PASSWORD
# Set GITHUB_TOKEN to avoid getting rate-limited when pulumi sdk downloads the kubernetes provider
- export GITHUB_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.helm-charts.github_token --with-decryption --query "Parameter.Value" --out text)
# Use S3 backend to store stack status
- export PULUMI_CONFIG_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name ci.helm-charts.pulumi_password --with-decryption --query "Parameter.Value" --out text)
# Configure and use datadog-agent-qa AWS profile
- mkdir -p ~/.aws
- aws ssm get-parameter --region us-east-1 --name ci.helm-charts.agent-qa-profile --with-decryption --query "Parameter.Value" --out text >> ~/.aws/config
- export AWS_PROFILE=agent-qa-ci
- pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
# SSH Key retrieval for GCP
- aws ssm get-parameter --region us-east-1 --name ci.helm-charts.ssh_public_key --with-decryption --query "Parameter.Value" --out text > $E2E_GCP_PUBLIC_KEY_PATH || exit $?
- touch $E2E_GCP_PRIVATE_KEY_PATH && chmod 600 $E2E_GCP_PRIVATE_KEY_PATH && aws ssm get-parameter --region us-east-1 --name ci.helm-charts.ssh_private_key --with-decryption --query "Parameter.Value" --out text > $E2E_GCP_PRIVATE_KEY_PATH || exit $?
# Setup GCP credentials. https://www.pulumi.com/registry/packages/gcp/installation-configuration/
# The service account is called `agent-e2e-tests`
- aws ssm get-parameter --region us-east-1 --name ci.helm-charts.e2e_tests_gcp_credentials --with-decryption --query "Parameter.Value" --out text > ~/gcp-credentials.json || exit $?
- export GOOGLE_APPLICATION_CREDENTIALS=~/gcp-credentials.json
script:
- E2E_BUILD_TAGS=$E2E_BUILD_TAGS E2E_PROFILE=ci E2E_AGENT_VERSION=$E2E_AGENT_VERSION make test-e2e