Skip to content

Commit a0ddc7b

Browse files
authored
ci: cns patch testing in release pipeline (#3914)
* ci:cns patch test in release pipeline * skip extra create cluster * fix syntax
1 parent bd7e2ae commit a0ddc7b

File tree

4 files changed

+195
-13
lines changed

4 files changed

+195
-13
lines changed

.pipelines/cni/cilium/cilium-overlay-load-test-template.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ stages:
223223
- job: deploy_pods
224224
condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) )
225225
displayName: "Scale Test"
226-
dependsOn: deploy_cilium_components
226+
dependsOn:
227+
- deploy_cilium_components
228+
- deploy_cns_and_ipam
227229
steps:
228230
- template: ../load-test-templates/pod-deployment-template.yaml
229231
parameters:

.pipelines/cni/pipeline.yaml

Lines changed: 119 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ stages:
210210
osSkuWin: 'Windows2022'
211211
scaleup: ${SCALEUP_WIN}
212212
iterations: ${ITERATIONS_WIN}
213+
upgradeScenario: false
213214

214215
- template: singletenancy/cniv2-template.yaml
215216
parameters:
@@ -226,6 +227,7 @@ stages:
226227
osSkuWin: 'Windows2022'
227228
scaleup: ${SCALEUP_WIN}
228229
iterations: ${ITERATIONS_WIN}
230+
upgradeScenario: false
229231

230232
## Linux E2E
231233
- template: singletenancy/cniv1-template.yaml
@@ -250,6 +252,7 @@ stages:
250252
arch: amd64
251253
scaleup: ${SCALEUP_LINUX}
252254
iterations: ${ITERATIONS_LINUX}
255+
upgradeScenario: false
253256

254257
- template: singletenancy/cniv2-template.yaml
255258
parameters:
@@ -261,6 +264,7 @@ stages:
261264
arch: amd64
262265
scaleup: ${SCALEUP_LINUX}
263266
iterations: ${ITERATIONS_LINUX}
267+
upgradeScenario: false
264268

265269
- template: singletenancy/cniv2-template.yaml
266270
parameters:
@@ -273,6 +277,7 @@ stages:
273277
osSKU: AzureLinux
274278
scaleup: ${SCALEUP_LINUX}
275279
iterations: ${ITERATIONS_LINUX}
280+
upgradeScenario: false
276281

277282
- template: singletenancy/cniv2-template.yaml
278283
parameters:
@@ -284,6 +289,7 @@ stages:
284289
arch: arm64
285290
scaleup: ${SCALEUP_LINUX}
286291
iterations: ${ITERATIONS_LINUX}
292+
upgradeScenario: false
287293

288294
- template: singletenancy/cniv2-template.yaml
289295
parameters:
@@ -295,6 +301,7 @@ stages:
295301
arch: amd64
296302
scaleup: ${SCALEUP_LINUX}
297303
iterations: ${ITERATIONS_LINUX}
304+
upgradeScenario: false
298305

299306
## Cilium E2E
300307
- template: cilium/cilium-overlay-load-test-template.yaml
@@ -404,7 +411,7 @@ stages:
404411
upgradeScenario: false
405412

406413

