Skip to content

Commit ecf9306

Browse files
Add a quick start for all SSI test suites (#8433)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7beb580 commit ecf9306

12 files changed

Lines changed: 443 additions & 33 deletions

File tree

‎README.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ All detailed documentation lives in the [`docs/`](docs/README.md) folder. Here i
4646
|-------|-------------|
4747
| [Build](docs/execute/build.md) | Build options, weblog variants, image names |
4848
| [Run](docs/execute/run.md) | Run options, selecting tests, scenarios, timeouts |
49+
| [SSI quick start](docs/execute/ssi.md) | Choose and run Docker, AWS, or Kubernetes SSI tests |
4950
| [Logs](docs/execute/logs.md) | Understanding the logs folder structure |
5051
| [Test outcomes](docs/execute/test-outcomes.md) | Reading test results |
5152
| [Replay mode](docs/execute/replay.md) | Re-run tests without starting the containers |
@@ -90,10 +91,10 @@ All detailed documentation lives in the [`docs/`](docs/README.md) folder. Here i
9091

9192
## Additional requirements
9293

93-
Specific scenarios may require additional tools:
94-
95-
- **Kubernetes tests** -- require Kind/Minikube for local K8s clusters. See [K8s docs](docs/understand/scenarios/k8s_library_injection_overview.md).
96-
- **AWS SSI tests** -- require AWS credentials and Pulumi setup. See [AWS SSI docs](docs/understand/scenarios/onboarding.md).
94+
Specific scenarios need extra tools or access. For Docker SSI, AWS SSI, and
95+
Kubernetes library injection, start with the
96+
[SSI quick start](docs/execute/ssi.md). The
97+
[SSI access guide](docs/execute/ssi-access.md) lists every requirement.
9798

9899
## Contributing
99100

‎docs/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Everything you need to build images and execute test scenarios.
3131
- [Replay mode](execute/replay.md) -- re-run test methods without rebuilding the environment
3232
- [Custom tracer versions](execute/binaries.md) -- testing with local or unmerged tracer builds
3333
- [Troubleshooting](execute/troubleshooting.md) -- common issues, debugging tips, tracer debug output
34-
- [SSI execution](execute/ssi.md) -- running SSI-specific scenarios
34+
- [SSI quick start](execute/ssi.md) -- choose and run Docker, AWS, or Kubernetes SSI tests
35+
- [SSI access](execute/ssi-access.md) -- tools, AWS profiles, network access, registries, and keys
3536
- [End-to-end execution](execute/e2e.md) -- running end-to-end scenarios
3637

3738
## Writing and editing tests
@@ -58,6 +59,7 @@ How to add, modify, enable, and disable tests.
5859

5960
Deep dives into each scenario type.
6061

62+
- **SSI start here**: [quick start](execute/ssi.md) and [access requirements](execute/ssi-access.md)
6163
- **End-to-end**: covered in [scenarios overview](understand/scenarios/README.md) and [architecture](understand/architecture.md)
6264
- **Parametric**: [overview](understand/scenarios/parametric.md) and [contributing guide](edit/parametric_contributing.md)
6365
- **AWS SSI / Onboarding**: [full guide](understand/scenarios/onboarding.md) and [provision structure](understand/scenarios/onboarding_provision_section.md)

‎docs/execute/README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ For troubleshooting check the troubleshooting [page](./troubleshooting.md).
3434

3535
- [Build](./build.md) -- build options, weblog variants, image names
3636
- [Run](./run.md) -- run options, test selection, scenarios, sleep mode
37+
- [SSI quick start](./ssi.md) -- choose and run Docker, AWS, or Kubernetes SSI tests
38+
- [SSI access](./ssi-access.md) -- tools, AWS profiles, network access, registries, and keys
3739
- [Test outcomes](./test-outcomes.md) -- detailed explanation of test result states
3840
- [Logs](./logs.md) -- log folder structure and what each file contains
3941
- [Replay mode](./replay.md) -- re-run tests without rebuilding the environment

‎docs/execute/ssi-access.md‎

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
# SSI access and prerequisites
2+
3+
Use this page before you run an SSI wizard. For the commands, see the
4+
[SSI quick start](ssi.md).
5+
6+
## Common requirements
7+
8+
All SSI test suites need:
9+
10+
- Bash
11+
- Git
12+
- Docker 20.10 or later
13+
- Python 3.12
14+
15+
Run commands from the root of the system-tests repository.
16+
17+
Each wizard prepares the system-tests Python environment. You can also prepare
18+
it before you start:
19+
20+
```bash
21+
./build.sh -i runner
22+
```
23+
24+
Check that Docker is running:
25+
26+
```bash
27+
docker info
28+
```
29+
30+
## Requirements by test suite
31+
32+
| Test suite | Extra tools | Access |
33+
| --- | --- | --- |
34+
| Docker SSI | None for most tests | Private ECR access only for `websphere-app` and `jboss-app` |
35+
| AWS SSI | AWS CLI, aws-vault, and Pulumi 3.69 or later | AWS account, AppGate, and Datadog keys |
36+
| K8s library injection | AWS CLI, aws-vault, kubectl, Kind or Minikube, and Helm | Private ECR. Operator also needs Datadog keys |
37+
| K8s injector-dev | `injector-dev`, Colima, Minikube, Helm, kubectl | A private registry. Datadog ECR is the default |
38+
39+
The K8s library injection wizard can install Kind or Minikube and Helm. It does
40+
not install kubectl. Install kubectl before you start.
41+
42+
On macOS:
43+
44+
```bash
45+
brew install kubectl
46+
kubectl version --client
47+
```
48+
49+
For other systems, follow the
50+
[kubectl installation guide](https://kubernetes.io/docs/tasks/tools/#kubectl).
51+
52+
The injector-dev wizard can install its Kubernetes tools. It can also copy or
53+
download the `injector-dev` binary.
54+
55+
## Configure AWS access
56+
57+
AWS SSI and the Kubernetes test suites use different AWS accounts.
58+
59+
| Use | Account | aws-vault profile |
60+
| --- | --- | --- |
61+
| Run AWS SSI on EC2 | `dev-apm-dcs-system-tests` | `sso-dev-apm-dcs-system-tests-account-admin` |
62+
| Use SSI images in ECR | `apm-ecosystems-reliability` | `sso-apm-ecosystems-reliability-account-admin` |
63+
64+
Follow the internal
65+
[AWS SSO setup guide](https://datadoghq.atlassian.net/wiki/spaces/ENG/pages/2498068557/AWS+SSO+Getting+Started).
66+
Use the current setup command:
67+
68+
```bash
69+
ddtool cloud aws config
70+
```
71+
72+
On macOS, install the AWS CLI and `aws-vault` with Homebrew:
73+
74+
```bash
75+
brew install awscli aws-vault
76+
```
77+
78+
For other systems, use the installation steps in the AWS SSO setup guide.
79+
80+
Check AWS SSI access:
81+
82+
```bash
83+
aws-vault exec sso-dev-apm-dcs-system-tests-account-admin -- aws sts get-caller-identity
84+
```
85+
86+
Check ECR access:
87+
88+
```bash
89+
aws-vault exec sso-apm-ecosystems-reliability-account-admin -- \
90+
aws ecr get-login-password --region us-east-1 >/dev/null
91+
```
92+
93+
If a profile is missing, run `ddtool cloud aws config` again. If the account is
94+
still missing, use the
95+
[Cloud Access request form](https://datadoghq.atlassian.net/jira/software/c/projects/CLOUDA/forms/form/direct/4/26949).
96+
Ask for access to the account and profile from the table above.
97+
98+
## Configure network access for AWS SSI
99+
100+
AWS SSI creates EC2 instances on a private network. Datadog employees need
101+
access to that network through AppGate.
102+
103+
The access rules and client profiles are internal. They can also change. Do
104+
not copy them into this public repository.
105+
106+
Before your first run, ask in
107+
[#apm-shared-testing](https://dd.enterprise.slack.com/archives/C025TJ4RZ8X)
108+
for the current setup steps. The maintainers can confirm that your Datadog team
109+
has access and give you the current client profile.
110+
111+
Connect to the Datadog private network before you run the AWS SSI wizard.
112+
113+
## Configure Datadog keys
114+
115+
AWS SSI and `K8S_LIB_INJECTION_OPERATOR` use the real Datadog backend. Both
116+
need:
117+
118+
- `DD_API_KEY_ONBOARDING`
119+
- `DD_APP_KEY_ONBOARDING`
120+
121+
The Datadog keys must belong to the
122+
[system-tests Datadog organization](https://system-tests.datadoghq.com/).
123+
If you cannot create or read these keys, ask in
124+
[#apm-shared-testing](https://dd.enterprise.slack.com/archives/C025TJ4RZ8X).
125+
126+
The AWS SSI wizard asks for these keys. It also asks for
127+
`PULUMI_CONFIG_PASSPHRASE`. The wizard can save all three values in the local
128+
`.env` file.
129+
130+
For the K8s Operator scenario, add the two Datadog keys to `.env` before you
131+
run the wizard:
132+
133+
```text
134+
DD_API_KEY_ONBOARDING=<api-key>
135+
DD_APP_KEY_ONBOARDING=<application-key>
136+
```
137+
138+
Git ignores `.env`. Never add these values to source files or commits.
139+
140+
The wizard provides working defaults for the subnet, security group, and IAM
141+
instance profile. Use those defaults for a normal local run.
142+
143+
An EC2 key pair is optional. Use the default option unless you need SSH access
144+
to debug the virtual machine.
145+
146+
## Configure the private ECR registry
147+
148+
K8s library injection always uses the private Datadog ECR registry. K8s
149+
injector-dev can use that registry or another private registry.
150+
151+
Docker SSI uses public images in most cases. These two weblogs use private ECR
152+
images:
153+
154+
- `websphere-app`
155+
- `jboss-app`
156+
157+
The wizards perform the ECR login. They use this registry:
158+
159+
```text
160+
235494822917.dkr.ecr.us-east-1.amazonaws.com
161+
```
162+
163+
ECR tokens expire. Run the wizard again to get a new token.
164+
165+
## Next steps
166+
167+
- [Choose and run an SSI test suite](ssi.md)
168+
- [AWS SSI reference](../understand/scenarios/onboarding.md)
169+
- [Docker SSI reference](../understand/scenarios/docker_ssi.md)
170+
- [K8s library injection reference](../understand/scenarios/k8s_lib_injection.md)
171+
- [K8s injector-dev reference](../understand/scenarios/k8s_injector_dev.md)

‎docs/execute/ssi.md‎

Lines changed: 142 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,156 @@
1-
## Requirements
1+
# Run SSI tests
22

3-
### MacOS
3+
SSI means Single Step Instrumentation. It installs and injects a Datadog tracer
4+
without changes to the application code.
45

5-
Pulumi is infrastructure-as-code that allow you to manage AWS instance.
6+
This page covers all local SSI test suites in system-tests.
67

7-
```sh
8-
brew install pulumi/tap/pulumi
8+
## Choose a test suite
9+
10+
| Test suite | Use it to test | Runs on | Validation |
11+
| --- | --- | --- | --- |
12+
| Docker SSI | Tracer versions, guardrails, service naming, and other fast checks | Local Docker | APM Test Agent |
13+
| AWS SSI | Host and container injection on real virtual machines | AWS EC2 | Datadog backend |
14+
| K8s library injection | Kubernetes injection components | Local Kind or Minikube | APM Test Agent (Datadog backend for Operator) |
15+
| K8s injector-dev | Changes to the `injector-dev` tool | Local Colima and Minikube | APM Test Agent |
16+
17+
If you are new to SSI, start with Docker SSI. It has the fewest access
18+
requirements.
19+
20+
Use K8s library injection for normal Kubernetes injection tests. Use K8s
21+
injector-dev only when your change depends on the `injector-dev` tool.
22+
23+
## Terms used on this page
24+
25+
- **Scenario:** The test environment, its configuration, and its tests.
26+
- **Weblog:** A sample application that system-tests instruments.
27+
- **Wizard:** An interactive script that selects a valid test combination.
28+
- **Tracer:** The Datadog library injected into the application.
29+
- **APM Test Agent:** A local test service that captures telemetry.
30+
- **Injector:** The component that adds the tracer to an application.
31+
- **lib-init:** A container image that holds one tracer library.
32+
- **Cluster Agent:** The Datadog component that runs the Admission Controller.
33+
- **Admission Controller:** A component that changes a pod before it starts.
34+
- **ECR:** The AWS container image registry used by these tests.
35+
- **Provision:** The software and commands that AWS SSI installs on a virtual machine.
36+
37+
AWS SSI is also called **onboarding**, **auto-injection**, or
38+
**auto-instrumentation** in this repository.
39+
40+
## Before you start
41+
42+
You need Bash, Git, Docker 20.10 or later, and Python 3.12.
43+
44+
Read the [SSI access and prerequisites guide](ssi-access.md). It covers AWS
45+
profiles, private network access, ECR, Pulumi, Kubernetes tools, and Datadog
46+
keys.
47+
48+
Run every command from the root of the system-tests repository.
49+
50+
## Docker SSI
51+
52+
Docker SSI is the fastest SSI test suite. Most test cases use public images.
53+
54+
Run the wizard:
55+
56+
```bash
57+
./utils/scripts/ssi_wizards/docker_ssi_wizard.sh
58+
```
59+
60+
The wizard selects a language, scenario, weblog, base image, architecture, and
61+
runtime. It prints the final `./run.sh` command before it starts.
62+
63+
The `websphere-app` and `jboss-app` weblogs need private ECR access. The wizard
64+
can perform that login.
65+
66+
See the [Docker SSI reference](../understand/scenarios/docker_ssi.md) for the
67+
manual command and development details.
68+
69+
## AWS SSI
70+
71+
AWS SSI creates an EC2 instance and installs SSI on it. It sends telemetry to
72+
the system-tests Datadog organization.
73+
74+
Complete the [AWS access steps](ssi-access.md#configure-aws-access) and the
75+
[network access steps](ssi-access.md#configure-network-access-for-aws-ssi).
76+
Connect to the Datadog private network before you start.
77+
78+
Run the wizard:
79+
80+
```bash
81+
./utils/scripts/ssi_wizards/aws_onboarding_wizard.sh
982
```
1083

11-
### Check if your AWS client is correctly configured
84+
The wizard checks Pulumi and AWS access. It also configures the local `.env`
85+
file. You then select a language, scenario, weblog, virtual machine, and
86+
released or development components.
87+
88+
The wizard shuts down the EC2 instance after the run. If you keep the instance
89+
for debugging, follow its `pulumi destroy` reminder.
90+
91+
See the [AWS SSI reference](../understand/scenarios/onboarding.md) for manual
92+
execution, logs, and troubleshooting.
93+
94+
## K8s library injection
95+
96+
This suite tests the normal Kubernetes library injection flow. It uses the
97+
Datadog Admission Controller or pod annotations.
98+
99+
Complete the [AWS access steps](ssi-access.md#configure-aws-access) and the
100+
[ECR steps](ssi-access.md#configure-the-private-ecr-registry).
101+
102+
If you select `K8S_LIB_INJECTION_OPERATOR`, also complete the
103+
[Datadog key steps](ssi-access.md#configure-datadog-keys). This scenario uses
104+
the real Datadog Agent and backend. Other K8s injection scenarios use the APM
105+
Test Agent.
12106

107+
Run the wizard:
13108

14-
```sh
15-
aws-vault exec sso-sandbox-account-admin -- aws s3 ls
109+
```bash
110+
./utils/scripts/ssi_wizards/k8s_ssi_wizard.sh
16111
```
17112

18-
* `credentials missing` -> Somebody (who? fresh-service?) needs to check that you belong to the good group in AWS
19-
* need to `modify ~/.aws/config` ?
113+
The wizard installs the system-tests runner. It can also install Kind,
114+
Minikube, and Helm. It does not install kubectl. You then select the scenario,
115+
weblog, and component versions.
116+
117+
See the
118+
[K8s library injection reference](../understand/scenarios/k8s_lib_injection.md)
119+
for manual execution, component versions, logs, and debugging.
120+
121+
## K8s injector-dev
122+
123+
This suite tests the `injector-dev` binary. It is not the default K8s SSI test
124+
suite.
125+
126+
Complete the injector-dev steps in the
127+
[access guide](ssi-access.md#requirements-by-test-suite).
128+
129+
Run the wizard:
130+
131+
```bash
132+
./utils/scripts/ssi_wizards/k8s_injector_dev_wizard.sh
133+
```
134+
135+
The wizard checks the binary and the local Kubernetes tools. It then
136+
configures a private registry and selects the test components.
137+
138+
See the [K8s injector-dev reference](../understand/scenarios/k8s_injector_dev.md)
139+
for manual execution and all command options.
20140

21-
## Run
141+
## Read the result
22142

23-
* You need AppGate
24-
* `./utils/scripts/ssi_wizards/aws_onboarding_wizard.sh`
143+
The terminal shows the pytest result. A successful run ends with exit code
144+
zero.
25145

146+
Each scenario writes its files to a folder such as `logs_docker_ssi`. The
147+
folder name uses the scenario name in lowercase. Use these pages:
26148

27-
## Miscs infos
149+
- [Test outcomes](test-outcomes.md)
150+
- [Log files](logs.md)
151+
- [General troubleshooting](troubleshooting.md)
152+
- [AWS SSI troubleshooting](../understand/scenarios/onboarding.md#troubleshooting)
153+
- [K8s logs](../understand/scenarios/k8s_lib_injection.md#how-to-debug-your-kubernetes-environment-and-tests-results)
28154

29-
* The account `Datadog - apm-ecosystems-reliability / 235494822917` is used in CIs, not locally
30-
* The account `Datadog Sandbox / 601427279990` is used locally
31-
* https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/3487138295/Using+virtual+machines+to+test+your+software+components+against+different+operating+systems#AWS-CLI%3A-Datadog-SandBox-Account
32-
* https://system-tests.datadoghq.com/dashboard/nsk-tpd-u6q/aws-ec2-overview-system-tests?fromUser=false&refresh_mode=sliding&from_ts=1744813553852&to_ts=1744817153852&live=true
155+
If you are still blocked, ask in
156+
[#apm-shared-testing](https://dd.enterprise.slack.com/archives/C025TJ4RZ8X).

0 commit comments

Comments
 (0)