Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update windows scripts to use components.json instead of having versions hard coded in a script #5619

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e639dd7
don't need this comment anymore
timmy-wright Jan 21, 2025
d317336
migrate containers to components.json
timmy-wright Jan 21, 2025
2852af9
fix components.cue
timmy-wright Jan 21, 2025
c0215fa
start testing powershell function to extract components that need to …
timmy-wright Jan 21, 2025
af0f0cd
add test for parsing components.json
timmy-wright Jan 21, 2025
c8e935a
first attempt to use component.json to get the list of containers to …
timmy-wright Jan 21, 2025
5f35d82
Merge remote-tracking branch 'origin/master' into timmy/windows-compo…
timmy-wright Jan 22, 2025
c6e6abd
move files around
timmy-wright Jan 22, 2025
60ecb6a
source the right file
timmy-wright Jan 22, 2025
525935a
new location
timmy-wright Jan 22, 2025
c884aa4
copy windows-vhd-configuration.ps1
timmy-wright Jan 22, 2025
e32118c
try different path
timmy-wright Jan 22, 2025
20dd0be
paths
timmy-wright Jan 22, 2025
7bb69fe
fix path
timmy-wright Jan 22, 2025
fb39856
source helper functions
timmy-wright Jan 22, 2025
a006c98
fix version tag for iis
timmy-wright Jan 22, 2025
ad58f83
move windows build scripts to subdir
timmy-wright Jan 23, 2025
4264d5c
fix ciprod windows component
timmy-wright Jan 23, 2025
4297d2b
make components.json and helpers file be stored in env vars
timmy-wright Jan 23, 2025
4d8261f
more logging
timmy-wright Jan 23, 2025
db844c5
fix env setting
timmy-wright Jan 23, 2025
4bc0308
reorder
timmy-wright Jan 23, 2025
a1c5e74
clean up file paths - use defaults
timmy-wright Jan 23, 2025
5ef3134
quote
timmy-wright Jan 23, 2025
8a16535
default with fallback
timmy-wright Jan 23, 2025
d473d6b
make sure new tests file is tested
timmy-wright Jan 23, 2025
401f919
add list of images that will be pulled
timmy-wright Jan 23, 2025
b7c5c7a
print list of images that will be pulled
timmy-wright Jan 23, 2025
1c85a10
Merge remote-tracking branch 'origin/master' into timmy/windows-compo…
timmy-wright Jan 23, 2025
67ea29b
Merge remote-tracking branch 'origin/master' into timmy/windows-compo…
timmy-wright Jan 23, 2025
7b3d25e
fix colon
timmy-wright Jan 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/validate-windows-binary-signature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
paths:
- '.github/workflows/validate-windows-binary-signature.yaml'
- 'vhdbuilder/packer/test/windows-files-check.ps1'
- 'vhdbuilder/packer/generate-windows-vhd-configuration.ps1'
- '../../vhdbuilder/packer/windows'
- 'parts/linux/cloud-init/artifacts/components.json'

jobs:
check-files-for-ws2019:
Expand All @@ -13,10 +14,6 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Geneate windows vhd configuration
shell: powershell
run: |
./vhdbuilder/packer/generate-windows-vhd-configuration.ps1
- name: Run check script for 2019-containerd
shell: powershell
run: |
Expand All @@ -27,10 +24,6 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Geneate windows vhd configuration
shell: powershell
run: |
./vhdbuilder/packer/generate-windows-vhd-configuration.ps1
- name: Run check script for 2022-containerd
shell: powershell
run: |
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/validate-windows-ut.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
shell: powershell
run: |
Invoke-Pester parts/windows/*.tests.ps1 -Passthru
- name: Perform a Pester test from the vhdbuilder/packer/windows/*.tests.ps1 file
shell: powershell
run: |
Invoke-Pester vhdbuilder/packer/windows/*.tests.ps1 -Passthru
- name: Perform a Pester test from the staging/cse/windows/*.tests.ps1 file
shell: powershell
run: |
Expand Down
3 changes: 1 addition & 2 deletions .pipelines/.vsts-vhd-builder-release-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ pr:
- vhdbuilder/packer/convert-sig-to-classic-storage-account-blob.sh
- vhdbuilder/packer/generate-vhd-publishing-info.sh
- vhdbuilder/packer/init-variables.sh
- vhdbuilder/packer/windows-image.env
- vhdbuilder/packer/windows-vhd-builder-sig.json
- vhdbuilder/packer/windows/
exclude:
- vhdbuilder/release-notes
- /**/*.md
Expand Down
2 changes: 1 addition & 1 deletion packer.mk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ else
@echo "${MODE}: Building with Hyper-v generation 2 VM and save to Shared Image Gallery"
endif
endif
@packer build -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/windows-vhd-builder-sig.json
@packer build -var-file=vhdbuilder/packer/settings.json vhdbuilder/packer/windows/windows-vhd-builder-sig.json
endif

