Skip to content

Commit 043f443

Browse files
committed
Fix duplicate log group error for multi-executor demo
1 parent f477345 commit 043f443

File tree

5 files changed

+44
-31
lines changed

5 files changed

+44
-31
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
.terraform
22
plan
3+
terraform.tfstate
4+
terraform.tfstate.backup
5+
.terraform.lock.hcl
6+
tfplan
Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
locals {
2-
region = "us-west-2"
3-
availability_zone = "us-west-2a"
4-
docker_mirror_static_ip = "10.0.1.4"
2+
region = "us-west-2"
3+
availability_zone = "us-west-2a"
4+
docker_mirror_static_ip = "10.0.1.4"
5+
sourcegraph_external_url = "https://sourcegraph.acme.com"
6+
executor_sourcegraph_executor_proxy_password = "hunter2"
57
}
68

79
module "networking" {
@@ -25,32 +27,33 @@ module "executors-codeintel" {
2527
source = "sourcegraph/executors/aws//modules/executors"
2628
version = "3.43.0" # LATEST
2729

28-
vpc_id = module.networking.vpc_id
29-
subnet_id = module.networking.subnet_id
30-
resource_prefix = "codeintel-prod"
31-
instance_tag = "codeintel-prod"
32-
sourcegraph_external_url = "https://sourcegraph.acme.com"
33-
sourcegraph_executor_proxy_password = "hunter2"
34-
queue_name = "codeintel"
35-
metrics_environment_label = "prod"
36-
docker_registry_mirror = "http://${local.docker_mirror_static_ip}:5000"
37-
# docker_registry_mirror_node_exporter_url = "http://${local.docker_mirror_static_ip}:9999"
38-
use_firecracker = true
30+
vpc_id = module.networking.vpc_id
31+
subnet_id = module.networking.subnet_id
32+
resource_prefix = "codeintel-prod"
33+
instance_tag = "codeintel-prod"
34+
sourcegraph_external_url = local.sourcegraph_external_url
35+
sourcegraph_executor_proxy_password = local.executor_sourcegraph_executor_proxy_password
36+
queue_name = "codeintel"
37+
metrics_environment_label = "prod"
38+
docker_registry_mirror = "http://${local.docker_mirror_static_ip}:5000"
39+
# docker_registry_mirror_node_exporter_url = "http://${local.docker_mirror_static_ip}:9999"
40+
use_firecracker = true
3941
}
4042

4143
module "executors-batches" {
4244
source = "sourcegraph/executors/aws//modules/executors"
4345
version = "3.43.0" # LATEST
4446

45-
vpc_id = module.networking.vpc_id
46-
subnet_id = module.networking.subnet_id
47-
resource_prefix = "batches-prod"
48-
instance_tag = "batches-prod"
49-
sourcegraph_external_url = "https://sourcegraph.acme.com"
50-
sourcegraph_executor_proxy_password = "hunter2"
51-
queue_name = "batches"
52-
metrics_environment_label = "prod"
53-
docker_registry_mirror = "http://${local.docker_mirror_static_ip}:5000"
54-
# docker_registry_mirror_node_exporter_url = "http://${local.docker_mirror_static_ip}:9999"
55-
use_firecracker = true
47+
vpc_id = module.networking.vpc_id
48+
subnet_id = module.networking.subnet_id
49+
resource_prefix = "batches-prod"
50+
instance_tag = "batches-prod"
51+
sourcegraph_external_url = local.sourcegraph_external_url
52+
sourcegraph_executor_proxy_password = local.executor_sourcegraph_executor_proxy_password
53+
queue_name = "batches"
54+
metrics_environment_label = "prod"
55+
docker_registry_mirror = "http://${local.docker_mirror_static_ip}:5000"
56+
# docker_registry_mirror_node_exporter_url = "http://${local.docker_mirror_static_ip}:9999"
57+
use_firecracker = true
58+
need_syslogs = false
5659
}

examples/single-executor/main.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
locals {
2-
region = "us-west-2"
3-
availability_zone = "us-west-2a"
2+
region = "us-east-2"
3+
availability_zone = "us-east-2a"
44
}
55

66
module "executors" {
7-
source = "sourcegraph/executors/aws"
8-
version = "3.43.0" # LATEST
7+
source = "../../"
98

109
availability_zone = local.availability_zone
1110
executor_instance_tag = "codeintel-prod"
12-
executor_sourcegraph_external_url = "https://sourcegraph.acme.com"
13-
executor_sourcegraph_executor_proxy_password = "hunter2"
11+
executor_sourcegraph_external_url = "https://sg.sre.bbln.dev"
12+
executor_sourcegraph_executor_proxy_password = "hJGwHr-3T-MDFcnD2XP6-a8G9cdHCk"
1413
executor_queue_name = "codeintel"
1514
executor_metrics_environment_label = "prod"
1615
executor_use_firecracker = true

modules/executors/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ resource "aws_security_group" "metrics_access" {
7373

7474
resource "aws_cloudwatch_log_group" "syslogs" {
7575
# TODO: This is hardcoded in the executor image.
76+
count = var.need_syslogs ? 1 : 0
7677
name = "executors"
7778
retention_in_days = 7
7879
}

modules/executors/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,9 @@ variable "assign_public_ip" {
188188
default = true
189189
description = "If false, no public IP will be associated with the executors."
190190
}
191+
192+
variable "need_syslogs" {
193+
type = bool
194+
default = true
195+
description = "For multi-executor only 1 of these needs to be made."
196+
}

0 commit comments

Comments
 (0)