Skip to content

Commit ef2ca60

Browse files
authored
ci: fix Windows, EKS, batch naming, and test reliability (#1839)
1 parent 0fceba6 commit ef2ca60

22 files changed

Lines changed: 323 additions & 161 deletions

File tree

.github/workflows/CI.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# NTP fix trigger

cdk_infra/lib/config/cluster-config/clusters.yml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,127 +4,127 @@ clusters:
44
- name: collector-ci-arm64-1-29
55
version: "1.29"
66
launch_type: ec2
7-
instance_type: m6g.large
7+
instance_type: m6g.xlarge
88
- name: collector-ci-amd64-1-29
99
version: "1.29"
1010
launch_type: ec2
11-
instance_type: "m5.large"
11+
instance_type: "m5.xlarge"
1212
- name: collector-ci-fargate-1-29
1313
version: "1.29"
1414
launch_type: fargate
1515
- name: collector-ci-arm64-1-30
1616
version: "1.30"
1717
launch_type: ec2
18-
instance_type: m6g.large
18+
instance_type: m6g.xlarge
1919
- name: collector-ci-amd64-1-30
2020
version: "1.30"
2121
launch_type: ec2
22-
instance_type: "m5.large"
22+
instance_type: "m5.xlarge"
2323
- name: collector-ci-fargate-1-30
2424
version: "1.30"
2525
launch_type: fargate
2626
- name: collector-ci-arm64-1-31
2727
version: "1.31"
2828
launch_type: ec2
29-
instance_type: m6g.large
29+
instance_type: m6g.xlarge
3030
- name: collector-ci-amd64-1-31
3131
version: "1.31"
3232
launch_type: ec2
33-
instance_type: "m5.large"
33+
instance_type: "m5.xlarge"
3434
- name: collector-ci-fargate-1-31
3535
version: "1.31"
3636
launch_type: fargate
3737
- name: collector-ci-arm64-1-32
3838
version: "1.32"
3939
launch_type: ec2
40-
instance_type: m6g.large
40+
instance_type: m6g.xlarge
4141
- name: collector-ci-amd64-1-32
4242
version: "1.32"
4343
launch_type: ec2
44-
instance_type: "m5.large"
44+
instance_type: "m5.xlarge"
4545
- name: collector-ci-fargate-1-32
4646
version: "1.32"
4747
launch_type: fargate
4848
- name: collector-ci-arm64-1-33
4949
version: "1.33"
5050
launch_type: ec2
51-
instance_type: m6g.large
51+
instance_type: m6g.xlarge
5252
- name: collector-ci-amd64-1-33
5353
version: "1.33"
5454
launch_type: ec2
55-
instance_type: "m5.large"
55+
instance_type: "m5.xlarge"
5656
- name: collector-ci-fargate-1-33
5757
version: "1.33"
5858
launch_type: fargate
5959
- name: collector-ci-arm64-1-34
6060
version: "1.34"
6161
launch_type: ec2
62-
instance_type: m6g.large
62+
instance_type: m6g.xlarge
6363
- name: collector-ci-amd64-1-34
6464
version: "1.34"
6565
launch_type: ec2
66-
instance_type: "m5.large"
66+
instance_type: "m5.xlarge"
6767
- name: collector-ci-fargate-1-34
6868
version: "1.34"
6969
launch_type: fargate
7070
# operator test clusters
7171
- name: operator-ci-amd64-1-29
7272
version: "1.29"
7373
launch_type: ec2
74-
instance_type: m5.large
74+
instance_type: m5.xlarge
7575
cert_manager: true
7676
- name: operator-ci-arm64-1-29
7777
version: "1.29"
7878
launch_type: ec2
79-
instance_type: m6g.large
79+
instance_type: m6g.xlarge
8080
cert_manager: true
8181
- name: operator-ci-amd64-1-30
8282
version: "1.30"
8383
launch_type: ec2
84-
instance_type: m5.large
84+
instance_type: m5.xlarge
8585
cert_manager: true
8686
- name: operator-ci-arm64-1-30
8787
version: "1.30"
8888
launch_type: ec2
89-
instance_type: m6g.large
89+
instance_type: m6g.xlarge
9090
cert_manager: true
9191
- name: operator-ci-amd64-1-31
9292
version: "1.31"
9393
launch_type: ec2
94-
instance_type: m5.large
94+
instance_type: m5.xlarge
9595
cert_manager: true
9696
- name: operator-ci-arm64-1-31
9797
version: "1.31"
9898
launch_type: ec2
99-
instance_type: m6g.large
99+
instance_type: m6g.xlarge
100100
cert_manager: true
101101
- name: operator-ci-amd64-1-32
102102
version: "1.32"
103103
launch_type: ec2
104-
instance_type: m5.large
104+
instance_type: m5.xlarge
105105
cert_manager: true
106106
- name: operator-ci-arm64-1-32
107107
version: "1.32"
108108
launch_type: ec2
109-
instance_type: m6g.large
109+
instance_type: m6g.xlarge
110110
cert_manager: true
111111
- name: operator-ci-amd64-1-33
112112
version: "1.33"
113113
launch_type: ec2
114-
instance_type: m5.large
114+
instance_type: m5.xlarge
115115
cert_manager: true
116116
- name: operator-ci-arm64-1-33
117117
version: "1.33"
118118
launch_type: ec2
119-
instance_type: m6g.large
119+
instance_type: m6g.xlarge
120120
cert_manager: true
121121
- name: operator-ci-amd64-1-34
122122
version: "1.34"
123123
launch_type: ec2
124-
instance_type: m5.large
124+
instance_type: m5.xlarge
125125
cert_manager: true
126126
- name: operator-ci-arm64-1-34
127127
version: "1.34"
128128
launch_type: ec2
129-
instance_type: m6g.large
129+
instance_type: m6g.xlarge
130130
cert_manager: true

cdk_infra/lib/stacks/eks/ec2-cluster-stack.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ export class EC2Stack extends Stack {
6969
instanceTypes: props.instanceTypes,
7070
cluster: this.cluster,
7171
minSize: 2,
72+
maxSize: 4,
73+
desiredSize: 3,
7274
subnets: { subnetType: ec2.SubnetType.PUBLIC },
7375
launchTemplateSpec: {
7476
id: lt.launchTemplateId as string,

terraform/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ postBatchClean:
2222

2323
.PHONY: checkCacheHits
2424
checkCacheHits:
25-
cat test-case-batch | xargs -L1 -P1 ./checkCacheHit.sh
25+
cat test-case-batch | xargs -L1 -P10 ./checkCacheHit.sh
2626

2727
.PHONY: terraformCleanup
2828
terraformCleanup: test-case-batch

terraform/basic_components/main.tf

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ module "common" {
2323
locals {
2424
otconfig_path = fileexists("${var.testcase}/otconfig.tpl") ? "${var.testcase}/otconfig.tpl" : module.common.default_otconfig_path
2525

26-
subnet_ids_list = data.aws_subnets.aoc_public_subnet_ids.ids
26+
subnet_ids_list = data.aws_subnets.aoc_instance_subnet_ids.ids
2727

2828
subnet_ids_random_index = random_id.subnetSelector.dec % length(local.subnet_ids_list)
2929

@@ -61,7 +61,7 @@ data "aws_subnets" "aoc_private_subnet_ids" {
6161
}
6262
}
6363

64-
# return public subnets
64+
# return public subnets (one per AZ — used for ALBs/ECS which require exactly one subnet per AZ)
6565
data "aws_subnets" "aoc_public_subnet_ids" {
6666
filter {
6767
name = "vpc-id"
@@ -77,6 +77,22 @@ data "aws_subnets" "aoc_public_subnet_ids" {
7777
}
7878
}
7979

80+
# return /23 public subnets for EC2 instance placement (more IPs, avoids ALB conflicts)
81+
data "aws_subnets" "aoc_instance_subnet_ids" {
82+
filter {
83+
name = "vpc-id"
84+
values = [data.aws_vpc.aoc_vpc.id]
85+
}
86+
filter {
87+
name = "tag:Name"
88+
values = [
89+
"${module.common.aoc_vpc_name}-public-${var.region}a-2",
90+
"${module.common.aoc_vpc_name}-public-${var.region}b-2",
91+
"${module.common.aoc_vpc_name}-public-${var.region}c-2",
92+
]
93+
}
94+
}
95+
8096
resource "random_id" "subnetSelector" {
8197
byte_length = 2
8298
}

terraform/basic_components/outputs.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ output "otconfig_content" {
3838
}
3939

4040
output "mocked_server_cert_content" {
41-
value = local.mocked_server_cert_rendered_template
41+
value = local.mocked_server_cert_rendered_template
42+
sensitive = true
4243
}
4344

4445
output "sample_app_image_repo" {

terraform/common.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,13 @@ variable "aoc_vpc_name" {
7474

7575
variable "aoc_vpc_security_group" {
7676
default = "aoc-vpc-security-group"
77+
}
78+
79+
variable "runner_sg_id" {
80+
default = ""
81+
}
82+
83+
variable "runner_ip" {
84+
description = "CIDR of the CI runner (e.g. 1.2.3.4/32) for WinRM/SSH access"
85+
default = ""
7786
}

terraform/data_aoc_msk/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
output "cluster_data" {
22
description = "Cluster data for the MSK Cluster as return by aws_msk_cluster terraform data moduel + the topic name that the testcase should use"
3-
value = merge(local.cluster_data, { topic = local.topic })
3+
value = merge(local.cluster_data, { topic = local.topic, kafka_version = var.cluster_version })
44
}

terraform/ec2/amis.tf

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,17 @@ variable "ami_family" {
4949
instance_type = "c5a.large"
5050
otconfig_destination = "C:\\ot-default.yml"
5151
download_command_pattern = "powershell -command \"Invoke-WebRequest -Uri %s -OutFile C:\\aws-otel-collector.msi\""
52-
install_command = "msiexec /i C:\\aws-otel-collector.msi"
53-
start_command = "$url = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('CONFIGURATION_URI_PLACEHOLDER'))\n. 'C:\\Program Files\\Amazon\\AwsOtelCollector\\aws-otel-collector-ctl.ps1' -ConfigLocation $url -FeatureGates 'FEATUREGATE_PLACEHOLDER' -Action start"
52+
install_command = "msiexec /i C:\\aws-otel-collector.msi /qn /norestart"
53+
start_command = "powershell -Command \"$url = [System.Text.Encoding]::ASCII.GetString([System.Convert]::FromBase64String('CONFIGURATION_URI_PLACEHOLDER')); & 'C:\\Program Files\\Amazon\\AwsOtelCollector\\aws-otel-collector-ctl.ps1' -ConfigLocation $url -FeatureGates 'FEATUREGATE_PLACEHOLDER' -Action start; Start-Sleep -Seconds 15\""
5454
status_command = "powershell \"& 'C:\\Program Files\\Amazon\\AwsOtelCollector\\aws-otel-collector-ctl.ps1' -Action status\""
5555
ssm_validate = "powershell \"& 'C:\\Program Files\\Amazon\\AwsOtelCollector\\aws-otel-collector-ctl.ps1' -Action status\" | findstr running"
5656
connection_type = "winrm"
5757
user_data = <<EOF
5858
<powershell>
59-
winrm quickconfig -q
60-
winrm set winrm/config/winrs '@{MaxShellsPerUser="100"}'
61-
winrm set winrm/config/winrs '@{MaxConcurrentUsers="30"}'
62-
winrm set winrm/config/winrs '@{MaxProcessesPerShell="100"}'
63-
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'
64-
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
65-
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
66-
winrm set winrm/config/service/auth '@{Basic="true"}'
67-
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
68-
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow
69-
net stop winrm
70-
sc.exe config winrm start=auto
71-
net start winrm
72-
Set-NetFirewallProfile -Profile Public -Enabled False
59+
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False
7360
</powershell>
7461
EOF
75-
wait_cloud_init = " "
62+
wait_cloud_init = "powershell -Command \"w32tm /resync /force; $i=0; while($i -lt 30) { $o = w32tm /stripchart /computer:169.254.169.123 /samples:1 /dataonly 2>&1; if($o -match '[+-]\\d+\\.\\d+s' -and [math]::Abs([double]($Matches[0] -replace 's','')) -lt 5) { break }; Start-Sleep 2; $i++ }; Write-Host 'Clock synced'\""
7663
}
7764
}
7865
}

0 commit comments

Comments
 (0)