407-
## If upgradeScenario is set, redeploy new IPAM version to existing clusters and run tests
414+
## If upgradeScenario is set, redeploy new IPAM/CNS version to existing clusters and run tests
408415
- ${{if eq(parameters.upgradeScenario, true)}}:
409416
- template: cilium/cilium-overlay-load-test-template.yaml
410417
parameters:
@@ -520,6 +527,108 @@ stages:
520527
cni: "cilium_dualstack"
521528
upgradeScenario: true
522529
dependsOn: cilium_ds_rdma
530+
531+
- template: singletenancy/cniv2-template.yaml
532+
parameters:
533+
name: linux_podsubnet_upgrade
534+
clusterType: swift-byocni-up
535+
clusterName: "linux-podsub"
536+
nodeCount: ${NODE_COUNT_LINUX}
537+
vmSize: ${VM_SIZE}
538+
arch: amd64
539+
scaleup: ${SCALEUP_LINUX}
540+
iterations: ${ITERATIONS_LINUX}
541+
upgradeScenario: true
542+
dependsOn: linux_podsubnet
543+
544+
- template: singletenancy/cniv2-template.yaml
545+
parameters:
546+
name: linux_overlay_upgrade
547+
clusterType: overlay-byocni-up
548+
clusterName: "linux-over"
549+
nodeCount: ${NODE_COUNT_LINUX}
550+
vmSize: ${VM_SIZE}
551+
arch: amd64
552+
scaleup: ${SCALEUP_LINUX}
553+
iterations: ${ITERATIONS_LINUX}
554+
upgradeScenario: true
555+
dependsOn: linux_overlay
556+
557+
- template: singletenancy/cniv2-template.yaml
558+
parameters:
559+
name: mariner_linux_overlay_upgrade
560+
clusterType: overlay-byocni-up
561+
clusterName: "mariner-over"
562+
nodeCount: ${NODE_COUNT_LINUX}
563+
vmSize: ${VM_SIZE}
564+
arch: amd64
565+
osSKU: AzureLinux
566+
scaleup: ${SCALEUP_LINUX}
567+
iterations: ${ITERATIONS_LINUX}
568+
upgradeScenario: true
569+
dependsOn: mariner_linux_overlay
570+
571+
- template: singletenancy/cniv2-template.yaml
572+
parameters:
573+
name: arm_linux_overlay_upgrade
574+
clusterType: overlay-byocni-up
575+
clusterName: "arm-over"
576+
nodeCount: ${NODE_COUNT_LINUX}
577+
vmSize: Standard_D8ps_v5
578+
arch: arm64
579+
scaleup: ${SCALEUP_LINUX}
580+
iterations: ${ITERATIONS_LINUX}
581+
upgradeScenario: true
582+
dependsOn: arm_linux_overlay
583+
584+
- template: singletenancy/cniv2-template.yaml
585+
parameters:
586+
name: rdma_linux_overlay_upgrade
587+
clusterType: overlay-byocni-up
588+
clusterName: "rdma-over"
589+
nodeCount: 2
590+
vmSize: Standard_HC44-16rs
591+
arch: amd64
592+
scaleup: ${SCALEUP_LINUX}
593+
iterations: ${ITERATIONS_LINUX}
594+
upgradeScenario: true
595+
dependsOn: rdma_linux_overlay
596+
597+
- template: singletenancy/cniv2-template.yaml
598+
parameters:
599+
name: windows_podsubnet_upgrade
600+
clusterType: swift-byocni-up
601+
clusterName: w22-podsub
602+
nodeCount: ${NODE_COUNT_WINCLUSTER_SYSTEMPOOL}
603+
nodeCountWin: ${NODE_COUNT_WIN}
604+
vmSize: ${VM_SIZE_WINCLUSTER_SYSTEMPOOL}
605+
vmSizeWin: ${VM_SIZE_WIN}
606+
arch: amd64
607+
os: windows
608+
os_version: 'ltsc2022'
609+
osSkuWin: 'Windows2022'
610+
scaleup: ${SCALEUP_WIN}
611+
iterations: ${ITERATIONS_WIN}
612+
upgradeScenario: true
613+
dependsOn: windows_podsubnet_HNS
614+
615+
- template: singletenancy/cniv2-template.yaml
616+
parameters:
617+
name: windows_overlay_upgrade
618+
clusterType: overlay-byocni-up
619+
clusterName: w22-over
620+
nodeCount: ${NODE_COUNT_WINCLUSTER_SYSTEMPOOL}
621+
nodeCountWin: ${NODE_COUNT_WIN}
622+
vmSize: ${VM_SIZE_WINCLUSTER_SYSTEMPOOL}
623+
vmSizeWin: ${VM_SIZE_WIN}
624+
arch: amd64
625+
os: windows
626+
os_version: 'ltsc2022'
627+
osSkuWin: 'Windows2022'
628+
scaleup: ${SCALEUP_WIN}
629+
iterations: ${ITERATIONS_WIN}
630+
upgradeScenario: true
631+
dependsOn: windows_overlay_HNS
523632

524633
- stage: delete_resources
525634
displayName: "Delete Resources"
@@ -556,6 +665,15 @@ stages:
556665
- cilium_ds_arm_upgrade
557666
- cilium_ds_mariner_upgrade
558667
- cilium_ds_rdma_upgrade
668+
- linux_podsubnet_upgrade
669+
- linux_overlay_upgrade
670+
- mariner_linux_overlay_upgrade
671+
- arm_linux_overlay_upgrade
672+
- rdma_linux_overlay_upgrade
673+
- windows_podsubnet_upgrade
674+
- windows_overlay_upgrade
675+
- windows_podsubnet_upgrade_HNS
676+
- windows_overlay_upgrade_HNS
559677
variables:
560678
commitID: $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ]
561679
jobs:

.pipelines/cni/singletenancy/cniv2-template.yaml

