Skip to content
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

e2e: Terraform updates to support framework deploys #6948

Merged
merged 1 commit into from
Jan 21, 2020

Conversation

tgross
Copy link
Member

@tgross tgross commented Jan 16, 2020

The e2e framework instantiates clients for Nomad/Consul but the provisioning of the actual Nomad cluster is left to Terraform. The Terraform provisioning process uses remote-exec to deploy specific versions of Nomad so that we don't have to bake an AMI every time we want to test a new version. But Terraform treats the resulting instances as immutable, so we can't use the same tooling to update the version of Nomad in-place. This is a prerequisite for upgrade testing.

This changeset:

  • provides Terraform output that written to JSON used by the framework to configure provisioning via terraform output provisioning (consumed by e2e: deploy Nomad from testing framework #6949)
  • provides Terraform output that can be used by test operators to configure their shell via $(terraform output environment)
  • drops remote-exec provisioning steps from Terraform
  • makes changes to the deployment scripts to ensure they can be run multiple times w/ different versions against the same host.


output "provisioning" {
description = "output to a file to be use w/ E2E framework -provision.terraform"
value = jsonencode(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow this is p cool - didn't realise tf had list templating like this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm sure the Terraform team would be terrified if they saw this. 😀

@tgross tgross force-pushed the e2e_provisioning_terraform_scripts branch 3 times, most recently from 18f029e to be92c27 Compare January 21, 2020 19:45
@tgross
Copy link
Member Author

tgross commented Jan 21, 2020

I've found a couple of cleanup items to wrap up here for Windows.

The e2e framework instantiates clients for Nomad/Consul but the
provisioning of the actual Nomad cluster is left to Terraform. The
Terraform provisioning process uses `remote-exec` to deploy specific
versions of Nomad so that we don't have to bake an AMI every time we
want to test a new version. But Terraform treats the resulting
instances as immutable, so we can't use the same tooling to update the
version of Nomad in-place. This is a prerequisite for upgrade testing.

This changeset:
* provides Terraform output that written to JSON used by the framework
  to configure provisioning via `terraform output provisioning`.
* provides Terraform output that can be used by test operators to
  configure their shell via `$(terraform output environment)`
* drops `remote-exec` provisioning steps from Terraform
* makes changes to the deployment scripts to ensure they can be run
  multiple times w/ different versions against the same host.
@tgross tgross force-pushed the e2e_provisioning_terraform_scripts branch from be92c27 to 06b31c5 Compare January 21, 2020 20:52
@tgross
Copy link
Member Author

tgross commented Jan 21, 2020

I've rebased this and the target branch off master and did a full end-to-end test (including Windows) with #6949. Once tests pass I'll merge this and then open a PR with the combined branch vs master.

@tgross tgross merged commit a3dc578 into e2e_provisioning_rework Jan 21, 2020
@tgross tgross deleted the e2e_provisioning_terraform_scripts branch January 21, 2020 21:27
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants