Skip to content

Commit 565e24a

Browse files
update RM and screenshots
1 parent f47a891 commit 565e24a

File tree

6 files changed

+102
-3
lines changed

6 files changed

+102
-3
lines changed

integration/README.md

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,74 @@ Generally a test will do the following for any given EC2 Machine:
1111
- Create a machine using the variables provided below in `us-west-1`
1212
- Run a test using `observeinc/collection/aws//modules/testing/exec` module to accept python scripts located at `integration/tests/scripts`
1313

14+
### Pre-requisites
1415

15-
### Variables
16+
Ensure you have the following:
17+
- Built version of the agent ( in `observe-repos/observe-agent/dist`) using `go-releaser`
18+
- Blunderdome Admin Access in AWS (used to assume the `gh-observe_agent-repo` role for testing )
19+
- Observe Collection URL & Datastream Token to test with
20+
- Generated Private & public key pair ( name to `test_key.pub` & `test_key.pem`)
21+
- Terraform provider overide and terraform variables (see below section on how to do this)
22+
23+
24+
**Building the agent**:
25+
26+
```
27+
observe-agent git:(nikhil/update-RM) ✗ goreleaser release --snapshot --clean --verbose
28+
```
29+
30+
If agent distributable is not built, you may get the following message:
31+
32+
```
33+
│ Error: Test assertion failed
34+
35+
│ on tests/integration.tftest.hcl line 65, in run "test_install":
36+
│ 65: condition = output.error == ""
37+
│ ├────────────────
38+
│ │ output.error is "FileNotFoundError: [Errno 2] No such file or directory: '/Users/nikhil.dua/Documents/observe-repos/observe-agent/dist'"
39+
40+
│ Error in Installation Test
41+
```
42+
43+
44+
**SSH Key Pairs**:
45+
46+
Generate in PEM format for the OpenSSH Key that will be used by Terraform EC2 Modules:
47+
48+
```
49+
ssh-keygen -m PEM
50+
```
51+
52+
For more info on generating SSH keys, see [here](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/create-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws)
53+
54+
Ensure you have `./test_key.pub` and `./test_key.pem` in the `integration` directory. This can also be changed and specifed in the `integration/tests.auto.tfvars` file.
55+
56+
Ensure the extensions are correct!
57+
58+
59+
**AWS UI Access (optional)**:
60+
61+
For AWS UI access for viewing machines:
62+
1. Login to Britive Blunderdome
63+
64+
2. Navigate to AWS Console
65+
66+
<p align="left">
67+
<img src="screenshots/aws-console.png" alt="AWS Console" width="300"/>
68+
</p>
69+
70+
3. Click Switch role and input details for `nikhil-ps-account` which is the member account for integration testing within Blunderdome. Details are the following:
71+
<p align="left">
72+
<img src="screenshots/member-account.png" alt="Member Account" width="500"/>
73+
</p>
74+
75+
4. You can now access EC2 machines and download key pairs (same as what Github Actions workflow uses)
76+
77+
5. Ensure you're in `us-west-1`
78+
79+
80+
81+
### Terraform Variables
1682

1783
The tests are run using the following variables. These can be set in the `integration/tests.auto.tfvars` file for local testing.
1884

@@ -25,6 +91,17 @@ OBSERVE_URL = "https://<TENANT_ID.collect.observe-staging.com>" #Observe URL to
2591
OBSERVE_TOKEN ="<DATASTREAM_TOKEN_TO_TEST_OBSERVE_AGENT_WITH">
2692
```
2793

94+
The PUBLIC & PRIVATE key pair can be generated by following the instructions in the "SSH Key Pairs" section above
95+
96+
Example of what the `integrations` folder contains after creating `.*tfvars` file and SSH Key Pair:
97+
98+
99+
<p align="left">
100+
<img src="screenshots/ssh-example.png" alt="SSH Example" width="200"/>
101+
</p>
102+
103+
104+
### Terraform Provider
28105

29106
Note: You must also set the provider correctly. We use the following settings:
30107
- Region: `us-west-1`
@@ -47,8 +124,30 @@ provider "aws" {
47124

48125
or through a `provider_override.tf` placed in `modules/create_ec2` directory.
49126

127+
Example of this:
128+
129+
<p align="left">
130+
<img src="screenshots/provider-example.png" alt="SSH Example" width="200"/>
131+
</p>
132+
133+
134+
135+
136+
> [!NOTE]
137+
> For Terraform to access and assume the role properly, you MUST be logged into Blunderdome Admin in console and have the correct permissions!
138+
139+
Example of this:
140+
141+
```
142+
observe git:(master) ✗ s/aws-creds checkout blunderdome
143+
144+
Checked out 'AWS Blunderdome Organization/460044344528 (observe-blunderdome)/BritiveBlunderdome-FullAWSAdmin' into awscli profile 'blunderdome'
145+
146+
observe git:(master) ✗ export AWS_PROFILE=blunderdome
147+
```
148+
50149

51-
### Local Testing
150+
### Local Testing (without terraform test)
52151

53152
Any of the python scripts in the `/scripts` directory can be tested by running them directly, granted an EC2 Machine exists. As the scripts rely on the outputs of `create_ec2` and `setup_observe_variables` modules to be passed in as environment variables, these environment variables can be manually set if the set up modules are not ran.
54153

@@ -88,7 +187,7 @@ Testing SSH connection to host 54.177.26.178 with timeout 120s
88187

89188
### Architecture
90189

91-
The architecture diagram can be found ![here](Observe-Agent.png)
190+
The architecture diagram can be found ![here](screenshots/Observe-Agent.png)
92191

93192

94193

29.2 KB
Loading
214 KB
Loading
71 KB
Loading
60.8 KB
Loading

0 commit comments

Comments
 (0)