Skip to content

Commit 3cee8db

Browse files
committed
windows-2025 and other updates
1 parent b7b530b commit 3cee8db

18 files changed

+837
-26
lines changed

examples/multi-runner-cppal/templates/runner-configs/ubuntu-jammy.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runner_config:
2929
scale_down_schedule_expression: cron(* * * * ? *)
3030
# userdata_template: ./templates/user-data.sh
3131
ami_owners: [ "047402373783" ]
32-
ami_filter: { 'name': ['github-runner-ubuntu-jammy-amd64-202411261305']}
32+
ami_filter: { 'name': ['github-runner-ubuntu-jammy-amd64-202411261305'] }
3333
block_device_mappings:
3434
- device_name: /dev/sda1
3535
delete_on_termination: true

examples/multi-runner-cppal/templates/runner-configs/windows-2019.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runner_config:
2323
scale_down_schedule_expression: cron(* * * * ? *)
2424
runner_boot_time_in_minutes: 20
2525
ami_owners: [ "047402373783" ]
26-
ami_filter: { 'name': ['github-runner-windows-2019-amd64-202411261305'] }
26+
ami_filter: { 'name': ['github-runner-windows-2019-amd64-202503111933'] }
2727
block_device_mappings:
2828
- device_name: /dev/sda1
2929
delete_on_termination: true

examples/multi-runner-cppal/templates/runner-configs/windows-2022.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ runner_config:
2424
scale_down_schedule_expression: cron(* * * * ? *)
2525
runner_boot_time_in_minutes: 20
2626
ami_owners: [ "047402373783" ]
27-
ami_filter: { 'name': ['github-runner-windows-2022-amd64-202411261305'] }
27+
ami_filter: { 'name': ['github-runner-windows-2022-amd64-202503112051'] }
2828
block_device_mappings:
2929
- device_name: /dev/sda1
3030
delete_on_termination: true
3131
volume_type: gp3
32-
volume_size: 100
32+
volume_size: 110
3333
encrypted: true
3434
iops: null
3535
throughput: null
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
matcherConfig:
2+
exactMatch: true
3+
labelMatchers:
4+
- [self-hosted, windows, x64, windows-2025-aws]
5+
fifo: true
6+
runner_config:
7+
create_service_linked_role_spot: true
8+
enable_ephemeral_runners: true
9+
instance_target_capacity_type: "on-demand"
10+
enable_userdata: false
11+
runner_os: windows
12+
runner_run_as: Administrator
13+
runner_architecture: x64
14+
runner_extra_labels: "windows-2025-aws"
15+
runner_name_prefix: windows-2025-x64_
16+
enable_ssm_on_runners: true
17+
credit_specification: standard
18+
instance_types:
19+
- m5.xlarge
20+
- c5.xlarge
21+
runners_maximum_count: 100
22+
delay_webhook_event: 0
23+
scale_down_schedule_expression: cron(* * * * ? *)
24+
runner_boot_time_in_minutes: 20
25+
ami_owners: [ "047402373783" ]
26+
ami_filter: { 'name': ['github-runner-windows-2025-amd64-202503112051'] }
27+
block_device_mappings:
28+
- device_name: /dev/sda1
29+
delete_on_termination: true
30+
volume_type: gp3
31+
volume_size: 110
32+
encrypted: true
33+
iops: null
34+
throughput: null
35+
kms_key_id: null
36+
snapshot_id: null
37+
runner_log_files:
38+
- log_group_name: user_data
39+
prefix_log_group: true
40+
file_path: "C:\\ProgramData\\Amazon\\EC2Launch\\log\\agent.log*"
41+
log_stream_name: "{instance_id}/user_data"

images/windows-2019-cppal/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@
5656
}
5757
],
5858
"last_run_uuid": "9b83e34b-a8ab-fcd4-5d9b-b2213e165d46"
59-
}
59+
}

