Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rebwill committed Aug 13, 2024
1 parent 2d137be commit 27dbd47
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 172 deletions.
97 changes: 4 additions & 93 deletions enos/enos-dev-scenario-pr-replication.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,10 @@ scenario "dev_pr_replication" {
c. 'artifact:zip'
This will download a Vault .zip bundle from releases.hashicorp.com with the version and
edition you specify.
TODO: add required variable
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list dev_single_cluster
Expand All @@ -81,7 +80,7 @@ scenario "dev_pr_replication" {
Notes:
- To learn more about any Enos command, use the `--help` flag, e.g.:
$ enos scenario launch --help
- Enos will run all matrix variant combinations that match your filter. If you specify one
Expand All @@ -108,94 +107,6 @@ scenario "dev_pr_replication" {
7. When you're done, destroy the scenario and associated infrastructure:
$ enos scenario destroy dev_pr_replication <filter>
PREREQUISITES
In order to execute this scenario you'll need:
1. To install the enos CLI:
- $ brew tap hashicorp/tap && brew update && brew install hashicorp/tap/enos
2. Authenticate to an AWS account via Doormat and export the credentials locally. Follow the guide here:
https://eng-handbook.hashicorp.services/internal-tools/enos/getting-started/#authenticate-to-aws-with-doormat
3. An SSH keypair set up in your AWS account:
https://eng-handbook.hashicorp.services/internal-tools/enos/getting-started/#set-your-aws-key-pair-name-and-private-key
RUNNING THIS SCENARIO
1. Set input variables
This scenario requires several input variables to be set in order to function
properly. While not all variants will require all variables, it's suggested that you look over
the scenario outline to determine which variables affect which steps and which have inputs that
you should set. You can use the following command to get a textual outline of the entire
scenario:
enos scenario outline dev_pr_replication
You can also create an HTML version that is suitable for viewing in web browsers:
enos scenario outline dev_pr_replication --format html > index.html
open index.html
There are two main options for setting these input variables:
* Create an 'enos-local.vars' file in the same 'enos' directory where this scenario is defined.
Declare your desired variable values in this file. For example, you could copy the following content
and then set the values as necessary:
(Note: Artifactory credentials are only required if you are using `artifact:deb` or `artifact:rpm`,
as Enos will download these from Artifactory)
artifactory_username = "[email protected]"
artifactory_token = "<ARTIFACTORY TOKEN VALUE>
aws_region = "us-west-2"
aws_ssh_keypair_name = "<YOUR REGION SPECIFIC KEYPAIR NAME>"
aws_ssh_keypair_key_path = "/path/to/your/private/key.pem"
dev_build_local_ui = false
dev_consul_version = "1.18.1"
vault_license_path = "./support/vault.hclic"
vault_product_version = "1.16.2"
* Set them as environment variables:
export ENOS_VAR_aws_region="us-west-2"
export ENOS_VAR_vault_license_path="./support/vault.hclic"
2. Launch the scenario
After you've configured your inputs, you can list and filter the available scenarios and then
subsequently launch your desired one.
Note: To learn more about any Enos command, use the `--help` flag, e.g.:
enos scenario launch --help
If you don't know yet what combination of matrix variants you want to use for your scenario,
can view all the possible combinations through the `list` command:
enos scenario list dev_pr_replication
Once you know what filter you want to use to obtain your desired combination of matrix variants,
use the `launch` command with that filter to launch your scenario.
enos scenario launch dev_pr_replication arch:amd64 artifact:deb distro:ubuntu edition:ent.hsm primary_backend:raft primary_seal:awskms secondary_backend:raft secondary_seal:pkcs11
Note: In this scenario, the artifact:local variant builds
3. Inspect your cluster if necessary
When the scenario is finished launching, refer to the scenario outputs to see information
related to your cluster. You can use this information to SSH into nodes and/or to interact
with vault. If using Ubuntu, your SSH user will be `ubuntu`; if using any of the other
supported distros, it will be `ec2-user`.
enos scenario output dev_pr_replication arch:amd64 artifact:deb distro:ubuntu edition:ent.hsm primary_backend:raft primary_seal:awskms secondary_backend:raft secondary_seal:pkcs11
ssh -i /path/to/your/private/key.pem <SSH_USER>@<PUBLIC_IP>
vault status
4. Destroy your resources
After you've finished, destroy the cluster.
enos scenario destroy dev_pr_replication arch:amd64 artifact:deb distro:ubuntu edition:ent.hsm primary_backend:raft primary_seal:awskms secondary_backend:raft secondary_seal:pkcs11
EOF

// The matrix is where we define all the baseline combinations that enos can utilize to customize
Expand Down
70 changes: 3 additions & 67 deletions enos/enos-dev-scenario-single-cluster.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,10 @@ scenario "dev_single_cluster" {
c. 'artifact:zip'
This will download a Vault .zip bundle from releases.hashicorp.com with the version and
edition you specify.
TODO: add required variable
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command.
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list dev_single_cluster
Expand All @@ -80,7 +79,7 @@ scenario "dev_single_cluster" {
Notes:
- To learn more about any Enos command, use the `--help` flag, e.g.:
$ enos scenario launch --help
- Enos will run all matrix variant combinations that match your filter. If you specify one
Expand All @@ -107,69 +106,6 @@ scenario "dev_single_cluster" {
7. When you're done, destroy the scenario and associated infrastructure:
$ enos scenario destroy dev_single_cluster <filter>
In order to execute this scenario you'll need:
1. To install the enos CLI:
- $ brew tap hashicorp/tap && brew update && brew install hashicorp/tap/enos
2. Access to an AWS account via Doormat. Follow the guide here:
https://eng-handbook.hashicorp.services/internal-tools/enos/getting-started/#authenticate-to-aws-with-doormat
3. An SSH keypair set up in your AWS account:
https://eng-handbook.hashicorp.services/internal-tools/enos/getting-started/#set-your-aws-key-pair-name-and-private-key
Please note that this scenario requires several input variables to be set in order to function
properly. While not all variants will require all variables, it's suggested that you look over
the scenario outline to determine which variables affect which steps and which have inputs that
you should set. You can use the following command to get a textual outline of the entire
scenario:
enos scenario outline dev_single_cluster
You can also create an HTML version that is suitable for viewing in web browsers:
enos scenario outline dev_single_cluster --format html > index.html
open index.html
To configure the required variables you have a couple of choices. You can create an
'enos-local.vars' file in the same 'enos' directory where this scenario is defined. In it you
declare your desired variable values. For example, you could copy the following content and
then set the values as necessary:
artifactory_username = "[email protected]"
artifactory_token = "<ARTIFACTORY TOKEN VALUE>
aws_region = "us-west-2"
aws_ssh_keypair_name = "<YOUR REGION SPECIFIC KEYPAIR NAME>"
aws_ssh_keypair_key_path = "/path/to/your/private/key.pem"
dev_build_local_ui = false
dev_consul_version = "1.18.1"
vault_license_path = "./support/vault.hclic"
vault_product_version = "1.16.2"
Alternatively, you can set them in your environment:
export ENOS_VAR_aws_region="us-west-2"
export ENOS_VAR_vault_license_path="./support/vault.hclic"
After you've configured your inputs you can list and filter the available scenarios and then
subsequently launch and destroy them.
enos scenario list --help
enos scenario launch --help
enos scenario list dev_single_cluster
enos scenario launch dev_single_cluster arch:arm64 artifact:local backend:raft distro:ubuntu edition:ce seal:awskms
When the scenario is finished launching you refer to the scenario outputs to see information
related to your cluster. You can use this information to SSH into nodes and/or to interact
with vault.
enos scenario output dev_single_cluster arch:arm64 artifact:local backend:raft distro:ubuntu edition:ce seal:awskms
ssh -i /path/to/your/private/key.pem <PUBLIC_IP>
vault status
After you've finished you can tear down the cluster
enos scenario destroy dev_single_cluster arch:arm64 artifact:local backend:raft distro:ubuntu edition:ce seal:awskms
EOF

// The matrix is where we define all the baseline combinations that enos can utilize to customize
Expand Down
5 changes: 3 additions & 2 deletions enos/enos-scenario-agent.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ scenario "agent" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list agent
Expand All @@ -81,7 +82,7 @@ scenario "agent" {
- To learn more about any Enos command, use the `--help` flag, e.g.:
$ enos scenario launch --help
- Enos will run all matrix variant combinations that match your filter. If you specify one
variant for each matrix item, the filter will produce and run only one scenario. Even if you are
using a Raft backend, you may want to specify a consul_version (though it functionally will not
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-autopilot.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ scenario "autopilot" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list autopilot
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-proxy.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ scenario "proxy" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list proxy
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-replication.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ scenario "replication" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list replication
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-seal-ha.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ scenario "seal_ha" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list seal_ha
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-smoke.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ scenario "smoke" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list smoke
Expand Down
3 changes: 2 additions & 1 deletion enos/enos-scenario-ui.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ scenario "ui" {
- vault_license_path (if using an ENT edition of Vault)
4. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list ui
Expand Down
7 changes: 3 additions & 4 deletions enos/enos-scenario-upgrade.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ scenario "upgrade" {
vault_artifact_path = path/to/existing-vault-artifact.[zip | rpm | deb]
b. 'artifact_source:local'
This will build a Vault .zip bundle from your local branch. Set the following variable:
vault_artifact_path = path/to/where/vault-should-be-built.zip
This will build a Vault .zip bundle from your local branch. No variables required.
c. 'artifact_source:artifactory'
This will download a Vault artifact of the specified version, edition, and revision SHA
Expand All @@ -71,7 +69,8 @@ scenario "upgrade" {
artifactory_token = your-token
5. If you don't know yet what combination of matrix variants you want to use for your scenario, you
can view all the possible combinations through the `list` command:
can view all the possible combinations through the `list` command. You can also reduce the list by
adding one or more filter items, e.g. 'arch:amd64' to get just the scenario combinations that use amd64.
$ enos scenario list upgrade
Expand Down

0 comments on commit 27dbd47

Please sign in to comment.