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