-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement terraform based system tests #227
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
|
Status update: I managed to write the TF service deployer, but it needs to nice Terraform definition, which will actually perform something useful. A test scenario consist of two parts:
@kaiyan-sheng I was wondering if you wouldn't like to play with it (git checkout), share some feedback and write some Terraform files which can usually do sth useful (most wanted). I wrote a sample which creates SNS topic, but due to lack of messages, I don't see any CloudWatch metrics :( FYI I haven't enabled the AWS account in the CI due to security reasons and cost-savings. Let's first check it on our workstations. |
@ycombinator Thanks a lot for the review! I addressed your comments and introduced small changes in README. Please take a look and re-review whenever you've time. |
docs/howto/system_testing.md
Outdated
|
||
`<service deployer>` - a name of the supported service deployer: `docker` or `tf` (terraform). | ||
|
||
### Docker Compose service deployer | ||
|
||
The `docker-compose.yml` file defines the integration service(s) for the package. If your package has a logs data stream, the log files from your package's integration service must be written to a volume. For example, the `apache` package has the following definition in it's integration service's `docker-compose.yml` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence made sense earlier because the sample file structure above showed a docker-compose.yml
file. Now the sample file structure above just says <service deployer files>
so this sentence doesn't make as much sense.
I would add another introductory sentence to bridge this gap, something like:
When using the Docker Compose service deployer, the
<service deployer files>
must include adocker-compose.yml
file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added here and for the TF service deployer
docs/howto/system_testing.md
Outdated
<service deployer files> | ||
``` | ||
|
||
`<service deployer>` - a name of the supported service deployer: `docker` or `tf` (terraform). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth clarifying that the docker
name is for the Docker Compose service deployer and the tf
name is for the Terraform service deployer. It's pretty obvious but it doesn't hurt to be explicit and tie these names to the sections that follow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, docker and docker compose are different products. Fixed
### Data stream-level configuration | ||
### Terraform service deployer | ||
|
||
The `*.tf` files define the infrastructure using the Terraform syntax. The terraform based service can be handy to boot up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to my comment on the Docker Composer service deployer, I would add an introductory sentence to bridge the gap between what's shown in the sample file structure and this sentence here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
docs/howto/system_testing.md
Outdated
### Terraform service deployer | ||
|
||
The `*.tf` files define the infrastructure using the Terraform syntax. The terraform based service can be handy to boot up | ||
resources on AWS and use them for testing (e.g. spawn EC2 instance and collect its metrics). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we specifically mention AWS here? Or can we be more generic and say resources supported by Terraform or something like that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
|
||
// Build Terraform executor container name | ||
serviceContainer := fmt.Sprintf("%s_terraform_1", service.project) | ||
outCtxt.Hostname = serviceContainer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to set outCtxt.Hostname
here? AFAICT it's not useful because the Agent configuration will never really need to talk to the Terraform executor container. Instead it will need to use the outCtxt.CustomProperties
to talk to the service that is deployed by the Terraform executor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can try this, I hope everything will still work (it's not expected value somewhere). Fixed.
Co-authored-by: Shaunak Kashyap <[email protected]>
Co-authored-by: Shaunak Kashyap <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Very nice work on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I'm opening this as draft to present the progress on the TF-based system tests.Please do not consider this as final form, as I will modify it soon.Issue: #89
How to test this:
Tf definitions in:
data_stream/ec2_metrics/_dev/deploy/tf/main.tf
(or other .tf files)EDIT:
I switched from SNS to EC2 metrics during tests as metrics tend to appear quicker.