images/windows-2019-cppal/variables.auto.pkrvars.hcl

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ custom_shell_commands = [
1717
"cd C:\\",
1818
"# already installed: powershell -Command iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))",
1919
"choco feature enable -n allowGlobalConfirmation",
20+
"choco feature disable --name='ignoreInvalidOptionsSwitches'",
2021
"choco install -y visualstudio2017buildtools --version 15.9.18.0",
2122
"choco install -y 7zip.install --version 19.0",
2223
"choco install -y chocolatey --version 0.12.1",
@@ -67,7 +68,7 @@ custom_shell_commands = [
6768
"choco install -y python --version 3.8.3",
6869
"New-Item -ItemType SymbolicLink -Path \"C:\\Git\" -Target \"C:\\Program Files\\Git\"",
6970
"# Adding visualstudio2019",
70-
"choco install visualstudio2019-workload-vctools --package-parameters \"--add Microsoft.VisualStudio.Component.VC.140\" \"--add Microsoft.VisualStudio.Component.VC.14.29.x86.x64\" -y",
71+
"choco install visualstudio2019-workload-vctools --package-parameters '--add Microsoft.VisualStudio.Component.VC.14.29.x86.x64 --add Microsoft.VisualStudio.Component.VC.140' -y",
7172
"$${oldpath} = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name PATH).path",
7273
"$${newpath} = \"C:\\Git\\usr\\bin;$${oldpath}\"",
7374
"Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name PATH -Value $${newPath}",

images/windows-2022-cppal/github_agent.windows.pkr.hcl

-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ packer {
77
}
88
}
99

10-
aws_polling {
11-
delay_seconds = 60
12-
max_attempts = 120
13-
}
14-
1510
variable "ssh_keypair_name" {
1611
description = "SSH keypair name"
1712
type = string

images/windows-2022-cppal/variables.auto.pkrvars.hcl

+6-5
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,24 @@ region = "us-west-2"
99
instance_type = "m5a.xlarge"
1010
# 2024-09 size was 70. Add 10 for the jobs, and 10 for the pagefile.
1111
# then another 10 for the pagefile.
12-
root_volume_size_gb = 100
12+
root_volume_size_gb = 110
1313
ssh_keypair_name = "cppalliance-us-west-2-kp"
1414
ssh_private_key_file = "/root/.ssh/cppalliance-us-west-2-kp.pem"
1515

1616
custom_shell_commands = [
1717
"Set-PSDebug -Trace 1",
1818
"cd C:\\",
1919
"choco feature enable -n allowGlobalConfirmation",
20+
"choco feature disable --name='ignoreInvalidOptionsSwitches'",
2021
"# if --version is mentioned, the version has been checked, and the package installed",
2122
"# automatic",
2223
"# choco install -y visualstudio2017buildtools --version 15.9.54.0",
2324
"# Installing visualstudio2019 on the same image as 2022. Recommended to install in chronological order",
2425
"# Note 2023-08-17: visualstudio2019buildtools and visualstudio2019-workload-vctools no longer appear to be compatible",
2526
"# with visualstudio2022buildtools and visualstudio2019-workload-vctools. Warnings and errors. Commenting out:",
2627
"# choco install -y visualstudio2019buildtools",
27-
"# choco install visualstudio2019-workload-vctools --package-parameters \"--add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.v141.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.140\" -y ",
28-
"choco install -y visualstudio2022buildtools --parameters \"--add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.CMake.Project\"",
28+
"# choco install visualstudio2019-workload-vctools --package-parameters '--add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140' -y",
29+
"choco install -y visualstudio2022buildtools --parameters '--add Microsoft.VisualStudio.Component.VC.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Llvm.Clang --add Microsoft.VisualStudio.Component.VC.CMake.Project'",
2930
"choco install -y 7zip.install --version 22.1",
3031
"# automatic",
3132
"# choco install -y chocolatey --version 1.31",
@@ -85,8 +86,8 @@ custom_shell_commands = [
8586
"Start-Sleep -Seconds 10",
8687
" # This should be rewritten with fewer quotes, group all together.",
8788
"# one previous version",
88-
"# choco upgrade visualstudio2022-workload-vctools --package-parameters \"--add Microsoft.VisualStudio.Component.VC.14.34.17.4.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.v141.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.140\" -y ",
89-
"choco upgrade visualstudio2022-workload-vctools --package-parameters \"--add Microsoft.VisualStudio.Component.VC.14.41.17.11.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.v141.x86.x64\" \"--add Microsoft.VisualStudio.Component.VC.140\" -y ",
89+
"# choco upgrade visualstudio2022-workload-vctools --package-parameters '--add Microsoft.VisualStudio.Component.VC.14.34.17.4.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140' -y",
90+
"choco upgrade visualstudio2022-workload-vctools --package-parameters '--add Microsoft.VisualStudio.Component.VC.14.41.17.11.x86.x64 --add Microsoft.VisualStudio.Component.VC.14.29.16.11.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140' -y",
9091
"$${oldpath} = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name PATH).path",
9192
"$${newpath} = \"C:\\Git\\usr\\bin;$${oldpath}\"",
9293
"Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Session Manager\\Environment' -Name PATH -Value $${newPath}",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<powershell>
2+
3+
Write-Output "Running User Data Script"
4+
Write-Host "(host) Running User Data Script"
5+
6+
Set-ExecutionPolicy Unrestricted -Scope LocalMachine -Force -ErrorAction Ignore
7+
8+
# Don't set this before Set-ExecutionPolicy as it throws an error
9+
$ErrorActionPreference = "stop"
10+
11+
# Remove HTTP listener
12+
Remove-Item -Path WSMan:\Localhost\listener\listener* -Recurse
13+
14+
# Create a self-signed certificate to let ssl work
15+
$Cert = New-SelfSignedCertificate -CertstoreLocation Cert:\LocalMachine\My -DnsName "packer"
16+
New-Item -Path WSMan:\LocalHost\Listener -Transport HTTPS -Address * -CertificateThumbPrint $Cert.Thumbprint -Force
17+
18+
# WinRM
19+
Write-Output "Setting up WinRM"
20+
Write-Host "(host) setting up WinRM"
21+
22+
# I'm not really sure why we need the cmd.exe wrapper, but it works with it and doesn't work without it
23+
cmd.exe /c winrm quickconfig -q
24+
cmd.exe /c winrm set "winrm/config" '@{MaxTimeoutms="1800000"}'
25+
cmd.exe /c winrm set "winrm/config/winrs" '@{MaxMemoryPerShellMB="1024"}'
26+
cmd.exe /c winrm set "winrm/config/service" '@{AllowUnencrypted="true"}'
27+
cmd.exe /c winrm set "winrm/config/client" '@{AllowUnencrypted="true"}'
28+
cmd.exe /c winrm set "winrm/config/service/auth" '@{Basic="true"}'
29+
cmd.exe /c winrm set "winrm/config/client/auth" '@{Basic="true"}'
30+
cmd.exe /c winrm set "winrm/config/service/auth" '@{CredSSP="true"}'
31+
cmd.exe /c winrm set "winrm/config/listener?Address=*+Transport=HTTPS" "@{Port=`"5986`";Hostname=`"packer`";CertificateThumbprint=`"$($Cert.Thumbprint)`"}"
32+
cmd.exe /c netsh advfirewall firewall set rule group="remote administration" new enable=yes
33+
cmd.exe /c netsh firewall add portopening TCP 5986 "Port 5986"
34+
cmd.exe /c net stop winrm
35+
cmd.exe /c sc config winrm start= auto
36+
cmd.exe /c net start winrm
37+
</powershell>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
ssh_keypair_name = "tagr-us-west-2"
3+
ssh_private_key_file = "/home/sam/work/cppalliance/aws/boost.v2.account/tagr-us-west-2.pem"
4+
disable_docker_registry = true

0 commit comments

Comments
 (0)