Skip to content

Commit ec775ea

Browse files
carsonipmergify[bot]
authored andcommitted
tf: configurable ec_target for smoke and benchmark (#21274)
* tf: Configurable ec_target * Revert change * Push ec_target down to ec_deployment * Refactor * Revert standalone ac url * Update region * Smoke test set EC target * Update to use QA regions * Change qa region * Move worker to same region * Use closest region in profiles * tf format * Address review comments * fail fast * Description * Update readme * Remove EC_TARGET (cherry picked from commit 3ecb34d)
1 parent 40a5a03 commit ec775ea

22 files changed

Lines changed: 115 additions & 21 deletions

.github/workflows/benchmarks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
TF_VAR_BUILD_ID: ${{ github.run_id }}
9494
TF_VAR_ENVIRONMENT: ci
9595
TF_VAR_REPO: ${{ github.repository }}
96+
TF_VAR_ec_target: qa
9697
GOBENCH_TAGS: branch=${{ github.head_ref || github.ref }},commit=${{ github.sha }},target_branch=${{ github.base_ref }},enable_tail_sampling=${{ inputs.enableTailSampling }}
9798
GOBENCH_PASSWORD: ${{ secrets.GOBENCH_PASSWORD }}
9899
GOBENCH_USERNAME: ${{ secrets.GOBENCH_USERNAME }}

.github/workflows/smoke-tests-os.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ jobs:
4545
TF_VAR_BRANCH: ${{ github.ref_name }}
4646
TF_VAR_REPO: ${{ github.repository }}
4747
TF_VAR_CREATED_DATE: ${{ needs.prepare.outputs.date }}
48+
TF_VAR_ec_target: qa
49+
# Required for QA usage: gcp-us-central1 is a valid QA region.
50+
TF_VAR_region: gcp-us-central1
4851
permissions:
4952
contents: read
5053
id-token: write

testing/benchmark/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ In order for the `ec_deployment` provider to work against ESS, it is necessary t
3939
an API Key by exporting the environment variable `EC_API_KEY`. To generate a new API
4040
key in ESS, you can navigate to [Features > API Keys > Generate API Key](https://cloud.elastic.co/deployment-features/keys).
4141

42+
To target QA Elastic Cloud environment, set `TF_VAR_ec_target=qa` (default is `pro`).
43+
4244
## Usage
4345

4446
The `make` command is meant to be the main entrypoint to this environment, providing a light

testing/benchmark/main.tf

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ locals {
2626
build = var.BUILD_ID
2727
created_date = coalesce(var.CREATED_DATE, time_static.created_date.unix)
2828
}
29-
project = "apm-server-benchmarks"
29+
project = "apm-server-benchmarks"
30+
ec_target = lower(var.ec_target)
31+
api_endpoints = {
32+
qa = "https://public-api.qa.cld.elstc.co"
33+
pro = "https://api.elastic-cloud.com"
34+
}
3035
}
3136

3237
module "tags" {
@@ -36,7 +41,9 @@ module "tags" {
3641
project = startswith(var.user_name, "benchci") ? local.project : "${local.project}-${var.user_name}"
3742
}
3843

39-
provider "ec" {}
44+
provider "ec" {
45+
endpoint = local.api_endpoints[local.ec_target]
46+
}
4047

4148
provider "aws" {
4249
region = var.worker_region
@@ -92,6 +99,7 @@ module "ec_deployment" {
9299
count = var.run_standalone ? 0 : 1
93100
source = "../infra/terraform/modules/ec_deployment"
94101

102+
ec_target = var.ec_target
95103
region = var.ess_region
96104
stack_version = var.stack_version
97105

testing/benchmark/system-profiles/16GB_ARM-x2zone.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6g.2xlarge"
66

7+
worker_region = "eu-west-1"
78
# Elastic Cloud
8-
ess_region = "us-west-2"
9+
ess_region = "aws-eu-west-1"
910
deployment_template = "aws-cpu-optimized-faster-warm"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

testing/benchmark/system-profiles/16GBx2zone-aws.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6i.2xlarge"
66

7+
worker_region = "eu-west-1"
78
# Elastic Cloud
8-
ess_region = "us-west-2"
9+
ess_region = "aws-eu-west-1"
910
deployment_template = "aws-cpu-optimized-faster-warm"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

testing/benchmark/system-profiles/16GBx2zone-azure.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6i.2xlarge"
66

7+
worker_region = "us-east-2"
78
# Elastic Cloud
8-
ess_region = "azure-westus2"
9+
ess_region = "azure-eastus2"
910
deployment_template = "azure-cpu-optimized"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

testing/benchmark/system-profiles/16GBx2zone-gcp.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6i.2xlarge"
66

7+
worker_region = "us-east-2"
78
# Elastic Cloud
8-
ess_region = "gcp-us-west2"
9+
ess_region = "gcp-us-central1"
910
deployment_template = "gcp-cpu-optimized"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

testing/benchmark/system-profiles/32GB_ARM-x2zone.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6g.4xlarge"
66

7+
worker_region = "eu-west-1"
78
# Elastic Cloud
8-
ess_region = "us-west-2"
9+
ess_region = "aws-eu-west-1"
910
deployment_template = "aws-cpu-optimized-faster-warm"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

testing/benchmark/system-profiles/32GBx2zone-aws.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ user_name = "USER"
44

55
worker_instance_type = "c6i.4xlarge"
66

7+
worker_region = "eu-west-1"
78
# Elastic Cloud
8-
ess_region = "us-west-2"
9+
ess_region = "aws-eu-west-1"
910
deployment_template = "aws-cpu-optimized-faster-warm"
1011
# The number of AZs the APM Server should span.
1112
apm_server_zone_count = 1

0 commit comments

Comments
 (0)