forked from microsoft/windows-container-networking
-
Notifications
You must be signed in to change notification settings - Fork 0
206 lines (178 loc) · 7.7 KB
/
containerd-integration.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# This workflow sets up Containerd with all supported plugins and runs the CRI
# integration suite on all supported Windows version.
name: Containerd Integration
on:
workflow_dispatch:
# When added to a merge queue.
# See https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-a-merge-queue#triggering-merge-group-checks-with-github-actions
merge_group:
pull_request:
branches: ['main', 'release/**']
env:
GO_VERSION: "1.21.1"
CNI_BASE_DIR: "C:\\Program Files\\containerd\\cni"
CONTAINERD_REPO: "containerd/containerd"
CONTAINERD_TAG: "1.7"
CRICTL_REPO: "kubernetes-sigs/cri-tools"
CRICTL_TAG: "v1.26.0"
permissions:
contents: read
jobs:
integration:
strategy:
fail-fast: false
matrix:
os: [windows-2019, windows-2022]
plugin: [nat, sdnbridge, sdnoverlay]
runs-on: "${{ matrix.os }}"
defaults:
run:
shell: bash
working-directory: src/github.com/microsoft/windows-container-networking
steps:
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: false
- name: Checkout Containerd
uses: actions/checkout@v3
with:
repository: "${{ env.CONTAINERD_REPO }}"
path: src/github.com/containerd/containerd
- name: Checkout Plugins
uses: actions/checkout@v3
with:
path: src/github.com/microsoft/windows-container-networking
- name: Checkout CRI Tools
uses: actions/checkout@v3
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/microsoft/windows-container-networking/out" >> $GITHUB_PATH
echo "${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools/build/bin/windows/amd64" >> $GITHUB_PATH
- name: Install Containerd Prereqs
run: script/setup/install-dev-tools
working-directory: src/github.com/containerd/containerd
# NOTE(aznashwan): starting with Golang 1.21, the windows-2019 GitHub runner's
# builtin MinGW version leads to DLL loading errors during runtime.
- name: Upgrade MinGW on Windows 2019
if: matrix.os == 'windows-2019'
run: |
choco upgrade mingw --version=12.2.0.3042023
- name: Containerd Binaries
env:
CGO_ENABLED: 1
run: mingw32-make.exe binaries
working-directory: src/github.com/containerd/containerd
- name: CRI Binaries
env:
CGO_ENABLED: 1
run: |
mingw32-make.exe critest
mingw32-make.exe crictl
working-directory: src/github.com/kubernetes-sigs/cri-tools
- name: Plugin Binaries
env:
CGO_ENABLED: 1
run: |
mingw32-make.exe '${{ matrix.plugin }}'
mkdir -p "${{ env.CNI_BASE_DIR }}\\bin"
# HACK(aznashwan): currently the plugins blindly pass the 'type' field to HCN:
case "${{ matrix.plugin }}" in
'sdnbridge')
install -D -m 755 "out/${{ matrix.plugin }}.exe" "${{ env.CNI_BASE_DIR }}\\bin\\L2Bridge.exe"
;;
'sdnoverlay')
install -D -m 755 "out/${{ matrix.plugin }}.exe" "${{ env.CNI_BASE_DIR }}\\bin\\Overlay.exe"
;;
'nat')
install -D -m 755 "out/${{ matrix.plugin }}.exe" "${{ env.CNI_BASE_DIR }}\\bin\\nat.exe"
;;
*)
echo "Unknown plugin: '${{ matrix.plugin }}'"
exit 1
;;
esac
- name: Define Test Image Config
env:
TEST_IMAGE_LIST: ${{ github.workspace }}/repolist.toml
CRI_TEST_IMAGES: ${{ github.workspace }}/cri-test-images.yaml
BUSYBOX_TESTING_IMAGE_REF: "registry.k8s.io/e2e-test-images/busybox:1.29-2"
RESOURCE_CONSUMER_TESTING_IMAGE_REF: "registry.k8s.io/e2e-test-images/resource-consumer:1.10"
WEBSERVER_TESTING_IMAGE_REF: "registry.k8s.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: Install Containerd Testing Prereqs
run: |
script/setup/install-gotestsum
script/setup/install-teststat
working-directory: src/github.com/containerd/containerd
# - name: Contained Unit Tests
# env:
# CGO_ENABLED: 1
# GOTESTSUM_JUNITFILE: ${{github.workspace}}/test-unit-root.xml
# GOTESTSUM_JSONFILE: ${{github.workspace}}/test-unit-root-gotest.json
# run: mingw32-make.exe test root-test
# - run: if [ -f *-gotest.json ]; then echo '# Root Test' >> $GITHUB_STEP_SUMMARY; teststat -markdown *-gotest.json >> $GITHUB_STEP_SUMMARY; fi
# if: always()
# - run: script/test/test2annotation.sh ${TESTFILE}
# env:
# TESTFILE: ${{github.workspace}}/test-unit-root-gotest.json
# if: always()
- name: Generate Testing CNI Config
shell: powershell
run: |
scripts/test/generateTestCniConf.ps1 -Type '${{ matrix.plugin }}' -OutDir '${{ env.CNI_BASE_DIR }}\\conf' -EnsureOutDirEmpty $true -HostInterfaceNamePattern '*Ethernet*'
- name: Containerd Integration Tests
env:
CGO_ENABLED: 1
GOTESTSUM_JUNITFILE: ${{github.workspace}}/test-integration-serial-junit.xml
GOTESTSUM_JSONFILE: ${{github.workspace}}/test-integration-serial-gotest.json
EXTRA_TESTFLAGS: "-timeout=20m"
run: |
mingw32-make.exe integration
# script/test/test2annotation.sh ${GOTESTSUM_JSONFILE}
working-directory: src/github.com/containerd/containerd
- name: Containerd CRI Integration Test
env:
DISABLE_CRI_SANDBOXES: ${{ matrix.disable_cri_sandboxes }}
TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml
run: |
mingw32-make.exe cri-integration
working-directory: src/github.com/containerd/containerd
- name: CRI Test Suite
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
# This test is exceedingly flaky only on ws2022 so skip for now to keep CI happy.
# Info: https://github.com/containerd/containerd/issues/6652
if( '${{ matrix.os }}' -eq 'windows-2022' )
{
$skip = "-ginkgo.skip=runtime should support exec with tty=true and stdin=true"
}
critest.exe --runtime-endpoint=npipe://.//pipe//containerd-containerd --test-images-file='${{env.CRI_TEST_IMAGES}}' --report-dir='${{github.workspace}}/critestreport' $skip
- uses: actions/upload-artifact@v3
if: always()
with:
name: TestResults ${{ matrix.os }}
path: |
${{github.workspace}}/*-junit.xml
${{github.workspace}}/*-gotest.json
${{github.workspace}}/critestreport/*.log