Skip to content

Commit aeea697

Browse files
author
Adelina Tuvenie
committed
Add WS2022 support in Windows Periodic tests
Some extra steps were added for WS2022 in accordance with the published image on Azure: - Install Container Feature & reboot VM - Create NAT network Temporarily we skip critest steps for WS2022 until all test images are updated in that project. Signed-off-by: Adelina Tuvenie <[email protected]>
1 parent e00f87f commit aeea697

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

.github/workflows/windows-periodic.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
winIntegration:
2121
strategy:
2222
matrix:
23-
win_ver: [ltsc2019, sac2004]
23+
win_ver: [ltsc2019, sac2004, ltsc2022]
2424
include:
2525
- win_ver: sac2004
2626
AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:datacenter-core-2004-with-containers-smalldisk:19041.928.2104150521"
@@ -30,6 +30,10 @@ jobs:
3030
AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2019-Datacenter-with-Containers-smalldisk:17763.1935.2105080716"
3131
AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2019-${{ github.run_id }}
3232
GOOGLE_BUCKET: "gs://containerd-integration/logs/windows-ltsc2019/"
33+
- win_ver: ltsc2022
34+
AZURE_IMG: "MicrosoftWindowsServer:WindowsServer:2022-datacenter-smalldisk-g2:20348.169.2108120020"
35+
AZURE_RESOURCE_GROUP: ctrd-integration-ltsc2022-${{ github.run_id }}
36+
GOOGLE_BUCKET: "gs://containerd-integration/logs/windows-ltsc2022/"
3337
runs-on: ubuntu-latest
3438
steps:
3539
- uses: actions/checkout@v2
@@ -94,6 +98,29 @@ jobs:
9498
exit 1
9599
fi
96100
101+
- name: InstallContainerFeatureWS2022
102+
if: ${{ matrix.win_ver == 'ltsc2022' }}
103+
run: |
104+
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { Install-WindowsFeature -Name 'Containers' -Restart }"
105+
106+
- name: WaitForVMToRestart
107+
if: ${{ matrix.win_ver == 'ltsc2022' }}
108+
timeout-minutes: 5
109+
run: |
110+
# give the vm 30 seconds to actually stop. SSH server might actually respond while server is shutting down.
111+
sleep 30
112+
while [ ! $( ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "hostname") ];
113+
do
114+
echo "Unable to connect to azurevm"
115+
done
116+
echo "Connection reestablished. VM restarted succesfully."
117+
118+
- name: CreateNatNetworkWS2022
119+
if: ${{ matrix.win_ver == 'ltsc2022' }}
120+
run: |
121+
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { curl.exe -L 'https://raw.githubusercontent.com/microsoft/SDN/master/Kubernetes/windows/hns.psm1' -o hns.psm1 }"
122+
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { Import-Module .\hns.psm1 ; New-HnsNetwork -Type NAT -Name nat -AddressPrefix 172.19.208.0/20 -Gateway 172.19.208.1 }"
123+
97124
- name: PrepareTestingEnv
98125
run: |
99126
scp -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} $GITHUB_WORKSPACE/script/setup/prepare_env_windows.ps1 azureuser@${{ env.VM_PUB_IP }}:/prepare_env_windows.ps1
@@ -120,7 +147,8 @@ jobs:
120147
- name: PrepareRepoList
121148
run: |
122149
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh -c 'cat > c:/repolist.toml'" <<'EOF'
123-
busybox = "docker.io/claudiubelu/busybox:1.29"
150+
busybox = "k8s.gcr.io/e2e-test-images/busybox:1.29-2"
151+
ResourceConsumer = "k8s.gcr.io/e2e-test-images/resource-consumer:1.10"
124152
EOF
125153
126154
- name: RunCRIIntegrationTests
@@ -135,14 +163,17 @@ jobs:
135163
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cat /c/Logs/cri-integration.log | go-junit-report.exe > c:/Logs/junit_01.xml' "
136164
137165
- name: GetCritestRepo
166+
if: ${{ matrix.win_ver != 'ltsc2022' }}
138167
run: |
139168
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "git clone https://github.com/kubernetes-sigs/cri-tools c:/cri-tools"
140169
141170
- name: BuildCritest
171+
if: ${{ matrix.win_ver != 'ltsc2022' }}
142172
run: |
143173
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cd /c/cri-tools && make critest'"
144174
145175
- name: RunCritest
176+
if: ${{ matrix.win_ver != 'ltsc2022' }}
146177
run: |
147178
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "powershell.exe -command { Start-Process -FilePath C:\containerd\bin\containerd.exe -NoNewWindow -RedirectStandardError true -PassThru ; get-process | sls containerd ; start-sleep 5 ; c:\cri-tools\build\bin\critest.exe --runtime-endpoint=\"npipe:\\\\.\\pipe\\containerd-containerd\" --report-dir='c:\Logs' }"
148179

0 commit comments

Comments
 (0)