Lines changed: 69 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ parameters:
1212
iterations: 3
1313
osSKU: Ubuntu
1414
osSkuWin: Windows2022
15+
upgradeScenario: ""
1516

1617
# CNIv2
1718
# + Should be able to scale up/down the pods successfully certain number of times.
@@ -28,7 +29,7 @@ parameters:
2829
# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
2930
# CONTROL_OS either contains 'linux' or 'all' and CONTROL_CNI either contains 'cniv1' or 'all'. Both must be true and are not case sensitive
3031
stages:
31-
- ${{ if eq(parameters.os, 'linux') }}:
32+
- ${{ if and(eq(parameters.os, 'linux'), eq(parameters.upgradeScenario, false)) }}:
3233
- stage: create_${{ parameters.name }}
3334
condition: and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cniv2'), contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'linux'), contains(variables.CONTROL_OS, 'all') ) ) )
3435
variables:
@@ -61,7 +62,7 @@ stages:
6162
# Condition confirms that:
6263
# Previous job has reported Succeeded. Previous job is currently setup which controls variable assignment and we are dependent on its success.
6364
# CONTROL_OS either contains 'windows' or 'all' and CONTROL_CNI either contains 'cniv2' or 'all'. Both must be true and are not case sensitive
64-
- ${{ if eq(parameters.os, 'windows') }}:
65+
- ${{ if and(eq(parameters.os, 'windows'), eq(parameters.upgradeScenario, false)) }}:
6566
- stage: create_${{ parameters.name }}
6667
condition: and( succeeded(), and( or( contains(variables.CONTROL_CNI, 'cniv2'), contains(variables.CONTROL_CNI, 'all') ), or( contains(variables.CONTROL_OS, 'windows'), contains(variables.CONTROL_OS, 'all') ) ) )
6768
variables:
@@ -116,7 +117,12 @@ stages:
116117
pool:
117118
name: $(BUILD_POOL_NAME_DEFAULT)
118119
dependsOn:
119-
- create_${{ parameters.name }}
120+
- ${{ if and(eq(parameters.upgradeScenario, true), ne(parameters.dependsOn, '')) }}:
121+
- ${{ parameters.dependsOn }}
122+
- ${{ if and(eq(parameters.upgradeScenario, false), eq(parameters.os, 'linux')) }}:
123+
- create_${{ parameters.name }}
124+
- ${{ if and(eq(parameters.upgradeScenario, false), eq(parameters.os, 'windows')) }}:
125+
- create_${{ parameters.name }}
120126
- publish
121127
- setup
122128
displayName: "CNIv2 Test - ${{ parameters.name }}"
@@ -136,11 +142,34 @@ stages:
136142
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
137143
kubectl cluster-info
138144
kubectl get po -owide -A
145+
if [ ${{parameters.upgradeScenario}} == "true" ]; then
146+
if [ -z "$UPGRADE_CNS_VERSION" ]
147+
then
148+
echo "UPGRADE_CNS_VERSION is not set, using default value"
149+
CNS=$(make cns-version)
150+
else
151+
CNS=$UPGRADE_CNS_VERSION
152+
echo "UPGRADE_CNS_VERSION is set to $CNS"
153+
fi
154+
IPAM_IMAGE_REPO=$UPGRADE_IPAM_IMAGE_REPO
155+
CNS_IMAGE_REPO=$UPGRADE_CNS_IMAGE_REPO
156+
else
157+
if [ -z "$TEST_CNS_VERSION" ]
158+
then
159+
echo "TEST_CNS_VERSION is not set, using default value"
160+
CNS=$(make cns-version)
161+
else
162+
CNS=$TEST_CNS_VERSION
163+
echo "TEST_CNS_VERSION is set to $CNS"
164+
fi
165+
fi
166+
139167
if [ "${{parameters.os}}" == "windows" ]; then
140-
sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
168+
sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
141169
else
142-
sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
170+
sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
143171
fi
172+
144173
name: "overlaye2e"
145174
displayName: "Overlay Integration"
146175
- ${{ if contains(parameters.clusterType, 'swift') }}:
@@ -155,10 +184,31 @@ stages:
155184
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID)
156185
kubectl cluster-info
157186
kubectl get po -owide -A
187+
if [ ${{parameters.upgradeScenario}} == "true" ]; then
188+
if [ -z "$UPGRADE_CNS_VERSION" ]
189+
then
190+
echo "UPGRADE_CNS_VERSION is not set, using default value"
191+
CNS=$(make cns-version)
192+
else
193+
CNS=$UPGRADE_CNS_VERSION
194+
echo "UPGRADE_CNS_VERSION is set to $CNS"
195+
fi
196+
IPAM_IMAGE_REPO=$UPGRADE_IPAM_IMAGE_REPO
197+
CNS_IMAGE_REPO=$UPGRADE_CNS_IMAGE_REPO
198+
else
199+
if [ -z "$TEST_CNS_VERSION" ]
200+
then
201+
echo "TEST_CNS_VERSION is not set, using default value"
202+
CNS=$(make cns-version)
203+
else
204+
CNS=$TEST_CNS_VERSION
205+
echo "TEST_CNS_VERSION is set to $CNS"
206+
fi
207+
fi
158208
if [ "${{parameters.os}}" == "windows" ]; then
159-
sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
209+
sudo -E env "PATH=$PATH" make test-load CNS_ONLY=true CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
160210
else
161-
sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
211+
sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=${CNS} CNI_VERSION=$(make cni-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
162212
fi
163213
name: "swifte2e"
164214
displayName: "Swift Integration"
@@ -195,6 +245,8 @@ stages:
195245
tag: $(npmVersion)
196246
dependsOn: integration
197247
continueOnError: true
248+
${{ if eq(parameters.upgradeScenario, 'true') }}:
249+
logType: upgradeNpmLogs
198250
- job: deploy_pods
199251
condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) )
200252
displayName: "Scale Test"
@@ -208,6 +260,8 @@ stages:
208260
iterations: ${{ parameters.iterations }}
209261
nodeCount: $(nodeCount)
210262
cni: cniv2
263+
${{ if eq(parameters.upgradeScenario, 'true') }}:
264+
logType: upgradeScaleTest
211265
- template: ../load-test-templates/validate-state-template.yaml
212266
parameters:
213267
clusterName: ${{ parameters.clusterName }}-$(commitID)
@@ -225,6 +279,8 @@ stages:
225279
os: ${{ parameters.os }}
226280
cni: cniv2
227281
region: $(location)
282+
${{ if eq(parameters.upgradeScenario, 'true') }}:
283+
logType: upgradeRestartNode
228284
- template: ../load-test-templates/validate-state-template.yaml
229285
parameters:
230286
clusterName: ${{ parameters.clusterName }}-$(commitID)
@@ -243,6 +299,8 @@ stages:
243299
cni: cniv2
244300
scaleup: ${{ parameters.scaleup }}
245301
nodeCount: ${{ parameters.nodeCount }}
302+
${{ if eq(parameters.upgradeScenario, 'true') }}:
303+
logType: upgradeRestartCNS
246304
- job: recover
247305
condition: and( not(canceled()), not(failed()) )
248306
displayName: "Recover Resources"
@@ -309,7 +367,10 @@ stages:
309367
dependsOn:
310368
- ${{ parameters.name }}
311369
- setup
312-
displayName: "HNS Test - ${{ parameters.clusterName }}"
370+
${{ if eq(parameters.upgradeScenario, true) }}:
371+
displayName: "HNS Test w/ Upgrade - ${{ parameters.name }}"
372+
${{ else }}:
373+
displayName: "HNS Test - ${{ parameters.name }}"
313374
jobs:
314375
- job: restart_hns
315376
displayName: "Restart and Validate HNS"

.pipelines/npm/npm-cni-integration-test.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ parameters:
66
dependsOn: ""
77
tag: ""
88
continueOnError: false
9+
logType: "npmLogs"
910

1011
# Condition confirms that:
1112
# Pipeline has not been canceled and that the previous job has reports anything other than failure(Succeeded, SuccededWithIssues, Skipped). Previous job is declared by dependsOn: ${{ parameters.dependsOn }}
@@ -134,7 +135,7 @@ jobs:
134135
condition: always()
135136
136137
- bash: |
137-
npmLogs=$(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_npmLogs_Attempt_#$(System.StageAttempt)
138+
npmLogs=$(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt)
138139
mkdir -p $npmLogs
139140
140141
kubectl get pods -n kube-system | grep npm
@@ -147,8 +148,8 @@ jobs:
147148
retryCountOnTaskFailure: 3
148149
condition: always()
149150
150-
- publish: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_npmLogs_Attempt_#$(System.StageAttempt)
151+
- publish: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt)
151152
condition: always()
152-
artifact: ${{ parameters.clusterName }}_npmLogs_Attempt_#$(System.StageAttempt)
153+
artifact: ${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt)
153154
name: npmLogs
154155
displayName: Publish NPM pod logs

0 commit comments

Comments
 (0)