|
1 | | -## Requirements |
| 1 | +# Run SSI tests |
2 | 2 |
|
3 | | -### MacOS |
| 3 | +SSI means Single Step Instrumentation. It installs and injects a Datadog tracer |
| 4 | +without changes to the application code. |
4 | 5 |
|
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. |
6 | 7 |
|
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 |
9 | 82 | ``` |
10 | 83 |
|
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. |
12 | 106 |
|
| 107 | +Run the wizard: |
13 | 108 |
|
14 | | -```sh |
15 | | -aws-vault exec sso-sandbox-account-admin -- aws s3 ls |
| 109 | +```bash |
| 110 | +./utils/scripts/ssi_wizards/k8s_ssi_wizard.sh |
16 | 111 | ``` |
17 | 112 |
|
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. |
20 | 140 |
|
21 | | -## Run |
| 141 | +## Read the result |
22 | 142 |
|
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. |
25 | 145 |
|
| 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: |
26 | 148 |
|
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) |
28 | 154 |
|
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