az-login:
Expand Down
143 changes: 141 additions & 2 deletions parts/linux/cloud-init/artifacts/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@
"latestVersion": "1.8.22",
"previousLatestVersion": "1.8.20"
}
],
"windowsVersions": []
},
{
"downloadURL": "mcr.microsoft.com/windows/servercore/iis:*",
"amd64OnlyVersions": [],
"multiArchVersionsV2": [],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=windows/servercore/iis",
"latestVersion": "latest"
}
]
},
{
Expand All @@ -19,6 +31,12 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/pause",
"latestVersion": "3.6"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/pause",
"latestVersion": "3.9"
}
]
},
{
Expand All @@ -29,7 +47,8 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/coredns",
"latestVersion": "v1.9.4-hotfix.20240704"
}
]
],
"windowsVersions": []
},
{
"downloadURL": "mcr.microsoft.com/oss/v2/kubernetes/coredns:*",
Expand All @@ -43,11 +62,26 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/v2/kubernetes/coredns",
"latestVersion": "v1.9.4-4"
}
]
],
"windowsVersions": []
},
{
"downloadURL": "mcr.microsoft.com/containernetworking/azure-cni:*",
"amd64OnlyVersions": [],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni",
"latestVersion": "v1.4.58"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni",
"latestVersion": "v1.5.38"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni",
"latestVersion": "v1.6.13"
}
],
"multiArchVersionsV2": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cni",
Expand Down Expand Up @@ -93,6 +127,20 @@
{
"downloadURL": "mcr.microsoft.com/containernetworking/azure-cns:*",
"amd64OnlyVersions": [],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cns",
"latestVersion": "v1.4.58"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cns",
"latestVersion": "v1.5.38"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cns",
"latestVersion": "v1.6.13"
}
],
"multiArchVersionsV2": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=containernetworking/azure-cns",
Expand Down Expand Up @@ -229,6 +277,13 @@
"latestVersion": "v1.4.7",
"previousLatestVersion": "v1.4.5"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/secrets-store/driver",
"latestVersion": "v1.4.7",
"previousLatestVersion": "v1.4.5"
}
]
},
{
Expand All @@ -240,6 +295,13 @@
"latestVersion": "v1.6.2",
"previousLatestVersion": "v1.5.3"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/azure/secrets-store/provider-azure",
"latestVersion": "v1.5.3",
"previousLatestVersion": "v1.6.2"
}
]
},
{
Expand All @@ -250,6 +312,12 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=azuremonitor/containerinsights/ciprod",
"latestVersion": "3.1.24"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=azuremonitor/containerinsights/ciprod",
"latestVersion": "win-3.1.24"
}
]
},
{
Expand Down Expand Up @@ -319,6 +387,33 @@
"latestVersion": "v1.31.1",
"previousLatestVersion": "v1.30.0"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/azure-cloud-node-manager",
"latestVersion": "v1.27.21-windows-hpc",
"previousLatestVersion": "v1.27.21"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/azure-cloud-node-manager",
"latestVersion": "v1.28.13-windows-hpc",
"previousLatestVersion": "v1.28.13"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/azure-cloud-node-manager",
"latestVersion": "v1.29.11-windows-hpc",
"previousLatestVersion": "v1.29.11"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/azure-cloud-node-manager",
"latestVersion": "v1.30.7-windows-hpc",
"previousLatestVersion": "v1.30.7"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes/azure-cloud-node-manager",
"latestVersion": "v1.31.1-windows-hpc",
"previousLatestVersion": "v1.30.1"
}
]
},
{
Expand Down Expand Up @@ -360,6 +455,22 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azuredisk-csi",
"latestVersion": "v1.31.2"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azuredisk-csi",
"latestVersion": "v1.29.12",
"previousLatestVersion": "v1.29.10"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azuredisk-csi",
"latestVersion": "v1.30.7",
"previousLatestVersion": "v1.30.5"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azuredisk-csi",
"latestVersion": "v1.31.2"
}
]
},
{
Expand All @@ -380,6 +491,22 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azurefile-csi",
"latestVersion": "v1.31.2"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azurefile-csi",
"latestVersion": "v1.29.10",
"previousLatestVersion": "v1.29.9"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azurefile-csi",
"latestVersion": "v1.30.7",
"previousLatestVersion": "v1.30.6"
},
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/azurefile-csi",
"latestVersion": "v1.31.2"
}
]
},
{
Expand Down Expand Up @@ -410,6 +537,12 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/livenessprobe",
"latestVersion": "v2.14.0"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/livenessprobe",
"latestVersion": "v2.14.0"
}
]
},
{
Expand All @@ -420,6 +553,12 @@
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/csi-node-driver-registrar",
"latestVersion": "v2.12.0"
}
],
"windowsVersions": [
{
"renovateTag": "registry=https://mcr.microsoft.com, name=oss/kubernetes-csi/csi-node-driver-registrar",
"latestVersion": "v2.12.0"
}
]
},
{
Expand Down
8 changes: 8 additions & 0 deletions schemas/components.cue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ package components
downloadURL: string
amd64OnlyVersions: [...string]
multiArchVersionsV2: [...#VersionV2]
windowsVersions: [...#WindowsVersion]
}

#GPUContainerImage: {
downloadURL: string
gpuVersion: #VersionV2
}

#WindowsVersion: {
k8sVersion?: string
renovateTag?: string
latestVersion: string
previousLatestVersion?: string
}

