open-nomad/e2e/terraform/packer
Tim Gross 9f05d62338
E2E with HCP Consul/Vault (#12267)
Use HCP Consul and HCP Vault for the Consul and Vault clusters used in E2E testing. This has the following benefits:

* Without the need to support mTLS bootstrapping for Consul and Vault, we can simplify the mTLS configuration by leaning on Terraform instead of janky bash shell scripting.
* Vault bootstrapping is no longer required, so we can eliminate even more janky shell scripting
* Our E2E exercises HCP, which is important to us as an organization
* With the reduction in configurability, we can simplify the Terraform configuration and drop the complicated `provision.sh`/`provision.ps1` scripts we were using previously. We can template Nomad configuration files and upload them with the `file` provisioner.
* Packer builds for Linux and Windows become much simpler.

tl;dr way less janky shell scripting!
2022-03-18 09:27:28 -04:00
..
ubuntu-bionic-amd64 E2E with HCP Consul/Vault (#12267) 2022-03-18 09:27:28 -04:00
windows-2016-amd64 E2E with HCP Consul/Vault (#12267) 2022-03-18 09:27:28 -04:00
build e2e: Spin clusters with custom url binaries (#10656) 2021-05-25 13:47:39 -04:00
README.md update readme about profiles and packer build 2021-01-25 11:40:26 -05:00
ubuntu-bionic-amd64.pkr.hcl E2E with HCP Consul/Vault (#12267) 2022-03-18 09:27:28 -04:00
windows-2016-amd64.pkr.hcl E2E with HCP Consul/Vault (#12267) 2022-03-18 09:27:28 -04:00

Packer Builds

These builds are run as-needed to update the AMIs used by the end-to-end test infrastructure.

What goes here?

  • steps that aren't specific to a given Nomad build: ex. all Linux instances need jq and awscli.
  • steps that aren't specific to a given EC2 instance: nothing that includes an IP address.
  • steps that infrequently change: the version of Consul or Vault we ship.

Running Packer builds

$ packer --version
1.6.4

# build Ubuntu Bionic AMI
$ ./build ubuntu-bionic-amd64

# build Windows AMI
$ ./build windows-2016-amd64

Debugging Packer Builds

To debug a Packer build you'll need to pass the -debug and -on-error flags. You can then ssh into the instance using the ec2_amazon-ebs.pem file that Packer drops in this directory.

Packer doesn't have a cleanup command if you've run -on-error=abort. So when you're done, clean up the machine by looking for "Packer" in the AWS console: