2018-12-18 19:37:03 +00:00
|
|
|
Terraform provisioner for end to end tests
|
|
|
|
==========================================
|
|
|
|
|
|
|
|
This folder contains terraform resources for provisioning a nomad cluster on AWS for end to end tests.
|
2019-01-03 21:31:19 +00:00
|
|
|
It uses a Nomad binary identified by its commit SHA that's stored in a shared s3 bucket that Nomad team
|
2019-01-03 19:19:04 +00:00
|
|
|
developers can access. The commit SHA can be from any branch that's pushed to remote.
|
2018-12-18 19:37:03 +00:00
|
|
|
|
2019-01-03 18:12:43 +00:00
|
|
|
Use [envchain](https://github.com/sorah/envchain) to store your AWS credentials.
|
|
|
|
|
|
|
|
|
2018-12-18 19:37:03 +00:00
|
|
|
```
|
|
|
|
$ cd e2e/terraform/
|
2019-05-21 13:13:49 +00:00
|
|
|
$ TF_VAR_nomad_sha=<nomad_sha> envchain nomadaws terraform apply
|
2018-12-18 19:37:03 +00:00
|
|
|
```
|
|
|
|
|
2019-01-03 18:12:43 +00:00
|
|
|
After this step, you should have a nomad client address to point the end to end tests in the `e2e` folder to.
|
2019-01-03 21:31:19 +00:00
|
|
|
|
2019-05-03 14:54:34 +00:00
|
|
|
## SSH
|
|
|
|
|
|
|
|
Terraform will output node IPs that may be accessed via ssh:
|
|
|
|
|
|
|
|
```
|
|
|
|
ssh -i keys/nomad-e2e-*.pem ubuntu@${EC2_IP_ADDR}
|
|
|
|
```
|
|
|
|
|
2019-11-19 16:06:10 +00:00
|
|
|
The Windows client runs OpenSSH for conveniences, but has a different user and will drop you into a Powershell shell instead of bash:
|
|
|
|
|
|
|
|
```
|
|
|
|
ssh -i keys/nomad-e2e-*.pem Administrator@${EC2_IP_ADDR}
|
|
|
|
```
|
|
|
|
|
2019-05-03 14:54:34 +00:00
|
|
|
|
|
|
|
## Teardown
|
2019-11-19 16:06:10 +00:00
|
|
|
The terraform state file stores all the info, so the nomad_sha doesn't need to be valid during teardown.
|
2019-01-03 21:31:19 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
$ cd e2e/terraform/
|
|
|
|
$ envchain nomadaws TF_VAR_nomad_sha=yyyzzz terraform destroy
|
|
|
|
```
|