#Images: [...#ContainerImage]
#GPUImages: [...#GPUContainerImage]
#Packages: [...#Package]
Expand Down
2 changes: 1 addition & 1 deletion staging/cse/windows/configfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function Adjust-DynamicPortRange()
# The fix which reduces dynamic port usage is still needed for DSR mode
# Update the range to avoid that it conflicts with NodePort range (30000 - 32767)
if ($global:EnableIncreaseDynamicPortRange) {
# UDP port 65330 is excluded in vhdbuilder/packer/configure-windows-vhd.ps1 since it may fail when it is set in provisioning nodes
# UDP port 65330 is excluded in vhdbuilder/packer/windows/configure-windows-vhd.ps1 since it may fail when it is set in provisioning nodes
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "set", "dynamicportrange", "tcp", "16385", "49151") -ExitCode $global:WINDOWS_CSE_ERROR_SET_TCP_DYNAMIC_PORT_RANGE
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "add", "excludedportrange", "tcp", "30000", "2768") -ExitCode $global:WINDOWS_CSE_ERROR_SET_TCP_EXCLUDE_PORT_RANGE
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "set", "dynamicportrange", "udp", "16385", "49151") -ExitCode $global:WINDOWS_CSE_ERROR_SET_UDP_DYNAMIC_PORT_RANGE
Expand Down
2 changes: 1 addition & 1 deletion vhdbuilder/packer/init-variables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ fi
# shellcheck disable=SC2236
if [ "$OS_TYPE" == "Windows" ]; then
imported_windows_image_name=""
source $CDIR/windows-image.env
source $CDIR/windows/windows-image.env

echo "Set the base image sku and version from windows-image.env"
case "${WINDOWS_SKU}" in
Expand Down
9 changes: 0 additions & 9 deletions vhdbuilder/packer/test/run-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ source ./parts/linux/cloud-init/artifacts/cse_benchmark_functions.sh

PERFORMANCE_DATA_FILE=vhd-build-performance-data.json
LINUX_SCRIPT_PATH="linux-vhd-content-test.sh"
WIN_CONFIGURATION_SCRIPT_PATH="generate-windows-vhd-configuration.ps1"
WIN_SCRIPT_PATH="windows-vhd-content-test.ps1"
TEST_RESOURCE_PREFIX="vhd-test"
TEST_VM_ADMIN_USERNAME="azureuser"
Expand Down Expand Up @@ -151,14 +150,6 @@ if [ "$OS_TYPE" == "Linux" ]; then
exit 1
fi
else
SCRIPT_PATH="$CDIR/../$WIN_CONFIGURATION_SCRIPT_PATH"
echo "Run $SCRIPT_PATH"
az vm run-command invoke --command-id RunPowerShellScript \
--name $VM_NAME \
--resource-group "$TEST_VM_RESOURCE_GROUP_NAME" \
--scripts "@$SCRIPT_PATH" \
--output json

SCRIPT_PATH="$CDIR/$WIN_SCRIPT_PATH"
echo "Run $SCRIPT_PATH"
ret=$(az vm run-command invoke --command-id RunPowerShellScript \
Expand Down
9 changes: 6 additions & 3 deletions vhdbuilder/packer/test/windows-files-check.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ param (
$windowsSKU
)

# We use parameters for test script so we set environment variables before importing c:\windows-vhd-configuration.ps1 to reuse it
# We use parameters for test script so we set environment variables before importing c:\build\windows-vhd-configuration.ps1 to reuse it
$env:WindowsSKU=$windowsSKU

. c:\windows-vhd-configuration.ps1
. vhdbuilder/packer/windows/windows-vhd-configuration.ps1

# We skip the signature validation of following scripts for known issues
# Some scripts in aks-windows-cse-scripts-v0.0.31.zip and aks-windows-cse-scripts-v0.0.32.zip are not signed, and this issue is fixed in aks-windows-cse-scripts-v0.0.33.zip
Expand Down Expand Up @@ -301,7 +301,10 @@ function Test-PullImages {

Write-Output "Test-PullImages."

Write-Output "Pulling images for windows server $windowsSKU" # The variable $windowsSKU will be "2019-containerd", "2022-containerd", ...
Write-Output "Test pulling images for windows server $windowsSKU" # The variable $windowsSKU will be "2019-containerd", "2022-containerd", ...
foreach ($image in $imagesToPull) {
Write-Output "* $image"
}
foreach ($image in $imagesToPull) {
Write-Output "Pulling image $image"
Retry-Command -ScriptBlock {
Expand Down
Loading
Loading