Infra: AWS self termination
[csit.git] / fdio.infra.terraform / README.txt
1 Terraform CI Infra
2 ==================
3 This folder contains configuration for terraform based deployments.
4
5
6 Nomad:
7 ----------------------
8 Application orchestration - Nomad
9 - ./1n_nmd/
10
11
12 AWS:
13 ----------------------
14 Testbed deployment - Amazon AWS
15 - ./2n_aws_c5n/
16 - ./3n_aws_c5n/
17
18 Prerequisities:
19 ~~~~~~~~~~~~~~~
20 aws-cli >= 2.1.21
21   - Configured with personal "AWS Access Key ID" and "AWS Secret Access Key"
22   - See: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html
23
24 terraform-provisioner-ansible >= v2.5.0
25   - Terraform's Ansible provisioner requires manual installation
26   - See: https://github.com/radekg/terraform-provisioner-ansible
27
28 Getting started:
29 ~~~~~~~~~~~~~~~~
30 Tested setup:
31 - Install and configure prerequisities as specified.
32
33 - OPTIONAL: Enable logging
34   Terraform does not have logging enabled by default, to enable logging
35   to stderr, set up TF_LOG variable with specified loglevel:
36   Available loglevels: TRACE, DEBUG, INFO, WARN, ERROR
37
38     export TF_LOG="LOGLEVEL"
39
40   It is also possible to store logged output to a file by setting up
41   TF_LOG_PATH variable:
42     export TF_LOG_PATH="path/to/logfile"
43
44 - Run Terraform in a given root module folder depending on chosen testbed
45   topology. Terraform will deploy and configure instances and other resources,
46   all of these resources can be later identified on AWS via Environment tag.
47   By default, Environment tag "CSIT-AWS" is used.
48   Example:
49     cd fdio.infra.terraform/2n_aws_c5n/
50     terraform init
51     terraform apply
52
53   This will deploy envirnoment with default values, you can check the defaults
54   in ./2n_aws_c5n/main.tf and ./2n_aws_c5n/variables.tf files
55
56   If you would like to change some of these values, you can:
57   1) Set up TF_VAR_* environment variables prior to running 'terraform apply':
58       export TF_VAR_testbed_name="testbed1"
59
60   2) Use '-var=varname=value' flag when running 'terraform apply':
61       terraform apply -var=testbed_name=testbed1
62
63   Note:
64   Only variables defined in variables.tf file of the root module can be
65   changed using these methods.
66
67 - Run the tests
68   1) To run some tests use the VPP performance bootstrap script, e.g:
69       cd ../resources/libraries/bash/entry
70       ./bootstrap_vpp_perf.sh csit-vpp-perf-mrr-daily-master-2n-aws
71
72   2) To run only selected tests based on TAGS, export environment variables
73      before running the test suite and run a verify JOB, e.g:
74       export GERRIT_EVENT_TYPE="comment-added"
75       export GERRIT_EVENT_COMMENT_TEXT="1cAND64bANDmrrANDethip4-ip4base"
76       ./bootstrap_vpp_perf.sh csit-vpp-perf-verify-master-2n-aws
77
78 - To clean up the AWS environment and remove all used resources, run:
79     terraform destroy
80
81
82 Azure:
83 ----------------------
84 Testbed deployment - Microsoft Azure
85 - ./3n_azure_fsv2/