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

tf: add standalone apm server profiles with NVMe SSDs and io2 EBS #15624

Merged
merged 10 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
required: false
type: boolean
default: false
standaloneInstanceSize:
description: 'AWS instance size of standalone APM Server, e.g. c6i.2xlarge'
required: false
type: string
enableTailSampling:
description: 'Enable tail-based sampling on the APM server'
required: false
Expand Down Expand Up @@ -67,6 +71,7 @@ jobs:
TF_VAR_private_key: ./id_rsa_terraform
TF_VAR_public_key: ./id_rsa_terraform.pub
TF_VAR_run_standalone: ${{ inputs.runStandalone || github.event.schedule=='0 0 1 * *' }}
TF_VAR_standalone_apm_server_instance_size: ${{ inputs.standaloneInstanceSize || 'c6i.2xlarge' }}
TF_VAR_apm_server_tail_sampling: ${{ inputs.enableTailSampling || 'false' }} # set the default again otherwise schedules won't work
TF_VAR_apm_server_tail_sampling_storage_limit: ${{ inputs.tailSamplingStorageLimit || '10GB' }} # set the default again otherwise schedules won't work
RUN_STANDALONE: ${{ inputs.runStandalone || github.event.schedule=='0 0 1 * *' }}
Expand Down
1 change: 1 addition & 0 deletions testing/benchmark/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ module "standalone_apm_server" {
apm_instance_type = var.standalone_apm_server_instance_size
apm_volume_type = var.standalone_apm_server_volume_type
apm_volume_size = var.apm_server_tail_sampling ? coalesce(var.standalone_apm_server_volume_size, 60) : var.standalone_apm_server_volume_size
apm_iops = var.standalone_apm_server_iops
apm_server_bin_path = var.apm_server_bin_path
ea_managed = false

Expand Down
6 changes: 6 additions & 0 deletions testing/benchmark/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ variable "standalone_apm_server_volume_size" {
description = "Optional volume size in GB to use for APM Server VM"
}

variable "standalone_apm_server_iops" {
default = null
type = number
description = "Optional disk IOPS in GB to use for APM Server VM"
}

## VPC Network settings

variable "vpc_cidr" {
Expand Down
13 changes: 13 additions & 0 deletions testing/infra/terraform/modules/standalone_apm_server/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ resource "aws_instance" "apm" {
root_block_device {
volume_type = var.apm_volume_type
volume_size = var.apm_volume_size
iops = var.apm_iops
}

connection {
Expand All @@ -181,6 +182,18 @@ resource "aws_instance" "apm" {
private_key = file("${var.aws_provisioner_key_name}")
}

// For instance types with 'd.' e.g. c6id.2xlarge, use the NVMe ssd as data disk.
provisioner "remote-exec" {
inline = length(regexall("d[.]", self.instance_type)) > 0 ? [
"sudo mkfs -t xfs /dev/nvme1n1",
"mkdir ~/data",
"sudo mount /dev/nvme1n1 ~/data",
"sudo chown $USER:$USER ~/data",
] : [
":", // no-op
]
}

provisioner "file" {
source = "${var.apm_server_bin_path}/apm-server"
destination = local.bin_path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ variable "apm_volume_size" {
description = "Optional apm server volume size in GB override"
}

variable "apm_iops" {
default = null
type = number
description = "Optional apm server disk IOPS override"
}

variable "vpc_id" {
description = "VPC ID to provision the EC2 instance"
type = string
Expand Down
Loading