Skip to content

Commit

Permalink
[backport] CI/CD changes to PR and CNI Release Test Pipelines (#2940)
Browse files Browse the repository at this point in the history
* ci: Add node restart to cniv2 E2E (#2901)

* ci: add node restart to cniv2 E2E

* chore: change directory after scale

* chore: fixup nodepool

* chore: pipeline cleanup

* ci: cleanup test resources

* chore: address comments

* [FIX] ci: Update AzCLI task to v2 (#2922)

* ci: Update AzCLI task to v2

* ci: add scriptType: "bash"

* ci: Shift E2E cluster creation (#2862)

* ci: shift cluster creation

* chore: change depends on for release test
  • Loading branch information
jpayne3506 authored Aug 21, 2024
1 parent 3d3634d commit a6fc0e3
Show file tree
Hide file tree
Showing 40 changed files with 453 additions and 189 deletions.
9 changes: 5 additions & 4 deletions .pipelines/cni/cilium/cilium-overlay-load-test-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ stages:
commitID: $[ stagedependencies.setup.env.outputs['SetEnvVars.commitID'] ]
dependsOn:
- setup
- build_images
displayName: "Create Cluster - ${{ parameters.clusterName }}"
jobs:
- job: create_aks_cluster_with_${{ parameters.name }}
Expand Down Expand Up @@ -68,7 +69,7 @@ stages:
- job: deploy_cilium_components
displayName: Deploy Cilium
steps:
- task: AzureCLI@1
- task: AzureCLI@2
displayName: "Install Cilium, CNS, and ip-masq-agent"
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
Expand Down Expand Up @@ -105,7 +106,7 @@ stages:
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
kubectl get po -owide -A
Expand All @@ -116,7 +117,7 @@ stages:
- job: deploy_cilium_components
displayName: Deploy Cilium with Hubble
steps:
- task: AzureCLI@1
- task: AzureCLI@2
displayName: "Install Cilium, CNS, and ip-masq-agent"
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
Expand Down Expand Up @@ -197,7 +198,7 @@ stages:
dependsOn: restart_cns
steps:
- template: ../../templates/cilium-cli.yaml
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
52 changes: 26 additions & 26 deletions .pipelines/cni/cilium/cilium-scale-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -27,12 +27,12 @@ stages:
kubectl apply -f test/integration/manifests/cilium/cilium-operator
echo "Keep CNS version up to date, grabbing pipeline parameter"
CNS_IMAGE=${CNS_IMAGE}
sed -i '/containers:/{n;n;s/\(image\).*/\1: '"${CNS_IMAGE//\//\\/}"'/}' test/integration/manifests/cns/daemonset.yaml
kubectl apply -f test/integration/manifests/cns/daemonset.yaml
sed -i '/containers:/{n;n;s/\(image\).*/\1: '"${CNS_IMAGE//\//\\/}"'/}' test/integration/manifests/cns/daemonset.yaml
kubectl apply -f test/integration/manifests/cns/daemonset.yaml
for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_AKS_CLUSTER_TEST) --query "[].name" -o tsv); do
make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_AKS_CLUSTER_TEST) VMSS_NAME=${val}
done
kubectl get node
kubectl get node
kubectl get pod -A
name: "UpdateCiliumandCNSVersion"
displayName: "Update Cilium and CNS Version"
Expand All @@ -43,7 +43,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -63,7 +63,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -72,7 +72,7 @@ stages:
inlineScript: |
echo "Set node label scale-test=true and connectivity-test=true for testing"
az aks get-credentials --resource-group ${CLUSTER} --name ${CLUSTER}
cd test/scale
cd test/scale
chmod +x label-nodes.sh
./label-nodes.sh
name: "LabelNodes"
Expand All @@ -84,7 +84,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -95,14 +95,14 @@ stages:
echo "collect cpu and memory usage before scaling for network policies"
mkdir test1_1_netpol_cpu_and_mem_before
cd test1_1_netpol_cpu_and_mem_before
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_before_netpol_scale.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_before_netpol_scale.log"
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test1_1_netpol_cpu_and_mem_before/
echo $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo mkdir $ARTIFACT_DIR
cd ..
sudo cp ./test1_1_netpol_cpu_and_mem_before/* $ARTIFACT_DIR
Expand All @@ -113,7 +113,7 @@ stages:
echo "collect cpu and mem results after scaling"
mkdir test1_2_netpol_cpu_and_mem_scale
cd test1_2_netpol_cpu_and_mem_scale
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_netpol_scale.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_netpol_scale.log"
Expand Down Expand Up @@ -148,7 +148,7 @@ stages:
name: "$(BUILD_POOL_NAME_DEFAULT)"
timeoutInMinutes: 120
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -163,14 +163,14 @@ stages:
echo "collect cpu and mem results after connectivity tests"
mkdir test1_3_netpol_cpu_and_mem_after
cd test1_3_netpol_cpu_and_mem_after
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_after_netpol_tests.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_after_netpol_tests.log"
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test1_3_netpol_cpu_and_mem_after/
echo $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo mkdir $ARTIFACT_DIR
cd ..
sudo cp ./test1_3_netpol_cpu_and_mem_after/* $ARTIFACT_DIR
Expand All @@ -190,7 +190,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -201,14 +201,14 @@ stages:
echo "collect cpu and mem results before scale for lb tests"
mkdir test2_1_lb_cpu_and_mem_before
cd test2_1_lb_cpu_and_mem_before
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_before_lb_scale.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_before_lb_scale.log"
echo "Logs will be available as a build artifact"
ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test2_1_lb_cpu_and_mem_before/
echo $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR
sudo mkdir $ARTIFACT_DIR
cd ..
sudo cp ./test2_1_lb_cpu_and_mem_before/* $ARTIFACT_DIR
Expand All @@ -218,7 +218,7 @@ stages:
echo "collect cpu and mem results after scaling"
mkdir test2_2_lb_cpu_and_mem_scale
cd test2_2_lb_cpu_and_mem_scale
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_lb_scale.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_lb_scale.log"
Expand Down Expand Up @@ -252,7 +252,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -274,7 +274,7 @@ stages:
cd ..
mkdir test2_3_lb_cpu_and_mem_after
cd test2_3_lb_cpu_and_mem_after
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_after_lb_tests.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_after_lb_tests.log"
Expand Down Expand Up @@ -312,7 +312,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -328,7 +328,7 @@ stages:
echo "collect cpu and mem results after netperf tests"
mkdir test3_netperf_cpu_and_mem
cd test3_netperf_cpu_and_mem
echo "running k top node"
echo "running k top node"
kubectl top node >> "node_netperf.log"
echo "running k top pod"
kubectl top pod -A | grep cilium >> "pod_netperf.log"
Expand All @@ -337,8 +337,8 @@ stages:
ARTIFACT_DIR2=$(Build.ArtifactStagingDirectory)/test3_netperf/
echo $ARTIFACT_DIR
echo $ARTIFACT_DIR2
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR2
sudo rm -rf $ARTIFACT_DIR
sudo rm -rf $ARTIFACT_DIR2
sudo mkdir $ARTIFACT_DIR
sudo mkdir $ARTIFACT_DIR2
cd ..
Expand Down Expand Up @@ -367,7 +367,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand All @@ -389,7 +389,7 @@ stages:
pool:
name: "$(BUILD_POOL_NAME_DEFAULT)"
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
9 changes: 6 additions & 3 deletions .pipelines/cni/cilium/nightly-release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ stages:
make docker-operator-generic-image
name: BuildCiliumImage
displayName: "Build Cilium Image"
- task: AzureCLI@1
- task: AzureCLI@2
displayName: "Login"
inputs:
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
inlineScript: |
az acr login -n $(ACR)
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
inlineScript: |
set -ex
docker tag quay.io/cilium/cilium:$(DOCKER_IMAGE_TAG) $(ACR).azurecr.io/cilium/cilium:$(DOCKER_IMAGE_TAG)
Expand All @@ -54,11 +56,12 @@ stages:
docker push $(ACR).azurecr.io/cilium/operator-generic:$(DOCKER_IMAGE_TAG)
name: "PushCiliumImage"
displayName: "Push Cilium Image"
- task: AzureCLI@1
- task: AzureCLI@2
displayName: "Logout"
inputs:
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
inlineScript: |
docker logout
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: ${{ parameters.sub }}
scriptLocation: "inlineScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ parameters:
nodeCountWin: 2

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ parameters:
jobName: "deploy_pods"

steps:
- task: AzureCLI@1
- task: AzureCLI@2
displayName: "Pod Deployment"
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
jobName: "restart_cns"

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ parameters:
cni: "cniv1"

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ parameters:
region: ""

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ parameters:
cni: "cilium"

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/cni/lsg/kernel-upgrade-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ parameters:
clusterName: ""

steps:
- task: AzureCLI@1
- task: AzureCLI@2
inputs:
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
Expand Down
Loading

0 comments on commit a6fc0e3

Please sign in to comment.