Skip to content

Commit 90b4110

Browse files
committed
fix: build validator image after generating perf validation config
1 parent 7b7021c commit 90b4110

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

terraform/performance/main.tf

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,21 @@ resource "time_sleep" "wait_until_metrics_collected" {
9999
depends_on = [module.ec2_setup]
100100
}
101101

102+
# performance_validation.yml is generated above and baked into the validator
103+
# image at build time (the Dockerfile COPYs src/), so the image must be built
104+
# after the config file exists and before the validator container runs.
105+
resource "null_resource" "build_validator_image" {
106+
triggers = {
107+
validation_config = local_file.validation_config_file.content
108+
}
109+
110+
provisioner "local-exec" {
111+
command = "docker build -t aoc-validator:local ../../validator"
112+
}
113+
114+
depends_on = [local_file.validation_config_file]
115+
}
116+
102117
module "validator" {
103118
source = "../validation"
104119

@@ -107,5 +122,5 @@ module "validator" {
107122
testing_id = module.ec2_setup.testing_id
108123
metric_namespace = var.performance_metric_namespace
109124

110-
depends_on = [time_sleep.wait_until_metrics_collected]
125+
depends_on = [time_sleep.wait_until_metrics_collected, null_resource.build_validator_image]
111126
}

0 commit comments

Comments
 (0)