From 5b78a9a8f1390d9efa7510473b968aa6d363de21 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Thu, 3 Mar 2022 04:55:22 +1100 Subject: [PATCH 1/4] Remove hardcoded /tmp in tempfile paths There's no specific need mentioned at the points it was added, and it makes the Windows-hosted test run setup slightly weird. Signed-off-by: Paul "TBBle" Hampson --- .github/workflows/windows-periodic.yml | 1 - integration/addition_gids_test.go | 2 +- integration/container_log_test.go | 4 ++-- integration/pod_dualstack_test.go | 2 +- integration/pod_hostname_test.go | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows-periodic.yml b/.github/workflows/windows-periodic.yml index af872a2d6..d5084ed41 100644 --- a/.github/workflows/windows-periodic.yml +++ b/.github/workflows/windows-periodic.yml @@ -183,7 +183,6 @@ jobs: ssh -i $HOME/.ssh/id_rsa ${{ env.SSH_OPTS }} azureuser@${{ env.VM_PUB_IP }} "sh.exe -s" < Date: Wed, 2 Mar 2022 22:54:05 +1100 Subject: [PATCH 2/4] Enable CRI Integration tests on Windows Signed-off-by: Paul "TBBle" Hampson --- .github/workflows/ci.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a776fed4..46d02ccdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,7 @@ jobs: integration-windows: name: Windows Integration runs-on: ${{ matrix.os }} - timeout-minutes: 35 + timeout-minutes: 50 needs: [project, linters, protos, man] env: GOTEST: gotestsum -- @@ -280,6 +280,25 @@ jobs: git checkout "${SHIM_COMMIT}" GO111MODULE=on go build -mod=vendor -o "${bindir}/integration/client/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 + - run: script/setup/install-cni-windows + + - env: + TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml + 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" + run: | + cat > "${{ env.TEST_IMAGE_LIST }}" << EOF + busybox = "${{ env.BUSYBOX_TESTING_IMAGE_REF }}" + ResourceConsumer = "${{ env.RESOURCE_CONSUMER_TESTING_IMAGE_REF }}" + EOF + + - name: Set env for prepare_env_windows.ps1 + shell: bash + run: echo "HOME=${USERPROFILE}" >> $GITHUB_ENV + + - shell: powershell + run: script/setup/prepare_env_windows.ps1 + - run: script/setup/install-gotestsum - name: Tests env: @@ -301,6 +320,12 @@ jobs: CGO_ENABLED: 1 GOTESTSUM_JUNITFILE: ${{github.workspace}}/test-integration-parallel-junit.xml run: mingw32-make.exe integration + + - name: CRI Integration Test + env: + TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml + run: | + make cri-integration - uses: actions/upload-artifact@v2 if: always() with: From 768bf73dd1a3d1c727aa3f72c2aa381f38bc9da4 Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 6 Mar 2022 14:14:22 +1100 Subject: [PATCH 3/4] Enable cri-tools critest on Windows Signed-off-by: Paul "TBBle" Hampson --- .github/workflows/ci.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46d02ccdb..46cc0c35b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,7 @@ jobs: integration-windows: name: Windows Integration runs-on: ${{ matrix.os }} - timeout-minutes: 50 + timeout-minutes: 55 needs: [project, linters, protos, man] env: GOTEST: gotestsum -- @@ -259,11 +259,17 @@ jobs: repository: Microsoft/hcsshim path: src/github.com/Microsoft/hcsshim + - uses: actions/checkout@v2 + with: + repository: kubernetes-sigs/cri-tools + path: src/github.com/kubernetes-sigs/cri-tools + - name: Set env run: | echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV echo "${{ github.workspace }}/bin" >> $GITHUB_PATH echo "${{ github.workspace }}/src/github.com/containerd/containerd/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools/build/bin" >> $GITHUB_PATH - run: script/setup/install-dev-tools @@ -279,18 +285,26 @@ jobs: git fetch --tags origin "${SHIM_COMMIT}" git checkout "${SHIM_COMMIT}" GO111MODULE=on go build -mod=vendor -o "${bindir}/integration/client/containerd-shim-runhcs-v1.exe" ./cmd/containerd-shim-runhcs-v1 + cd ../../kubernetes-sigs/cri-tools + make critest - run: script/setup/install-cni-windows - env: TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml + CRI_TEST_IMAGES: ${{github.workspace}}/cri-test-images.yaml 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" run: | cat > "${{ env.TEST_IMAGE_LIST }}" << EOF busybox = "${{ env.BUSYBOX_TESTING_IMAGE_REF }}" ResourceConsumer = "${{ env.RESOURCE_CONSUMER_TESTING_IMAGE_REF }}" EOF + cat > "${{ env.CRI_TEST_IMAGES }}" << EOF + defaultTestContainerImage: ${{ env.BUSYBOX_TESTING_IMAGE_REF }} + webServerTestImage: ${{ env.WEBSERVER_TESTING_IMAGE_REF }} + EOF - name: Set env for prepare_env_windows.ps1 shell: bash @@ -326,6 +340,16 @@ jobs: TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml run: | make cri-integration + + - name: cri-tools critest + env: + CRI_TEST_IMAGES: ${{github.workspace}}/cri-test-images.yaml + shell: powershell + run: | + Start-Process -FilePath containerd.exe -NoNewWindow -RedirectStandardError true -PassThru + get-process | sls containerd + start-sleep 5 + critest.exe --runtime-endpoint=npipe://.//pipe//containerd-containerd --test-images-file='${{env.CRI_TEST_IMAGES}}' --report-dir='${{github.workspace}}/critestreport' - uses: actions/upload-artifact@v2 if: always() with: From 48b478381e92c9f6a13b1f587cd00d77f598210e Mon Sep 17 00:00:00 2001 From: "Paul \"TBBle\" Hampson" Date: Sun, 6 Mar 2022 15:51:40 +1100 Subject: [PATCH 4/4] Skip most of script/setup/prepare_env_windows.ps1 Apart from crictl and go-junit-report, this script is just making the remote test VMs look like GitHub Actions VMs, i.e. git, make-mingw32, golang. And we don't use go-junit-report, so we can save a lot of time (about five minutes) by just extracting the interesting part. Signed-off-by: Paul "TBBle" Hampson --- .github/workflows/ci.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46cc0c35b..8e2b005e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -230,7 +230,7 @@ jobs: integration-windows: name: Windows Integration runs-on: ${{ matrix.os }} - timeout-minutes: 55 + timeout-minutes: 50 needs: [project, linters, protos, man] env: GOTEST: gotestsum -- @@ -306,12 +306,14 @@ jobs: webServerTestImage: ${{ env.WEBSERVER_TESTING_IMAGE_REF }} EOF - - name: Set env for prepare_env_windows.ps1 - shell: bash - run: echo "HOME=${USERPROFILE}" >> $GITHUB_ENV - - - shell: powershell - run: script/setup/prepare_env_windows.ps1 + - name: Get crictl tool + shell: powershell + run: | + # Get critctl tool. Used for cri-integration tests + $CRICTL_DOWNLOAD_URL="https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.21.0/crictl-v1.21.0-windows-amd64.tar.gz" + curl.exe -L $CRICTL_DOWNLOAD_URL -o c:\crictl.tar.gz + tar -xvf c:\crictl.tar.gz + mv crictl.exe "${{ github.workspace }}/bin/crictl.exe" # Move crictl somewhere in path - run: script/setup/install-gotestsum - name: Tests