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

Ability To Configure Locust Version #31

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ No modules.
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Id of the subnet | `string` | n/a | yes |
| <a name="input_tags"></a> [tags](#input\_tags) | Common tags | `map` | `{}` | no |
| <a name="input_taurus_version"></a> [taurus\_version](#input\_taurus\_version) | Taurus version | `string` | `"1.16.0"` | no |
| <a name="input_locust_version"></a> [locust\_version](#input\_locust_\_version) | Locust version | `string` | `"2.9.0"` | no |
| <a name="input_web_cidr_ingress_blocks"></a> [web\_cidr\_ingress\_blocks](#input\_web\_cidr\_ingress\_blocks) | web for the leader | `list` | <pre>[<br> "0.0.0.0/0"<br>]</pre> | no |

## Outputs
Expand Down
9 changes: 7 additions & 2 deletions leader.tf
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ locals {
"${path.module}/scripts/entrypoint.leader.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -62,6 +63,7 @@ locals {
"${path.module}/scripts/entrypoint.leader.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -70,7 +72,9 @@ locals {
leader_user_data_base64 = base64encode(
templatefile(
"${path.module}/scripts/locust.entrypoint.leader.full.sh.tpl",
{}
{
LOCUST_VERSION = var.locust_version
}
)
)
}
Expand All @@ -79,7 +83,8 @@ locals {
templatefile(
"${path.module}/scripts/k6.entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
JVM_ARGS = var.nodes_jvm_args,
LOCUST_VERSION = var.locust_version
}
)
)
Expand Down
7 changes: 6 additions & 1 deletion nodes.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ locals {
"${path.module}/scripts/entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -74,6 +75,7 @@ locals {
"${path.module}/scripts/entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -82,7 +84,9 @@ locals {
node_user_data_base64 = base64encode(
templatefile(
"${path.module}/scripts/locust.entrypoint.node.full.sh.tpl",
{}
{
LOCUST_VERSION = var.locust_version
}
)
)
}
Expand All @@ -92,6 +96,7 @@ locals {
"${path.module}/scripts/k6.entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand Down
2 changes: 1 addition & 1 deletion scripts/entrypoint.leader.full.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export BZT_VERSION="1.16.0"
sudo pip3 install bzt==$BZT_VERSION

# LOCUST
export LOCUST_VERSION="2.9.0"
export LOCUST_VERSION="${LOCUST_VERSION}"
sudo pip3 install locust==$LOCUST_VERSION

# JMETER
Expand Down
2 changes: 1 addition & 1 deletion scripts/entrypoint.node.full.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export BZT_VERSION="1.16.0"
sudo pip3 install bzt==$BZT_VERSION

# LOCUST
export LOCUST_VERSION="2.9.0"
export LOCUST_VERSION="${LOCUST_VERSION}"
sudo pip3 install locust==$LOCUST_VERSION


Expand Down
2 changes: 1 addition & 1 deletion scripts/locust.entrypoint.leader.full.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo yum update -y
sudo yum install -y pcre2-devel.x86_64 python gcc python3-devel tzdata curl unzip bash htop

# LOCUST
export LOCUST_VERSION="2.9.0"
export LOCUST_VERSION="${LOCUST_VERSION}"
sudo pip3 install locust==$LOCUST_VERSION

export PRIVATE_IP=$(hostname -I | awk '{print $1}')
Expand Down
2 changes: 1 addition & 1 deletion scripts/locust.entrypoint.node.full.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo yum update -y
sudo yum install -y pcre2-devel.x86_64 python gcc python3-devel tzdata curl unzip bash htop

# LOCUST
export LOCUST_VERSION="2.9.0"
export LOCUST_VERSION="${LOCUST_VERSION}"
sudo pip3 install locust==$LOCUST_VERSION

export PRIVATE_IP=$(hostname -I | awk '{print $1}')
Expand Down
5 changes: 4 additions & 1 deletion setup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ locals {
templatefile(
"${path.module}/scripts/entrypoint.leader.full.sh.tpl",
{
JVM_ARGS = var.leader_jvm_args,
JVM_ARGS = var.leader_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -18,6 +19,7 @@ locals {
"${path.module}/scripts/entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand All @@ -27,6 +29,7 @@ locals {
"${path.module}/scripts/entrypoint.node.full.sh.tpl",
{
JVM_ARGS = var.nodes_jvm_args
LOCUST_VERSION = var.locust_version
}
)
)
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,9 @@ variable "locust_exporter" {
}
description = "Export locust result to prometheus"
}

variable "locust_version" {
description = "Locust version defaults to 2.9.0"
type = string
default = "2.9.0"
}