From 7f9779672a2310790b7f512c20867b22c2f92daa Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:05:36 -0700 Subject: [PATCH 01/25] add new ipam/dropgz e2e test stage --- .pipelines/pipeline.yaml | 7 + .../ipam-dropgz-e2e-job-template.yaml | 29 ++++ .../ipam-dropgz-e2e-step-template.yaml | 147 ++++++++++++++++++ test/integration/manifests/cns/daemonset.yaml | 2 +- test/integration/setup_test.go | 16 +- 5 files changed, 198 insertions(+), 3 deletions(-) create mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml create mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 46f320b19b..ccaa694044 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -280,6 +280,13 @@ stages: name: "cilium_e2e" displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" + + - template: singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml + parameters: + name: "ipam_dropgz_e2e" + displayName: Azure-ipam and CNI-Dropgz + pipelineBuildImage: "$(BUILD_IMAGE)" + directory: or("/azure-ipam", "/dropgz") - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml new file mode 100644 index 0000000000..4591dc24c6 --- /dev/null +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml @@ -0,0 +1,29 @@ +parameters: + name: "" + displayName: "" + pipelineBuildImage: "$(BUILD_IMAGE)" + directory: "" + +stages: + - stage: ${{ parameters.name }} + displayName: E2E - ${{ parameters.displayName }} + dependsOn: + - setup + - publish + jobs: + - job: ${{ parameters.name }} + displayName: Azure-ipam/Dropgz Test Suite - (${{ parameters.name }}) + timeoutInMinutes: 120 + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + demands: + - agent.os -equals Linux + - Role -equals $(CUSTOM_E2E_ROLE) + variables: + GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path + GOBIN: "$(GOPATH)/bin" # Go binaries path + modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" + steps: + - template: ipam-dropgz-e2e-step-template.yaml + parameters: + name: ${{ parameters.name }} diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml new file mode 100644 index 0000000000..f7f9e17619 --- /dev/null +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml @@ -0,0 +1,147 @@ +parameters: + name: "" + +steps: + - bash: | + echo $UID + sudo rm -rf $(System.DefaultWorkingDirectory)/* + displayName: "Set up OS environment" + + - checkout: self + + - bash: | + go version + go env + mkdir -p '$(GOBIN)' + mkdir -p '$(GOPATH)/pkg' + mkdir -p '$(modulePath)' + echo '##vso[task.prependpath]$(GOBIN)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + name: "GoEnv" + displayName: "Set up the Go environment" + + - task: AzureCLI@1 + inputs: + azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + mkdir -p ~/.kube/ + echo "Create AKS cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=ipam-dropgz-e2e-$(make revision) + echo "Cluster successfully created" + displayName: Create test cluster + condition: succeeded() + + - script: | + ls -lah + pwd + echo "installing kubectl" + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + kubectl cluster-info + kubectl get po -owide -A + curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 + chmod 700 get_helm.sh + ./get_helm.sh + echo "deploy Cilium ConfigMap" + kubectl apply -f cilium/configmap.yaml + echo "install Cilium" + helm repo add cilium https://helm.cilium.io/ + helm install cilium cilium/cilium --version 1.12.1.1 --namespace kube-system -f cilium/cilium_helm_values.yaml + name: "installCilium" + displayName: "Install Cilium" + + - script: | + echo "install cilium CLI" + CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) + CLI_ARCH=amd64 + if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi + curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} + sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum + sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin + rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} + cilium status + name: "installCiliumCLI" + displayName: "Install Cilium CLI" + + - script: | + echo "install kubetest2 and gsutils" + go get github.com/onsi/ginkgo/ginkgo + go get github.com/onsi/gomega/... + go install github.com/onsi/ginkgo/ginkgo@latest + go install sigs.k8s.io/kubetest2@latest + go install sigs.k8s.io/kubetest2/kubetest2-noop@latest + go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest + wget https://storage.googleapis.com/pub/gsutil.tar.gz + tar xfz gsutil.tar.gz + sudo mv gsutil /usr/local/bin + name: "installKubetest" + displayName: "Set up Conformance Tests" + + - script: | + echo "Start Azilium E2E Tests" + kubectl get po -owide -A + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=true + retryCountOnTaskFailure: 3 + name: "aziliumTest" + displayName: "Run Azilium E2E" + + - script: | + echo "Logs will be available as a build artifact" + ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/ + echo $ARTIFACT_DIR + sudo rm -rf $ARTIFACT_DIR + sudo mkdir $ARTIFACT_DIR + sudo cp test/integration/logs/* $ARTIFACT_DIR + name: "GetLogs" + displayName: "Get logs" + condition: always() + + - task: PublishBuildArtifacts@1 + inputs: + artifactName: test-output + pathtoPublish: "$(Build.ArtifactStagingDirectory)/test-output" + condition: always() + + - script: | + echo "Run Service Conformance E2E" + export PATH=${PATH}:/usr/local/bin/gsutil + KUBECONFIG=~/.kube/config kubetest2 noop \ + --test ginkgo -- \ + --focus-regex "Services.*\[Conformance\].*" + name: "servicesConformance" + displayName: "Run Services Conformance Tests" + + - script: | + echo "Run Cilium Connectivity Tests" + cilium status + cilium connectivity test + name: "ciliumConnectivityTests" + displayName: "Run Cilium Connectivity Tests" + + - script: | + ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/ + echo $ARTIFACT_DIR + sudo rm -rf $ARTIFACT_DIR + sudo rm -rf test/integration/logs + name: "Cleanupartifactdir" + displayName: "Cleanup artifact dir" + condition: always() + + - task: AzureCLI@2 + inputs: + azureSubscription: "Azure Container Networking - Test" + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + echo "Deleting cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=ipam-dropgz-e2e-$(make revision) + echo "Cluster and resources down" + name: "Cleanupcluster" + displayName: "Cleanup cluster" + condition: always() diff --git a/test/integration/manifests/cns/daemonset.yaml b/test/integration/manifests/cns/daemonset.yaml index 33e2d112ea..d3990ac85c 100644 --- a/test/integration/manifests/cns/daemonset.yaml +++ b/test/integration/manifests/cns/daemonset.yaml @@ -83,7 +83,7 @@ spec: fieldPath: spec.nodeName initContainers: - name: init-cni-dropgz - image: acnpublic.azurecr.io/cni-dropgz-test:latest + image: acnpublic.azurecr.io/cni-dropgz:latest imagePullPolicy: Always command: ["/dropgz"] volumeMounts: diff --git a/test/integration/setup_test.go b/test/integration/setup_test.go index 976ed02f38..82e1e4e5ee 100644 --- a/test/integration/setup_test.go +++ b/test/integration/setup_test.go @@ -16,6 +16,7 @@ import ( const ( exitFail = 1 + envTestDropgz = "TEST_DROPGZ" envCNIDropgzVersion = "CNI_DROPGZ_VERSION" envCNSVersion = "CNS_VERSION" envInstallCNS = "INSTALL_CNS" @@ -104,10 +105,21 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l // check environment scenario log.Printf("Checking environment scenario") + if installBool1 := os.Getenv(envTestDropgz); installBool1 != "" { + if testDropgzScenario, err := strconv.ParseBool(installBool1); err == nil && testDropgzScenario == true { + log.Printf("Env %v set to true, deploy cniTest.Dockerfile", envTestDropgz) + initImage := []string{"cni-dropgz-test"} + cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) + } + } else { + log.Printf("Env %v not set to true, skipping", envTestDropgz) + initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) + } + if installBool1 := os.Getenv(envInstallAzureVnet); installBool1 != "" { if azureVnetScenario, err := strconv.ParseBool(installBool1); err == nil && azureVnetScenario == true { log.Printf("Env %v set to true, deploy azure-vnet", envInstallAzureVnet) - initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) + // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-vnet", "-o", "/opt/cni/bin/azure-vnet", "azure-swift.conflist", "-o", "/etc/cni/net.d/10-azure.conflist"} } @@ -122,7 +134,7 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l if installBool2 := os.Getenv(envInstallAzilium); installBool2 != "" { if aziliumScenario, err := strconv.ParseBool(installBool2); err == nil && aziliumScenario == true { log.Printf("Env %v set to true, deploy azure-ipam and cilium-cni", envInstallAzilium) - initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) + // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-ipam", "-o", "/opt/cni/bin/azure-ipam", "azilium.conflist", "-o", "/etc/cni/net.d/05-cilium.conflist"} } From 317380d7c3bc93bccd7b083bfd6781a5a644dcda Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 29 Sep 2022 08:54:23 -0700 Subject: [PATCH 02/25] set test image --- test/integration/setup_test.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/integration/setup_test.go b/test/integration/setup_test.go index 82e1e4e5ee..1a6c691600 100644 --- a/test/integration/setup_test.go +++ b/test/integration/setup_test.go @@ -105,22 +105,23 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l // check environment scenario log.Printf("Checking environment scenario") - if installBool1 := os.Getenv(envTestDropgz); installBool1 != "" { - if testDropgzScenario, err := strconv.ParseBool(installBool1); err == nil && testDropgzScenario == true { + if installBoolDropgz := os.Getenv(envTestDropgz); installBoolDropgz != "" { + if testDropgzScenario, err := strconv.ParseBool(installBoolDropgz); err == nil && testDropgzScenario == true { log.Printf("Env %v set to true, deploy cniTest.Dockerfile", envTestDropgz) - initImage := []string{"cni-dropgz-test"} + initImage, _ := parseImageString("acnpublic.azurecr.io/cni-dropgz-test:latest") cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) } } else { log.Printf("Env %v not set to true, skipping", envTestDropgz) initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) + cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) } if installBool1 := os.Getenv(envInstallAzureVnet); installBool1 != "" { if azureVnetScenario, err := strconv.ParseBool(installBool1); err == nil && azureVnetScenario == true { log.Printf("Env %v set to true, deploy azure-vnet", envInstallAzureVnet) // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) - cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) + // cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-vnet", "-o", "/opt/cni/bin/azure-vnet", "azure-swift.conflist", "-o", "/etc/cni/net.d/10-azure.conflist"} } // setup the CNS swiftconfigmap @@ -135,7 +136,7 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l if aziliumScenario, err := strconv.ParseBool(installBool2); err == nil && aziliumScenario == true { log.Printf("Env %v set to true, deploy azure-ipam and cilium-cni", envInstallAzilium) // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) - cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) + // cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-ipam", "-o", "/opt/cni/bin/azure-ipam", "azilium.conflist", "-o", "/etc/cni/net.d/05-cilium.conflist"} } // setup the CNS ciliumconfigmap From e7aa1add2fe8d1fd4ba9bb40d310fbf477c91631 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 29 Sep 2022 13:48:50 -0700 Subject: [PATCH 03/25] set paths in pipeline.yaml --- .pipelines/pipeline.yaml | 5 ++++- test/integration/setup_test.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index ccaa694044..609d9027ef 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -286,7 +286,10 @@ stages: name: "ipam_dropgz_e2e" displayName: Azure-ipam and CNI-Dropgz pipelineBuildImage: "$(BUILD_IMAGE)" - directory: or("/azure-ipam", "/dropgz") + paths: + include: + - "azure-ipam/*" + - "cni-dropgz/*" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: diff --git a/test/integration/setup_test.go b/test/integration/setup_test.go index 1a6c691600..b81ec1d77a 100644 --- a/test/integration/setup_test.go +++ b/test/integration/setup_test.go @@ -112,7 +112,7 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) } } else { - log.Printf("Env %v not set to true, skipping", envTestDropgz) + log.Printf("Env %v not set to true, deploying cni.Dockerfile", envTestDropgz) initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) } From ca931849039893b9d8f0e473dd7514faf658894c Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:01:35 -0700 Subject: [PATCH 04/25] set path trigger in ipam-dropgz-job template --- .pipelines/pipeline.yaml | 4 ---- .../ipam-dropgz/ipam-dropgz-e2e-job-template.yaml | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 609d9027ef..49f925e94a 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -286,10 +286,6 @@ stages: name: "ipam_dropgz_e2e" displayName: Azure-ipam and CNI-Dropgz pipelineBuildImage: "$(BUILD_IMAGE)" - paths: - include: - - "azure-ipam/*" - - "cni-dropgz/*" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml index 4591dc24c6..789b5dca31 100644 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml @@ -1,3 +1,8 @@ +trigger: + paths: + include: + - "azure-ipam/*" + - "cni-dropgz/*" parameters: name: "" displayName: "" From 00076a14669ac6ef75d46f2c88ec8eb8a9991806 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 29 Sep 2022 14:05:39 -0700 Subject: [PATCH 05/25] set path as param for ipam-dropgze2e --- .pipelines/pipeline.yaml | 4 ++++ .../ipam-dropgz/ipam-dropgz-e2e-job-template.yaml | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 49f925e94a..96867e1e86 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -286,6 +286,10 @@ stages: name: "ipam_dropgz_e2e" displayName: Azure-ipam and CNI-Dropgz pipelineBuildImage: "$(BUILD_IMAGE)" + paths: + include: + - "azure-ipam/*" + - "cni-dropgz/*" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml index 789b5dca31..4591dc24c6 100644 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml @@ -1,8 +1,3 @@ -trigger: - paths: - include: - - "azure-ipam/*" - - "cni-dropgz/*" parameters: name: "" displayName: "" From 5b16e4a45e3f4d40e9aa64cab47cb8f6e27f154f Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 29 Sep 2022 15:30:08 -0700 Subject: [PATCH 06/25] testing path trigger with branch --- .pipelines/pipeline.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 96867e1e86..40a295e2a5 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -274,7 +274,7 @@ stages: parameters: name: $(name) platforms: $(platforms) - + - template: singletenancy/cilium/cilium-e2e-job-template.yaml parameters: name: "cilium_e2e" @@ -286,6 +286,9 @@ stages: name: "ipam_dropgz_e2e" displayName: Azure-ipam and CNI-Dropgz pipelineBuildImage: "$(BUILD_IMAGE)" + branches: + include: + - master paths: include: - "azure-ipam/*" From 5d98e229c2586f4c5029fdd639ea43076ffd98eb Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 30 Sep 2022 09:20:04 -0700 Subject: [PATCH 07/25] create submodule pipeline --- .pipelines/pipeline.yaml | 13 - .pipelines/submodules-pipeline.yaml | 382 ++++++++++++++++++++++++++++ 2 files changed, 382 insertions(+), 13 deletions(-) create mode 100644 .pipelines/submodules-pipeline.yaml diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 40a295e2a5..9797d0664d 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -280,19 +280,6 @@ stages: name: "cilium_e2e" displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" - - - template: singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml - parameters: - name: "ipam_dropgz_e2e" - displayName: Azure-ipam and CNI-Dropgz - pipelineBuildImage: "$(BUILD_IMAGE)" - branches: - include: - - master - paths: - include: - - "azure-ipam/*" - - "cni-dropgz/*" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml new file mode 100644 index 0000000000..fb7f4a0350 --- /dev/null +++ b/.pipelines/submodules-pipeline.yaml @@ -0,0 +1,382 @@ +pr: + branches: + include: + - master + paths: + exclude: + - ".*" + - docs + +trigger: + paths: + include: + - "zapai/*" + - "azure-ipam/*" + - "dropgz/*" + exclude: + - docs + tags: + include: + - "zapai/*" + - "azure-ipam/*" + - "dropgz/*" + +stages: + - stage: setup + displayName: ACN + jobs: + - job: env + displayName: Setup + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + steps: + - script: | + BUILD_NUMBER=$(Build.BuildNumber) + echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" + echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" + echo "##vso[task.setvariable variable=cniVersion;isOutput=true]$(make cni-version)" + echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" + cat /etc/os-release + uname -a + sudo chown -R $(whoami):$(whoami) . + go version + go env + which go + echo $PATH + name: "EnvironmentalVariables" + displayName: "Set environmental variables" + condition: always() + + - stage: test + displayName: Test ACN + dependsOn: + - setup + jobs: + - job: test + displayName: Run Tests + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + steps: + - script: | + make tools + # run test, echo exit status code to fd 3, pipe output from test to tee, which splits output to stdout and go-junit-report (which converts test output to report.xml), stdout from tee is redirected to fd 4. Take output written to fd 3 (which is the exit code of test), redirect to stdout, pipe to read from stdout then exit with that status code. Read all output from fd 4 (output from tee) and write to top stdout + { { { { + sudo -E env "PATH=$PATH" make test-all; + echo $? >&3; + } | tee >(build/tools/bin/go-junit-report > report.xml) >&4; + } 3>&1; + } | { read xs; exit $xs; } + } 4>&1 + retryCountOnTaskFailure: 3 + name: "Test" + displayName: "Run Tests" + + - bash: | + build/tools/bin/gocov convert coverage.out > coverage.json + build/tools/bin/gocov-xml < coverage.json > coverage.xml + name: "Coverage" + displayName: "Generate Coverage Reports" + condition: always() + + - task: PublishTestResults@2 + inputs: + testRunner: JUnit + testResultsFiles: report.xml + displayName: "Publish Test Results" + condition: always() + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: coverage.xml + displayName: "Publish Code Coverage Results" + condition: always() + + - stage: binaries + displayName: Build Binaries + dependsOn: + - setup + - test + jobs: + - job: build + displayName: Build Binaries + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + steps: + - script: | + make all-binaries-platforms + name: "BuildAllPlatformBinaries" + displayName: "Build all platform binaries" + + - script: | + mkdir -p ./output/bins + cd ./output + find . -name '*.tgz' -print -exec mv -t ./bins/ {} + + find . -name '*.zip' -print -exec mv -t ./bins/ {} + + shopt -s extglob + rm -rf !("bins") + name: "PrepareArtifacts" + displayName: "Prepare Artifacts" + + - task: CopyFiles@2 + inputs: + sourceFolder: "output" + targetFolder: $(Build.ArtifactStagingDirectory) + condition: succeeded() + + - task: PublishBuildArtifacts@1 + inputs: + artifactName: "output" + pathtoPublish: "$(Build.ArtifactStagingDirectory)" + condition: succeeded() + + - task: AzureCLI@1 + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + inlineScript: | + echo Creating storage container with name acn-$(STORAGE_ID) and account name $(STORAGE_ACCOUNT_NAME) + az storage container create -n acn-$(STORAGE_ID) --account-name $(STORAGE_ACCOUNT_NAME) --public-access container + az storage blob upload-batch -d acn-$(STORAGE_ID) -s ./output/bins/ --account-name $(STORAGE_ACCOUNT_NAME) + displayName: Create artifact storage container + condition: succeeded() + + - publish: ./test/apimodels/ + artifact: clusterdefinitions + + - stage: containerize + displayName: Build Images + dependsOn: + - setup + - test + jobs: + - job: containerize_linux_amd64 + displayName: Build Images + pool: + name: "$(BUILD_POOL_NAME_LINUX_AMD64)" + strategy: + matrix: + acncli_linux_amd64: + arch: amd64 + os: linux + name: acncli + cni_dropgz_linux_amd64: + arch: amd64 + os: linux + name: cni-dropgz + cni_dropgz_test_linux_amd64: + arch: amd64 + os: linux + name: cni-dropgz-test + cns_linux_amd64: + arch: amd64 + os: linux + name: cns + npm_linux_amd64: + arch: amd64 + os: linux + name: npm + steps: + - template: containers/container-template.yaml + parameters: + name: $(name) + os: $(os) + arch: $(arch) + - job: containerize_linux_arm64 + displayName: Build Images + variables: + TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] + pool: + name: "$(BUILD_POOL_NAME_LINUX_ARM64)" + strategy: + matrix: + acncli_linux_arm64: + arch: arm64 + os: linux + name: acncli + cni_dropgz_linux_arm64: + arch: arm64 + os: linux + name: cni-dropgz + cni_dropgz_test_linux_arm64: + arch: arm64 + os: linux + name: cni-dropgz-test + cns_linux_arm64: + arch: arm64 + os: linux + name: cns + npm_linux_arm64: + arch: arm64 + os: linux + name: npm + steps: + - template: containers/container-template.yaml + parameters: + name: $(name) + os: $(os) + arch: $(arch) + - job: containerize_windows_amd64 + timeoutInMinutes: 120 + displayName: Build Images + variables: + TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] + pool: + name: "$(BUILD_POOL_NAME_WINDOWS_AMD64)" + strategy: + matrix: + cns_windows_amd64: + arch: amd64 + name: cns + npm_windows_amd64: + arch: amd64 + name: npm + steps: + - template: containers/container-template-windows.yaml + parameters: + name: $(name) + arch: $(arch) + tag: $(TAG) + + - stage: publish + displayName: Publish Multiarch Manifests + dependsOn: + - containerize + jobs: + - job: manifest + displayName: Compile Manifests + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + strategy: + matrix: + acncli: + name: acncli + platforms: linux/amd64 linux/arm64 + cni_dropgz: + name: cni-dropgz + platforms: linux/amd64 linux/arm64 + cni_dropgz_test: + name: cni-dropgz-test + platforms: linux/amd64 linux/arm64 + cns: + name: cns + platforms: linux/amd64 linux/arm64 windows/amd64 + npm: + name: npm + platforms: linux/amd64 linux/arm64 windows/amd64 + steps: + - template: containers/manifest-template.yaml + parameters: + name: $(name) + platforms: $(platforms) + + - template: singletenancy/cilium/cilium-e2e-job-template.yaml + parameters: + name: "cilium_e2e" + displayName: Cilium + pipelineBuildImage: "$(BUILD_IMAGE)" + + - template: singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml + parameters: + name: "ipam_dropgz_e2e" + displayName: Azure-ipam and CNI-Dropgz + pipelineBuildImage: "$(BUILD_IMAGE)" + + - template: singletenancy/aks-swift/e2e-job-template.yaml + parameters: + name: "aks_swift_e2e" + displayName: AKS Swift + pipelineBuildImage: "$(BUILD_IMAGE)" + + # - template: singletenancy/aks-engine/e2e-job-template.yaml + # parameters: + # name: "ubuntu_18_04_linux_e2e" + # displayName: Ubuntu 18.04 + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniLinux1804.json" + # clusterDefinitionCniTypeKey: "azureCNIURLLinux" + # clusterDefinitionCniBuildOS: "linux" + # clusterDefinitionCniBuildExt: ".tgz" + + # - template: singletenancy/aks-engine/e2e-job-template.yaml + # parameters: + # name: "windows_19_03_e2e" + # displayName: "Windows 1903" + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniWindows1903.json" + # clusterDefinitionCniTypeKey: "azureCNIURLWindows" + # clusterDefinitionCniBuildOS: "windows" + # clusterDefinitionCniBuildExt: ".zip" + + # - template: singletenancy/aks-engine/e2e-job-template.yaml + # parameters: + # name: "windows_20_04_e2e" + # displayName: "Windows 2004" + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniWindows2004.json" + # clusterDefinitionCniTypeKey: "azureCNIURLWindows" + # clusterDefinitionCniBuildOS: "windows" + # clusterDefinitionCniBuildExt: ".zip" + + # - template: singletenancy/aks-engine/e2e-job-template.yaml + # parameters: + # name: "windows_20_22_e2e" + # displayName: "Windows 2022" + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniWindows2022.json" + # clusterDefinitionCniTypeKey: "azureCNIURLWindows" + # clusterDefinitionCniBuildOS: "windows" + # clusterDefinitionCniBuildExt: ".zip" + + # - template: singletenancy/aks-engine/e2e-dualstack-job-template.yaml + # parameters: + # name: "ubuntu_18_04_linux_dualstack_e2e" + # displayName: "Ubuntu 18.04 Dualstack" + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniLinuxDualstack1804.json" + # clusterDefinitionCniTypeKey: "azureCNIURLLinux" + # clusterDefinitionCniBuildOS: "linux" + # clusterDefinitionCniBuildExt: ".tgz" + + # - template: singletenancy/aks-engine/e2e-dualstack-job-template.yaml + # parameters: + # name: "windows_20_04_dualstack_e2e" + # displayName: "Windows 20.04 Dualstack" + # pipelineBuildImage: "$(BUILD_IMAGE)" + # clusterDefinition: "cniWindowsDualstack2004.json" + # clusterDefinitionCniTypeKey: "azureCNIURLWindows" + # clusterDefinitionCniBuildOS: "windows" + # clusterDefinitionCniBuildExt: ".zip" + + - stage: cleanup + displayName: Cleanup + dependsOn: + - "aks_swift_e2e" + # - "ubuntu_18_04_linux_e2e" + # - "windows_19_03_e2e" + # - "windows_20_04_e2e" + # - "windows_20_22_e2e" + # - "ubuntu_18_04_linux_dualstack_e2e" + # - "windows_20_04_dualstack_e2e" + jobs: + - job: delete_remote_artifacts + displayName: Delete remote artifacts + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + demands: agent.os -equals Linux + steps: + - checkout: none + - task: AzureCLI@1 + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + inlineScript: | + BUILD_NUMBER=$(Build.BuildNumber) + BUILD_NUMBER=${BUILD_NUMBER//./-} + echo Deleting storage container with name acn-$BUILD_NUMBER and account name $(STORAGE_ACCOUNT_NAME) + az storage container delete -n acn-$BUILD_NUMBER --account-name $(STORAGE_ACCOUNT_NAME) + displayName: Cleanup remote Azure storage container From 98bd23ada24c11ceca187e094a15995250004998 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:01:23 -0700 Subject: [PATCH 08/25] add log in /azure-ipam to test piepline trigger --- azure-ipam/main.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-ipam/main.go b/azure-ipam/main.go index f5e13e5aab..636e904868 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,6 +15,7 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) + log.Printf("test line. adding change to trigger submodule pipeline. REMOVE later") os.Exit(1) } } @@ -22,10 +23,10 @@ func main() { func executePlugin() error { // logger config loggerCfg := &logger.Config{ - Level: "debug", - Filepath: "/var/log/azure-ipam.log", - MaxSizeInMB: 5, // MegaBytes - MaxBackups: 8, + Level: "debug", + Filepath: "/var/log/azure-ipam.log", + MaxSizeInMB: 5, // MegaBytes + MaxBackups: 8, } // Create logger pluginLogger, cleanup, err := logger.New(loggerCfg) From fa961b67e17df8e74f5e5a9f38d73a744c655656 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 30 Sep 2022 11:13:30 -0700 Subject: [PATCH 09/25] remove build for cni-dropgz image in submodule pipeline --- .pipelines/submodules-pipeline.yaml | 11 ----------- azure-ipam/main.go | 2 +- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index fb7f4a0350..d204e893bc 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -164,10 +164,6 @@ stages: arch: amd64 os: linux name: acncli - cni_dropgz_linux_amd64: - arch: amd64 - os: linux - name: cni-dropgz cni_dropgz_test_linux_amd64: arch: amd64 os: linux @@ -198,10 +194,6 @@ stages: arch: arm64 os: linux name: acncli - cni_dropgz_linux_arm64: - arch: arm64 - os: linux - name: cni-dropgz cni_dropgz_test_linux_arm64: arch: arm64 os: linux @@ -256,9 +248,6 @@ stages: acncli: name: acncli platforms: linux/amd64 linux/arm64 - cni_dropgz: - name: cni-dropgz - platforms: linux/amd64 linux/arm64 cni_dropgz_test: name: cni-dropgz-test platforms: linux/amd64 linux/arm64 diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 636e904868..cdd095ec08 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,7 +15,7 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) - log.Printf("test line. adding change to trigger submodule pipeline. REMOVE later") + log.Printf("adding change to trigger submodule pipeline. REMOVE later") os.Exit(1) } } From b4a635cfa41f55f1f5b114b104fbb1151a02adcf Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Mon, 3 Oct 2022 15:05:42 -0700 Subject: [PATCH 10/25] create separate swift + cilium ipam/dropgz test stages --- ... ipam-dropgz-cilium-e2e-job-template.yaml} | 4 +- ...ipam-dropgz-cilium-e2e-step-template.yaml} | 0 .../ipam-dropgz-swift-e2e-job-template.yaml | 28 +++++ .../ipam-dropgz-swift-e2e-step-template.yaml | 113 ++++++++++++++++++ .pipelines/submodules-pipeline.yaml | 32 +++-- azure-ipam/main.go | 2 +- 6 files changed, 164 insertions(+), 15 deletions(-) rename .pipelines/singletenancy/ipam-dropgz/{ipam-dropgz-e2e-job-template.yaml => ipam-dropgz-cilium-e2e-job-template.yaml} (83%) rename .pipelines/singletenancy/ipam-dropgz/{ipam-dropgz-e2e-step-template.yaml => ipam-dropgz-cilium-e2e-step-template.yaml} (100%) create mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml create mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml similarity index 83% rename from .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml rename to .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml index 4591dc24c6..076e0f108e 100644 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml @@ -12,7 +12,7 @@ stages: - publish jobs: - job: ${{ parameters.name }} - displayName: Azure-ipam/Dropgz Test Suite - (${{ parameters.name }}) + displayName: Azure-ipam/Dropgz Cilium Test Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: name: $(BUILD_POOL_NAME_DEFAULT) @@ -24,6 +24,6 @@ stages: GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" steps: - - template: ipam-dropgz-e2e-step-template.yaml + - template: ipam-dropgz-cilium-e2e-step-template.yaml parameters: name: ${{ parameters.name }} diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml similarity index 100% rename from .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-e2e-step-template.yaml rename to .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml new file mode 100644 index 0000000000..28d3046250 --- /dev/null +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml @@ -0,0 +1,28 @@ +parameters: + name: "" + displayName: "" + pipelineBuildImage: "$(BUILD_IMAGE)" + +stages: + - stage: ${{ parameters.name }} + displayName: E2E - ${{ parameters.displayName }} + dependsOn: + - setup + - publish + jobs: + - job: ${{ parameters.name }} + displayName: Azure-ipam/Dropgz AKS Swift Suite - (${{ parameters.name }}) + timeoutInMinutes: 120 + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + demands: + - agent.os -equals Linux + - Role -equals $(CUSTOM_E2E_ROLE) + variables: + GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path + GOBIN: "$(GOPATH)/bin" # Go binaries path + modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" + steps: + - template: ipam-dropgz-swift-e2e-step-template.yaml + parameters: + name: ${{ parameters.name }} diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml new file mode 100644 index 0000000000..be7146a093 --- /dev/null +++ b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml @@ -0,0 +1,113 @@ +parameters: + name: "" + +steps: + - bash: | + echo $UID + sudo rm -rf $(System.DefaultWorkingDirectory)/* + displayName: "Set up OS environment" + + - checkout: self + + - bash: | + go version + go env + mkdir -p '$(GOBIN)' + mkdir -p '$(GOPATH)/pkg' + mkdir -p '$(modulePath)' + echo '##vso[task.prependpath]$(GOBIN)' + echo '##vso[task.prependpath]$(GOROOT)/bin' + name: "GoEnv" + displayName: "Set up the Go environment" + + - task: AzureCLI@1 + inputs: + azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + mkdir -p ~/.kube/ + echo "Create AKS cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) + echo "Cluster successfully created" + displayName: Create test cluster + condition: succeeded() + + - script: | + echo "install kubetest2 and gsutils" + go get github.com/onsi/ginkgo/ginkgo + go get github.com/onsi/gomega/... + go install github.com/onsi/ginkgo/ginkgo@latest + go install sigs.k8s.io/kubetest2@latest + go install sigs.k8s.io/kubetest2/kubetest2-noop@latest + go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest + wget https://storage.googleapis.com/pub/gsutil.tar.gz + tar xfz gsutil.tar.gz + sudo mv gsutil /usr/local/bin + name: "installKubetest" + displayName: "Set up Conformance Tests" + + - script: | + ls -lah + pwd + echo "installing kubectl" + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + kubectl cluster-info + kubectl get po -owide -A + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=true + retryCountOnTaskFailure: 3 + name: "aksswifte2e" + displayName: "Run AKS Swift E2E" + + - script: | + echo "Logs will be available as a build artifact" + ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/aks-swift-output/ + echo $ARTIFACT_DIR + sudo rm -rf $ARTIFACT_DIR + sudo mkdir $ARTIFACT_DIR + sudo cp test/integration/logs/* $ARTIFACT_DIR + name: "GetLogs" + displayName: "Get logs" + condition: always() + + - task: PublishBuildArtifacts@1 + inputs: + artifactName: aks-swift-output + pathtoPublish: "$(Build.ArtifactStagingDirectory)/aks-swift-output" + condition: always() + + - script: | + echo "Run Service Conformance E2E" + export PATH=${PATH}:/usr/local/bin/gsutil + KUBECONFIG=~/.kube/config kubetest2 noop \ + --test ginkgo -- \ + --focus-regex "Services.*\[Conformance\].*" + name: "servicesConformance" + displayName: "Run Services Conformance Tests" + + - script: | + ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/aks-swift-output/ + echo $ARTIFACT_DIR + sudo rm -rf $ARTIFACT_DIR + sudo rm -rf test/integration/logs + name: "Cleanupartifactdir" + displayName: "Cleanup artifact dir" + condition: always() + + - task: AzureCLI@2 + inputs: + azureSubscription: "Azure Container Networking - Test" + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + echo "Deleting cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) + echo "Cluster and resources down" + name: "Cleanupcluster" + displayName: "Cleanup cluster" + condition: always() diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index d204e893bc..05414d2ce2 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -263,24 +263,30 @@ stages: name: $(name) platforms: $(platforms) - - template: singletenancy/cilium/cilium-e2e-job-template.yaml - parameters: - name: "cilium_e2e" - displayName: Cilium - pipelineBuildImage: "$(BUILD_IMAGE)" + # - template: singletenancy/cilium/cilium-e2e-job-template.yaml + # parameters: + # name: "cilium_e2e" + # displayName: Cilium + # pipelineBuildImage: "$(BUILD_IMAGE)" - - template: singletenancy/ipam-dropgz/ipam-dropgz-e2e-job-template.yaml + - template: singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml parameters: - name: "ipam_dropgz_e2e" - displayName: Azure-ipam and CNI-Dropgz + name: "ipam_dropgz_cilium_e2e" + displayName: Azure-ipam and CNI-Dropgz for Cilium pipelineBuildImage: "$(BUILD_IMAGE)" - - template: singletenancy/aks-swift/e2e-job-template.yaml + - template: singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml parameters: - name: "aks_swift_e2e" - displayName: AKS Swift + name: "ipam_dropgz_swift_e2e" + displayName: Azure-ipam and CNI-Dropgz for Swift pipelineBuildImage: "$(BUILD_IMAGE)" + # - template: singletenancy/aks-swift/e2e-job-template.yaml + # parameters: + # name: "aks_swift_e2e" + # displayName: AKS Swift + # pipelineBuildImage: "$(BUILD_IMAGE)" + # - template: singletenancy/aks-engine/e2e-job-template.yaml # parameters: # name: "ubuntu_18_04_linux_e2e" @@ -344,7 +350,9 @@ stages: - stage: cleanup displayName: Cleanup dependsOn: - - "aks_swift_e2e" + - ipam_dropgz_cilium_e2e + - ipam_dropgz_swift_e2e + # - "aks_swift_e2e" # - "ubuntu_18_04_linux_e2e" # - "windows_19_03_e2e" # - "windows_20_04_e2e" diff --git a/azure-ipam/main.go b/azure-ipam/main.go index cdd095ec08..77bd87cd31 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,7 +15,7 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) - log.Printf("adding change to trigger submodule pipeline. REMOVE later") + log.Printf("REMOVE later") os.Exit(1) } } From d047a70370bda5928e42495a8d93e258ece487ec Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Wed, 5 Oct 2022 11:56:23 -0700 Subject: [PATCH 11/25] remove commented test bits --- .pipelines/submodules-pipeline.yaml | 79 ----------------------------- azure-ipam/main.go | 1 - 2 files changed, 80 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index 05414d2ce2..6c7e9fc230 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -262,12 +262,6 @@ stages: parameters: name: $(name) platforms: $(platforms) - - # - template: singletenancy/cilium/cilium-e2e-job-template.yaml - # parameters: - # name: "cilium_e2e" - # displayName: Cilium - # pipelineBuildImage: "$(BUILD_IMAGE)" - template: singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml parameters: @@ -281,84 +275,11 @@ stages: displayName: Azure-ipam and CNI-Dropgz for Swift pipelineBuildImage: "$(BUILD_IMAGE)" - # - template: singletenancy/aks-swift/e2e-job-template.yaml - # parameters: - # name: "aks_swift_e2e" - # displayName: AKS Swift - # pipelineBuildImage: "$(BUILD_IMAGE)" - - # - template: singletenancy/aks-engine/e2e-job-template.yaml - # parameters: - # name: "ubuntu_18_04_linux_e2e" - # displayName: Ubuntu 18.04 - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniLinux1804.json" - # clusterDefinitionCniTypeKey: "azureCNIURLLinux" - # clusterDefinitionCniBuildOS: "linux" - # clusterDefinitionCniBuildExt: ".tgz" - - # - template: singletenancy/aks-engine/e2e-job-template.yaml - # parameters: - # name: "windows_19_03_e2e" - # displayName: "Windows 1903" - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniWindows1903.json" - # clusterDefinitionCniTypeKey: "azureCNIURLWindows" - # clusterDefinitionCniBuildOS: "windows" - # clusterDefinitionCniBuildExt: ".zip" - - # - template: singletenancy/aks-engine/e2e-job-template.yaml - # parameters: - # name: "windows_20_04_e2e" - # displayName: "Windows 2004" - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniWindows2004.json" - # clusterDefinitionCniTypeKey: "azureCNIURLWindows" - # clusterDefinitionCniBuildOS: "windows" - # clusterDefinitionCniBuildExt: ".zip" - - # - template: singletenancy/aks-engine/e2e-job-template.yaml - # parameters: - # name: "windows_20_22_e2e" - # displayName: "Windows 2022" - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniWindows2022.json" - # clusterDefinitionCniTypeKey: "azureCNIURLWindows" - # clusterDefinitionCniBuildOS: "windows" - # clusterDefinitionCniBuildExt: ".zip" - - # - template: singletenancy/aks-engine/e2e-dualstack-job-template.yaml - # parameters: - # name: "ubuntu_18_04_linux_dualstack_e2e" - # displayName: "Ubuntu 18.04 Dualstack" - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniLinuxDualstack1804.json" - # clusterDefinitionCniTypeKey: "azureCNIURLLinux" - # clusterDefinitionCniBuildOS: "linux" - # clusterDefinitionCniBuildExt: ".tgz" - - # - template: singletenancy/aks-engine/e2e-dualstack-job-template.yaml - # parameters: - # name: "windows_20_04_dualstack_e2e" - # displayName: "Windows 20.04 Dualstack" - # pipelineBuildImage: "$(BUILD_IMAGE)" - # clusterDefinition: "cniWindowsDualstack2004.json" - # clusterDefinitionCniTypeKey: "azureCNIURLWindows" - # clusterDefinitionCniBuildOS: "windows" - # clusterDefinitionCniBuildExt: ".zip" - - stage: cleanup displayName: Cleanup dependsOn: - ipam_dropgz_cilium_e2e - ipam_dropgz_swift_e2e - # - "aks_swift_e2e" - # - "ubuntu_18_04_linux_e2e" - # - "windows_19_03_e2e" - # - "windows_20_04_e2e" - # - "windows_20_22_e2e" - # - "ubuntu_18_04_linux_dualstack_e2e" - # - "windows_20_04_dualstack_e2e" jobs: - job: delete_remote_artifacts displayName: Delete remote artifacts diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 77bd87cd31..d040da9d91 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,7 +15,6 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) - log.Printf("REMOVE later") os.Exit(1) } } From e855c7637401e2c8c9957eb4487e7b3c59f2cbe1 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:00:12 -0700 Subject: [PATCH 12/25] remove commented lines from setup_test.go --- .pipelines/pipeline.yaml | 1 + test/integration/setup_test.go | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 9797d0664d..33ddad68a7 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -331,6 +331,7 @@ stages: displayName: Cleanup dependsOn: - "aks_swift_e2e" + - "cilium_e2e" - "ubuntu_18_04_linux_e2e" - "windows_19_03_e2e" - "windows_20_04_e2e" diff --git a/test/integration/setup_test.go b/test/integration/setup_test.go index b81ec1d77a..ffd3eac586 100644 --- a/test/integration/setup_test.go +++ b/test/integration/setup_test.go @@ -120,8 +120,6 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l if installBool1 := os.Getenv(envInstallAzureVnet); installBool1 != "" { if azureVnetScenario, err := strconv.ParseBool(installBool1); err == nil && azureVnetScenario == true { log.Printf("Env %v set to true, deploy azure-vnet", envInstallAzureVnet) - // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) - // cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-vnet", "-o", "/opt/cni/bin/azure-vnet", "azure-swift.conflist", "-o", "/etc/cni/net.d/10-azure.conflist"} } // setup the CNS swiftconfigmap @@ -135,8 +133,6 @@ func installCNSDaemonset(ctx context.Context, clientset *kubernetes.Clientset, l if installBool2 := os.Getenv(envInstallAzilium); installBool2 != "" { if aziliumScenario, err := strconv.ParseBool(installBool2); err == nil && aziliumScenario == true { log.Printf("Env %v set to true, deploy azure-ipam and cilium-cni", envInstallAzilium) - // initImage, _ := parseImageString(cns.Spec.Template.Spec.InitContainers[0].Image) - // cns.Spec.Template.Spec.InitContainers[0].Image = getImageString(initImage, cniDropgzVersion) cns.Spec.Template.Spec.InitContainers[0].Args = []string{"deploy", "azure-ipam", "-o", "/opt/cni/bin/azure-ipam", "azilium.conflist", "-o", "/etc/cni/net.d/05-cilium.conflist"} } // setup the CNS ciliumconfigmap From 6e56d32641247345da1855ac341493b6011f9ad5 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:56:30 -0700 Subject: [PATCH 13/25] update paths/triggers and set template parameters --- .pipelines/pipeline.yaml | 2 + .../aks-swift/e2e-job-template.yaml | 2 + .../aks-swift/e2e-step-template.yaml | 3 +- .../cilium/cilium-e2e-job-template.yaml | 2 + .../cilium/cilium-e2e-step-template.yaml | 3 +- .pipelines/submodules-pipeline.yaml | 37 ++++++++++++++----- azure-ipam/main.go | 1 + 7 files changed, 39 insertions(+), 11 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 33ddad68a7..9fa7947839 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -280,12 +280,14 @@ stages: name: "cilium_e2e" displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: false - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: name: "aks_swift_e2e" displayName: AKS Swift pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: false - template: singletenancy/aks-engine/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml index a68af2f475..cbd195c278 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml @@ -2,6 +2,7 @@ parameters: name: "" displayName: "" pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: "" stages: - stage: ${{ parameters.name }} @@ -26,3 +27,4 @@ stages: - template: e2e-step-template.yaml parameters: name: ${{ parameters.name }} + testDropgz: ${{ parameters.testDropgz }} diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index 1e156e9318..e6e4119300 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -1,5 +1,6 @@ parameters: name: "" + testDropgz: "" steps: - bash: | @@ -57,7 +58,7 @@ steps: sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl cluster-info kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ= ${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aksswifte2e" displayName: "Run AKS Swift E2E" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml index e743518e9b..32c5189d49 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml @@ -2,6 +2,7 @@ parameters: name: "" displayName: "" pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: "" stages: - stage: ${{ parameters.name }} @@ -26,3 +27,4 @@ stages: - template: cilium-e2e-step-template.yaml parameters: name: ${{ parameters.name }} + testDropgz: ${{ parameters.testDropgz }} diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index 6125cedf87..1b5e4692f3 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -1,5 +1,6 @@ parameters: name: "" + testDropgz: "" steps: - bash: | @@ -84,7 +85,7 @@ steps: - script: | echo "Start Azilium E2E Tests" kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ= ${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aziliumTest" displayName: "Run Azilium E2E" diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index 6c7e9fc230..72c0a94905 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -3,9 +3,12 @@ pr: include: - master paths: + include: + - "zapai/*" + - "azure-ipam/*" + - "dropgz/*" exclude: - - ".*" - - docs + - "*" trigger: paths: @@ -14,12 +17,14 @@ trigger: - "azure-ipam/*" - "dropgz/*" exclude: - - docs + - "*" tags: include: - "zapai/*" - "azure-ipam/*" - "dropgz/*" + exclude: + - "*" stages: - stage: setup @@ -263,17 +268,31 @@ stages: name: $(name) platforms: $(platforms) - - template: singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml + # - template: singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml + # parameters: + # name: "ipam_dropgz_cilium_e2e" + # displayName: Azure-ipam and CNI-Dropgz for Cilium + # pipelineBuildImage: "$(BUILD_IMAGE)" + + # - template: singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml + # parameters: + # name: "ipam_dropgz_swift_e2e" + # displayName: Azure-ipam and CNI-Dropgz for Swift + # pipelineBuildImage: "$(BUILD_IMAGE)" + + - template: singletenancy/cilium/cilium-e2e-job-template.yaml parameters: - name: "ipam_dropgz_cilium_e2e" - displayName: Azure-ipam and CNI-Dropgz for Cilium + name: "cilium_e2e" + displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: true - - template: singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml + - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: - name: "ipam_dropgz_swift_e2e" - displayName: Azure-ipam and CNI-Dropgz for Swift + name: "aks_swift_e2e" + displayName: AKS Swift pipelineBuildImage: "$(BUILD_IMAGE)" + testDropgz: true - stage: cleanup displayName: Cleanup diff --git a/azure-ipam/main.go b/azure-ipam/main.go index d040da9d91..5063a87f41 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,6 +15,7 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) + log.Printf("trigger submod pipeline") os.Exit(1) } } From 36e06463a9ebc09d6b420cf539e33568ef14d5ea Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:59:13 -0700 Subject: [PATCH 14/25] change cleanup dependsOn --- .pipelines/submodules-pipeline.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index 72c0a94905..a914a6e555 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -297,8 +297,8 @@ stages: - stage: cleanup displayName: Cleanup dependsOn: - - ipam_dropgz_cilium_e2e - - ipam_dropgz_swift_e2e + - cilium_e2e + - aks_swift_e2e jobs: - job: delete_remote_artifacts displayName: Delete remote artifacts From a45b24c5e5482c442bf72d8823251412ca5c86f0 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 09:06:04 -0700 Subject: [PATCH 15/25] test parameter call --- .pipelines/singletenancy/aks-swift/e2e-step-template.yaml | 2 +- .pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index e6e4119300..3993ba88cd 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -58,7 +58,7 @@ steps: sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl cluster-info kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ= ${{ parameters.testDropgz }} + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aksswifte2e" displayName: "Run AKS Swift E2E" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index 1b5e4692f3..3c9347cca2 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -85,7 +85,7 @@ steps: - script: | echo "Start Azilium E2E Tests" kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ= ${{ parameters.testDropgz }} + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aziliumTest" displayName: "Run Azilium E2E" From 10bfb525f20939939da8a0a0ccd3671fac7e0291 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:06:14 -0700 Subject: [PATCH 16/25] export parameter --- .pipelines/singletenancy/aks-swift/e2e-step-template.yaml | 4 +++- .pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index 3993ba88cd..97f3c4f393 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -58,7 +58,9 @@ steps: sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl cluster-info kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=${{ parameters.testDropgz }} + export dropgzBool=${{ parameters.testDropgz }} + echo Test Dropgz bool set to $dropgzBool + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=$dropgzBool retryCountOnTaskFailure: 3 name: "aksswifte2e" displayName: "Run AKS Swift E2E" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index 3c9347cca2..eb3f28b175 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -85,7 +85,9 @@ steps: - script: | echo "Start Azilium E2E Tests" kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=${{ parameters.testDropgz }} + export dropgzBool=${{ parameters.testDropgz }} + echo Test Dropgz bool set to $dropgzBool + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=$dropgzBool retryCountOnTaskFailure: 3 name: "aziliumTest" displayName: "Run Azilium E2E" From 83a36073adf6363760a6a65ed4b19bbd5a652c91 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 11:30:38 -0700 Subject: [PATCH 17/25] skip setting testDropgz instead of setting false --- .pipelines/pipeline.yaml | 4 ++-- .pipelines/singletenancy/aks-swift/e2e-step-template.yaml | 4 +--- .pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml | 4 +--- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 9fa7947839..15b3863c0e 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -280,14 +280,14 @@ stages: name: "cilium_e2e" displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" - testDropgz: false + testDropgz: "" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: name: "aks_swift_e2e" displayName: AKS Swift pipelineBuildImage: "$(BUILD_IMAGE)" - testDropgz: false + testDropgz: "" - template: singletenancy/aks-engine/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index 97f3c4f393..3993ba88cd 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -58,9 +58,7 @@ steps: sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl kubectl cluster-info kubectl get po -owide -A - export dropgzBool=${{ parameters.testDropgz }} - echo Test Dropgz bool set to $dropgzBool - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=$dropgzBool + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aksswifte2e" displayName: "Run AKS Swift E2E" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index eb3f28b175..3c9347cca2 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -85,9 +85,7 @@ steps: - script: | echo "Start Azilium E2E Tests" kubectl get po -owide -A - export dropgzBool=${{ parameters.testDropgz }} - echo Test Dropgz bool set to $dropgzBool - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=$dropgzBool + sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=${{ parameters.testDropgz }} retryCountOnTaskFailure: 3 name: "aziliumTest" displayName: "Run Azilium E2E" From f807c4bfe30049733ff8291edb303c09c7ba66f4 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 14:31:25 -0700 Subject: [PATCH 18/25] removing ipam-dropgz templates and focus submod UT on azure-ipam --- .../ipam-dropgz-cilium-e2e-job-template.yaml | 29 ---- .../ipam-dropgz-cilium-e2e-step-template.yaml | 147 ------------------ .../ipam-dropgz-swift-e2e-job-template.yaml | 28 ---- .../ipam-dropgz-swift-e2e-step-template.yaml | 113 -------------- .pipelines/submodules-pipeline.yaml | 14 +- Makefile | 3 + 6 files changed, 4 insertions(+), 330 deletions(-) delete mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml delete mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml delete mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml delete mode 100644 .pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml deleted file mode 100644 index 076e0f108e..0000000000 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml +++ /dev/null @@ -1,29 +0,0 @@ -parameters: - name: "" - displayName: "" - pipelineBuildImage: "$(BUILD_IMAGE)" - directory: "" - -stages: - - stage: ${{ parameters.name }} - displayName: E2E - ${{ parameters.displayName }} - dependsOn: - - setup - - publish - jobs: - - job: ${{ parameters.name }} - displayName: Azure-ipam/Dropgz Cilium Test Suite - (${{ parameters.name }}) - timeoutInMinutes: 120 - pool: - name: $(BUILD_POOL_NAME_DEFAULT) - demands: - - agent.os -equals Linux - - Role -equals $(CUSTOM_E2E_ROLE) - variables: - GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path - GOBIN: "$(GOPATH)/bin" # Go binaries path - modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" - steps: - - template: ipam-dropgz-cilium-e2e-step-template.yaml - parameters: - name: ${{ parameters.name }} diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml deleted file mode 100644 index f7f9e17619..0000000000 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-step-template.yaml +++ /dev/null @@ -1,147 +0,0 @@ -parameters: - name: "" - -steps: - - bash: | - echo $UID - sudo rm -rf $(System.DefaultWorkingDirectory)/* - displayName: "Set up OS environment" - - - checkout: self - - - bash: | - go version - go env - mkdir -p '$(GOBIN)' - mkdir -p '$(GOPATH)/pkg' - mkdir -p '$(modulePath)' - echo '##vso[task.prependpath]$(GOBIN)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - name: "GoEnv" - displayName: "Set up the Go environment" - - - task: AzureCLI@1 - inputs: - azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - addSpnToEnvironment: true - inlineScript: | - mkdir -p ~/.kube/ - echo "Create AKS cluster" - make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=ipam-dropgz-e2e-$(make revision) - echo "Cluster successfully created" - displayName: Create test cluster - condition: succeeded() - - - script: | - ls -lah - pwd - echo "installing kubectl" - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - kubectl cluster-info - kubectl get po -owide -A - curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 - chmod 700 get_helm.sh - ./get_helm.sh - echo "deploy Cilium ConfigMap" - kubectl apply -f cilium/configmap.yaml - echo "install Cilium" - helm repo add cilium https://helm.cilium.io/ - helm install cilium cilium/cilium --version 1.12.1.1 --namespace kube-system -f cilium/cilium_helm_values.yaml - name: "installCilium" - displayName: "Install Cilium" - - - script: | - echo "install cilium CLI" - CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt) - CLI_ARCH=amd64 - if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi - curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum - sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin - rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} - cilium status - name: "installCiliumCLI" - displayName: "Install Cilium CLI" - - - script: | - echo "install kubetest2 and gsutils" - go get github.com/onsi/ginkgo/ginkgo - go get github.com/onsi/gomega/... - go install github.com/onsi/ginkgo/ginkgo@latest - go install sigs.k8s.io/kubetest2@latest - go install sigs.k8s.io/kubetest2/kubetest2-noop@latest - go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest - wget https://storage.googleapis.com/pub/gsutil.tar.gz - tar xfz gsutil.tar.gz - sudo mv gsutil /usr/local/bin - name: "installKubetest" - displayName: "Set up Conformance Tests" - - - script: | - echo "Start Azilium E2E Tests" - kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZILIUM=true TEST_DROPGZ=true - retryCountOnTaskFailure: 3 - name: "aziliumTest" - displayName: "Run Azilium E2E" - - - script: | - echo "Logs will be available as a build artifact" - ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/ - echo $ARTIFACT_DIR - sudo rm -rf $ARTIFACT_DIR - sudo mkdir $ARTIFACT_DIR - sudo cp test/integration/logs/* $ARTIFACT_DIR - name: "GetLogs" - displayName: "Get logs" - condition: always() - - - task: PublishBuildArtifacts@1 - inputs: - artifactName: test-output - pathtoPublish: "$(Build.ArtifactStagingDirectory)/test-output" - condition: always() - - - script: | - echo "Run Service Conformance E2E" - export PATH=${PATH}:/usr/local/bin/gsutil - KUBECONFIG=~/.kube/config kubetest2 noop \ - --test ginkgo -- \ - --focus-regex "Services.*\[Conformance\].*" - name: "servicesConformance" - displayName: "Run Services Conformance Tests" - - - script: | - echo "Run Cilium Connectivity Tests" - cilium status - cilium connectivity test - name: "ciliumConnectivityTests" - displayName: "Run Cilium Connectivity Tests" - - - script: | - ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/ - echo $ARTIFACT_DIR - sudo rm -rf $ARTIFACT_DIR - sudo rm -rf test/integration/logs - name: "Cleanupartifactdir" - displayName: "Cleanup artifact dir" - condition: always() - - - task: AzureCLI@2 - inputs: - azureSubscription: "Azure Container Networking - Test" - scriptLocation: "inlineScript" - scriptType: "bash" - addSpnToEnvironment: true - inlineScript: | - echo "Deleting cluster" - make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=ipam-dropgz-e2e-$(make revision) - echo "Cluster and resources down" - name: "Cleanupcluster" - displayName: "Cleanup cluster" - condition: always() diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml deleted file mode 100644 index 28d3046250..0000000000 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml +++ /dev/null @@ -1,28 +0,0 @@ -parameters: - name: "" - displayName: "" - pipelineBuildImage: "$(BUILD_IMAGE)" - -stages: - - stage: ${{ parameters.name }} - displayName: E2E - ${{ parameters.displayName }} - dependsOn: - - setup - - publish - jobs: - - job: ${{ parameters.name }} - displayName: Azure-ipam/Dropgz AKS Swift Suite - (${{ parameters.name }}) - timeoutInMinutes: 120 - pool: - name: $(BUILD_POOL_NAME_DEFAULT) - demands: - - agent.os -equals Linux - - Role -equals $(CUSTOM_E2E_ROLE) - variables: - GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path - GOBIN: "$(GOPATH)/bin" # Go binaries path - modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" - steps: - - template: ipam-dropgz-swift-e2e-step-template.yaml - parameters: - name: ${{ parameters.name }} diff --git a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml b/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml deleted file mode 100644 index be7146a093..0000000000 --- a/.pipelines/singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-step-template.yaml +++ /dev/null @@ -1,113 +0,0 @@ -parameters: - name: "" - -steps: - - bash: | - echo $UID - sudo rm -rf $(System.DefaultWorkingDirectory)/* - displayName: "Set up OS environment" - - - checkout: self - - - bash: | - go version - go env - mkdir -p '$(GOBIN)' - mkdir -p '$(GOPATH)/pkg' - mkdir -p '$(modulePath)' - echo '##vso[task.prependpath]$(GOBIN)' - echo '##vso[task.prependpath]$(GOROOT)/bin' - name: "GoEnv" - displayName: "Set up the Go environment" - - - task: AzureCLI@1 - inputs: - azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - addSpnToEnvironment: true - inlineScript: | - mkdir -p ~/.kube/ - echo "Create AKS cluster" - make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) - echo "Cluster successfully created" - displayName: Create test cluster - condition: succeeded() - - - script: | - echo "install kubetest2 and gsutils" - go get github.com/onsi/ginkgo/ginkgo - go get github.com/onsi/gomega/... - go install github.com/onsi/ginkgo/ginkgo@latest - go install sigs.k8s.io/kubetest2@latest - go install sigs.k8s.io/kubetest2/kubetest2-noop@latest - go install sigs.k8s.io/kubetest2/kubetest2-tester-ginkgo@latest - wget https://storage.googleapis.com/pub/gsutil.tar.gz - tar xfz gsutil.tar.gz - sudo mv gsutil /usr/local/bin - name: "installKubetest" - displayName: "Set up Conformance Tests" - - - script: | - ls -lah - pwd - echo "installing kubectl" - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" - sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl - kubectl cluster-info - kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-integration CNS_VERSION=$(make cns-version) CNI_DROPGZ_VERSION=$(make cni-dropgz-version) INSTALL_CNS=true INSTALL_AZURE_VNET=true TEST_DROPGZ=true - retryCountOnTaskFailure: 3 - name: "aksswifte2e" - displayName: "Run AKS Swift E2E" - - - script: | - echo "Logs will be available as a build artifact" - ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/aks-swift-output/ - echo $ARTIFACT_DIR - sudo rm -rf $ARTIFACT_DIR - sudo mkdir $ARTIFACT_DIR - sudo cp test/integration/logs/* $ARTIFACT_DIR - name: "GetLogs" - displayName: "Get logs" - condition: always() - - - task: PublishBuildArtifacts@1 - inputs: - artifactName: aks-swift-output - pathtoPublish: "$(Build.ArtifactStagingDirectory)/aks-swift-output" - condition: always() - - - script: | - echo "Run Service Conformance E2E" - export PATH=${PATH}:/usr/local/bin/gsutil - KUBECONFIG=~/.kube/config kubetest2 noop \ - --test ginkgo -- \ - --focus-regex "Services.*\[Conformance\].*" - name: "servicesConformance" - displayName: "Run Services Conformance Tests" - - - script: | - ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/aks-swift-output/ - echo $ARTIFACT_DIR - sudo rm -rf $ARTIFACT_DIR - sudo rm -rf test/integration/logs - name: "Cleanupartifactdir" - displayName: "Cleanup artifact dir" - condition: always() - - - task: AzureCLI@2 - inputs: - azureSubscription: "Azure Container Networking - Test" - scriptLocation: "inlineScript" - scriptType: "bash" - addSpnToEnvironment: true - inlineScript: | - echo "Deleting cluster" - make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) - echo "Cluster and resources down" - name: "Cleanupcluster" - displayName: "Cleanup cluster" - condition: always() diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index a914a6e555..90364f165d 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -68,7 +68,7 @@ stages: make tools # run test, echo exit status code to fd 3, pipe output from test to tee, which splits output to stdout and go-junit-report (which converts test output to report.xml), stdout from tee is redirected to fd 4. Take output written to fd 3 (which is the exit code of test), redirect to stdout, pipe to read from stdout then exit with that status code. Read all output from fd 4 (output from tee) and write to top stdout { { { { - sudo -E env "PATH=$PATH" make test-all; + sudo -E env "PATH=$PATH" make test-azure-ipam; echo $? >&3; } | tee >(build/tools/bin/go-junit-report > report.xml) >&4; } 3>&1; @@ -267,18 +267,6 @@ stages: parameters: name: $(name) platforms: $(platforms) - - # - template: singletenancy/ipam-dropgz/ipam-dropgz-cilium-e2e-job-template.yaml - # parameters: - # name: "ipam_dropgz_cilium_e2e" - # displayName: Azure-ipam and CNI-Dropgz for Cilium - # pipelineBuildImage: "$(BUILD_IMAGE)" - - # - template: singletenancy/ipam-dropgz/ipam-dropgz-swift-e2e-job-template.yaml - # parameters: - # name: "ipam_dropgz_swift_e2e" - # displayName: Azure-ipam and CNI-Dropgz for Swift - # pipelineBuildImage: "$(BUILD_IMAGE)" - template: singletenancy/cilium/cilium-e2e-job-template.yaml parameters: diff --git a/Makefile b/Makefile index 7be3d2724f..32d5c97566 100644 --- a/Makefile +++ b/Makefile @@ -716,6 +716,9 @@ test-extended-cyclonus: ## run the cyclonus test for npm. cd test/cyclonus && bash ./test-cyclonus.sh extended cd .. +test-azure-ipam: ## run the unit test for azure-ipam + cd $(AZURE_IPAM_DIR) && go test + kind: kind create cluster --config ./test/kind/kind.yaml From b6d4e330b020ac5bc09d924205e178e8a35105ee Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 15:59:31 -0700 Subject: [PATCH 19/25] remove parsing gatewayIP from azure-ipam unit tests --- azure-ipam/ipam_test.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/azure-ipam/ipam_test.go b/azure-ipam/ipam_test.go index 485ee4f928..ce84c8ebe7 100644 --- a/azure-ipam/ipam_test.go +++ b/azure-ipam/ipam_test.go @@ -162,16 +162,6 @@ func TestCmdAdd(t *testing.T) { IP: net.IPv4(10, 0, 1, 10), Mask: net.CIDRMask(24, 32), }, - Gateway: net.IPv4(10, 0, 0, 1), - }, - }, - Routes: []*cniTypes.Route{ - { - Dst: net.IPNet{ - IP: net.IPv4(0, 0, 0, 0), - Mask: net.CIDRMask(0, 32), - }, - GW: net.IPv4(10, 0, 0, 1), }, }, DNS: cniTypes.DNS{}, From 16f3e678168885ef4b408518be2c64052948ad14 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Thu, 6 Oct 2022 16:21:05 -0700 Subject: [PATCH 20/25] update make target test-azure-ipam --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 32d5c97566..d3c17da772 100644 --- a/Makefile +++ b/Makefile @@ -717,7 +717,7 @@ test-extended-cyclonus: ## run the cyclonus test for npm. cd .. test-azure-ipam: ## run the unit test for azure-ipam - cd $(AZURE_IPAM_DIR) && go test + cd $(AZURE_IPAM_DIR) && go test -mod=readonly -buildvcs=false -coverpkg=$(COVER_FILTER) -race -covermode atomic -failfast -coverprofile=coverage.out $(COVER_PKG)/... kind: kind create cluster --config ./test/kind/kind.yaml From 736cf85355c2421245dca89182606f0fe3384ca0 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 7 Oct 2022 09:39:13 -0700 Subject: [PATCH 21/25] update make target --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index d3c17da772..eeac218a16 100644 --- a/Makefile +++ b/Makefile @@ -717,6 +717,8 @@ test-extended-cyclonus: ## run the cyclonus test for npm. cd .. test-azure-ipam: ## run the unit test for azure-ipam + @$(eval COVER_FILTER=`go list --tags ignore_uncovered,ignore_autogenerated $(COVER_PKG)/... | tr '\n' ','`) + @echo Test coverpkg: $(COVER_FILTER) cd $(AZURE_IPAM_DIR) && go test -mod=readonly -buildvcs=false -coverpkg=$(COVER_FILTER) -race -covermode atomic -failfast -coverprofile=coverage.out $(COVER_PKG)/... kind: From 63d39211b389681c26f3db938152b40ad65fd037 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 7 Oct 2022 09:52:16 -0700 Subject: [PATCH 22/25] only publish test results --- .pipelines/submodules-pipeline.yaml | 14 -------------- Makefile | 4 +--- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index 90364f165d..db5f5d05be 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -78,13 +78,6 @@ stages: name: "Test" displayName: "Run Tests" - - bash: | - build/tools/bin/gocov convert coverage.out > coverage.json - build/tools/bin/gocov-xml < coverage.json > coverage.xml - name: "Coverage" - displayName: "Generate Coverage Reports" - condition: always() - - task: PublishTestResults@2 inputs: testRunner: JUnit @@ -92,13 +85,6 @@ stages: displayName: "Publish Test Results" condition: always() - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: coverage.xml - displayName: "Publish Code Coverage Results" - condition: always() - - stage: binaries displayName: Build Binaries dependsOn: diff --git a/Makefile b/Makefile index eeac218a16..32d5c97566 100644 --- a/Makefile +++ b/Makefile @@ -717,9 +717,7 @@ test-extended-cyclonus: ## run the cyclonus test for npm. cd .. test-azure-ipam: ## run the unit test for azure-ipam - @$(eval COVER_FILTER=`go list --tags ignore_uncovered,ignore_autogenerated $(COVER_PKG)/... | tr '\n' ','`) - @echo Test coverpkg: $(COVER_FILTER) - cd $(AZURE_IPAM_DIR) && go test -mod=readonly -buildvcs=false -coverpkg=$(COVER_FILTER) -race -covermode atomic -failfast -coverprofile=coverage.out $(COVER_PKG)/... + cd $(AZURE_IPAM_DIR) && go test kind: kind create cluster --config ./test/kind/kind.yaml From c2ee39e5ec21ab49fc38d4bee6a55368a6f0754d Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:25:23 -0700 Subject: [PATCH 23/25] omit npm build --- .pipelines/submodules-pipeline.yaml | 14 -------------- azure-ipam/main.go | 1 - 2 files changed, 15 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index db5f5d05be..7f313f0b2c 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -163,10 +163,6 @@ stages: arch: amd64 os: linux name: cns - npm_linux_amd64: - arch: amd64 - os: linux - name: npm steps: - template: containers/container-template.yaml parameters: @@ -193,10 +189,6 @@ stages: arch: arm64 os: linux name: cns - npm_linux_arm64: - arch: arm64 - os: linux - name: npm steps: - template: containers/container-template.yaml parameters: @@ -215,9 +207,6 @@ stages: cns_windows_amd64: arch: amd64 name: cns - npm_windows_amd64: - arch: amd64 - name: npm steps: - template: containers/container-template-windows.yaml parameters: @@ -245,9 +234,6 @@ stages: cns: name: cns platforms: linux/amd64 linux/arm64 windows/amd64 - npm: - name: npm - platforms: linux/amd64 linux/arm64 windows/amd64 steps: - template: containers/manifest-template.yaml parameters: diff --git a/azure-ipam/main.go b/azure-ipam/main.go index 5063a87f41..d040da9d91 100644 --- a/azure-ipam/main.go +++ b/azure-ipam/main.go @@ -15,7 +15,6 @@ import ( func main() { if err := executePlugin(); err != nil { log.Printf("error executing azure-ipam plugin: %v\n", err) - log.Printf("trigger submod pipeline") os.Exit(1) } } From 75d62c760823d439b1138ee29793ee96c4c08fa2 Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Mon, 10 Oct 2022 12:24:02 -0700 Subject: [PATCH 24/25] keep npm build and simplify unit testing stage --- .pipelines/submodules-pipeline.yaml | 32 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index 7f313f0b2c..a1ec9c83c7 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -59,32 +59,16 @@ stages: jobs: - job: test displayName: Run Tests - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT)" steps: - script: | make tools - # run test, echo exit status code to fd 3, pipe output from test to tee, which splits output to stdout and go-junit-report (which converts test output to report.xml), stdout from tee is redirected to fd 4. Take output written to fd 3 (which is the exit code of test), redirect to stdout, pipe to read from stdout then exit with that status code. Read all output from fd 4 (output from tee) and write to top stdout - { { { { - sudo -E env "PATH=$PATH" make test-azure-ipam; - echo $? >&3; - } | tee >(build/tools/bin/go-junit-report > report.xml) >&4; - } 3>&1; - } | { read xs; exit $xs; } - } 4>&1 + sudo -E env "PATH=$PATH" make test-azure-ipam; retryCountOnTaskFailure: 3 name: "Test" displayName: "Run Tests" - - task: PublishTestResults@2 - inputs: - testRunner: JUnit - testResultsFiles: report.xml - displayName: "Publish Test Results" - condition: always() - - stage: binaries displayName: Build Binaries dependsOn: @@ -163,6 +147,10 @@ stages: arch: amd64 os: linux name: cns + npm_linux_amd64: + arch: amd64 + os: linux + name: npm steps: - template: containers/container-template.yaml parameters: @@ -189,6 +177,10 @@ stages: arch: arm64 os: linux name: cns + npm_linux_arm64: + arch: arm64 + os: linux + name: npm steps: - template: containers/container-template.yaml parameters: @@ -207,6 +199,9 @@ stages: cns_windows_amd64: arch: amd64 name: cns + npm_windows_amd64: + arch: amd64 + name: npm steps: - template: containers/container-template-windows.yaml parameters: @@ -234,6 +229,9 @@ stages: cns: name: cns platforms: linux/amd64 linux/arm64 windows/amd64 + npm: + name: npm + platforms: linux/amd64 linux/arm64 windows/amd64 steps: - template: containers/manifest-template.yaml parameters: From 34da57228b213e68593cf2654029d2247a10e4aa Mon Sep 17 00:00:00 2001 From: camrynl <31013536+camrynl@users.noreply.github.com> Date: Fri, 14 Oct 2022 11:22:42 -0700 Subject: [PATCH 25/25] adjust cluster naming to avoid resource overlap in pipelines --- .pipelines/pipeline.yaml | 2 ++ .pipelines/singletenancy/aks-swift/e2e-job-template.yaml | 2 ++ .pipelines/singletenancy/aks-swift/e2e-step-template.yaml | 3 ++- .pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml | 2 ++ .pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml | 3 ++- .pipelines/submodules-pipeline.yaml | 2 ++ 6 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 15b3863c0e..f24a75e853 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -281,6 +281,7 @@ stages: displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: "" + clusterName: "ciliume2e" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: @@ -288,6 +289,7 @@ stages: displayName: AKS Swift pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: "" + clusterName: "swifte2e" - template: singletenancy/aks-engine/e2e-job-template.yaml parameters: diff --git a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml index cbd195c278..f79c23f867 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml @@ -3,6 +3,7 @@ parameters: displayName: "" pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: "" + clusterName: "" stages: - stage: ${{ parameters.name }} @@ -28,3 +29,4 @@ stages: parameters: name: ${{ parameters.name }} testDropgz: ${{ parameters.testDropgz }} + clusterName: ${{ parameters.clusterName }} diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index 3993ba88cd..8917289301 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -1,6 +1,7 @@ parameters: name: "" testDropgz: "" + clusterName: "" steps: - bash: | @@ -31,7 +32,7 @@ steps: mkdir -p ~/.kube/ echo "Create AKS cluster" make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) + make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision) echo "Cluster successfully created" displayName: Create test cluster condition: succeeded() diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml index 32c5189d49..3eced7361f 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-job-template.yaml @@ -3,6 +3,7 @@ parameters: displayName: "" pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: "" + clusterName: "" stages: - stage: ${{ parameters.name }} @@ -28,3 +29,4 @@ stages: parameters: name: ${{ parameters.name }} testDropgz: ${{ parameters.testDropgz }} + clusterName: ${{ parameters.clusterName }} diff --git a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml index 3c9347cca2..aeb976e5d6 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml @@ -1,6 +1,7 @@ parameters: name: "" testDropgz: "" + clusterName: "" steps: - bash: | @@ -31,7 +32,7 @@ steps: mkdir -p ~/.kube/ echo "Create AKS cluster" make -C ./hack/swift azcfg AZCLI=az - make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=ciliume2e-$(make revision) + make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision) echo "Cluster successfully created" displayName: Create test cluster condition: succeeded() diff --git a/.pipelines/submodules-pipeline.yaml b/.pipelines/submodules-pipeline.yaml index a1ec9c83c7..eedc9b551a 100644 --- a/.pipelines/submodules-pipeline.yaml +++ b/.pipelines/submodules-pipeline.yaml @@ -244,6 +244,7 @@ stages: displayName: Cilium pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: true + clusterName: "submodules-ciliume2e" - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: @@ -251,6 +252,7 @@ stages: displayName: AKS Swift pipelineBuildImage: "$(BUILD_IMAGE)" testDropgz: true + clusterName: "submodules-swifte2e" - stage: cleanup displayName: Cleanup