Skip to content

Commit c5ec54b

Browse files
steelhead31sxa
andauthored
Vagrant: Update Windows Checks ( GHA & VPC ) To Include Windows 2025 Support (#4061)
* VPC: Add Windows 2025 Support * VPC: Add Test Debug * Debug * VPC: Fix grep for identifying windows JDK to test * Vagrant: Up Performance Of Windows Vagrant Boxes * Vagrant: Bump Windows VM Specs For Stability * VPC: Add Ability For Test JDK to run version specific tests Test * Update ansible/pbTestScripts/vagrantPlaybookCheck.sh Co-authored-by: Stewart X Addison <[email protected]> --------- Co-authored-by: Stewart X Addison <[email protected]>
1 parent a5397cd commit c5ec54b

File tree

9 files changed

+188
-68
lines changed

9 files changed

+188
-68
lines changed

.github/workflows/build_wsl.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ jobs:
2525
strategy:
2626
fail-fast: false
2727
matrix:
28-
os: [windows-2019, windows-2022]
28+
os: [windows-2022, windows-2025]
29+
include:
30+
- os: windows-2022
31+
skip_tags: "adoptopenjdk,jenkins,MSVS_2013,reboot"
32+
- os: windows-2025
33+
# 2025 runners already have VS 2022 & 2019 redists so skip them on win2025
34+
skip_tags: "adoptopenjdk,jenkins,MSVS_2013,MSVS_2019,MSVS_2022,reboot"
2935
name: Windows
3036
runs-on: ${{ matrix.os }}
3137
steps:
@@ -80,4 +86,5 @@ jobs:
8086
run: |
8187
export ANSIBLE_CONFIG=./ansible.cfg
8288
# Skip MSVS_2013 until https://github.com/adoptium/infrastructure/issues/2178 is fixed
83-
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win --extra-vars 'git_sha=${{ github.sha }}' -b --skip-tags adoptopenjdk,jenkins,MSVS_2013,reboot playbooks/AdoptOpenJDK_Windows_Playbook/main.yml
89+
# Windows 2025 runner already has MSVS_2022 installed so will be skipped in the playbook execution.
90+
ansible-playbook -i playbooks/AdoptOpenJDK_Windows_Playbook/hosts.win --extra-vars 'git_sha=${{ github.sha }}' -b --skip-tags "${{ matrix.skip_tags }}" playbooks/AdoptOpenJDK_Windows_Playbook/main.yml

ansible/pbTestScripts/testJDKWin.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,8 @@ rm -rf /cygdrive/c/tmp/*-jre
99
rm -rf /cygdrive/c/tmp/*-test-image
1010

1111
#Identify The JDK
12-
1312
# Set Test JDK HOME To The Relocated JDK
14-
# export TEST_JDK_HOME=C:/cygwin64$(find ~ -maxdepth 1 -type d -name "*jdk*"|grep -v ".*jre"| grep -v ".*-image")
15-
export TEST_JDK_HOME=`ls -d c:/tmp/jdk*|grep -v "static"|grep -v "debug"|grep -v "jre"|grep -v "test-image"|grep -v "jmods"`
13+
export TEST_JDK_HOME=`ls -d c:/tmp/jdk*|grep -v "static"|grep -v "debug"|grep -v "jre"|grep -v "test-image"|grep -v "jmods"|grep '[+b]'`
1614
echo TEST_JDK_HOME=$TEST_JDK_HOME
1715

1816
## Run The Same Tests As Test JDK for Linux
@@ -47,5 +45,6 @@ make _jdk_math_0
4745

4846
# Run Some Additional Tests To Test The Playbooks Have Run Properly
4947
export BUILD_LIST=functional
48+
make compile
5049
make _MBCS_Tests_pref_ja_windows_0
5150
make _MBCS_Tests_formatter_ja_windows_0

ansible/pbTestScripts/vagrantPlaybookCheck.sh

Lines changed: 61 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -134,50 +134,57 @@ checkVars()
134134
echo "Can't find vagrant-rsync-back plugin, installing . . ."
135135
vagrant plugin install vagrant-rsync-back
136136
fi
137-
if [[ "$fastMode" == true ]]; then
138-
skipFullSetup=",nvidia_cuda_toolkit"
139-
case "$jdkToBuild" in
140-
"jdk8" )
141-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2019";
142-
if [ "$buildHotspot" != "" ]; then
143-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2019"
144-
fi
145-
;;
146-
"jdk11" )
147-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2019";
148-
if [ "$buildHotspot" != "" ]; then
149-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2019"
150-
fi
151-
;;
152-
"jdk17" )
153-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017";
154-
if [ "$buildHotspot" != "" ]; then
155-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017"
156-
fi
157-
;;
158-
"jdk21" )
159-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
160-
if [ "$buildHotspot" != "" ]; then
161-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
162-
fi
163-
;;
164-
"jdk22" )
165-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
166-
if [ "$buildHotspot" != "" ]; then
167-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
168-
fi
169-
;;
170-
"jdk" )
171-
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
172-
if [ "$buildHotspot" != "" ]; then
173-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
137+
138+
if [[ "$fastMode" == true ]]; then
139+
skipFullSetup=",nvidia_cuda_toolkit"
140+
case "$jdkToBuild" in
141+
"jdk8" )
142+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2019";
143+
if [ "$buildHotspot" != "" ]; then
144+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2019"
145+
fi
146+
;;
147+
"jdk11" )
148+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2019";
149+
if [ "$buildHotspot" != "" ]; then
150+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2019"
151+
fi
152+
;;
153+
"jdk17" )
154+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017";
155+
if [ "$buildHotspot" != "" ]; then
156+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017"
157+
fi
158+
;;
159+
"jdk21" )
160+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
161+
if [ "$buildHotspot" != "" ]; then
162+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
163+
fi
164+
;;
165+
"jdk22" )
166+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
167+
if [ "$buildHotspot" != "" ]; then
168+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
169+
fi
170+
;;
171+
"jdk25" )
172+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
173+
if [ "$buildHotspot" != "" ]; then
174+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
175+
fi
176+
;;
177+
"jdk" )
178+
skipFullSetup="$skipFullSetup,MSVS_2013,MSVS_2017,MSVS_2019";
179+
if [ "$buildHotspot" != "" ]; then
180+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1,MSVS_2013,MSVS_2017,MSVS_2019"
181+
fi
182+
;;
183+
*)
184+
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1";;
185+
esac
174186
fi
175-
;;
176-
*)
177-
skipFullSetup="$skipFullSetup,MSVS_2010,VS2010_SP1";;
178-
esac
179-
fi
180-
jdkToBuild="--version $jdkToBuild"
187+
jdkToBuild="--version $jdkToBuild"
181188
}
182189

183190
checkVagrantOS()
@@ -358,7 +365,7 @@ startVMPlaybookWin()
358365
cd $WORKSPACE/adoptopenjdkPBTests/${gitFork}-${newGitBranch}/ansible
359366

360367
if [ "$newVagrantFiles" = "true" ]; then
361-
if [[ "$useAdopt" == "true" ]] && [[ "$OS" == "Win2022" ]]; then
368+
if [[ "$useAdopt" == "true" ]] && [[ "$OS" == "Win2022" || "$OS" == "Win2025" ]]; then
362369
echo "Use Adoptium Box For Win2022"
363370
ln -sf vagrant/Vagrantfile.$OS.Adopt Vagrantfile
364371
else
@@ -465,14 +472,13 @@ startVMPlaybookWin()
465472
# Run a python script to start a test for the built JDK on the Windows VM
466473
if [[ $PYTHON_VERSION == *"Python 2."* ]]; then
467474
echo "Python 2 detected"
468-
python pbTestScripts/startScriptWin.py -i "127.0.0.1:$vagrantPort" -t 2>&1 | tee $testLogPath
475+
python pbTestScripts/startScriptWin.py -i "127.0.0.1:$vagrantPort" -a "$jdkToBuild" -t 2>&1 | tee $testLogPath
469476
elif [[ $PYTHON_VERSION == *"Python 3."* ]]; then
470477
echo "Python 3 detected"
471-
#echo "Due To Changes In Python 3 - No Output Will Be Displayed Until The Build Is Completed"
472-
#python pbTestScripts/startScriptWin_v2.py -i "127.0.0.1:$vagrantPort" -t 2>&1 | tee $testLogPath
473-
# Create Powershell Script To Launch Tests
474-
echo "& sh \"C:/vagrant/pbTestScripts/testJDKWin.sh\"" > testJDK_Tmp.ps1
475-
# Copy PowerShell Script From Vagrant Share For Performance Reasons & Launch
478+
echo "Due To Changes In Python 3 - No Output Will Be Displayed Until The Build Is Completed so use PowerShell instead"
479+
# Create Powershell Script To Launch Build
480+
echo "Set-Location -Path \"C:/tmp\"" > testJDK_Tmp.ps1
481+
echo "& sh \"C:/vagrant/pbTestScripts/testJDKWin.sh\" $jdkToBuild" >> testJDK_Tmp.ps1
476482
vagrant winrm -s powershell -e -c 'copy c:/vagrant/testJDK_Tmp.ps1 c:/tmp; cd c:/tmp; pwd; ls'
477483
vagrant winrm -e -c 'powershell -ExecutionPolicy Bypass -File c:/tmp/testJDK_Tmp.ps1' | tee $testLogPath
478484
else
@@ -528,10 +534,12 @@ echo "Testing on the following OSs: $vagrantOS"
528534
for OS in $vagrantOS
529535
do
530536
echo OS = $vagrantOS
531-
if [[ "$OS" == "Win2012" || "$OS" == "Win2022" ]] ; then
532-
startVMPlaybookWin $OS
537+
echo "OS : $OS"
538+
539+
if [[ "$OS" == "Win2012" || "$OS" == "Win2022" || "$OS" == "Win2025" ]]; then
540+
startVMPlaybookWin "$OS"
533541
else
534-
startVMPlaybook $OS
542+
startVMPlaybook "$OS"
535543
fi
536544
if [[ "$vmHalt" == true ]]; then
537545
vagrant halt

ansible/vagrant/Vagrantfile.Win2012

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Start-Process powershell -Verb runAs
1111
# Windows 2012r2 needs to be forced to use TLS1.2, see: https://github.com/adoptium/infrastructure/issues/1858
1212
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
1313
14-
wget https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
14+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
1515
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
1616
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
1717
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert

ansible/vagrant/Vagrantfile.Win2022

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $script = <<SCRIPT
99
Start-Process powershell -Verb runAs
1010
1111
12-
wget https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
12+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
1313
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
1414
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
1515
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
@@ -46,9 +46,9 @@ Vagrant.configure("2") do |config|
4646
end
4747
config.vm.provider "virtualbox" do |v|
4848
v.gui = false
49-
v.memory = 8192
50-
v.cpus = 2
51-
v.customize ["modifyvm", :id, "--cpuexecutioncap", "50"]
49+
v.memory = 9126
50+
v.cpus = 3
51+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "65"]
5252
end
5353
config.vm.boot_timeout = 600
5454
end

ansible/vagrant/Vagrantfile.Win2022.Adopt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$script = <<SCRIPT
99
Start-Process powershell -Verb runAs
1010
11-
wget https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
11+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
1212
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
1313
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
1414
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
@@ -45,9 +45,9 @@ Vagrant.configure("2") do |config|
4545
end
4646
config.vm.provider "virtualbox" do |v|
4747
v.gui = false
48-
v.memory = 8192
49-
v.cpus = 2
50-
v.customize ["modifyvm", :id, "--cpuexecutioncap", "60"]
48+
v.memory = 9126
49+
v.cpus = 3
50+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "65"]
5151
end
5252
config.vm.boot_timeout = 600
5353
end
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Runs Powershell as an administator and does the following:
5+
# - Gets/executes an Ansible provided script that configures WinRM to allow Ansible to communicate over it.
6+
# - Resizes the disk to ~100GB, in line with the 'disksize.size = 100GB' option in the config below
7+
8+
$script = <<SCRIPT
9+
Start-Process powershell -Verb runAs
10+
11+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
12+
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
13+
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
14+
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
15+
.\\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck
16+
17+
# Retrieving disk's current size
18+
$currentDiskSize =(Get-Partition -DriveLetter c | select Size)
19+
$currentDiskSize =($currentDiskSize -replace "[^0-9]" , "")
20+
# The size the disk should be, in bytes (130GB)
21+
$diskSizeBoundary = 139586437120
22+
# Changing the disksize to max supported size (~130GB)
23+
if ([long]$currentDiskSize -lt $diskSizeBoundary) {
24+
echo "Resizing disk to max size"
25+
$size = (Get-PartitionSupportedSize -DriveLetter c); Resize-Partition -DriveLetter c -Size $size.SizeMax
26+
}else {
27+
echo "Disk is already at max size"
28+
}
29+
30+
Start-Process cmd -Verb runAs
31+
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
32+
SCRIPT
33+
34+
# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
35+
Vagrant.configure("2") do |config|
36+
37+
config.vm.define :adoptopenjdkW2025 do |adoptopenjdkW2025|
38+
adoptopenjdkW2025.vm.box = "gusztavvargadr/windows-server-2025-standard"
39+
adoptopenjdkW2025.vm.hostname = "adoptopenjdkW2025"
40+
adoptopenjdkW2025.vm.communicator = "winrm"
41+
adoptopenjdkW2025.vm.synced_folder ".", "/vagrant"
42+
adoptopenjdkW2025.vm.network :private_network, type: "dhcp"
43+
adoptopenjdkW2025.vm.provision "shell", inline: $script, privileged: false
44+
adoptopenjdkW2025.disksize.size = '130GB'
45+
end
46+
config.vm.provider "virtualbox" do |v|
47+
v.gui = false
48+
v.memory = 9126
49+
v.cpus = 3
50+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "65"]
51+
end
52+
config.vm.boot_timeout = 800
53+
end
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# -*- mode: ruby -*-
2+
# vi: set ft=ruby :
3+
4+
# Runs Powershell as an administator and does the following:
5+
# - Gets/executes an Ansible provided script that configures WinRM to allow Ansible to communicate over it.
6+
# - Resizes the disk to ~100GB, in line with the 'disksize.size = 100GB' option in the config below
7+
8+
$script = <<SCRIPT
9+
Start-Process powershell -Verb runAs
10+
11+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
12+
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
13+
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
14+
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert
15+
.\\ConfigureRemotingForAnsible.ps1 -SkipNetworkProfileCheck
16+
17+
# Retrieving disk's current size
18+
$currentDiskSize =(Get-Partition -DriveLetter c | select Size)
19+
$currentDiskSize =($currentDiskSize -replace "[^0-9]" , "")
20+
# The size the disk should be, in bytes (130GB)
21+
$diskSizeBoundary = 139586437120
22+
# Changing the disksize to max supported size (~130GB)
23+
if ([long]$currentDiskSize -lt $diskSizeBoundary) {
24+
echo "Resizing disk to max size"
25+
$size = (Get-PartitionSupportedSize -DriveLetter c); Resize-Partition -DriveLetter c -Size $size.SizeMax
26+
}else {
27+
echo "Disk is already at max size"
28+
}
29+
30+
Start-Process cmd -Verb runAs
31+
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
32+
SCRIPT
33+
34+
# 2 = version of configuration file for Vagrant 1.1+ leading up to 2.0.x
35+
Vagrant.configure("2") do |config|
36+
37+
config.vm.define :adoptopenjdkW2025 do |adoptopenjdkW2025|
38+
adoptopenjdkW2025.vm.box = "adoptium/windows2025"
39+
adoptopenjdkW2025.vm.hostname = "adoptopenjdkW2025"
40+
adoptopenjdkW2025.vm.communicator = "winrm"
41+
adoptopenjdkW2025.vm.synced_folder ".", "/vagrant"
42+
adoptopenjdkW2025.vm.network :private_network, type: "dhcp"
43+
adoptopenjdkW2025.vm.provision "shell", inline: $script, privileged: false
44+
adoptopenjdkW2025.disksize.size = '131GB'
45+
end
46+
config.vm.provider "virtualbox" do |v|
47+
v.gui = false
48+
v.memory = 9126
49+
v.cpus = 3
50+
v.customize ["modifyvm", :id, "--cpuexecutioncap", "65"]
51+
end
52+
config.vm.boot_timeout = 800
53+
end

ansible/vagrant/Vagrantfile.Windows2022.Core

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ $script = <<SCRIPT
99
Start-Process powershell -Verb runAs
1010
1111
12-
wget https://raw.githubusercontent.com/ansible/ansible-documentation/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
12+
wget https://raw.githubusercontent.com/ansible/ansible/38e50c9f819a045ea4d40068f83e78adbfaf2e68/examples/scripts/ConfigureRemotingForAnsible.ps1 -OutFile .\\ConfigureRemotingForAnsible.ps1
1313
.\\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999
1414
.\\ConfigureRemotingForAnsible.ps1 -EnableCredSSP
1515
.\\ConfigureRemotingForAnsible.ps1 -ForceNewSSLCert

0 commit comments

Comments
 (0)