Skip to content

Commit

Permalink
Parametrize CRITest test images in Windows Periodic workflow.
Browse files Browse the repository at this point in the history
This patch makes the Windows Periodic workflow pass specific test images
to CRITest. This will allow full control over the container images used
in workflow runs as opposed to relying on the hardcoded defaults in
`cri-tools` to be compatible with all the tested Windows releases.

Depends-On: kubernetes-sigs/cri-tools#855

Signed-off-by: Nashwan Azhari <[email protected]>
  • Loading branch information
aznashwan committed Dec 13, 2021
1 parent 1d446f7 commit 8bdf1fc
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/windows-periodic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ env:
DEFAULT_ADMIN_USERNAME: azureuser
SSH_OPTS: "-o ServerAliveInterval=20 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
REMOTE_VM_BIN_PATH: "c:\\containerd\\bin"
BUSYBOX_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/busybox:1.29-2"
RESOURCE_CONSUMER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/resource-consumer:1.10"
WEBSERVER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/nginx:1.14-2"


jobs:
winIntegration:
Expand Down Expand Up @@ -147,12 +151,15 @@ jobs:
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cd /c/containerd && (make integration | tee /c/Logs/integration.log)'"
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -c 'cat /c/Logs/integration.log | go-junit-report.exe > /c/Logs/junit_00.xml'"
# CRI-integration tests for Windows PR is not merged. TO DO (adelina-t): enable these when PR #5163 merges.
- name: PrepareRepoList
run: |
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh -c 'cat > c:/repolist.toml'" <<'EOF'
busybox = "k8s.gcr.io/e2e-test-images/busybox:1.29-2"
ResourceConsumer = "k8s.gcr.io/e2e-test-images/resource-consumer:1.10"
busybox = ${{ env.BUSYBOX_TESTING_IMAGE_REF }}
ResourceConsumer = ${{ env.RESOURCE_CONSUMER_TESTING_IMAGE_REF }}
EOF
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh -c 'cat > c:/cri-test-images.yaml'" <<'EOF'
DefaultTestContainerImage: ${{ env.BUSYBOX_TESTING_IMAGE_REF }}
WebServerTestImage: ${{ env.WEBSERVER_TESTING_IMAGE_REF }}
EOF
- name: RunCRIIntegrationTests
Expand All @@ -177,9 +184,18 @@ jobs:
- name: RunCritest
run: |
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' }"
ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -s" <<EOF
cd c:/containerd
./script/setup/install-cni-windows
mkdir /c/tmp
export TEST_IMAGE_LIST=c:/repolist.toml
export CONTAINERD_ROOT=/c/ProgramData/containerd/root
make cri-integration | tee c:/Logs/cri-integration.log
EOF
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\" --test-images-file='c:\cri-test-images.yaml' --report-dir='c:\Logs' }"
- name: PullLogsFromWinNode

run: |
scp -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }}:c:/Logs/*.xml ${{ env.LOGS_DIR }}/artifacts/
for f in $(ls ${{ env.LOGS_DIR }}/artifacts/*.xml); do
Expand Down

0 comments on commit 8bdf1fc

Please sign in to comment.