From 459a12ebfc0e0dada94db3472dd5d7637d732af8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 3 Nov 2024 19:37:11 -0800 Subject: [PATCH 01/52] Template --- .pipelines/containers/manifest-template.yaml | 19 +------ .pipelines/pipeline.yaml | 59 +++++--------------- .pipelines/run-pipeline.yaml | 7 +-- .pipelines/template.trigger.jobs.yaml | 2 +- .pipelines/templates/log-template.yaml | 9 +-- .pipelines/trigger.yaml | 24 ++++---- 6 files changed, 38 insertions(+), 82 deletions(-) diff --git a/.pipelines/containers/manifest-template.yaml b/.pipelines/containers/manifest-template.yaml index 3a6b386838..82e69bd962 100644 --- a/.pipelines/containers/manifest-template.yaml +++ b/.pipelines/containers/manifest-template.yaml @@ -36,22 +36,7 @@ steps: displayName: Manifest Push retryCountOnTaskFailure: 3 - - task: AzureCLI@2 - displayName: "Logout" - inputs: - azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - inlineScript: | - docker logout - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: "Add SBOM Generator tool" - inputs: - BuildDropPath: "$(Build.ArtifactStagingDirectory)" - - - task: PublishBuildArtifacts@1 + - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: "output" - pathtoPublish: "$(Build.ArtifactStagingDirectory)" - condition: succeeded() + targetPath: "$(Build.ArtifactStagingDirectory)" diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 61af558e89..396731db60 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -1,26 +1,7 @@ -pr: - branches: - include: - - master - - release/* - paths: - exclude: - - ".devcontainer" - - ".hooks" - - ".vscode" - - ".github" - - docs - -trigger: - branches: - include: - - gh-readonly-queue/master/* - tags: - include: - - "*" - stages: - stage: setup + variables: + ACN_DIR: $(Build.SourcesDirectory) displayName: ACN jobs: - job: env @@ -48,7 +29,6 @@ stages: echo $(Build.SourceBranch) name: "EnvironmentalVariables" displayName: "Set environmental variables" - condition: always() - template: templates/run-unit-tests.yaml @@ -58,6 +38,8 @@ stages: dependsOn: - setup - test + variables: + ACN_DIR: $(Build.SourcesDirectory) jobs: - job: build displayName: Build Binaries @@ -66,45 +48,27 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" steps: + - checkout: self - script: | make ipv6-hp-bpf-lib 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() - - stage: containerize displayName: Build Images dependsOn: - setup - test + variables: + ACN_DIR: $(Build.SourcesDirectory) jobs: - job: containerize_amd64 displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_AMD64)" strategy: + maxParallel: 4 matrix: azure_ipam_linux_amd64: arch: amd64 @@ -143,6 +107,7 @@ stages: name: npm os: windows steps: + - checkout: self - template: containers/container-template.yaml parameters: arch: $(arch) @@ -154,6 +119,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" strategy: + maxParallel: 4 matrix: azure_ipam_linux_arm64: arch: arm64 @@ -176,6 +142,7 @@ stages: name: npm os: linux steps: + - checkout: self - template: containers/container-template.yaml parameters: arch: $(arch) @@ -188,12 +155,14 @@ stages: - containerize variables: Packaging.EnableSBOMSigning: false + ACN_DIR: $(Build.SourcesDirectory) jobs: - job: manifest displayName: Compile Manifests pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: + maxParallel: 4 matrix: azure_ipam: name: azure-ipam @@ -399,6 +368,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: + maxParallel: 4 matrix: cilium_e2e: name: cilium_e2e @@ -462,6 +432,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: + maxParallel: 4 matrix: swiftv2_e2e: name: swiftv2_e2e diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index f69f3c3296..52ea7150c2 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -16,10 +16,9 @@ parameters: type: string default: '' - stages: - stage: setup - displayName: ACN + displayName: "[PreBuild] Configure and Provision Required Resources" # Block build start until pre-build validation occurs. dependsOn: pre_build variables: @@ -85,7 +84,6 @@ stages: workingDirectory: $(ACN_DIR) - script: | - mkdir -p ./output/bins cd ./output find . -name '*.tgz' -print -exec mv -t ./bins/ {} + find . -name '*.zip' -print -exec mv -t ./bins/ {} + @@ -93,13 +91,14 @@ stages: rm -rf !("bins") name: "PrepareArtifacts" displayName: "Prepare Artifacts" - + - task: CopyFiles@2 inputs: sourceFolder: "output" targetFolder: $(Build.ArtifactStagingDirectory) condition: succeeded() + - stage: containerize displayName: Build Images dependsOn: diff --git a/.pipelines/template.trigger.jobs.yaml b/.pipelines/template.trigger.jobs.yaml index ce7ba6354c..f5723a14be 100644 --- a/.pipelines/template.trigger.jobs.yaml +++ b/.pipelines/template.trigger.jobs.yaml @@ -53,7 +53,7 @@ jobs: TMPL_REPO_REF: '${{ parameters.mainRepoRef }}' TMPL_REPO_NAME: '${{ parameters.mainRepoName }}' TMPL_REPO_TYPE: '${{ parameters.mainRepoType }}' - ACCEPTED_REPO_REFS: '^refs/heads/feature/ob-onboard-0$' + ACCEPTED_REPO_REFS: '^refs/heads/feature/ob-onboard-2$' ACCEPTED_REPO_NAME: '^Azure/azure-container-networking$' ACCEPTED_REPO_TYPE: '^github$' diff --git a/.pipelines/templates/log-template.yaml b/.pipelines/templates/log-template.yaml index fee969889f..11d7abf80f 100644 --- a/.pipelines/templates/log-template.yaml +++ b/.pipelines/templates/log-template.yaml @@ -268,8 +268,9 @@ steps: displayName: Windows Logs condition: always() - - publish: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) - condition: always() - artifact: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) - name: acnLogs_${{ parameters.logType }} + - task: 1ES.PublishPipelineArtifact@1 displayName: Publish Cluster logs + condition: always() + inputs: + targetPath: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) + artifactName: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 8bed06043a..ee7cd12afc 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -21,14 +21,19 @@ trigger: none # include: # - "*" - resources: repositories: + + - repository: 1ESPipelineTemplates + type: git + name: 1ESPipelineTemplates/1ESPipelineTemplates + ref: refs/tags/stable + - repository: azure-container-networking type: github name: Azure/azure-container-networking endpoint: 'Azure-ACN RO Service Connection' - ref: refs/heads/feature/ob-onboard-0 + ref: refs/heads/feature/ob-onboard-2 variables: @@ -37,16 +42,11 @@ variables: REPO_NAME: $[ resources.repositories['azure-container-networking'].name ] REPO_TYPE: $[ resources.repositories['azure-container-networking'].type ] CHANGESET_COMMIT: $[ resources.repositories['self'].version ] - - -pool: - vmImage: ubuntu-latest - extends: - template: /.pipelines/template.trigger.jobs.yaml@azure-container-networking + template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: - mainRepoRef: $(REPO_REF) - mainRepoCommit: $(REPO_COMMIT) - mainRepoName: $(REPO_NAME) - mainRepoType: $(REPO_TYPE) + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + stages: + - template: /.pipelines/pipeline.yaml@azure-container-networking From a15519c9f005d675cb0c09f67bdcb7d1c59e6302 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:25:17 -0800 Subject: [PATCH 02/52] Use Separate Pipeline File --- .pipelines/pipeline.yaml | 59 ++++++--- .pipelines/run-pipeline.yaml | 241 ++++++++++++++--------------------- 2 files changed, 137 insertions(+), 163 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 396731db60..61af558e89 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -1,7 +1,26 @@ +pr: + branches: + include: + - master + - release/* + paths: + exclude: + - ".devcontainer" + - ".hooks" + - ".vscode" + - ".github" + - docs + +trigger: + branches: + include: + - gh-readonly-queue/master/* + tags: + include: + - "*" + stages: - stage: setup - variables: - ACN_DIR: $(Build.SourcesDirectory) displayName: ACN jobs: - job: env @@ -29,6 +48,7 @@ stages: echo $(Build.SourceBranch) name: "EnvironmentalVariables" displayName: "Set environmental variables" + condition: always() - template: templates/run-unit-tests.yaml @@ -38,8 +58,6 @@ stages: dependsOn: - setup - test - variables: - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: build displayName: Build Binaries @@ -48,27 +66,45 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" steps: - - checkout: self - script: | make ipv6-hp-bpf-lib 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() + - stage: containerize displayName: Build Images dependsOn: - setup - test - variables: - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: containerize_amd64 displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_AMD64)" strategy: - maxParallel: 4 matrix: azure_ipam_linux_amd64: arch: amd64 @@ -107,7 +143,6 @@ stages: name: npm os: windows steps: - - checkout: self - template: containers/container-template.yaml parameters: arch: $(arch) @@ -119,7 +154,6 @@ stages: pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" strategy: - maxParallel: 4 matrix: azure_ipam_linux_arm64: arch: arm64 @@ -142,7 +176,6 @@ stages: name: npm os: linux steps: - - checkout: self - template: containers/container-template.yaml parameters: arch: $(arch) @@ -155,14 +188,12 @@ stages: - containerize variables: Packaging.EnableSBOMSigning: false - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: manifest displayName: Compile Manifests pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: - maxParallel: 4 matrix: azure_ipam: name: azure-ipam @@ -368,7 +399,6 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: - maxParallel: 4 matrix: cilium_e2e: name: cilium_e2e @@ -432,7 +462,6 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: - maxParallel: 4 matrix: swiftv2_e2e: name: swiftv2_e2e diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 52ea7150c2..d239fb51ff 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -1,39 +1,14 @@ -parameters: - -- name: triggerBuildSourceBranch - type: string - default: '' - -- name: triggerBuildReason - type: string - default: '' - -- name: triggerBuildGitRef - type: string - default: '' - -- name: triggerBuildQueuedBy - type: string - default: '' - stages: - stage: setup - displayName: "[PreBuild] Configure and Provision Required Resources" - # Block build start until pre-build validation occurs. - dependsOn: pre_build variables: ACN_DIR: $(Build.SourcesDirectory) + displayName: ACN jobs: - job: env displayName: Setup pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_DEFAULT)" steps: - - checkout: ACNTools - clean: true - - script: | # To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage BUILD_NUMBER=$(Build.BuildNumber) @@ -48,12 +23,16 @@ stages: go env which go echo $PATH + echo "------" + echo $(Build.QueuedBy) + echo $(Build.Reason) # manual, PR, IndividualCI + echo $(Build.SourceBranch) name: "EnvironmentalVariables" displayName: "Set environmental variables" - - template: templates/unit-tests.stages.yaml@ACNTools + - template: templates/run-unit-tests.yaml - - ${{ if not(contains(parameters.triggerBuildSourceBranch, 'refs/pull')) }}: + - ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - stage: binaries displayName: Build Binaries dependsOn: @@ -66,38 +45,15 @@ stages: displayName: Build Binaries variables: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - ob_outputDirectory: $(Build.ArtifactStagingDirectory) - ob_git_checkout: true pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_DEFAULT)" steps: - - checkout: ACNReviewChanges - clean: true - + - checkout: self - script: | make ipv6-hp-bpf-lib make all-binaries-platforms name: "BuildAllPlatformBinaries" displayName: "Build all platform binaries" - workingDirectory: $(ACN_DIR) - - - script: | - 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() - - stage: containerize displayName: Build Images @@ -110,14 +66,11 @@ stages: - job: containerize_amd64 displayName: Build Images pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_LINUX_AMD64)" strategy: maxParallel: 4 matrix: azure_ipam_linux_amd64: - Suffix: azure_ipam_linux_amd64 arch: amd64 name: azure-ipam os: linux @@ -127,7 +80,6 @@ stages: name: azure-ipam os: windows cni_linux_amd64: - Suffix: cni_linux_amd64 arch: amd64 name: cni os: linux @@ -136,23 +88,11 @@ stages: arch: amd64 name: cni os: windows - cns_linux_amd64: - Suffix: cns_linux_amd64 - arch: amd64 - name: cns - os: linux - cns_windows_amd64: - Suffix: cns_windows_amd64 - arch: amd64 - name: cns - os: windows ipv6_hp_bpf_linux_amd64: - Suffix: ipv6_hp_bpf_linux_amd64 arch: amd64 name: ipv6-hp-bpf os: linux npm_linux_amd64: - Suffix: npm_linux_amd64 arch: amd64 name: npm os: linux @@ -166,10 +106,8 @@ stages: ob_artifactSuffix: $(Suffix) # this is needed to not collide published artifact containers ob_outputDirectory: $(System.ArtifactStagingDirectory) steps: - - checkout: ACNReviewChanges - clean: true - - - template: containers/container-template.steps.yaml@ACNTools + - checkout: self + - template: containers/container-template.yaml parameters: arch: $(arch) name: $(name) @@ -178,8 +116,6 @@ stages: - job: containerize_linux_arm64 displayName: Build Images pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_LINUX_ARM64)" strategy: maxParallel: 4 @@ -188,43 +124,30 @@ stages: arch: arm64 name: azure-ipam os: linux - Suffix: azure-ipam-linux-arm64 cni_linux_arm64: arch: arm64 name: cni os: linux - Suffix: cni-linux-arm64 cns_linux_arm64: arch: arm64 name: cns os: linux - Suffix: cns ipv6_hp_bpf_linux_arm64: arch: arm64 name: ipv6-hp-bpf os: linux - Suffix: ipv6-hp-bpf-linux-arm64 npm_linux_arm64: arch: arm64 name: npm os: linux - Suffix: npm-linux-arm64 - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - ob_outputDirectory: $(Build.ArtifactStagingDirectory) - ob_git_checkout: true - ob_artifactSuffix: $(Suffix) steps: - - checkout: ACNReviewChanges - clean: true - - - template: containers/container-template.steps.yaml@ACNTools + - checkout: self + - template: containers/container-template.yaml parameters: arch: $(arch) name: $(name) os: $(os) - - stage: publish displayName: Publish Multiarch Manifests dependsOn: @@ -236,8 +159,6 @@ stages: - job: manifest displayName: Compile Manifests pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: maxParallel: 4 @@ -245,42 +166,26 @@ stages: azure_ipam: name: azure-ipam platforms: linux/amd64 linux/arm64 windows/amd64 - Suffix: azure-ipam cni: name: cni platforms: linux/amd64 linux/arm64 windows/amd64 - Suffix: cni cns: name: cns platforms: linux/amd64 linux/arm64 windows/amd64 - Suffix: cns ipv6_hp_bpf: name: ipv6-hp-bpf platforms: linux/amd64 linux/arm64 - Suffix: ipv6-hp-bpf npm: name: npm platforms: linux/amd64 linux/arm64 windows/amd64 - Suffix: npm - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory) - ob_git_checkout: true - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - # this is needed to not collide published artifact containers - #ob_artifactBaseName: drop_$(Job.StageName)_$(Job.JobName)_ - ob_artifactSuffix: $(Suffix) - #artifactName: ${{ ob_artifactBaseName }}${{ name }} steps: - - checkout: ACNReviewChanges - clean: true - - - template: containers/manifest-template.steps.yaml@ACNTools + - template: containers/manifest-template.yaml parameters: name: $(name) platforms: $(platforms) # Cilium Podsubnet E2E tests - - template: singletenancy/cilium/cilium-e2e.jobs.yaml@ACNTools + - template: singletenancy/cilium/cilium-e2e-job-template.yaml parameters: name: "cilium_e2e" displayName: Cilium @@ -290,8 +195,19 @@ stages: k8sVersion: "" dependsOn: "containerize" + # Cilium Nodesubnet E2E tests + - template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e-job-template.yaml + parameters: + name: "cilium_nodesubnet_e2e" + displayName: Cilium NodeSubnet + clusterType: nodesubnet-byocni-nokubeproxy-up + clusterName: "cilndsubnete2e" + vmSize: Standard_B2s + k8sVersion: "" + dependsOn: "containerize" + # Cilium Overlay E2E tests - - template: singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml@ACNTools + - template: singletenancy/cilium-overlay/cilium-overlay-e2e-job-template.yaml parameters: name: "cilium_overlay_e2e" displayName: Cilium on AKS Overlay @@ -302,7 +218,7 @@ stages: dependsOn: "containerize" # Cilium Dualstack Overlay E2E tests - - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml@ACNTools + - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e-job-template.yaml parameters: name: "cilium_dualstackoverlay_e2e" displayName: Cilium on AKS DualStack Overlay @@ -313,8 +229,8 @@ stages: k8sVersion: "" dependsOn: "containerize" - # Cilium Overlay with hubble E2E tests - - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml@ACNTools + # Cilium Overlay with hubble E2E tests + - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e-job-template.yaml parameters: name: "cilium_h_overlay_e2e" displayName: Cilium on AKS Overlay with Hubble @@ -326,7 +242,7 @@ stages: testHubble: true # Azure Overlay E2E tests - - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml@ACNTools + - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e-job-template.yaml parameters: name: "azure_overlay_e2e" displayName: Azure Overlay @@ -337,8 +253,19 @@ stages: k8sVersion: "" dependsOn: "containerize" + # Azure Overlay E2E Stateless CNI tests + - template: singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e-job-template.yaml + parameters: + name: "azure_overlay_stateless_e2e" + displayName: Azure Stateless CNI Overlay + os: windows + clusterType: overlay-byocni-up + clusterName: "statelesswin" + vmSize: Standard_B2ms + dependsOn: "containerize" + # AKS Swift E2E tests - - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml@ACNTools + - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: name: "aks_swift_e2e" displayName: AKS Swift Ubuntu @@ -350,7 +277,7 @@ stages: dependsOn: "containerize" # AKS Swift Vnet Scale E2E tests - - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml@ACNTools + - template: singletenancy/aks-swift/e2e-job-template.yaml parameters: name: "aks_swift_vnetscale_e2e" displayName: AKS Swift Vnet Scale Ubuntu @@ -358,11 +285,11 @@ stages: clusterType: vnetscale-swift-byocni-up clusterName: "vscaleswifte2e" vmSize: Standard_B2ms - k8sVersion: "1.28" + k8sVersion: "1.30" dependsOn: "containerize" # CNIv1 E2E tests - - template: singletenancy/aks/aks-e2e.jobs.yaml@ACNTools + - template: singletenancy/aks/e2e-job-template.yaml parameters: name: "aks_ubuntu_22_linux_e2e" displayName: AKS Ubuntu 22 @@ -375,7 +302,7 @@ stages: scaleup: 100 dependsOn: "containerize" - - template: singletenancy/aks/aks-e2e.jobs.yaml@ACNTools + - template: singletenancy/aks/e2e-job-template.yaml parameters: name: "aks_windows_22_e2e" displayName: AKS Windows 2022 @@ -389,7 +316,7 @@ stages: dependsOn: "containerize" # CNI dual stack overlay E2E tests - - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml@ACNTools + - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e-job-template.yaml parameters: name: "dualstackoverlay_e2e" displayName: AKS DualStack Overlay @@ -400,7 +327,7 @@ stages: dependsOn: "containerize" # Swiftv2 E2E tests with multitenancy cluster start up - - template: multitenancy/swiftv2-e2e.jobs.yaml@ACNTools + - template: multitenancy/swiftv2-e2e-job-template.yaml parameters: name: "swiftv2_e2e" displayName: Swiftv2 Multitenancy @@ -420,8 +347,10 @@ stages: dependsOn: - setup - azure_overlay_e2e + - azure_overlay_stateless_e2e - aks_swift_e2e - cilium_e2e + - cilium_nodesubnet_e2e - cilium_overlay_e2e - cilium_h_overlay_e2e - aks_ubuntu_22_linux_e2e @@ -431,76 +360,92 @@ stages: - cilium_dualstackoverlay_e2e - swiftv2_e2e variables: - ACN_DIR: $(Build.SourcesDirectory) commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: - - job: delete + - job: delete_build displayName: Delete Cluster pool: - isCustom: true - type: linux name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: + maxParallel: 4 matrix: cilium_e2e: name: cilium_e2e clusterName: "ciliume2e" - Suffix: cilium_e2e + region: $(REGION_AKS_CLUSTER_TEST) + cilium_nodesubnet_e2e: + name: cilium_nodesubnet_e2e + clusterName: "cilndsubnete2e" + region: $(REGION_AKS_CLUSTER_TEST) cilium_overlay_e2e: name: cilium_overlay_e2e clusterName: "cilovere2e" - Suffix: cilium_overlay_e2e + region: $(REGION_AKS_CLUSTER_TEST) cilium_h_overlay_e2e: name: cilium_h_overlay_e2e clusterName: "cilwhleovere2e" - Suffix: cilium_h_overlay_e2e + region: $(REGION_AKS_CLUSTER_TEST) azure_overlay_e2e: name: azure_overlay_e2e clusterName: "azovere2e" - Suffix: azure_overlay_e2e + region: $(REGION_AKS_CLUSTER_TEST) + azure_overlay_stateless_e2e: + name: azure_overlay_stateless_e2e + clusterName: "statelesswin" + region: $(REGION_AKS_CLUSTER_TEST) aks_swift_e2e: name: aks_swift_e2e clusterName: "swifte2e" - Suffix: aks_swift_e2e + region: $(REGION_AKS_CLUSTER_TEST) aks_swift_vnetscale_e2e: name: aks_swift_vnetscale_e2e clusterName: "vscaleswifte2e" - Suffix: aks_swift_vnetscale_e2e + region: $(REGION_AKS_CLUSTER_TEST) aks_ubuntu_22_linux_e2e: name: aks_ubuntu_22_linux_e2e clusterName: "ubuntu22e2e" - Suffix: aks_ubuntu_22_linux_e2e + region: $(REGION_AKS_CLUSTER_TEST) aks_windows_22_e2e: name: aks_windows_22_e2e clusterName: "win22e2e" - Suffix: aks_windows_22_e2e + region: $(REGION_AKS_CLUSTER_TEST) dualstackoverlay_e2e: name: dualstackoverlay_e2e clusterName: "dsovere2e" - Suffix: dualstackoverlay_e2e + region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) cilium_dualstackoverlay_e2e: name: cilium_dualstackoverlay_e2e clusterName: "cildsovere2e" - Suffix: cilium_dualstackoverlay_e2e + region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) + steps: + - template: templates/delete-cluster.yaml + parameters: + name: $(name) + clusterName: $(clusterName)-$(commitID) + region: $(region) + sub: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) + svcConn: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + + - job: delete_test + displayName: Delete Cluster + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + strategy: + maxParallel: 4 + matrix: swiftv2_e2e: name: swiftv2_e2e - clusterName: "mtcluster" - Suffix: swiftv2_e2e + clusterName: "mtacluster" + region: $(REGION_SWIFTV2_CLUSTER_TEST) swiftv2_dummy_e2e: name: swiftv2_dummy_e2e clusterName: "swiftv2dummy" - Suffix: swiftv2_dummy_e2e - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - ob_outputDirectory: $(Build.ArtifactStagingDirectory) - ob_git_checkout: true - ob_artifactSuffix: $(Suffix) # this is needed to not collide published artifact containers + region: $(REGION_SWIFTV2_CLUSTER_TEST) steps: - - checkout: ACNReviewChanges - clean: true - - - template: templates/delete-cluster.steps.yaml@ACNTools + - template: templates/delete-cluster.yaml parameters: name: $(name) clusterName: $(clusterName)-$(commitID) - region: $(REGION_AKS_CLUSTER_TEST) + region: $(region) + sub: $(SUB_AZURE_NETWORK_AGENT_TEST) + svcConn: $(ACN_TEST_SERVICE_CONNECTION) From 1b6926b27a1aa7071ebc3f9a43addfa580fc698e Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:30:46 -0800 Subject: [PATCH 03/52] fixup! Template --- .../OneBranch.NonOfficial.CrossPlat.yaml | 28 ------------------- .pipelines/OneBranch.Official.CrossPlat.yaml | 27 ------------------ 2 files changed, 55 deletions(-) delete mode 100644 .pipelines/OneBranch.NonOfficial.CrossPlat.yaml delete mode 100644 .pipelines/OneBranch.Official.CrossPlat.yaml diff --git a/.pipelines/OneBranch.NonOfficial.CrossPlat.yaml b/.pipelines/OneBranch.NonOfficial.CrossPlat.yaml deleted file mode 100644 index 35f263ec6e..0000000000 --- a/.pipelines/OneBranch.NonOfficial.CrossPlat.yaml +++ /dev/null @@ -1,28 +0,0 @@ -trigger: none - -variables: - WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # for Windows jobs - LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0' # for Linux jobs - -resources: - repositories: - - repository: templates - type: git - name: OneBranch.Pipelines/GovernedTemplates - ref: refs/heads/main - -extends: - template: v2/OneBranch.NonOfficial.CrossPlat.yml@templates - parameters: - featureFlags: - WindowsHostVersion: 1ESWindows2022 - stages: - - stage: build - jobs: - - job: main - pool: - type: windows - variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out' - steps: [] - diff --git a/.pipelines/OneBranch.Official.CrossPlat.yaml b/.pipelines/OneBranch.Official.CrossPlat.yaml deleted file mode 100644 index e67c7df267..0000000000 --- a/.pipelines/OneBranch.Official.CrossPlat.yaml +++ /dev/null @@ -1,27 +0,0 @@ -trigger: none - -variables: - WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' # for Windows jobs - LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0' # for Linux jobs - -resources: - repositories: - - repository: templates - type: git - name: OneBranch.Pipelines/GovernedTemplates - ref: refs/heads/main - -extends: - template: v2/OneBranch.Official.CrossPlat.yml@templates - parameters: - featureFlags: - WindowsHostVersion: 1ESWindows2022 - stages: - - stage: build - jobs: - - job: main - pool: - type: windows - variables: - ob_outputDirectory: '$(Build.SourcesDirectory)\out' - steps: [] From ad44eafbaecf2fe7da0bf8aa9ec6e0aa8e3fbb8e Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:33:44 -0800 Subject: [PATCH 04/52] fixup! Template --- .pipelines/trigger.yaml | 43 ++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index ee7cd12afc..8cc2d2df86 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -1,25 +1,24 @@ -trigger: none -#pr: -# branches: -# include: -# - master -# - release/* -# paths: -# exclude: -# - ".devcontainer" -# - ".hooks" -# - ".vscode" -# - ".github" -# - docs -# -# -#trigger: -# branches: -# include: -# - gh-readonly-queue/master/* -# tags: -# include: -# - "*" +pr: + branches: + include: + - master + - release/* + paths: + exclude: + - ".devcontainer" + - ".hooks" + - ".vscode" + - ".github" + - docs + + +trigger: + branches: + include: + - gh-readonly-queue/master/* + tags: + include: + - "*" resources: repositories: From 238fcc0e93e0f58a8cc1a6aba7c54d929926f358 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:55:01 -0800 Subject: [PATCH 05/52] fixup! Template --- .pipelines/trigger.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 8cc2d2df86..7a5a4f6ea9 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -41,11 +41,18 @@ variables: REPO_NAME: $[ resources.repositories['azure-container-networking'].name ] REPO_TYPE: $[ resources.repositories['azure-container-networking'].type ] CHANGESET_COMMIT: $[ resources.repositories['self'].version ] + # Local analysis is only enabled on PR branches + Codeql.AnalyzeInPipeline: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')] extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" + codeql: + # Enables CodeQL on the main branch + compiled: + enabled: true + # Enables CodeQL on PR branches + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/')) }}: + enabledOnNonDefaultBranches: true stages: - template: /.pipelines/pipeline.yaml@azure-container-networking From d443e38ca33b052933564b577485451030fe543d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:56:54 -0800 Subject: [PATCH 06/52] fixup! Template --- .pipelines/trigger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 7a5a4f6ea9..fbdc0b707c 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -52,7 +52,7 @@ extends: compiled: enabled: true # Enables CodeQL on PR branches - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/')) }}: + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true stages: - template: /.pipelines/pipeline.yaml@azure-container-networking From cf851ac2af12e4b1efe8eb6963d1bfbdae117b9c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:59:47 -0800 Subject: [PATCH 07/52] fixup! Template --- .pipelines/trigger.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index fbdc0b707c..3fa01856a7 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -47,12 +47,13 @@ variables: extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: - codeql: - # Enables CodeQL on the main branch - compiled: - enabled: true - # Enables CodeQL on PR branches - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: - enabledOnNonDefaultBranches: true + sdl: + codeql: + # Enables CodeQL on the main branch + compiled: + enabled: true + # Enables CodeQL on PR branches + ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: + enabledOnNonDefaultBranches: true stages: - template: /.pipelines/pipeline.yaml@azure-container-networking From dfed76509f9b9e705a2f5de58a84739d9ca35ab4 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 8 Nov 2024 16:22:57 -0800 Subject: [PATCH 08/52] fixup! Template --- .pipelines/trigger.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 3fa01856a7..1ce7fa89f5 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -48,6 +48,9 @@ extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: sdl: + sourceAnalysisPool: + name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) + os: windows codeql: # Enables CodeQL on the main branch compiled: From 1aaa8cc0d15b84f87a14611d71f4788734843861 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 16:04:12 -0800 Subject: [PATCH 09/52] fixup! Template --- .pipelines/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 61af558e89..96e36875d1 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -27,6 +27,7 @@ stages: displayName: Setup pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux steps: - script: | # To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage From cd544beebc4d47039d8fb6d2f56570b0404e7025 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 16:49:58 -0800 Subject: [PATCH 10/52] fixup! Template --- .pipelines/pipeline.yaml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 96e36875d1..8a8053cea7 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -1,24 +1,3 @@ -pr: - branches: - include: - - master - - release/* - paths: - exclude: - - ".devcontainer" - - ".hooks" - - ".vscode" - - ".github" - - docs - -trigger: - branches: - include: - - gh-readonly-queue/master/* - tags: - include: - - "*" - stages: - stage: setup displayName: ACN From 8638f02f07100263c0ee063f626fa7f1c7a42535 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:00:30 -0800 Subject: [PATCH 11/52] fixup! Template --- .pipelines/pipeline.yaml | 6 ++++++ .pipelines/templates/run-unit-tests.yaml | 2 ++ 2 files changed, 8 insertions(+) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 8a8053cea7..a06b9f089d 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -45,6 +45,7 @@ stages: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux steps: - script: | make ipv6-hp-bpf-lib @@ -84,6 +85,7 @@ stages: displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_AMD64)" + os: linux strategy: matrix: azure_ipam_linux_amd64: @@ -133,6 +135,7 @@ stages: displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" + os: linux strategy: matrix: azure_ipam_linux_arm64: @@ -173,6 +176,7 @@ stages: displayName: Compile Manifests pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: matrix: azure_ipam: @@ -378,6 +382,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: matrix: cilium_e2e: @@ -441,6 +446,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: matrix: swiftv2_e2e: diff --git a/.pipelines/templates/run-unit-tests.yaml b/.pipelines/templates/run-unit-tests.yaml index cedcae057d..7fc6053bd9 100644 --- a/.pipelines/templates/run-unit-tests.yaml +++ b/.pipelines/templates/run-unit-tests.yaml @@ -10,6 +10,7 @@ stages: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux steps: - script: | make tools @@ -36,6 +37,7 @@ stages: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS_ALT)" + os: windows steps: - script: | cd npm/ From 509f7a4b2bb4c468bff3cbc6b6be7c69eba6f3d9 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:31:51 -0800 Subject: [PATCH 12/52] fixup! Template --- .pipelines/templates/run-unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/templates/run-unit-tests.yaml b/.pipelines/templates/run-unit-tests.yaml index 7fc6053bd9..408074b1c0 100644 --- a/.pipelines/templates/run-unit-tests.yaml +++ b/.pipelines/templates/run-unit-tests.yaml @@ -36,7 +36,7 @@ stages: variables: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: - name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS_ALT)" + name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" os: windows steps: - script: | From 618f471d8670a543b0c9e6135e98e506831e2704 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:49:08 -0800 Subject: [PATCH 13/52] fixup! Template --- .pipelines/pipeline.yaml | 10 ++++++++++ .pipelines/templates/run-unit-tests.yaml | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index a06b9f089d..656f04af0c 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -47,6 +47,10 @@ stages: name: "$(BUILD_POOL_NAME_DEFAULT)" os: linux steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - script: | make ipv6-hp-bpf-lib make all-binaries-platforms @@ -125,6 +129,9 @@ stages: name: npm os: windows steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) - template: containers/container-template.yaml parameters: arch: $(arch) @@ -195,6 +202,9 @@ stages: name: npm platforms: linux/amd64 linux/arm64 windows/amd64 steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) - template: containers/manifest-template.yaml parameters: name: $(name) diff --git a/.pipelines/templates/run-unit-tests.yaml b/.pipelines/templates/run-unit-tests.yaml index 408074b1c0..2d7baf921a 100644 --- a/.pipelines/templates/run-unit-tests.yaml +++ b/.pipelines/templates/run-unit-tests.yaml @@ -12,6 +12,10 @@ stages: name: "$(BUILD_POOL_NAME_DEFAULT)" os: linux steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - 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 @@ -39,6 +43,10 @@ stages: name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" os: windows steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - script: | cd npm/ go test ./... From 2249b3c9d3c9c2e5c920a17ed6710f2ae4767115 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 22:48:06 -0800 Subject: [PATCH 14/52] fixup! Template --- .pipelines/pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 656f04af0c..7c6aa71295 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -73,7 +73,7 @@ stages: targetFolder: $(Build.ArtifactStagingDirectory) condition: succeeded() - - task: PublishBuildArtifacts@1 + - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: "output" pathtoPublish: "$(Build.ArtifactStagingDirectory)" From 9c965d26bcd0d9185cc9e74a84a7a50525d52dee Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 22:49:24 -0800 Subject: [PATCH 15/52] fixup! Template --- .pipelines/pipeline.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 7c6aa71295..5af557035b 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -76,8 +76,7 @@ stages: - task: 1ES.PublishPipelineArtifact@1 inputs: artifactName: "output" - pathtoPublish: "$(Build.ArtifactStagingDirectory)" - condition: succeeded() + targetPath: "$(Build.ArtifactStagingDirectory)" - stage: containerize displayName: Build Images From 3b96a6b0cba9ba3b3a7a33a61d1f62f8037335d4 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 23:40:34 -0800 Subject: [PATCH 16/52] fixup! Template --- .../containers/container-template.steps.yaml | 34 +++------ .../containers/manifest-template.steps.yaml | 19 +---- .pipelines/run-pipeline.yaml | 73 +++++++++++++------ 3 files changed, 64 insertions(+), 62 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 3867ffa7e9..f3dc5e505f 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -5,33 +5,19 @@ parameters: steps: - task: AzureCLI@2 - displayName: "Login" - inputs: - azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - inlineScript: | - az acr login -n $(ACR) - -- script: | - set -e - if [ "$IN_OS" = 'windows' ]; then export BUILDX_ACTION='--push'; fi - make "$IMGNAME" OS="$IN_OS" ARCH="$IN_ARCH" - name: image_build - displayName: Image Build - workingDirectory: $(ACN_DIR) + displayName: "Image Build" retryCountOnTaskFailure: 3 - env: - IMGNAME: '${{ parameters.name }}-image' - IN_OS: '${{ parameters.os }}' - IN_ARCH: '${{ parameters.arch }}' - -- task: AzureCLI@2 - displayName: "Logout" inputs: azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) + addSpnToEnvironment: True scriptLocation: "inlineScript" scriptType: "bash" inlineScript: | - docker logout - + set -e + make "$MAKE_CMD" + env: + OS: ${{ parameters.os }} + ARCH: ${{ parameters.arch }} + MAKE_CMD: ${{ parameters.name }}-image + ${{ if eq(parameters.os, 'windows') }}: + BUILDX_ACTION: '--push' diff --git a/.pipelines/containers/manifest-template.steps.yaml b/.pipelines/containers/manifest-template.steps.yaml index a8d1916460..82e69bd962 100644 --- a/.pipelines/containers/manifest-template.steps.yaml +++ b/.pipelines/containers/manifest-template.steps.yaml @@ -15,8 +15,7 @@ steps: - script: | set -e - make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" - workingDirectory: $(ACN_DIR) + make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" name: manifest_build displayName: Manifest Build retryCountOnTaskFailure: 3 @@ -35,19 +34,9 @@ steps: make ${{ parameters.name }}-skopeo-archive IMAGE_ARCHIVE_DIR=$(Build.ArtifactStagingDirectory)/images name: manifest_push displayName: Manifest Push - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - - task: AzureCLI@2 - displayName: "Logout" - inputs: - azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - inlineScript: | - docker logout - - - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 - displayName: "Add SBOM Generator tool" + - task: 1ES.PublishPipelineArtifact@1 inputs: - BuildDropPath: "$(Build.ArtifactStagingDirectory)" + artifactName: "output" + targetPath: "$(Build.ArtifactStagingDirectory)" diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index d239fb51ff..efb5e17681 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -1,13 +1,12 @@ stages: - stage: setup - variables: - ACN_DIR: $(Build.SourcesDirectory) displayName: ACN jobs: - job: env displayName: Setup pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux steps: - script: | # To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage @@ -38,8 +37,6 @@ stages: dependsOn: - setup - test - variables: - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: build displayName: Build Binaries @@ -47,26 +44,48 @@ stages: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux steps: - - checkout: self + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - script: | make ipv6-hp-bpf-lib 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) + + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: "output" + targetPath: "$(Build.ArtifactStagingDirectory)" + - stage: containerize displayName: Build Images dependsOn: - setup - test - variables: - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: containerize_amd64 displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_AMD64)" + os: linux strategy: maxParallel: 4 matrix: @@ -74,8 +93,7 @@ stages: arch: amd64 name: azure-ipam os: linux - azure_ipam_windows_amd64: - Suffix: azure_ipam_windows_amd64 + azure_ipam_windows: arch: amd64 name: azure-ipam os: windows @@ -84,10 +102,17 @@ stages: name: cni os: linux cni_windows_amd64: - Suffix: cni_windows_amd64 arch: amd64 name: cni os: windows + cns_linux_amd64: + arch: amd64 + name: cns + os: linux + cns_windows_amd64: + arch: amd64 + name: cns + os: windows ipv6_hp_bpf_linux_amd64: arch: amd64 name: ipv6-hp-bpf @@ -97,26 +122,24 @@ stages: name: npm os: linux npm_windows_amd64: - Suffix: npm_windows_amd64 arch: amd64 name: npm os: windows - variables: - ob_git_checkout: true - ob_artifactSuffix: $(Suffix) # this is needed to not collide published artifact containers - ob_outputDirectory: $(System.ArtifactStagingDirectory) steps: - - checkout: self - - template: containers/container-template.yaml + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - template: containers/container-template.steps.yaml parameters: arch: $(arch) name: $(name) os: $(os) - + os_version: $(os_version) - job: containerize_linux_arm64 displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" + os: linux strategy: maxParallel: 4 matrix: @@ -141,8 +164,7 @@ stages: name: npm os: linux steps: - - checkout: self - - template: containers/container-template.yaml + - template: containers/container-template.steps.yaml parameters: arch: $(arch) name: $(name) @@ -154,12 +176,12 @@ stages: - containerize variables: Packaging.EnableSBOMSigning: false - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: manifest displayName: Compile Manifests pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: maxParallel: 4 matrix: @@ -179,7 +201,10 @@ stages: name: npm platforms: linux/amd64 linux/arm64 windows/amd64 steps: - - template: containers/manifest-template.yaml + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - template: containers/manifest-template.steps.yaml parameters: name: $(name) platforms: $(platforms) @@ -366,6 +391,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: maxParallel: 4 matrix: @@ -430,6 +456,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: maxParallel: 4 matrix: From 84560051214c8d6223c5a71b4417705fcada7ddc Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:23:27 -0800 Subject: [PATCH 17/52] Separate Build Changes --- .../cni/k8s-e2e/k8s-e2e-job-template.yaml | 2 +- .pipelines/containers/manifest-template.yaml | 19 ++- .pipelines/multitenancy/swiftv2-e2e.jobs.yaml | 16 +-- .../multitenancy/swiftv2-e2e.steps.yaml | 28 +--- .pipelines/pipeline.yaml | 47 ++++--- .pipelines/run-pipeline.yaml | 30 ++-- .../aks-swift/aks-swift-e2e.jobs.yaml | 28 +--- .../aks-swift/aks-swift-e2e.steps.yaml | 74 +++++----- .../singletenancy/aks/aks-e2e.jobs.yaml | 35 ++--- .../singletenancy/aks/aks-e2e.steps.yaml | 61 ++++---- .../azure-cni-overlay-stateless-e2e.jobs.yaml | 94 +++++++++++++ ...azure-cni-overlay-stateless-e2e.steps.yaml | 102 ++++++++++++++ .../add-windows-nodepool.jobs.yaml | 69 +++++++++ .../azure-cni-overlay-e2e.jobs.yaml | 101 +++----------- .../azure-cni-overlay-e2e.steps.yaml | 124 +++++++++------- .../cilium-dualstackoverlay-e2e.jobs.yaml | 28 +--- .../cilium-dualstackoverlay-e2e.steps.yaml | 92 ++++++------ .../cilium-nodesubnet-e2e.jobs.yaml | 96 +++++++++++++ .../cilium-nodesubnet-e2e.steps.yaml | 75 ++++++++++ .../cilium-overlay-e2e.jobs.yaml | 28 +--- .../cilium-overlay-e2e.steps.yaml | 105 ++++++-------- .../cilium-overlay-e2e.jobs.yaml | 28 +--- .../cilium-overlay-e2e.steps.yaml | 94 ++++++------- .../singletenancy/cilium/cilium-e2e.jobs.yaml | 37 ++--- .../cilium/cilium-e2e.steps.yaml | 132 +++--------------- .../dualstackoverlay-e2e.jobs.yaml | 103 +++----------- .../dualstackoverlay-e2e.steps.yaml | 122 +++++++++------- .../create-cluster-swiftv2.jobs.yaml | 47 ------- .pipelines/templates/create-cluster.jobs.yaml | 55 ++++---- .../templates/delete-cluster.steps.yaml | 16 ++- .pipelines/templates/delete-cluster.yaml | 20 --- .pipelines/templates/log-template.steps.yaml | 24 ++-- .pipelines/templates/log-template.yaml | 9 +- .pipelines/trigger.yaml | 2 +- 34 files changed, 1004 insertions(+), 939 deletions(-) create mode 100644 .pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml create mode 100644 .pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.steps.yaml create mode 100644 .pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml create mode 100644 .pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml create mode 100644 .pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.steps.yaml delete mode 100644 .pipelines/templates/create-cluster-swiftv2.jobs.yaml delete mode 100644 .pipelines/templates/delete-cluster.yaml diff --git a/.pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml b/.pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml index 72c9092d76..fb7e79582e 100644 --- a/.pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml +++ b/.pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml @@ -8,11 +8,11 @@ parameters: jobs: - job: CNI_${{ parameters.os }} - condition: and( not(canceled()), not(failed()) ) displayName: CNI k8s E2E ${{ parameters.os }} dependsOn: ${{ parameters.dependsOn }} pool: name: $(BUILD_POOL_NAME_DEFAULT) + os: linux steps: - task: AzureCLI@2 inputs: diff --git a/.pipelines/containers/manifest-template.yaml b/.pipelines/containers/manifest-template.yaml index 82e69bd962..3a6b386838 100644 --- a/.pipelines/containers/manifest-template.yaml +++ b/.pipelines/containers/manifest-template.yaml @@ -36,7 +36,22 @@ steps: displayName: Manifest Push retryCountOnTaskFailure: 3 - - task: 1ES.PublishPipelineArtifact@1 + - task: AzureCLI@2 + displayName: "Logout" + inputs: + azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + inlineScript: | + docker logout + + - task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0 + displayName: "Add SBOM Generator tool" + inputs: + BuildDropPath: "$(Build.ArtifactStagingDirectory)" + + - task: PublishBuildArtifacts@1 inputs: artifactName: "output" - targetPath: "$(Build.ArtifactStagingDirectory)" + pathtoPublish: "$(Build.ArtifactStagingDirectory)" + condition: succeeded() diff --git a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml index b693827e30..e115bd3618 100644 --- a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml +++ b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml @@ -17,9 +17,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../templates/create-cluster-swiftv2.jobs.yaml@ACNTools + - template: ../templates/create-cluster-swiftv2.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -39,7 +38,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" @@ -48,22 +46,14 @@ stages: - job: ${{ parameters.name }} displayName: Swiftv2 Multitenancy E2E Test Suite - (${{ parameters.name }}) pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: swiftv2-e2e.steps.yaml@ACNTools + - template: swiftv2-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) os: linux - diff --git a/.pipelines/multitenancy/swiftv2-e2e.steps.yaml b/.pipelines/multitenancy/swiftv2-e2e.steps.yaml index 10a6a29982..7ef8ac6996 100644 --- a/.pipelines/multitenancy/swiftv2-e2e.steps.yaml +++ b/.pipelines/multitenancy/swiftv2-e2e.steps.yaml @@ -4,31 +4,25 @@ parameters: continueOnError: true steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Start Swiftv2 Pods" + continueOnError: ${{ parameters.continueOnError }} + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SUBNET_TOKEN: $(SUBNET_TOKEN) inputs: azureSubscription: $(ACN_TEST_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf ls -lah pwd kubectl cluster-info @@ -58,11 +52,6 @@ steps: echo "Check pods after 4 minutes" kubectl get po -owide -A kubectl describe pni - name: "start_swiftv2_pods" - displayName: "Start Swiftv2 Pods" - continueOnError: ${{ parameters.continueOnError }} - env: - SUBNET_TOKEN: $(SUBNET_TOKEN) - script: | set -e @@ -70,9 +59,6 @@ steps: cd test/integration/swiftv2 echo "TestSwiftv2PodToPod and will run it after migration from scripts." go test -count=1 swiftv2_test.go -timeout 3m -tags swiftv2 -run ^TestSwiftv2PodToPod$ -tags=swiftv2,integration -v - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "Swiftv2_Tests_future_version" displayName: "Swiftv2 Tests through code" continueOnError: ${{ parameters.continueOnError }} - diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 5af557035b..276a1d6454 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -1,3 +1,24 @@ +pr: + branches: + include: + - master + - release/* + paths: + exclude: + - ".devcontainer" + - ".hooks" + - ".vscode" + - ".github" + - docs + +trigger: + branches: + include: + - gh-readonly-queue/master/* + tags: + include: + - "*" + stages: - stage: setup displayName: ACN @@ -6,7 +27,6 @@ stages: displayName: Setup pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux steps: - script: | # To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage @@ -45,12 +65,7 @@ stages: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - script: | make ipv6-hp-bpf-lib make all-binaries-platforms @@ -73,10 +88,11 @@ stages: targetFolder: $(Build.ArtifactStagingDirectory) condition: succeeded() - - task: 1ES.PublishPipelineArtifact@1 + - task: PublishBuildArtifacts@1 inputs: artifactName: "output" - targetPath: "$(Build.ArtifactStagingDirectory)" + pathtoPublish: "$(Build.ArtifactStagingDirectory)" + condition: succeeded() - stage: containerize displayName: Build Images @@ -88,7 +104,6 @@ stages: displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_AMD64)" - os: linux strategy: matrix: azure_ipam_linux_amd64: @@ -128,9 +143,6 @@ stages: name: npm os: windows steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - template: containers/container-template.yaml parameters: arch: $(arch) @@ -141,7 +153,6 @@ stages: displayName: Build Images pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" - os: linux strategy: matrix: azure_ipam_linux_arm64: @@ -182,7 +193,6 @@ stages: displayName: Compile Manifests pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: matrix: azure_ipam: @@ -201,9 +211,6 @@ stages: name: npm platforms: linux/amd64 linux/arm64 windows/amd64 steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - template: containers/manifest-template.yaml parameters: name: $(name) @@ -391,7 +398,6 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: matrix: cilium_e2e: @@ -443,7 +449,7 @@ stages: clusterName: "cildsovere2e" region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) steps: - - template: templates/delete-cluster.yaml + - template: templates/delete-cluster.steps.yaml parameters: name: $(name) clusterName: $(clusterName)-$(commitID) @@ -455,7 +461,6 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: matrix: swiftv2_e2e: @@ -467,7 +472,7 @@ stages: clusterName: "swiftv2dummy" region: $(REGION_SWIFTV2_CLUSTER_TEST) steps: - - template: templates/delete-cluster.yaml + - template: templates/delete-cluster.steps.yaml parameters: name: $(name) clusterName: $(clusterName)-$(commitID) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index efb5e17681..223ea603a8 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -210,7 +210,7 @@ stages: platforms: $(platforms) # Cilium Podsubnet E2E tests - - template: singletenancy/cilium/cilium-e2e-job-template.yaml + - template: singletenancy/cilium/cilium-e2e.jobs.yaml parameters: name: "cilium_e2e" displayName: Cilium @@ -221,7 +221,7 @@ stages: dependsOn: "containerize" # Cilium Nodesubnet E2E tests - - template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e-job-template.yaml + - template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml parameters: name: "cilium_nodesubnet_e2e" displayName: Cilium NodeSubnet @@ -232,7 +232,7 @@ stages: dependsOn: "containerize" # Cilium Overlay E2E tests - - template: singletenancy/cilium-overlay/cilium-overlay-e2e-job-template.yaml + - template: singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml parameters: name: "cilium_overlay_e2e" displayName: Cilium on AKS Overlay @@ -243,7 +243,7 @@ stages: dependsOn: "containerize" # Cilium Dualstack Overlay E2E tests - - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e-job-template.yaml + - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml parameters: name: "cilium_dualstackoverlay_e2e" displayName: Cilium on AKS DualStack Overlay @@ -255,7 +255,7 @@ stages: dependsOn: "containerize" # Cilium Overlay with hubble E2E tests - - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e-job-template.yaml + - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml parameters: name: "cilium_h_overlay_e2e" displayName: Cilium on AKS Overlay with Hubble @@ -267,7 +267,7 @@ stages: testHubble: true # Azure Overlay E2E tests - - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e-job-template.yaml + - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml parameters: name: "azure_overlay_e2e" displayName: Azure Overlay @@ -279,7 +279,7 @@ stages: dependsOn: "containerize" # Azure Overlay E2E Stateless CNI tests - - template: singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e-job-template.yaml + - template: singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml parameters: name: "azure_overlay_stateless_e2e" displayName: Azure Stateless CNI Overlay @@ -290,7 +290,7 @@ stages: dependsOn: "containerize" # AKS Swift E2E tests - - template: singletenancy/aks-swift/e2e-job-template.yaml + - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml parameters: name: "aks_swift_e2e" displayName: AKS Swift Ubuntu @@ -302,7 +302,7 @@ stages: dependsOn: "containerize" # AKS Swift Vnet Scale E2E tests - - template: singletenancy/aks-swift/e2e-job-template.yaml + - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml parameters: name: "aks_swift_vnetscale_e2e" displayName: AKS Swift Vnet Scale Ubuntu @@ -314,7 +314,7 @@ stages: dependsOn: "containerize" # CNIv1 E2E tests - - template: singletenancy/aks/e2e-job-template.yaml + - template: singletenancy/aks/aks-e2e.jobs.yaml parameters: name: "aks_ubuntu_22_linux_e2e" displayName: AKS Ubuntu 22 @@ -327,7 +327,7 @@ stages: scaleup: 100 dependsOn: "containerize" - - template: singletenancy/aks/e2e-job-template.yaml + - template: singletenancy/aks/aks-e2e.jobs.yaml parameters: name: "aks_windows_22_e2e" displayName: AKS Windows 2022 @@ -341,7 +341,7 @@ stages: dependsOn: "containerize" # CNI dual stack overlay E2E tests - - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e-job-template.yaml + - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml parameters: name: "dualstackoverlay_e2e" displayName: AKS DualStack Overlay @@ -352,7 +352,7 @@ stages: dependsOn: "containerize" # Swiftv2 E2E tests with multitenancy cluster start up - - template: multitenancy/swiftv2-e2e-job-template.yaml + - template: multitenancy/swiftv2-e2e.jobs.yaml parameters: name: "swiftv2_e2e" displayName: Swiftv2 Multitenancy @@ -444,7 +444,7 @@ stages: clusterName: "cildsovere2e" region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) steps: - - template: templates/delete-cluster.yaml + - template: templates/delete-cluster.steps.yaml parameters: name: $(name) clusterName: $(clusterName)-$(commitID) @@ -469,7 +469,7 @@ stages: clusterName: "swiftv2dummy" region: $(REGION_SWIFTV2_CLUSTER_TEST) steps: - - template: templates/delete-cluster.yaml + - template: templates/delete-cluster.steps.yaml parameters: name: $(name) clusterName: $(clusterName)-$(commitID) diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml index 928bcdec06..f112a3fea5 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml @@ -15,9 +15,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.steps.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -35,7 +34,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] CURRENT_VERSION: $[ stagedependencies.containerize.check_tag.outputs['CurrentTagManifests.currentTagManifests'] ] commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] @@ -48,26 +46,22 @@ stages: displayName: Singletenancy AKS Swift Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: aks-swift-e2e.steps.yaml@ACNTools + - template: aks-swift-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) scaleup: 100 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -85,18 +79,8 @@ stages: - ${{ parameters.name }} - cni_linux condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.steps.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.steps.yaml index f8177d1014..21a0ec3446 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.steps.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.steps.yaml @@ -4,90 +4,93 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Set Kubeconfig" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - name: "kubeconfig" - displayName: "Set Kubeconfig" + make -C ./hack/aks set-kubeconf - script: | ls -lah pwd kubectl cluster-info kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux CNI_TYPE=cniv2 VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_AZURE_VNET=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load =true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) retryCountOnTaskFailure: 3 - name: "aksswifte2e" displayName: "Run AKS Swift E2E" + env: + SCALE_UP: 32 + OS_TYPE: linux + CNI_TYPE: cniv2 + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_AZURE_VNET: true + CLEANUP: true - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true + CNI_TYPE: cniv2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true CNI_TYPE=cniv2 + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - script: | echo "Run wireserver and metadata connectivity Tests" bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "WireserverMetadataConnectivityTests" displayName: "Run Wireserver and Metadata Connectivity Tests" - script: | @@ -97,8 +100,5 @@ steps: if ! [ -z $(kubectl -n kube-system get ds azure-cns | grep non-existing) ]; then kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' fi - workingDirectory: $(ACN_DIR) - retryCountOnTaskFailure: 3 - name: "testAsyncDelete" displayName: "Verify Async Delete when CNS is down" diff --git a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml index acfa1149a8..df56eb70c0 100644 --- a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml @@ -19,9 +19,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -35,35 +34,30 @@ stages: - stage: ${{ parameters.name }} displayName: E2E - ${{ parameters.displayName }} - dependsOn: - - setup - - publish - - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + dependsOn: + - setup + - publish + - ${{ parameters.clusterName }} jobs: - job: ${{ parameters.name }} displayName: Singletenancy AKS - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: aks-e2e.steps.yaml@ACNTools + - template: aks-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -72,7 +66,7 @@ stages: os_version: ${{ parameters.os_version }} scaleup: ${{ parameters.scaleup }} - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -91,18 +85,9 @@ stages: - ${{ parameters.name }} - cni_${{ parameters.os }} condition: failed() - pool: - type: linux - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true steps: - - checkout: ACNTools - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} cni: cniv1 - diff --git a/.pipelines/singletenancy/aks/aks-e2e.steps.yaml b/.pipelines/singletenancy/aks/aks-e2e.steps.yaml index 85dd35dfbd..9892941854 100644 --- a/.pipelines/singletenancy/aks/aks-e2e.steps.yaml +++ b/.pipelines/singletenancy/aks/aks-e2e.steps.yaml @@ -7,81 +7,80 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Deploy CNI" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + OS: ${{ parameters.os }} + ARCH: ${{ parameters.arch }} + OS_VERSION: linux inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf echo "Upload CNI" echo "Deploying on Linux nodes" - if [ "${{parameters.os}}" == "windows" ]; then - export CNI_IMAGE=$(make cni-image-name-and-tag OS='linux' ARCH=${{ parameters.arch }}) + if [ "$OS" == "windows" ]; then + export CNI_IMAGE=$(make cni-image-name-and-tag OS='linux') echo "CNI image: $CNI_IMAGE" envsubst '${CNI_IMAGE}' < ./test/integration/manifests/cni/cni-installer-v1.yaml | kubectl apply -f - kubectl rollout status daemonset/azure-cni -n kube-system echo "Deploying on windows nodes" - export CNI_IMAGE=$( make cni-image-name-and-tag OS='windows' ARCH=${{ parameters.arch }} OS_VERSION=${{ parameters.os_version }}) + export CNI_IMAGE=$( make cni-image-name-and-tag OS='windows') echo "CNI image: $CNI_IMAGE" envsubst '${CNI_IMAGE}' < ./test/integration/manifests/cni/cni-installer-v1-windows.yaml | kubectl apply -f - kubectl rollout status daemonset/azure-cni-windows -n kube-system else - export CNI_IMAGE=$(make cni-image-name-and-tag OS=${{ parameters.os }} ARCH=${{ parameters.arch }}) + export CNI_IMAGE=$(make cni-image-name-and-tag) echo "CNI image: $CNI_IMAGE" envsubst '${CNI_IMAGE}' < ./test/integration/manifests/cni/cni-installer-v1.yaml | kubectl apply -f - kubectl rollout status daemonset/azure-cni -n kube-system fi - name: "deployCNI" - displayName: "Deploy CNI" - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - script: | set -e - kubectl get pods -A -o wide - echo "Deploying test pods" + kubectl get pods -A -o wide pushd test/integration/load - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=${{ parameters.os }} go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + echo "Deploying test pods" + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ popd - make test-validate-state OS_TYPE=${{ parameters.os }} CNI_TYPE=cniv1 - + make test-validate-state kubectl delete ns load-test - workingDirectory: $(ACN_DIR) displayName: "Validate State" retryCountOnTaskFailure: 3 - + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: ${{ parameters.os }} + RESTART_CASE: true + CNI_TYPE: cniv1 diff --git a/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml new file mode 100644 index 0000000000..84c6177804 --- /dev/null +++ b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml @@ -0,0 +1,94 @@ +parameters: + name: "" + displayName: "" + clusterType: "" + clusterName: "" + vmSize: "" + k8sVersion: "" + dependsOn: "" + +stages: + - stage: ${{ parameters.clusterName }} + displayName: Create Cluster - ${{ parameters.displayName }} + dependsOn: + - ${{ parameters.dependsOn }} + - setup + variables: + commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + jobs: + - template: ../../templates/create-cluster.jobs.yaml + parameters: + name: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + clusterType: ${{ parameters.clusterType }} + clusterName: ${{ parameters.clusterName }}-$(commitID) + vmSize: ${{ parameters.vmSize }} + k8sVersion: ${{ parameters.k8sVersion }} + dependsOn: ${{ parameters.dependsOn }} + region: $(REGION_AKS_CLUSTER_TEST) + + - template: ../../templates/add-windows-nodepool.jobs.yaml + parameters: + depend: ${{ parameters.name }} + clusterName: ${{ parameters.clusterName }}-$(commitID) + vmSize: ${{ parameters.vmSize }} + + - stage: ${{ parameters.name }} + displayName: E2E - ${{ parameters.displayName }} + dependsOn: + - setup + - publish + - ${{ parameters.clusterName }} + variables: + commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path + GOBIN: "$(GOPATH)/bin" # Go binaries path + modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" + jobs: + - job: ${{ parameters.name }}_windows + displayName: Azure Stateless CNI Overlay Test Suite | Windows - (${{ parameters.name }}) + timeoutInMinutes: 120 + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux + demands: + - agent.os -equals Linux + - Role -equals $(CUSTOM_E2E_ROLE) + steps: + - checkout: self + clean: true + + - template: azure-cni-overlay-stateless-e2e.steps.yaml + parameters: + name: ${{ parameters.name }} + clusterName: ${{ parameters.clusterName }}-$(commitID) + os: windows + vmSizeWin: ${{ parameters.vmSize }} + + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml + parameters: + sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + clusterName: ${{ parameters.clusterName }}-$(commitID) + os: windows + dependsOn: ${{ parameters.name }}_windows + datapath: true + dns: true + portforward: true + hostport: true + service: true + hybridWin: true + + - job: failedE2ELogs_windows + displayName: "Windows Failure Logs" + dependsOn: + - ${{ parameters.name }}_windows + - cni_windows + condition: in(dependencies.${{ parameters.name }}_windows.result, 'Failed') + steps: + - template: ../../templates/log-template.steps.yaml + parameters: + clusterName: ${{ parameters.clusterName }}-$(commitID) + os: windows + cni: cniv2 + + diff --git a/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.steps.yaml b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.steps.yaml new file mode 100644 index 0000000000..7942a3e92d --- /dev/null +++ b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.steps.yaml @@ -0,0 +1,102 @@ +parameters: + name: "" + clusterName: "" + os: "" + +steps: + - task: KubectlInstaller@0 + inputs: + kubectlVersion: latest + + - task: AzureCLI@2 + displayName: "Set Kubeconfig" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + make -C ./hack/aks set-kubeconf + + - script: | + nodeList=`kubectl get node -owide | grep Windows | awk '{print $1}'` + for node in $nodeList; do + taint=`kubectl describe node $node | grep Taints | awk '{print $2}'` + if [ $taint == "node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule" ]; then + kubectl taint nodes $node node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule- + fi + done + sudo -E env "PATH=$PATH" make test-load CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) + displayName: "Windows v4Overlay ControlPlane Scale Tests" + retryCountOnTaskFailure: 2 + env: + SCALE_UP: 32 + OS_TYPE: windows + CNI_TYPE: stateless + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_AZURE_VNET_STATELESS: true + VALIDATE_V4OVERLAY: true + CLEANUP: true + + - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + kubectl get po -owide -A + echo "Restarting nodes" + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} + done + + - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + REGION: $(REGION_AKS_CLUSTER_TEST) + SCALE_UP: ${{ parameters.scaleup }} + RESTART_CASE: true + CNI_TYPE: stateless + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + cd test/integration/load + make -C ./hack/aks set-kubeconf + make -C ./hack/aks azcfg + kubectl get pods -owide -A + echo "Validating Node Restart" + go test -timeout 30m -tags load -run ^TestValidateState$ + + - script: | + echo "Run wireserver and metadata connectivity Tests" + bash test/network/wireserver_metadata_test.sh + retryCountOnTaskFailure: 3 + displayName: "Run Wireserver and Metadata Connectivity Tests" + + - script: | + echo "IPv4 Overlay DataPath Test" + cd test/integration/datapath + sudo -E env "PATH=$PATH" go test -count=1 datapath_windows_test.go -timeout 3m -tags connection -restartKubeproxy true -run ^TestDatapathWin$ + displayName: "Windows v4Overlay Datapath Tests" + retryCountOnTaskFailure: 3 + diff --git a/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml new file mode 100644 index 0000000000..6912f20f05 --- /dev/null +++ b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml @@ -0,0 +1,69 @@ +parameters: + depend: "" + clusterName: "" # unique identifier + vmSize: "" + +jobs: +- job: windows_nodepool + displayName: Add Windows Nodepool + dependsOn: ${{ parameters.depend }} + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux + demands: + - agent.os -equals Linux + - Role -equals $(CUSTOM_E2E_ROLE) + timeoutInMinutes: 30 + steps: + - task: AzureCLI@2 + displayName: "Add windows node to cluster" + retryCountOnTaskFailure: 5 + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SUB: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) + VM_SIZE_WIN: ${{ parameters.vmSize }} + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + + windows_nodepool=$(az aks nodepool list \ + --resource-group "$CLUSTER" \ + --cluster-name "$CLUSTER" \ + --query "[?osType=='Windows']" \ + --output tsv) + + if [ -z "$windows_nodepool" ]; then + echo "No Windows node pool found in the AKS cluster." + + # wait for cluster to update + while true; do + cluster_state=$(az aks show \ + --resource-group "$CLUSTER" \ + --name "$CLUSTER" \ + --query provisioningState) + + if echo "$cluster_state" | grep -q "Updating"; then + echo "Cluster is updating. Sleeping for 30 seconds..." + sleep 30 + else + break + fi + done + # cluster state is always set and visible outside the loop + echo "Cluster state is: $cluster_state" + + make -C ./hack/aks set-kubeconf + make -C ./hack/aks windows-nodepool-up + echo "Windows node was successfully added" + kubectl cluster-info + kubectl get node -owide + kubectl get po -owide -A + else + echo "Windows node pool already exists in the AKS cluster." + fi + diff --git a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml index 3af20d7bf7..514c47364b 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml @@ -15,9 +15,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -35,7 +34,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path @@ -45,88 +43,50 @@ stages: displayName: Azure CNI Overlay Test Suite | Linux - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: azure-cni-overlay-e2e.steps.yaml@ACNTools + - template: azure-cni-overlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) os: linux scaleup: 100 - - job: windows_nodepool - displayName: Add Windows Nodepool - dependsOn: ${{ parameters.name }}_linux - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - demands: - - agent.os -equals Linux - - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true - steps: - - checkout: ACNReviewChanges - clean: true - - - task: AzureCLI@2 - inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - workingDirectory: $(ACN_DIR) - addSpnToEnvironment: true - inlineScript: | - set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) - make -C ./hack/aks windows-nodepool-up AZCLI=az SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) CLUSTER=${{ parameters.clusterName }}-$(commitID) VM_SIZE_WIN=${{ parameters.vmSize }} - echo "Windows node are successfully added to v4 Overlay Cluster" - kubectl cluster-info - kubectl get node -owide - kubectl get po -owide -A - name: "Add_Windows_Node" - displayName: "Add windows node on v4 overlay cluster" - + - template: ../../templates/add-windows-nodepool.jobs.yaml + parameters: + depend: ${{ parameters.name }}_linux + clusterName: ${{ parameters.clusterName }}-$(commitID) + vmSize: ${{ parameters.vmSize }} - job: ${{ parameters.name }}_windows displayName: Azure CNI Overlay Test Suite | Windows - (${{ parameters.name }}) timeoutInMinutes: 120 dependsOn: windows_nodepool pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: azure-cni-overlay-e2e.steps.yaml@ACNTools + - template: azure-cni-overlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) os: windows scaleup: 50 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -138,7 +98,7 @@ stages: hostport: true service: true - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -155,20 +115,10 @@ stages: displayName: "Linux Failure Logs" dependsOn: - ${{ parameters.name }}_linux - - CNI_linux - condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_linux_Attempt_#$(System.StageAttempt) - ob_git_checkout: true + - cni_linux + condition: in(dependencies.${{ parameters.name }}_linux.result, 'Failed') steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: linux @@ -178,22 +128,13 @@ stages: displayName: "Windows Failure Logs" dependsOn: - ${{ parameters.name }}_windows - - CNI_windows - condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_windows_Attempt_#$(System.StageAttempt) - ob_git_checkout: true + - cni_windows + condition: in(dependencies.${{ parameters.name }}_windows.result, 'Failed') steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: windows cni: cniv2 + diff --git a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.steps.yaml b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.steps.yaml index cf0a0310ff..519af2c9fd 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.steps.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.steps.yaml @@ -5,89 +5,93 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Set Kubeconfig" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - name: "kubeconfig" - displayName: "Set Kubeconfig" + make -C ./hack/aks set-kubeconf - ${{ if eq(parameters.os, 'linux') }}: - script: | echo "Start Integration Tests on Overlay Cluster" kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux CNI_TYPE=cniv2 VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true VALIDATE_V4OVERLAY=true AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) retryCountOnTaskFailure: 2 - name: "integrationTest" displayName: "Run CNS Integration Tests on AKS Overlay" + env: + SCALE_UP: 32 + OS_TYPE: linux + CNI_TYPE: cniv2 + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_AZURE_CNI_OVERLAY: true + VALIDATE_V4OVERLAY: true + CLEANUP: true - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true + CNI_TYPE: cniv2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true CNI_TYPE=cniv2 + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - script: | echo "Run wireserver and metadata connectivity Tests" bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "WireserverMetadataConnectivityTests" displayName: "Run Wireserver and Metadata Connectivity Tests" - ${{ if eq(parameters.os, 'windows') }}: @@ -99,56 +103,70 @@ steps: kubectl taint nodes $node node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule- fi done - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=windows CNI_TYPE=cniv2 VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_AZURE_CNI_OVERLAY=true VALIDATE_V4OVERLAY=true CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) CLEANUP=true - workingDirectory: $(ACN_DIR) - name: "WindowsOverlayControlPlaneScaleTests" + sudo -E env "PATH=$PATH" make test-load CNS_VERSION=$(make cns-version) CNI_VERSION=$(make cni-version) displayName: "Windows v4Overlay ControlPlane Scale Tests" retryCountOnTaskFailure: 2 + env: + SCALE_UP: 32 + OS_TYPE: windows + CNI_TYPE: cniv2 + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_AZURE_CNI_OVERLAY: true + VALIDATE_V4OVERLAY: true + CLEANUP: true - script: | echo "IPv4 Overlay DataPath Test" cd test/integration/datapath sudo -E env "PATH=$PATH" go test -count=1 datapath_windows_test.go -timeout 3m -tags connection -restartKubeproxy true -run ^TestDatapathWin$ - workingDirectory: $(ACN_DIR) - name: "WindowsV4OverlayDatapathTests" displayName: "Windows v4Overlay Datapath Tests" retryCountOnTaskFailure: 3 - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: windows + RESTART_CASE: true + CNI_TYPE: cniv2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=windows go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=windows RESTART_CASE=true CNI_TYPE=cniv2 + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 diff --git a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml index cb08728d9e..1615640760 100644 --- a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml @@ -15,9 +15,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -39,32 +38,27 @@ stages: GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - job: ${{ parameters.name }} displayName: Cilium Dualstack Overlay Test Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: cilium-dualstackoverlay-e2e.steps.yaml@ACNTools + - template: cilium-dualstackoverlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) scaleup: 100 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -82,18 +76,8 @@ stages: - ${{ parameters.name }} - cni_${{ parameters.os }} condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} diff --git a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.steps.yaml b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.steps.yaml index 8d0b262de6..6954e9fa65 100644 --- a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.steps.yaml +++ b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.steps.yaml @@ -4,32 +4,23 @@ parameters: scaleup: "" steps: - - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Install Cilium on AKS Dualstack Overlay" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf ls -lah pwd kubectl cluster-info @@ -49,18 +40,22 @@ steps: envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY},${IPV6_HP_BPF_VERSION}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset-dualstack.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 - name: "installCilium" - displayName: "Install Cilium on AKS Dualstack Overlay" - - template: ../../templates/cilium-cli.steps.yaml@ACNTools + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests on Overlay Cluster" - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux CNI_TYPE=cilium_dualstack VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_OVERLAY=true AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) retryCountOnTaskFailure: 3 - name: "aziliumTest" displayName: "Run Azilium E2E on AKS Overlay" + env: + SCALE_UP: 32 + OS_TYPE: linux + CNI_TYPE: cilium_dualstack + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_OVERLAY: true + CLEANUP: true - script: | kubectl get pods -A @@ -68,47 +63,54 @@ steps: # Ensure Cilium is ready Xm\Xs cilium status --wait --wait-duration 2m retryCountOnTaskFailure: 3 - name: "CiliumStatus" displayName: "Cilium Status" - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true + CNI_TYPE: cilium_dualstack inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true CNI_TYPE=cilium_dualstack + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - script: | set -e @@ -118,7 +120,6 @@ steps: ns=`kubectl get ns | grep cilium-test | awk '{print $1}'` echo "##vso[task.setvariable variable=ciliumNamespace]$ns" retryCountOnTaskFailure: 3 - name: "ciliumConnectivityTests" displayName: "Run Cilium Connectivity Tests" - script: | @@ -129,9 +130,7 @@ steps: go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration -isDualStack=true echo "Dualstack Overlay Linux datapath IPv4 test" go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "DualStack_Overlay_Linux_Tests" displayName: "DualStack Overlay Linux Tests" - script: | @@ -139,23 +138,22 @@ steps: kubectl get pod -owide -A # Deleting echo-external-node deployment until cilium version matches TODO. https://github.com/cilium/cilium-cli/issues/67 is addressing the change. # Saves 17 minutes - kubectl delete deploy -n $(ciliumNamespace) echo-external-node + kubectl delete deploy -n "$CILIUM_NS" echo-external-node cd test/integration/load CNI_TYPE=cilium_dualstack go test -timeout 30m -tags load -run ^TestValidateState$ echo "delete cilium connectivity test resources and re-validate state" - kubectl delete ns $(ciliumNamespace) + kubectl delete ns "$CILIUM_NS" kubectl get pod -owide -A - CNI_TYPE=cilium_dualstack go test -timeout 30m -tags load -run ^TestValidateState$ - workingDirectory: $(ACN_DIR) - name: "validatePods" + go test -timeout 30m -tags load -run ^TestValidateState$ displayName: "Validate Pods" + env: + CILIUM_NS: $(ciliumNamespace) + CNI_TYPE: cilium_dualstack - script: | echo "Run wireserver and metadata connectivity Tests" bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "WireserverMetadataConnectivityTests" displayName: "Run Wireserver and Metadata Connectivity Tests" - script: | @@ -165,7 +163,5 @@ steps: if ! [ -z $(kubectl -n kube-system get ds azure-cns | grep non-existing) ]; then kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' fi - workingDirectory: $(ACN_DIR) - retryCountOnTaskFailure: 3 - name: "testAsyncDelete" displayName: "Verify Async Delete when CNS is down" + diff --git a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml new file mode 100644 index 0000000000..a22d659e77 --- /dev/null +++ b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml @@ -0,0 +1,96 @@ +parameters: + dependsOn: "" + name: "cilium_nodesubnet_e2e" + clusterType: "nodesubnet-byocni-nokubeproxy-up" + clusterName: "cilndsubnete2e" + vmSize: "" + os: "linux" + arch: "" + osSKU: Ubuntu + hubbleEnabled: false + dualstackVersion: "" + cni: "cilium" + +stages: + - stage: ${{ parameters.clusterName }} + displayName: Create Cluster - ${{ parameters.displayName }} + dependsOn: + - ${{ parameters.dependsOn }} + - setup + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux + variables: + commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + jobs: + - template: ../../templates/create-cluster.jobs.yaml + parameters: + name: ${{ parameters.name }} + displayName: ${{ parameters.displayName }} + clusterType: ${{ parameters.clusterType }} + clusterName: ${{ parameters.clusterName }}-$(commitID) + vmSize: ${{ parameters.vmSize }} + region: $(REGION_AKS_CLUSTER_TEST) + + - stage: ${{ parameters.name }} + displayName: E2E - ${{ parameters.displayName }} + variables: + TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] + CURRENT_VERSION: $[ stagedependencies.containerize.check_tag.outputs['CurrentTagManifests.currentTagManifests'] ] + commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path + GOBIN: "$(GOPATH)/bin" # Go binaries path + modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" + condition: and(succeeded(), eq(variables.TAG, variables.CURRENT_VERSION)) + dependsOn: + - setup + - publish + - ${{ parameters.clusterName }} + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + jobs: + - job: ${{ parameters.name }} + displayName: Nodesubnet with Cilium - (${{ parameters.name }}) + timeoutInMinutes: 120 + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + demands: + - agent.os -equals Linux + - Role -equals $(CUSTOM_E2E_ROLE) + steps: + - checkout: self + clean: true + + - template: cilium-nodesubnet-e2e.steps.yaml + parameters: + name: ${{ parameters.name }} + clusterName: ${{ parameters.clusterName }}-$(commitID) + arch: ${{ parameters.arch }} + os: ${{ parameters.os }} + scaleup: ${{ parameters.scaleup }} + + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml + parameters: + sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + clusterName: ${{ parameters.clusterName }}-$(commitID) + os: ${{ parameters.os }} + datapath: true + dns: true + cni: cilium + portforward: true + service: true + dependsOn: ${{ parameters.name }} + + - job: failedE2ELogs + displayName: "Failure Logs" + dependsOn: + - ${{ parameters.name }} + - cni_${{ parameters.os }} + condition: failed() + steps: + - template: ../../templates/log-template.steps.yaml + parameters: + clusterName: ${{ parameters.clusterName }}-$(commitID) + os: ${{ parameters.os }} + cni: cilium + diff --git a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.steps.yaml b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.steps.yaml new file mode 100644 index 0000000000..f97ef66228 --- /dev/null +++ b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.steps.yaml @@ -0,0 +1,75 @@ +parameters: + name: "" + clusterName: "" + scaleup: "" + +steps: + - task: AzureCLI@2 + displayName: 'Update IP configs' + env: + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + SECONDARY_IP_COUNT=$((SCALE_UP * 2)) \ + go run $(Build.SourcesDirectory)/test/integration/cilium-nodesubnet/ipconfigupdate.go + + - task: KubectlInstaller@0 + inputs: + kubectlVersion: latest + + - task: AzureCLI@2 + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + make -C ./hack/aks set-kubeconf + ls -lah + pwd + kubectl cluster-info + kubectl get po -owide -A + echo "install Cilium ${CILIUM_VERSION_TAG}" + export DIR=$(echo ${CILIUM_VERSION_TAG#v} | cut -d. -f1,2) + echo "installing files from ${DIR}" + echo "deploy Cilium ConfigMap" + kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config.yaml + # Passes Cilium image to daemonset and deployment + 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-operator/templates/deployment.yaml | kubectl apply -f - + kubectl get po -owide -A + displayName: "Install Cilium" + + - template: ../../templates/cilium-cli.yaml + + - script: | + echo "Start Nodesubnet E2E Tests" + kubectl get po -owide -A + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) + retryCountOnTaskFailure: 3 + displayName: "Run NodeSubnet E2E" + env: + SCALE_UP: 32 + OS_TYPE: linux + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_CNS_NODESUBNET: true + CLEANUP: true + + - template: ../../templates/cilium-tests.yaml + parameters: + clusterName: ${{ parameters.clusterName }} + scaleup: ${{ parameters.scaleup }} diff --git a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml index 0effe61217..c95fa8f6b8 100644 --- a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml @@ -17,9 +17,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -37,7 +36,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path @@ -47,27 +45,23 @@ stages: displayName: Cilium Overlay Test Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: cilium-overlay-e2e.steps.yaml@ACNTools + - template: cilium-overlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) testHubble: ${{ parameters.testHubble }} scaleup: 100 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -85,18 +79,8 @@ stages: - ${{ parameters.name }} - cni_${{ parameters.os }} condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} diff --git a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.steps.yaml b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.steps.yaml index f52800e74f..719178f6a5 100644 --- a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.steps.yaml +++ b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.steps.yaml @@ -5,31 +5,23 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Install Cilium on AKS Overlay" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf ls -lah export CILIUM_VERSION_TAG=${CILIUM_HUBBLE_VERSION_TAG} export DIR=$(echo ${CILIUM_VERSION_TAG#v} | cut -d. -f1,2) @@ -40,24 +32,29 @@ steps: envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f - envsubst '${CILIUM_IMAGE_REGISTRY},${CILIUM_VERSION_TAG}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f - # Use different file directories for nightly and current cilium version - name: "installCilium" - displayName: "Install Cilium on AKS Overlay" - - template: ../../templates/cilium-cli.steps.yaml@ACNTools + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests on Overlay Cluster" if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ] then - CNS=$(CNS_VERSION) IPAM=$(AZURE_IPAM_VERSION) && echo "Running nightly" + echo "Running nightly" else CNS=$(make cns-version) IPAM=$(make azure-ipam-version) fi - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_OVERLAY=true AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} retryCountOnTaskFailure: 3 - name: "aziliumTest" displayName: "Run Azilium E2E on AKS Overlay" + env: + CNS: $(CNS_VERSION) + IPAM: $(AZURE_IPAM_VERSION) + SCALE_UP: 32 + OS_TYPE: linux + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_OVERLAY: true + CLEANUP: true - script: | kubectl get pods -A @@ -65,47 +62,54 @@ steps: # Ensure Cilium is ready Xm\Xs cilium status --wait --wait-duration 2m retryCountOnTaskFailure: 3 - name: "CiliumStatus" displayName: "Cilium Status" - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e cd test/integration/load # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ kubectl get pods -owide -A cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - script: | set -e @@ -114,9 +118,7 @@ steps: cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption' --force-deploy ns=`kubectl get ns | grep cilium-test | awk '{print $1}'` echo "##vso[task.setvariable variable=ciliumNamespace]$ns" - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "ciliumConnectivityTests" displayName: "Run Cilium Connectivity Tests" - ${{ if eq( parameters['testHubble'], true) }}: @@ -130,9 +132,7 @@ steps: kubectl get pods -Aowide echo "verify Hubble metrics endpoint is usable" go test ./test/integration/networkobservability -v -tags=networkobservability - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "HubbleConnectivityTests" displayName: "Run Hubble Connectivity Tests" - script: | @@ -141,25 +141,26 @@ steps: kubectl get pod -owide -A if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then - echo "Check cilium identities in $(ciliumNamespace) namepsace during nightly run" + echo "Check cilium identities in "$CILIUM_NS" namepsace during nightly run" echo "expect the identities to be deleted when the namespace is deleted" kubectl get ciliumidentity | grep cilium-test fi make test-validate-state echo "delete cilium connectivity test resources and re-validate state" # TODO Delete this and the next 4 lines if connectivity no longer has bug - kubectl delete ns $(ciliumNamespace) + kubectl delete ns "$CILIUM_NS" kubectl get pod -owide -A make test-validate-state - workingDirectory: $(ACN_DIR) - name: "validatePods" displayName: "Validate Pods" + env: + CILIUM_NS: $(ciliumNamespace) + CNI_TYPE: cilium_dualstack - script: | if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then - kubectl get pod -owide -n $(ciliumNamespace) + kubectl get pod -owide -n "$CILIUM_NS" echo "wait for pod and cilium identity deletion in cilium-test namespace" while true; do - pods=$(kubectl get pods -n $(ciliumNamespace) --no-headers=true 2>/dev/null) + pods=$(kubectl get pods -n "$CILIUM_NS" --no-headers=true 2>/dev/null) if [[ -z "$pods" ]]; then echo "No pods found" break @@ -170,23 +171,22 @@ steps: echo "Verify cilium identities are deleted from cilium-test" checkIdentity="$(kubectl get ciliumidentity -o json | grep cilium-test | jq -e 'length == 0')" if [[ -n $checkIdentity ]]; then - echo "##[error]Cilium Identities still present in $(ciliumNamespace) namespace" + echo "##[error]Cilium Identities still present in "$CILIUM_NS" namespace" exit 1 else - printf -- "Identities deleted from $(ciliumNamespace) namespace\n" + printf -- "Identities deleted from "$CILIUM_NS" namespace\n" fi else echo "skip cilium identities check for PR pipeline" fi - name: "CiliumIdentities" displayName: "Verify Cilium Identities Deletion" + env: + CILIUM_NS: $(ciliumNamespace) - script: | echo "Run wireserver and metadata connectivity Tests" bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "WireserverMetadataConnectivityTests" displayName: "Run Wireserver and Metadata Connectivity Tests" - script: | @@ -196,17 +196,4 @@ steps: if ! [ -z $(kubectl -n kube-system get ds azure-cns | grep non-existing) ]; then kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' fi - workingDirectory: $(ACN_DIR) - retryCountOnTaskFailure: 3 - name: "testAsyncDelete" displayName: "Verify Async Delete when CNS is down" - - - script: | - ARTIFACT_DIR=$(Build.ArtifactStagingDirectory)/test-output/ - echo $ARTIFACT_DIR - sudo rm -rf $ARTIFACT_DIR - sudo rm -rf test/integration/logs - workingDirectory: $(ACN_DIR) - name: "Cleanupartifactdir" - displayName: "Cleanup artifact dir" - condition: always() diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml index a2485332c8..c20b806218 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml @@ -16,9 +16,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -36,7 +35,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path @@ -46,26 +44,22 @@ stages: displayName: Cilium Overlay Test Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: cilium-overlay-e2e.steps.yaml@ACNTools + - template: cilium-overlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) scaleup: 100 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -83,18 +77,8 @@ stages: - ${{ parameters.name }} - cni_${{ parameters.os }} condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.steps.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.steps.yaml index dea722df9c..458fc0205d 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.steps.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.steps.yaml @@ -6,31 +6,18 @@ parameters: steps: - - 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: KubectlInstaller@0 - inputs: - kubectlVersion: latest - - task: AzureCLI@2 + env: + CLUSTER: ${{ parameters.clusterName }} + AZCLI: az inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf ls -lah pwd kubectl cluster-info @@ -61,10 +48,9 @@ steps: fi kubectl get po -owide -A - name: "installCilium" displayName: "Install Cilium on AKS Overlay" - - template: ../../templates/cilium-cli.steps.yaml@ACNTools + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests on Overlay Cluster" @@ -75,11 +61,16 @@ steps: CNS=$(make cns-version) IPAM=$(make azure-ipam-version) fi kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_OVERLAY=true AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=${IPAM} CNS_VERSION=${CNS} retryCountOnTaskFailure: 3 - name: "aziliumTest" displayName: "Run Azilium E2E on AKS Overlay" + env: + SCALE_UP: 32 + OS_TYPE: linux + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_INSTALL_OVERLAY: true + CLEANUP: true - script: | kubectl get po -owide -A @@ -95,39 +86,46 @@ steps: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - 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} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" + REGION: $(REGION_AKS_CLUSTER_TEST) - task: AzureCLI@2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true + make test-validate-state kubectl delete ns load-test displayName: "Validate Node Restart" retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true - script: | set -e @@ -142,7 +140,6 @@ steps: ns=`kubectl get ns | grep cilium-test | awk '{print $1}'` echo "##vso[task.setvariable variable=ciliumNamespace]$ns" retryCountOnTaskFailure: 3 - name: "ciliumConnectivityTests" displayName: "Run Cilium Connectivity Tests" - ${{ if eq( parameters['testHubble'], true) }}: @@ -156,7 +153,6 @@ steps: kubectl get pods -Aowide echo "verify Hubble metrics endpoint is usable" go test ./test/integration/networkobservability -count=1 -v -tags=networkobservability - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 name: "HubbleConnectivityTests" displayName: "Run Hubble Connectivity Tests" @@ -166,25 +162,25 @@ steps: echo "validate pod IP assignment and check systemd-networkd restart" kubectl get pod -owide -A if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then - echo "Check cilium identities in $(ciliumNamespace) namepsace during nightly run" + echo "Check cilium identities in "$CILIUM_NS" namepsace during nightly run" echo "expect the identities to be deleted when the namespace is deleted" kubectl get ciliumidentity | grep cilium-test fi make test-validate-state - echo "delete cilium connectivity test resources and re-validate state" # TODO Delete this and the next 4 lines if connectivity no longer has bug - kubectl delete ns $(ciliumNamespace) + echo "delete cilium connectivity test resources and re-validate state" + kubectl delete ns "$CILIUM_NS" kubectl get pod -owide -A make test-validate-state - workingDirectory: $(ACN_DIR) - name: "validatePods" displayName: "Validate Pods" + env: + CILIUM_NS: $(ciliumNamespace) - script: | if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then - kubectl get pod -owide -n $(ciliumNamespace) - echo "wait for pod and cilium identity deletion in $(ciliumNamespace) namespace" + kubectl get pod -owide -n "$CILIUM_NS" + echo "wait for pod and cilium identity deletion in "$CILIUM_NS" namespace" while true; do - pods=$(kubectl get pods -n $(ciliumNamespace) --no-headers=true 2>/dev/null) + pods=$(kubectl get pods -n "$CILIUM_NS" --no-headers=true 2>/dev/null) if [[ -z "$pods" ]]; then echo "No pods found" break @@ -192,19 +188,20 @@ steps: sleep 2s done sleep 20s - echo "Verify cilium identities are deleted from $(ciliumNamespace)" + echo "Verify cilium identities are deleted from "$CILIUM_NS"" checkIdentity="$(kubectl get ciliumidentity -o json | grep cilium-test | jq -e 'length == 0')" if [[ -n $checkIdentity ]]; then - echo "##[error]Cilium Identities still present in $(ciliumNamespace) namespace" + echo "##[error]Cilium Identities still present in "$CILIUM_NS" namespace" exit 1 else - printf -- "Identities deleted from $(ciliumNamespace) namespace\n" + printf -- "Identities deleted from "$CILIUM_NS" namespace\n" fi else echo "skip cilium identities check for PR pipeline" fi - name: "CiliumIdentities" displayName: "Verify Cilium Identities Deletion" + env: + CILIUM_NS: $(ciliumNamespace) - script: | # TODO REMOVE THIS STEP, make test-load covers this set -e @@ -217,14 +214,12 @@ steps: kubectl get pod -owide -A echo "validate pods after CNS restart" make test-validate-state - workingDirectory: $(ACN_DIR) name: "restartCNS" displayName: "Restart CNS and validate pods" - script: | echo "Run wireserver and metadata connectivity Tests" bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 name: "WireserverMetadataConnectivityTests" displayName: "Run Wireserver and Metadata Connectivity Tests" @@ -240,7 +235,6 @@ steps: kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' fi fi - workingDirectory: $(ACN_DIR) name: "testAsyncDelete" displayName: "Verify Async Delete when CNS is down" diff --git a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml index d3eb5f84a0..3cb9b51cbb 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml @@ -14,11 +14,13 @@ stages: dependsOn: - ${{ parameters.dependsOn }} - setup + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -36,7 +38,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] CURRENT_VERSION: $[ stagedependencies.containerize.check_tag.outputs['CurrentTagManifests.currentTagManifests'] ] commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] @@ -44,31 +45,30 @@ stages: GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" condition: and(succeeded(), eq(variables.TAG, variables.CURRENT_VERSION)) + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux jobs: - job: ${{ parameters.name }} displayName: Cilium Test Suite - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges + - checkout: self clean: true - - template: cilium-e2e.steps.yaml@ACNTools + - template: cilium-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) scaleup: 100 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -82,24 +82,13 @@ stages: - job: failedE2ELogs displayName: "Failure Logs" - condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) dependsOn: - ${{ parameters.name }} - cni_${{ parameters.os }} - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_Attempt_#$(System.StageAttempt) - ob_git_checkout: true + condition: failed() steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: ${{ parameters.os }} cni: cilium - diff --git a/.pipelines/singletenancy/cilium/cilium-e2e.steps.yaml b/.pipelines/singletenancy/cilium/cilium-e2e.steps.yaml index 12e6f4e2ad..72fe79a919 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e.steps.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e.steps.yaml @@ -4,31 +4,23 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Install Cilium" + env: + SCALE_UP: ${{ coalesce(parameters.scaleup, 32) }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_AKS_CLUSTER_TEST)" inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks set-kubeconf ls -lah pwd kubectl cluster-info @@ -45,110 +37,26 @@ steps: 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 - name: "installCilium" - displayName: "Install Cilium" - - template: ../../templates/cilium-cli.steps.yaml@ACNTools + - template: ../../templates/cilium-cli.yaml - script: | echo "Start Azilium E2E Tests" kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_AZILIUM=true AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) retryCountOnTaskFailure: 3 - name: "aziliumTest" displayName: "Run Azilium E2E" + env: + SCALE_UP: 32 + OS_TYPE: linux + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_AZILIUM: true + CLEANUP: true + + + - template: ../../templates/cilium-tests.yaml + parameters: + clusterName: ${{ parameters.clusterName }} + scaleup: ${{ parameters.scaleup }} - - script: | - kubectl get po -owide -A - echo "Waiting < 2 minutes for cilium to be ready" - # Ensure Cilium is ready Xm\Xs - cilium status --wait --wait-duration 2m - retryCountOnTaskFailure: 3 - name: "CiliumStatus" - displayName: "Cilium Status" - - - task: AzureCLI@2 - inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - workingDirectory: $(ACN_DIR) - addSpnToEnvironment: true - inlineScript: | - set -e - kubectl get po -owide -A - clusterName=${{ parameters.clusterName }} - echo "Restarting nodes" - 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 - displayName: "Restart Nodes" - - - task: AzureCLI@2 - inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - workingDirectory: $(ACN_DIR) - addSpnToEnvironment: true - inlineScript: | - set -e - cd test/integration/load - - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A - - cd ../../.. - echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true - kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - - - script: | - set -e - echo "Run Cilium Connectivity Tests" - cilium status - cilium connectivity test --connect-timeout 4s --request-timeout 30s --test '!pod-to-pod-encryption,!node-to-node-encryption' --force-deploy - ns=`kubectl get ns | grep cilium-test | awk '{print $1}'` - echo "##vso[task.setvariable variable=ciliumNamespace]$ns" - retryCountOnTaskFailure: 3 - name: "ciliumConnectivityTests" - displayName: "Run Cilium Connectivity Tests" - - - script: | - echo "validate pod IP assignment and check systemd-networkd restart" - kubectl get pod -owide -A - # Deleting echo-external-node deployment until cilium version matches TODO. https://github.com/cilium/cilium-cli/issues/67 is addressing the change. - # Saves 17 minutes - kubectl delete deploy -n $(ciliumNamespace) echo-external-node - make test-validate-state - echo "delete cilium connectivity test resources and re-validate state" - kubectl delete ns $(ciliumNamespace) - kubectl get pod -owide -A - make test-validate-state - workingDirectory: $(ACN_DIR) - name: "validatePods" - displayName: "Validate Pods" - - - script: | - echo "Run wireserver and metadata connectivity Tests" - bash test/network/wireserver_metadata_test.sh - workingDirectory: $(ACN_DIR) - retryCountOnTaskFailure: 3 - name: "WireserverMetadataConnectivityTests" - displayName: "Run Wireserver and Metadata Connectivity Tests" - - - script: | - cd hack/scripts - chmod +x async-delete-test.sh - ./async-delete-test.sh - if ! [ -z $(kubectl -n kube-system get ds azure-cns | grep non-existing) ]; then - kubectl -n kube-system patch daemonset azure-cns --type json -p='[{"op": "remove", "path": "/spec/template/spec/nodeSelector/non-existing"}]' - fi - workingDirectory: $(ACN_DIR) - retryCountOnTaskFailure: 3 - name: "testAsyncDelete" - displayName: "Verify Async Delete when CNS is down" diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml index c6a0442ba8..6d02e85dd2 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml @@ -15,9 +15,8 @@ stages: - setup variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - ACN_DIR: $(Build.SourcesDirectory) jobs: - - template: ../../templates/create-cluster.jobs.yaml@ACNTools + - template: ../../templates/create-cluster.steps.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} @@ -36,7 +35,6 @@ stages: - publish - ${{ parameters.clusterName }} variables: - ACN_DIR: $(Build.SourcesDirectory) GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" @@ -46,87 +44,44 @@ stages: displayName: DualStack Overlay Test Suite | Linux - (${{ parameters.name }}) timeoutInMinutes: 120 pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: dualstackoverlay-e2e.steps.yaml@ACNTools + - template: dualstackoverlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) os: linux scaleup: 100 - - job: windows_nodepool - displayName: Add Windows Nodepool - dependsOn: ${{ parameters.name }}_linux - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - demands: - - agent.os -equals Linux - - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true - steps: - - checkout: ACNReviewChanges - clean: true - - - task: AzureCLI@2 - inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - workingDirectory: $(ACN_DIR) - addSpnToEnvironment: true - inlineScript: | - set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(commitID) - make -C ./hack/aks windows-nodepool-up AZCLI=az SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) CLUSTER=${{ parameters.clusterName }}-$(commitID) VM_SIZE_WIN=${{ parameters.vmSize }} - echo "Windows nodes have been successfully added to DualStack Overlay Cluster" - kubectl cluster-info - kubectl get node -owide - kubectl get po -owide -A - name: "Add_Windows_Node" - displayName: "Add windows node" + - template: ../../templates/add-windows-nodepool.jobs.yaml + parameters: + depend: ${{ parameters.name }}_linux + clusterName: ${{ parameters.clusterName }}-$(commitID) + vmSize: "Standard_D2_v3" - job: ${{ parameters.name }}_windows displayName: DualStack Overlay Test Suite | Windows - (${{ parameters.name }}) timeoutInMinutes: 120 dependsOn: windows_nodepool pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) + os: linux demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true - - - template: dualstackoverlay-e2e.steps.yaml@ACNTools + - template: dualstackoverlay-e2e.steps.yaml parameters: name: ${{ parameters.name }} clusterName: ${{ parameters.clusterName }}-$(commitID) os: windows scaleup: 50 - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) @@ -138,38 +93,27 @@ stages: hostport: true service: true - - template: ../../cni/k8s-e2e/k8s-e2e.jobs.yaml@ACNTools + - template: ../../cni/k8s-e2e/k8s-e2e-job-template.yaml parameters: sub: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) clusterName: ${{ parameters.clusterName }}-$(commitID) os: windows dependsOn: cni_linux - dualstack: true + # dualstack: true # Currently broken for scenario and blocking releases, HNS is investigating. Covered by go test in E2E step template dns: true portforward: true - service: true + # service: true # Currently broken for scenario and blocking releases, HNS is investigating. hostport: true hybridWin: true - job: failedE2ELogs_linux displayName: "Linux Failure Logs" dependsOn: - - CNI_linux # k8s tests - ${{ parameters.name }}_linux - cni_linux - condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_linux_Attempt_#$(System.StageAttempt) - ob_git_checkout: true + condition: in(dependencies.${{ parameters.name }}_linux.result, 'Failed') steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: linux @@ -178,22 +122,11 @@ stages: - job: failedE2ELogs_windows displayName: "Windows Failure Logs" dependsOn: - - CNI_windows # k8s tests - ${{ parameters.name }}_windows - cni_windows - condition: failed() - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(ACN_DIR)/${{ parameters.clusterName }}-$(commitID)_FailedE2ELogs_windows_Attempt_#$(System.StageAttempt) - ob_git_checkout: true + condition: in(dependencies.${{ parameters.name }}_windows.result, 'Failed') steps: - - checkout: ACNReviewChanges - clean: true - - - template: ../../templates/log-template.steps.yaml@ACNTools + - template: ../../templates/log-template.steps.yaml parameters: clusterName: ${{ parameters.clusterName }}-$(commitID) os: windows diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.steps.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.steps.yaml index 7764b08f0e..09db069453 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.steps.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.steps.yaml @@ -6,44 +6,41 @@ parameters: scaleup: "" steps: - - 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: KubectlInstaller@0 inputs: kubectlVersion: latest - task: AzureCLI@2 + displayName: "Set Kubeconfig" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - name: "kubeconfig" - displayName: "Set Kubeconfig" + make -C ./hack/aks set-kubeconf - ${{ if eq(parameters.os, 'linux') }}: - script: | kubectl cluster-info kubectl get node kubectl get po -owide -A - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=linux CNI_TYPE=dualstack VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_DUALSTACK_OVERLAY=true VALIDATE_DUALSTACK=true CNI_VERSION=$(make cni-version) CNS_VERSION=$(make cns-version) CLEANUP=true - workingDirectory: $(ACN_DIR) + sudo -E env "PATH=$PATH" make test-load =true CNI_VERSION=$(make cni-version) CNS_VERSION=$(make cns-version) retryCountOnTaskFailure: 3 - name: "integrationTest" displayName: "Run CNS Integration Tests on AKS DualStack Overlay" + env: + SCALE_UP: 32 + OS_TYPE: linux + CNI_TYPE: dualstack + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_DUALSTACK_OVERLAY: true + VALIDATE_DUALSTACK: true + CLEANUP: true - script: | set -e @@ -53,48 +50,54 @@ steps: go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration -isDualStack=true echo "Dualstack Overlay Linux datapath IPv4 test" go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration - workingDirectory: $(ACN_DIR) retryCountOnTaskFailure: 3 - name: "DualStack_Overlay_Linux_Tests" displayName: "DualStack Overlay Linux Tests" - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST)" + REGION: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) --query "[].name" -o tsv); do - make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) VMSS_NAME=${val} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: linux + RESTART_CASE: true + CNI_TYPE: dualstack inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=linux go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=linux RESTART_CASE=true CNI_TYPE=dualstack + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 - ${{ if eq(parameters.os, 'windows') }}: - script: | @@ -105,55 +108,70 @@ steps: kubectl taint nodes $node node.cloudprovider.kubernetes.io/uninitialized=true:NoSchedule- fi done - sudo -E env "PATH=$PATH" make test-load SCALE_UP=32 OS_TYPE=windows CNI_TYPE=cniv2 VALIDATE_STATEFILE=true INSTALL_CNS=true INSTALL_DUALSTACK_OVERLAY=true VALIDATE_DUALSTACK=true CNI_VERSION=$(make cni-version) CNS_VERSION=$(make cns-version) CLEANUP=true - workingDirectory: $(ACN_DIR) - name: "WindowsDualStackOverlayControlPlaneScaleTests" + sudo -E env "PATH=$PATH" make test-load CNI_VERSION=$(make cni-version) CNS_VERSION=$(make cns-version) displayName: "Windows DualStack Overlay ControlPlane Scale Tests" retryCountOnTaskFailure: 3 + env: + SCALE_UP: 32 + OS_TYPE: windows + # TODO: Check if this is correct. This is the original CNI_TYPE, but the previous test uses "dualstack" + CNI_TYPE: cniv2 + VALIDATE_STATEFILE: true + INSTALL_CNS: true + INSTALL_DUALSTACK_OVERLAY: true + VALIDATE_DUALSTACK: true + CLEANUP: true - script: | echo "DualStack Overlay DataPath Test" cd test/integration/datapath sudo -E env "PATH=$PATH" go test -count=1 datapath_windows_test.go -timeout 3m -tags connection -restartKubeproxy true -run ^TestDatapathWin$ - workingDirectory: $(ACN_DIR) - name: "WindowsDualStackOverlayDatapathTests" displayName: "Windows DualStack Overlay Datapath Tests" retryCountOnTaskFailure: 3 - task: AzureCLI@2 + displayName: "Restart Nodes" + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + RESOURCE_GROUP: "MC_${{ parameters.clusterName }}_${{ parameters.clusterName }}_$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST)" + REGION: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e clusterName=${{ parameters.clusterName }} echo "Restarting nodes" - for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) --query "[].name" -o tsv); do - make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) VMSS_NAME=${val} + for val in $(az vmss list -g "$RESOURCE_GROUP" --query "[].name" -o tsv); do + make -C ./hack/aks restart-vmss VMSS_NAME=${val} done - displayName: "Restart Nodes" - task: AzureCLI@2 + displayName: "Validate Node Restart" + retryCountOnTaskFailure: 3 + env: + ITERATIONS: 2 + SCALE_UP: ${{ parameters.scaleup }} + OS_TYPE: windows + RESTART_CASE: true + CNI_TYPE: cniv2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - cd test/integration/load - # Scale Cluster Up/Down to confirm functioning CNS - ITERATIONS=2 SCALE_UP=${{ parameters.scaleup }} OS_TYPE=windows go test -count 1 -timeout 30m -tags load -run ^TestLoad$ - kubectl get pods -owide -A + pushd test/integration/load + # Scale Cluster Up/Down to confirm functioning CNS + OS_TYPE=windows go test -count 1 -timeout 30m -tags load -run ^TestLoad$ + kubectl get pods -owide -A + popd - cd ../../.. echo "Validating Node Restart" - make test-validate-state OS_TYPE=windows RESTART_CASE=true CNI_TYPE=cniv2 + make test-validate-state kubectl delete ns load-test - displayName: "Validate Node Restart" - retryCountOnTaskFailure: 3 diff --git a/.pipelines/templates/create-cluster-swiftv2.jobs.yaml b/.pipelines/templates/create-cluster-swiftv2.jobs.yaml deleted file mode 100644 index f293007ec4..0000000000 --- a/.pipelines/templates/create-cluster-swiftv2.jobs.yaml +++ /dev/null @@ -1,47 +0,0 @@ -parameters: - os: linux - continueOnError: true - -jobs: - - job: ${{ parameters.name }} - displayName: Cluster - ${{ parameters.name }} - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true - steps: - - checkout: ACNReviewChanges - clean: true - - - task: AzureCLI@2 - inputs: - azureSubscription: $(ACN_TEST_SERVICE_CONNECTION) - scriptLocation: "inlineScript" - scriptType: "bash" - workingDirectory: $(ACN_DIR) - addSpnToEnvironment: true - inlineScript: | - set -e - echo "Check az version" - az version - if ${{ lower(contains(parameters.clusterType, 'dualstack')) }} - then - echo "Install az cli extension preview" - az extension add --name aks-preview - az extension update --name aks-preview - fi - mkdir -p ~/.kube/ - make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }} - - make -C ./hack/aks ${{ parameters.clusterType }} \ - AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) \ - CLUSTER=${{ parameters.clusterName }} \ - VM_SIZE=${{ parameters.vmSize }} OS=${{parameters.os}} - - echo "Cluster successfully created" - displayName: Cluster - ${{ parameters.clusterType }} - continueOnError: ${{ parameters.continueOnError }} - diff --git a/.pipelines/templates/create-cluster.jobs.yaml b/.pipelines/templates/create-cluster.jobs.yaml index 2bfa2f56f2..8a022341cb 100644 --- a/.pipelines/templates/create-cluster.jobs.yaml +++ b/.pipelines/templates/create-cluster.jobs.yaml @@ -14,45 +14,44 @@ parameters: jobs: - job: ${{ parameters.name }} displayName: Cluster - ${{ parameters.name }} - pool: - isCustom: true - type: linux - name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true steps: - - checkout: ACNReviewChanges - clean: true + - bash: | + set -e + echo "Check az version" + az version + + echo "Install az cli extension preview" + az extension add --name aks-preview + az extension update --name aks-preview + displayName: "Install AzCLI Extentions" + condition: and(succeeded(), ${{ contains(parameters.clusterType, 'dualstack') }}) + - task: AzureCLI@2 + displayName: Cluster - ${{ parameters.clusterType }} + continueOnError: contains(parameters.clusterType, 'dualstack') + env: + AZCLI: az + REGION: ${{ parameters.region }} + CLUSTER: ${{ parameters.clusterName }} + CLUSTER_TYPE: ${{ parameters.clusterType }} + SUB: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) + VM_SIZE: ${{ parameters.vmSize }} + VM_SIZE_WIN: ${{ parameters.vmSizeWin }} + OS: ${{ parameters.os }} + OS_SKU_WIN: ${{ parameters.osSkuWin }} inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e - echo "Check az version" - az version - if ${{ lower(contains(parameters.clusterType, 'dualstack')) }} - then - echo "Install az cli extension preview" - az extension add --name aks-preview - az extension update --name aks-preview - fi + mkdir -p ~/.kube/ - make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }} + make -C ./hack/aks azcfg - make -C ./hack/aks ${{ parameters.clusterType }} \ - AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \ - CLUSTER=${{ parameters.clusterName }} \ - VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \ - OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{parameters.os}} \ - WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} + make -C ./hack/aks "$CLUSTER_TYPE" + #WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} echo "Cluster successfully created" - displayName: Cluster - ${{ parameters.clusterType }} - continueOnError: ${{ contains(parameters.clusterType, 'dualstack') }} - diff --git a/.pipelines/templates/delete-cluster.steps.yaml b/.pipelines/templates/delete-cluster.steps.yaml index 04cc02d7f3..be60ad68f1 100644 --- a/.pipelines/templates/delete-cluster.steps.yaml +++ b/.pipelines/templates/delete-cluster.steps.yaml @@ -6,16 +6,22 @@ parameters: steps: - task: AzureCLI@2 inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + azureSubscription: ${{ parameters.svcConn }} scriptLocation: "inlineScript" scriptType: "bash" addSpnToEnvironment: true inlineScript: | echo "Deleting cluster" - make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }} - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - make -C ./hack/aks down AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) CLUSTER=${{ parameters.clusterName }} + make -C ./hack/aks azcfg + make -C ./hack/aks set-kubeconf + make -C ./hack/aks down echo "Cluster and resources down" name: delete displayName: Delete - ${{ parameters.name }} - + env: + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + REGION: ${{ parameters.region }} + SUB: ${{ parameters.sub }} + diff --git a/.pipelines/templates/delete-cluster.yaml b/.pipelines/templates/delete-cluster.yaml deleted file mode 100644 index f06f6d2173..0000000000 --- a/.pipelines/templates/delete-cluster.yaml +++ /dev/null @@ -1,20 +0,0 @@ -parameters: - name: "" - clusterName: "" - region: "" - -steps: - - task: AzureCLI@2 - inputs: - azureSubscription: ${{ parameters.svcConn }} - scriptLocation: "inlineScript" - scriptType: "bash" - addSpnToEnvironment: true - inlineScript: | - echo "Deleting cluster" - make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }} - make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - make -C ./hack/aks down AZCLI=az REGION=${{ parameters.region }} SUB=${{ parameters.sub }} CLUSTER=${{ parameters.clusterName }} - echo "Cluster and resources down" - name: delete - displayName: Delete - ${{ parameters.name }} diff --git a/.pipelines/templates/log-template.steps.yaml b/.pipelines/templates/log-template.steps.yaml index 0079bcee42..11d7abf80f 100644 --- a/.pipelines/templates/log-template.steps.yaml +++ b/.pipelines/templates/log-template.steps.yaml @@ -23,21 +23,16 @@ parameters: jobName: "FailedE2ELogs" steps: - - task: KubectlInstaller@0 - inputs: - kubectlVersion: latest - - task: AzureCLI@2 inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }} - acnLogs=$OB_OUTPUTDIRECTORY + acnLogs=$(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) mkdir -p $acnLogs echo "Root Directory created: $acnLogs" echo "##vso[task.setvariable variable=acnLogs]$acnLogs" @@ -100,7 +95,6 @@ steps: fi displayName: Failure Logs condition: always() - workingDirectory: $(ACN_DIR) - ${{ if eq(parameters.os, 'linux') }}: - bash: | @@ -173,7 +167,7 @@ steps: file="azure-cns.json" kubectl exec -i -n kube-system $pod -- cat /var/lib/azure-network/$file > $(acnLogs)/"$node"_logs/CNS-output/$file echo "CNS State, $file, captured: $(acnLogs)/"$node"_logs/CNS-output/$file" - if [[ $managed =~ true ]]; then + if [ $managed = "true" ]; then file="azure-endpoints.json" kubectl exec -i -n kube-system $pod -- cat /var/run/azure-cns/$file > $(acnLogs)/"$node"_logs/CNS-output/$file echo "CNS Managed State, $file, captured: $(acnLogs)/"$node"_logs/CNS-output/$file" @@ -196,7 +190,6 @@ steps: echo "Cilium, $file, captured: $(acnLogs)/"$node"_logs/Cilium-output/$file" done fi - workingDirectory: $(ACN_DIR) displayName: Linux Logs condition: always() @@ -272,13 +265,12 @@ steps: fi done fi - workingDirectory: $(ACN_DIR) displayName: Windows Logs condition: always() -# - publish: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) -# condition: always() -# artifact: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) -# name: acnLogs_${{ parameters.logType }} -# displayName: Publish Cluster logs - + - task: 1ES.PublishPipelineArtifact@1 + displayName: Publish Cluster logs + condition: always() + inputs: + targetPath: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) + artifactName: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) diff --git a/.pipelines/templates/log-template.yaml b/.pipelines/templates/log-template.yaml index 11d7abf80f..fee969889f 100644 --- a/.pipelines/templates/log-template.yaml +++ b/.pipelines/templates/log-template.yaml @@ -268,9 +268,8 @@ steps: displayName: Windows Logs condition: always() - - task: 1ES.PublishPipelineArtifact@1 - displayName: Publish Cluster logs + - publish: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) condition: always() - inputs: - targetPath: $(System.DefaultWorkingDirectory)/${{ parameters.clusterName }}_${{ parameters.logType }}_Attempt_#$(System.StageAttempt) - artifactName: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) + artifact: ${{ parameters.clusterName }}_${{ parameters.os }}${{ parameters.jobName }}_Attempt_#$(System.StageAttempt) + name: acnLogs_${{ parameters.logType }} + displayName: Publish Cluster logs diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 1ce7fa89f5..96b034b042 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -59,4 +59,4 @@ extends: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true stages: - - template: /.pipelines/pipeline.yaml@azure-container-networking + - template: /.pipelines/run-pipeline.yaml@azure-container-networking From 1c1350b36234b0eea2aa61c465c5b1c4881d8079 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:33:22 -0800 Subject: [PATCH 18/52] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 96b034b042..0a8354b896 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -47,10 +47,15 @@ variables: extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates parameters: + pool: + name: $(BUILD_POOL_NAME_DEFAULT) + os: linux + image: acn-runner-vmss-image-1es-v3.0 sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows + image: acn-runner-vmss-image-windows-1es-v3.0 codeql: # Enables CodeQL on the main branch compiled: From 1945cec03dbae59d6248ed6acab3bd5157a1cac6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:36:43 -0800 Subject: [PATCH 19/52] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 0a8354b896..a893417aa4 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -55,7 +55,7 @@ extends: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows - image: acn-runner-vmss-image-windows-1es-v3.0 + image: acn-runner-vmss-image-windows-1es-v2.0 codeql: # Enables CodeQL on the main branch compiled: From a6c19390c0f8393d258285a5cfefd8f631d315e8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:56:54 -0800 Subject: [PATCH 20/52] fixup! Separate Build Changes --- .pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml | 42 +++++-------------- .pipelines/multitenancy/swiftv2-e2e.jobs.yaml | 2 +- .pipelines/run-pipeline.yaml | 18 -------- .../aks-swift/aks-swift-e2e.jobs.yaml | 2 +- .../singletenancy/aks/aks-e2e.jobs.yaml | 2 +- .../azure-cni-overlay-stateless-e2e.jobs.yaml | 2 +- .../add-windows-nodepool.jobs.yaml | 2 +- .../azure-cni-overlay-e2e.jobs.yaml | 4 +- .../cilium-dualstackoverlay-e2e.jobs.yaml | 2 +- .../cilium-nodesubnet-e2e.jobs.yaml | 8 +--- .../cilium-overlay-e2e.jobs.yaml | 2 +- .../cilium-overlay-e2e.jobs.yaml | 2 +- .../singletenancy/cilium/cilium-e2e.jobs.yaml | 6 +-- .../dualstackoverlay-e2e.jobs.yaml | 3 +- 14 files changed, 27 insertions(+), 70 deletions(-) diff --git a/.pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml b/.pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml index 158685826f..c43c8723bd 100644 --- a/.pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml +++ b/.pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml @@ -8,26 +8,17 @@ parameters: jobs: - job: CNI_${{ parameters.os }} - condition: and( not(canceled()), not(failed()) ) displayName: CNI k8s E2E ${{ parameters.os }} dependsOn: ${{ parameters.dependsOn }} pool: - isCustom: true - type: linux name: $(BUILD_POOL_NAME_DEFAULT) - variables: - ob_outputDirectory: $(Build.ArtifactStagingDirectory)/output - ob_git_checkout: true + os: linux steps: - - checkout: ACNReviewChanges - clean: true - - task: AzureCLI@2 inputs: azureSubscription: ${{ parameters.sub }} scriptLocation: "inlineScript" scriptType: "bash" - workingDirectory: $(ACN_DIR) addSpnToEnvironment: true inlineScript: | set -e @@ -42,9 +33,8 @@ jobs: # https://github.com/kubernetes/sig-release/blob/master/release-engineering/artifacts.md#content-of-kubernetes-test-system-archtargz-on-example-of-kubernetes-test-linux-amd64targz-directories-removed-from-list # explictly unzip and strip directories from ginkgo and e2e.test tar -xvzf kubernetes-test-linux-amd64.tar.gz --strip-components=3 kubernetes/test/bin/ginkgo kubernetes/test/bin/e2e.test - displayName: "Setup Environment" - retryCountOnTaskFailure: 5 + displayName: "Setup Environment" - ${{ if contains(parameters.os, 'windows') }}: - script: | set -e @@ -57,13 +47,11 @@ jobs: kubectl exec -i -n kube-system $pod -- powershell "Restart-Service kubeproxy" kubectl exec -i -n kube-system $pod -- powershell "Get-Service kubeproxy" done - workingDirectory: $(ACN_DIR) name: kubeproxy displayName: Restart Kubeproxy on Windows nodes retryCountOnTaskFailure: 3 - - ${{ if eq(parameters.datapath, true) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Datapath name: datapath @@ -72,9 +60,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 10 - - ${{ if eq(parameters.dns, true) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: DNS name: dns @@ -83,9 +70,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if eq(parameters.portforward, true) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Kubectl Portforward name: portforward @@ -94,9 +80,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if and( eq(parameters.service, true), contains(parameters.cni, 'cni') ) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Service Conformance name: service @@ -105,9 +90,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if and( eq(parameters.service, true), contains(parameters.cni, 'cilium') ) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Service Conformance|Cilium name: service @@ -116,9 +100,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if eq(parameters.hostport, true) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Host Port name: hostport @@ -127,9 +110,8 @@ jobs: os: ${{ parameters.os }} processes: 1 # Has a short serial test attempts: 3 - - ${{ if and(eq(parameters.hybridWin, true), eq(parameters.os, 'windows')) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: Hybrid Network name: hybrid @@ -138,9 +120,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if and( eq(parameters.dualstack, true), eq(contains(parameters.cni, 'cilium'), false) ) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: DualStack Test name: DualStack @@ -150,9 +131,8 @@ jobs: os: ${{ parameters.os }} processes: 8 attempts: 3 - - ${{ if and( eq(parameters.dualstack, true), contains(parameters.cni, 'cilium') ) }}: - - template: k8s-e2e.steps.yaml@ACNTools + - template: ../k8s-e2e/k8s-e2e-step-template.yaml parameters: testName: DualStack Test|Cilium name: DualStack diff --git a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml index e115bd3618..3211a40a53 100644 --- a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml +++ b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml @@ -48,8 +48,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - template: swiftv2-e2e.steps.yaml diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 223ea603a8..4d14b5ac78 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -4,9 +4,6 @@ stages: jobs: - job: env displayName: Setup - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux steps: - script: | # To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage @@ -42,9 +39,6 @@ stages: displayName: Build Binaries variables: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux steps: - task: GoTool@0 inputs: @@ -83,9 +77,6 @@ stages: jobs: - job: containerize_amd64 displayName: Build Images - pool: - name: "$(BUILD_POOL_NAME_LINUX_AMD64)" - os: linux strategy: maxParallel: 4 matrix: @@ -179,9 +170,6 @@ stages: jobs: - job: manifest displayName: Compile Manifests - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: maxParallel: 4 matrix: @@ -389,9 +377,6 @@ stages: jobs: - job: delete_build displayName: Delete Cluster - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: maxParallel: 4 matrix: @@ -454,9 +439,6 @@ stages: - job: delete_test displayName: Delete Cluster - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: maxParallel: 4 matrix: diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml index f112a3fea5..624e233392 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml @@ -48,8 +48,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml index df56eb70c0..f9dda9c1b3 100644 --- a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml @@ -50,8 +50,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml index 84c6177804..2b1108e202 100644 --- a/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml @@ -51,8 +51,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml index 6912f20f05..7d9c695058 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml @@ -10,8 +10,8 @@ jobs: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) timeoutInMinutes: 30 steps: diff --git a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml index 514c47364b..73c304c7f6 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml @@ -45,8 +45,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self @@ -72,8 +72,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml index 1615640760..edcb792f10 100644 --- a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml @@ -45,8 +45,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml index a22d659e77..7076eea597 100644 --- a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml @@ -17,9 +17,6 @@ stages: dependsOn: - ${{ parameters.dependsOn }} - setup - pool: - name: $(BUILD_POOL_NAME_DEFAULT) - os: linux variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: @@ -46,16 +43,15 @@ stages: - setup - publish - ${{ parameters.clusterName }} - pool: - name: $(BUILD_POOL_NAME_DEFAULT) jobs: - job: ${{ parameters.name }} displayName: Nodesubnet with Cilium - (${{ parameters.name }}) timeoutInMinutes: 120 pool: name: $(BUILD_POOL_NAME_DEFAULT) + os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml index c95fa8f6b8..dd4429234b 100644 --- a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml @@ -47,8 +47,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml index c20b806218..43fcd073e9 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml @@ -46,8 +46,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml index 3cb9b51cbb..d053a1f291 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml @@ -17,6 +17,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: @@ -45,9 +46,6 @@ stages: GOBIN: "$(GOPATH)/bin" # Go binaries path modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" condition: and(succeeded(), eq(variables.TAG, variables.CURRENT_VERSION)) - pool: - name: $(BUILD_POOL_NAME_DEFAULT) - os: linux jobs: - job: ${{ parameters.name }} displayName: Cilium Test Suite - (${{ parameters.name }}) @@ -55,8 +53,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - checkout: self diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml index 6d02e85dd2..37c2098f26 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml @@ -46,6 +46,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) @@ -70,8 +71,8 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux + image: acn-runner-vmss-image-1es-v3.0 demands: - - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) steps: - template: dualstackoverlay-e2e.steps.yaml From c80d012b8cb9224d59f520690d23101aad69c300 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:44:01 -0800 Subject: [PATCH 21/52] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 820 +++++++++--------- .../templates/run-unit-tests.stages.yaml | 62 ++ 2 files changed, 472 insertions(+), 410 deletions(-) create mode 100644 .pipelines/templates/run-unit-tests.stages.yaml diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 4d14b5ac78..bf6bc5ac38 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -26,435 +26,435 @@ stages: name: "EnvironmentalVariables" displayName: "Set environmental variables" - - template: templates/run-unit-tests.yaml + - template: templates/run-unit-tests.stages.yaml - - ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - - stage: binaries - displayName: Build Binaries - dependsOn: - - setup - - test - jobs: - - job: build - displayName: Build Binaries - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) + #- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: + - stage: binaries + displayName: Build Binaries + dependsOn: + - setup + - test + jobs: + - job: build + displayName: Build Binaries + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) - - script: | - make ipv6-hp-bpf-lib - make all-binaries-platforms - displayName: "Build all platform binaries" + - script: | + make ipv6-hp-bpf-lib + make all-binaries-platforms + 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" + - 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) + - task: CopyFiles@2 + inputs: + sourceFolder: "output" + targetFolder: $(Build.ArtifactStagingDirectory) - - task: 1ES.PublishPipelineArtifact@1 - inputs: - artifactName: "output" - targetPath: "$(Build.ArtifactStagingDirectory)" + - task: 1ES.PublishPipelineArtifact@1 + inputs: + artifactName: "output" + targetPath: "$(Build.ArtifactStagingDirectory)" - - stage: containerize - displayName: Build Images - dependsOn: - - setup - - test - jobs: - - job: containerize_amd64 - displayName: Build Images - strategy: - maxParallel: 4 - matrix: - azure_ipam_linux_amd64: - arch: amd64 - name: azure-ipam - os: linux - azure_ipam_windows: - arch: amd64 - name: azure-ipam - os: windows - cni_linux_amd64: - arch: amd64 - name: cni - os: linux - cni_windows_amd64: - arch: amd64 - name: cni - os: windows - cns_linux_amd64: - arch: amd64 - name: cns - os: linux - cns_windows_amd64: - arch: amd64 - name: cns - os: windows - ipv6_hp_bpf_linux_amd64: - arch: amd64 - name: ipv6-hp-bpf - os: linux - npm_linux_amd64: - arch: amd64 - name: npm - os: linux - npm_windows_amd64: - arch: amd64 - name: npm - os: windows - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - template: containers/container-template.steps.yaml - parameters: - arch: $(arch) - name: $(name) - os: $(os) - os_version: $(os_version) - - job: containerize_linux_arm64 - displayName: Build Images - pool: - name: "$(BUILD_POOL_NAME_LINUX_ARM64)" - os: linux - strategy: - maxParallel: 4 - matrix: - azure_ipam_linux_arm64: - arch: arm64 - name: azure-ipam - os: linux - cni_linux_arm64: - arch: arm64 - name: cni - os: linux - cns_linux_arm64: - arch: arm64 - name: cns - os: linux - ipv6_hp_bpf_linux_arm64: - arch: arm64 - name: ipv6-hp-bpf - os: linux - npm_linux_arm64: - arch: arm64 - name: npm - os: linux - steps: - - template: containers/container-template.steps.yaml - parameters: - arch: $(arch) - name: $(name) - os: $(os) + - stage: containerize + displayName: Build Images + dependsOn: + - setup + - test + jobs: + - job: containerize_amd64 + displayName: Build Images + strategy: + maxParallel: 4 + matrix: + azure_ipam_linux_amd64: + arch: amd64 + name: azure-ipam + os: linux + azure_ipam_windows: + arch: amd64 + name: azure-ipam + os: windows + cni_linux_amd64: + arch: amd64 + name: cni + os: linux + cni_windows_amd64: + arch: amd64 + name: cni + os: windows + cns_linux_amd64: + arch: amd64 + name: cns + os: linux + cns_windows_amd64: + arch: amd64 + name: cns + os: windows + ipv6_hp_bpf_linux_amd64: + arch: amd64 + name: ipv6-hp-bpf + os: linux + npm_linux_amd64: + arch: amd64 + name: npm + os: linux + npm_windows_amd64: + arch: amd64 + name: npm + os: windows + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - template: containers/container-template.steps.yaml + parameters: + arch: $(arch) + name: $(name) + os: $(os) + os_version: $(os_version) + - job: containerize_linux_arm64 + displayName: Build Images + pool: + name: "$(BUILD_POOL_NAME_LINUX_ARM64)" + os: linux + strategy: + maxParallel: 4 + matrix: + azure_ipam_linux_arm64: + arch: arm64 + name: azure-ipam + os: linux + cni_linux_arm64: + arch: arm64 + name: cni + os: linux + cns_linux_arm64: + arch: arm64 + name: cns + os: linux + ipv6_hp_bpf_linux_arm64: + arch: arm64 + name: ipv6-hp-bpf + os: linux + npm_linux_arm64: + arch: arm64 + name: npm + os: linux + steps: + - template: containers/container-template.steps.yaml + parameters: + arch: $(arch) + name: $(name) + os: $(os) - - stage: publish - displayName: Publish Multiarch Manifests - dependsOn: - - containerize - variables: - Packaging.EnableSBOMSigning: false - jobs: - - job: manifest - displayName: Compile Manifests - strategy: - maxParallel: 4 - matrix: - azure_ipam: - name: azure-ipam - platforms: linux/amd64 linux/arm64 windows/amd64 - cni: - name: cni - platforms: linux/amd64 linux/arm64 windows/amd64 - cns: - name: cns - platforms: linux/amd64 linux/arm64 windows/amd64 - ipv6_hp_bpf: - name: ipv6-hp-bpf - platforms: linux/amd64 linux/arm64 - npm: - name: npm - platforms: linux/amd64 linux/arm64 windows/amd64 - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - template: containers/manifest-template.steps.yaml - parameters: - name: $(name) - platforms: $(platforms) + - stage: publish + displayName: Publish Multiarch Manifests + dependsOn: + - containerize + variables: + Packaging.EnableSBOMSigning: false + jobs: + - job: manifest + displayName: Compile Manifests + strategy: + maxParallel: 4 + matrix: + azure_ipam: + name: azure-ipam + platforms: linux/amd64 linux/arm64 windows/amd64 + cni: + name: cni + platforms: linux/amd64 linux/arm64 windows/amd64 + cns: + name: cns + platforms: linux/amd64 linux/arm64 windows/amd64 + ipv6_hp_bpf: + name: ipv6-hp-bpf + platforms: linux/amd64 linux/arm64 + npm: + name: npm + platforms: linux/amd64 linux/arm64 windows/amd64 + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - template: containers/manifest-template.steps.yaml + parameters: + name: $(name) + platforms: $(platforms) - # Cilium Podsubnet E2E tests - - template: singletenancy/cilium/cilium-e2e.jobs.yaml - parameters: - name: "cilium_e2e" - displayName: Cilium - clusterType: swift-byocni-nokubeproxy-up - clusterName: "ciliume2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" + # Cilium Podsubnet E2E tests + - template: singletenancy/cilium/cilium-e2e.jobs.yaml + parameters: + name: "cilium_e2e" + displayName: Cilium + clusterType: swift-byocni-nokubeproxy-up + clusterName: "ciliume2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" - # Cilium Nodesubnet E2E tests - - template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml - parameters: - name: "cilium_nodesubnet_e2e" - displayName: Cilium NodeSubnet - clusterType: nodesubnet-byocni-nokubeproxy-up - clusterName: "cilndsubnete2e" - vmSize: Standard_B2s - k8sVersion: "" - dependsOn: "containerize" + # Cilium Nodesubnet E2E tests + - template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml + parameters: + name: "cilium_nodesubnet_e2e" + displayName: Cilium NodeSubnet + clusterType: nodesubnet-byocni-nokubeproxy-up + clusterName: "cilndsubnete2e" + vmSize: Standard_B2s + k8sVersion: "" + dependsOn: "containerize" - # Cilium Overlay E2E tests - - template: singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml - parameters: - name: "cilium_overlay_e2e" - displayName: Cilium on AKS Overlay - clusterType: overlay-byocni-nokubeproxy-up - clusterName: "cilovere2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" + # Cilium Overlay E2E tests + - template: singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml + parameters: + name: "cilium_overlay_e2e" + displayName: Cilium on AKS Overlay + clusterType: overlay-byocni-nokubeproxy-up + clusterName: "cilovere2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" - # Cilium Dualstack Overlay E2E tests - - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml - parameters: - name: "cilium_dualstackoverlay_e2e" - displayName: Cilium on AKS DualStack Overlay - os: linux - clusterType: dualstack-byocni-nokubeproxy-up - clusterName: "cildsovere2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" + # Cilium Dualstack Overlay E2E tests + - template: singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml + parameters: + name: "cilium_dualstackoverlay_e2e" + displayName: Cilium on AKS DualStack Overlay + os: linux + clusterType: dualstack-byocni-nokubeproxy-up + clusterName: "cildsovere2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" - # Cilium Overlay with hubble E2E tests - - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml - parameters: - name: "cilium_h_overlay_e2e" - displayName: Cilium on AKS Overlay with Hubble - clusterType: overlay-byocni-nokubeproxy-up - clusterName: "cilwhleovere2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" - testHubble: true + # Cilium Overlay with hubble E2E tests + - template: singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml + parameters: + name: "cilium_h_overlay_e2e" + displayName: Cilium on AKS Overlay with Hubble + clusterType: overlay-byocni-nokubeproxy-up + clusterName: "cilwhleovere2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" + testHubble: true - # Azure Overlay E2E tests - - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml - parameters: - name: "azure_overlay_e2e" - displayName: Azure Overlay - os: linux - clusterType: overlay-byocni-up - clusterName: "azovere2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" + # Azure Overlay E2E tests + - template: singletenancy/azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml + parameters: + name: "azure_overlay_e2e" + displayName: Azure Overlay + os: linux + clusterType: overlay-byocni-up + clusterName: "azovere2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" - # Azure Overlay E2E Stateless CNI tests - - template: singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml - parameters: - name: "azure_overlay_stateless_e2e" - displayName: Azure Stateless CNI Overlay - os: windows - clusterType: overlay-byocni-up - clusterName: "statelesswin" - vmSize: Standard_B2ms - dependsOn: "containerize" + # Azure Overlay E2E Stateless CNI tests + - template: singletenancy/azure-cni-overlay-stateless/azure-cni-overlay-stateless-e2e.jobs.yaml + parameters: + name: "azure_overlay_stateless_e2e" + displayName: Azure Stateless CNI Overlay + os: windows + clusterType: overlay-byocni-up + clusterName: "statelesswin" + vmSize: Standard_B2ms + dependsOn: "containerize" - # AKS Swift E2E tests - - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml - parameters: - name: "aks_swift_e2e" - displayName: AKS Swift Ubuntu - os: linux - clusterType: swift-byocni-up - clusterName: "swifte2e" - vmSize: Standard_B2ms - k8sVersion: "" - dependsOn: "containerize" + # AKS Swift E2E tests + - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml + parameters: + name: "aks_swift_e2e" + displayName: AKS Swift Ubuntu + os: linux + clusterType: swift-byocni-up + clusterName: "swifte2e" + vmSize: Standard_B2ms + k8sVersion: "" + dependsOn: "containerize" - # AKS Swift Vnet Scale E2E tests - - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml - parameters: - name: "aks_swift_vnetscale_e2e" - displayName: AKS Swift Vnet Scale Ubuntu - os: linux - clusterType: vnetscale-swift-byocni-up - clusterName: "vscaleswifte2e" - vmSize: Standard_B2ms - k8sVersion: "1.30" - dependsOn: "containerize" + # AKS Swift Vnet Scale E2E tests + - template: singletenancy/aks-swift/aks-swift-e2e.jobs.yaml + parameters: + name: "aks_swift_vnetscale_e2e" + displayName: AKS Swift Vnet Scale Ubuntu + os: linux + clusterType: vnetscale-swift-byocni-up + clusterName: "vscaleswifte2e" + vmSize: Standard_B2ms + k8sVersion: "1.30" + dependsOn: "containerize" - # CNIv1 E2E tests - - template: singletenancy/aks/aks-e2e.jobs.yaml - parameters: - name: "aks_ubuntu_22_linux_e2e" - displayName: AKS Ubuntu 22 - arch: "amd64" - os: "linux" - clusterType: linux-cniv1-up - clusterName: "ubuntu22e2e" - vmSize: Standard_B2s - k8sVersion: 1.25 - scaleup: 100 - dependsOn: "containerize" + # CNIv1 E2E tests + - template: singletenancy/aks/aks-e2e.jobs.yaml + parameters: + name: "aks_ubuntu_22_linux_e2e" + displayName: AKS Ubuntu 22 + arch: "amd64" + os: "linux" + clusterType: linux-cniv1-up + clusterName: "ubuntu22e2e" + vmSize: Standard_B2s + k8sVersion: 1.25 + scaleup: 100 + dependsOn: "containerize" - - template: singletenancy/aks/aks-e2e.jobs.yaml - parameters: - name: "aks_windows_22_e2e" - displayName: AKS Windows 2022 - arch: amd64 - os: windows - clusterType: windows-cniv1-up - clusterName: "win22e2e" - vmSize: Standard_B2ms - os_version: "ltsc2022" - scaleup: 50 - dependsOn: "containerize" + - template: singletenancy/aks/aks-e2e.jobs.yaml + parameters: + name: "aks_windows_22_e2e" + displayName: AKS Windows 2022 + arch: amd64 + os: windows + clusterType: windows-cniv1-up + clusterName: "win22e2e" + vmSize: Standard_B2ms + os_version: "ltsc2022" + scaleup: 50 + dependsOn: "containerize" - # CNI dual stack overlay E2E tests - - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml - parameters: - name: "dualstackoverlay_e2e" - displayName: AKS DualStack Overlay - os: linux - clusterType: dualstack-overlay-byocni-up - clusterName: "dsovere2e" - vmSize: Standard_B2ms - dependsOn: "containerize" + # CNI dual stack overlay E2E tests + - template: singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml + parameters: + name: "dualstackoverlay_e2e" + displayName: AKS DualStack Overlay + os: linux + clusterType: dualstack-overlay-byocni-up + clusterName: "dsovere2e" + vmSize: Standard_B2ms + dependsOn: "containerize" - # Swiftv2 E2E tests with multitenancy cluster start up - - template: multitenancy/swiftv2-e2e.jobs.yaml - parameters: - name: "swiftv2_e2e" - displayName: Swiftv2 Multitenancy - os: linux - clusterType: swiftv2-multitenancy-cluster-up - clusterName: "mtacluster" - nodePoolName: "mtapool" - vmSize: $(SWIFTV2_MT_CLUSTER_SKU) - dependsOn: "containerize" - dummyClusterName: "swiftv2dummy" - dummyClusterType: "swiftv2-dummy-cluster-up" - dummyClusterDisplayName: Swiftv2 Multitenancy Dummy Cluster + # Swiftv2 E2E tests with multitenancy cluster start up + - template: multitenancy/swiftv2-e2e.jobs.yaml + parameters: + name: "swiftv2_e2e" + displayName: Swiftv2 Multitenancy + os: linux + clusterType: swiftv2-multitenancy-cluster-up + clusterName: "mtacluster" + nodePoolName: "mtapool" + vmSize: $(SWIFTV2_MT_CLUSTER_SKU) + dependsOn: "containerize" + dummyClusterName: "swiftv2dummy" + dummyClusterType: "swiftv2-dummy-cluster-up" + dummyClusterDisplayName: Swiftv2 Multitenancy Dummy Cluster - - stage: delete - displayName: Delete Clusters - condition: always() - dependsOn: - - setup - - azure_overlay_e2e - - azure_overlay_stateless_e2e - - aks_swift_e2e - - cilium_e2e - - cilium_nodesubnet_e2e - - cilium_overlay_e2e - - cilium_h_overlay_e2e - - aks_ubuntu_22_linux_e2e - - aks_swift_vnetscale_e2e - - aks_windows_22_e2e - - dualstackoverlay_e2e - - cilium_dualstackoverlay_e2e - - swiftv2_e2e - variables: - commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] - jobs: - - job: delete_build - displayName: Delete Cluster - strategy: - maxParallel: 4 - matrix: - cilium_e2e: - name: cilium_e2e - clusterName: "ciliume2e" - region: $(REGION_AKS_CLUSTER_TEST) - cilium_nodesubnet_e2e: - name: cilium_nodesubnet_e2e - clusterName: "cilndsubnete2e" - region: $(REGION_AKS_CLUSTER_TEST) - cilium_overlay_e2e: - name: cilium_overlay_e2e - clusterName: "cilovere2e" - region: $(REGION_AKS_CLUSTER_TEST) - cilium_h_overlay_e2e: - name: cilium_h_overlay_e2e - clusterName: "cilwhleovere2e" - region: $(REGION_AKS_CLUSTER_TEST) - azure_overlay_e2e: - name: azure_overlay_e2e - clusterName: "azovere2e" - region: $(REGION_AKS_CLUSTER_TEST) - azure_overlay_stateless_e2e: - name: azure_overlay_stateless_e2e - clusterName: "statelesswin" - region: $(REGION_AKS_CLUSTER_TEST) - aks_swift_e2e: - name: aks_swift_e2e - clusterName: "swifte2e" - region: $(REGION_AKS_CLUSTER_TEST) - aks_swift_vnetscale_e2e: - name: aks_swift_vnetscale_e2e - clusterName: "vscaleswifte2e" - region: $(REGION_AKS_CLUSTER_TEST) - aks_ubuntu_22_linux_e2e: - name: aks_ubuntu_22_linux_e2e - clusterName: "ubuntu22e2e" - region: $(REGION_AKS_CLUSTER_TEST) - aks_windows_22_e2e: - name: aks_windows_22_e2e - clusterName: "win22e2e" - region: $(REGION_AKS_CLUSTER_TEST) - dualstackoverlay_e2e: - name: dualstackoverlay_e2e - clusterName: "dsovere2e" - region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) - cilium_dualstackoverlay_e2e: - name: cilium_dualstackoverlay_e2e - clusterName: "cildsovere2e" - region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) - steps: - - template: templates/delete-cluster.steps.yaml - parameters: - name: $(name) - clusterName: $(clusterName)-$(commitID) - region: $(region) - sub: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) - svcConn: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + - stage: delete + displayName: Delete Clusters + condition: always() + dependsOn: + - setup + - azure_overlay_e2e + - azure_overlay_stateless_e2e + - aks_swift_e2e + - cilium_e2e + - cilium_nodesubnet_e2e + - cilium_overlay_e2e + - cilium_h_overlay_e2e + - aks_ubuntu_22_linux_e2e + - aks_swift_vnetscale_e2e + - aks_windows_22_e2e + - dualstackoverlay_e2e + - cilium_dualstackoverlay_e2e + - swiftv2_e2e + variables: + commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] + jobs: + - job: delete_build + displayName: Delete Cluster + strategy: + maxParallel: 4 + matrix: + cilium_e2e: + name: cilium_e2e + clusterName: "ciliume2e" + region: $(REGION_AKS_CLUSTER_TEST) + cilium_nodesubnet_e2e: + name: cilium_nodesubnet_e2e + clusterName: "cilndsubnete2e" + region: $(REGION_AKS_CLUSTER_TEST) + cilium_overlay_e2e: + name: cilium_overlay_e2e + clusterName: "cilovere2e" + region: $(REGION_AKS_CLUSTER_TEST) + cilium_h_overlay_e2e: + name: cilium_h_overlay_e2e + clusterName: "cilwhleovere2e" + region: $(REGION_AKS_CLUSTER_TEST) + azure_overlay_e2e: + name: azure_overlay_e2e + clusterName: "azovere2e" + region: $(REGION_AKS_CLUSTER_TEST) + azure_overlay_stateless_e2e: + name: azure_overlay_stateless_e2e + clusterName: "statelesswin" + region: $(REGION_AKS_CLUSTER_TEST) + aks_swift_e2e: + name: aks_swift_e2e + clusterName: "swifte2e" + region: $(REGION_AKS_CLUSTER_TEST) + aks_swift_vnetscale_e2e: + name: aks_swift_vnetscale_e2e + clusterName: "vscaleswifte2e" + region: $(REGION_AKS_CLUSTER_TEST) + aks_ubuntu_22_linux_e2e: + name: aks_ubuntu_22_linux_e2e + clusterName: "ubuntu22e2e" + region: $(REGION_AKS_CLUSTER_TEST) + aks_windows_22_e2e: + name: aks_windows_22_e2e + clusterName: "win22e2e" + region: $(REGION_AKS_CLUSTER_TEST) + dualstackoverlay_e2e: + name: dualstackoverlay_e2e + clusterName: "dsovere2e" + region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) + cilium_dualstackoverlay_e2e: + name: cilium_dualstackoverlay_e2e + clusterName: "cildsovere2e" + region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) + steps: + - template: templates/delete-cluster.steps.yaml + parameters: + name: $(name) + clusterName: $(clusterName)-$(commitID) + region: $(region) + sub: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) + svcConn: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) - - job: delete_test - displayName: Delete Cluster - strategy: - maxParallel: 4 - matrix: - swiftv2_e2e: - name: swiftv2_e2e - clusterName: "mtacluster" - region: $(REGION_SWIFTV2_CLUSTER_TEST) - swiftv2_dummy_e2e: - name: swiftv2_dummy_e2e - clusterName: "swiftv2dummy" - region: $(REGION_SWIFTV2_CLUSTER_TEST) - steps: - - template: templates/delete-cluster.steps.yaml - parameters: - name: $(name) - clusterName: $(clusterName)-$(commitID) - region: $(region) - sub: $(SUB_AZURE_NETWORK_AGENT_TEST) - svcConn: $(ACN_TEST_SERVICE_CONNECTION) + - job: delete_test + displayName: Delete Cluster + strategy: + maxParallel: 4 + matrix: + swiftv2_e2e: + name: swiftv2_e2e + clusterName: "mtacluster" + region: $(REGION_SWIFTV2_CLUSTER_TEST) + swiftv2_dummy_e2e: + name: swiftv2_dummy_e2e + clusterName: "swiftv2dummy" + region: $(REGION_SWIFTV2_CLUSTER_TEST) + steps: + - template: templates/delete-cluster.steps.yaml + parameters: + name: $(name) + clusterName: $(clusterName)-$(commitID) + region: $(region) + sub: $(SUB_AZURE_NETWORK_AGENT_TEST) + svcConn: $(ACN_TEST_SERVICE_CONNECTION) diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml new file mode 100644 index 0000000000..842624ab8b --- /dev/null +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -0,0 +1,62 @@ +stages: + - 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)" + os: linux + image: acn-runner-vmss-image-1es-v3.0 + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - 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" + + - stage: test_windows + displayName: Test ACN Windows + dependsOn: + - setup + jobs: + - job: test + displayName: Run Tests + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + pool: + name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" + os: windows + image: acn-runner-vmss-image-windows-1es-v2.0 + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - script: | + cd npm/ + go test ./... + cd ../cni/ + go test ./... + cd ../platform/ + go test ./... + retryCountOnTaskFailure: 3 + name: "TestWindows" + displayName: "Run Windows Tests" + From 9bca36b13d4e2a93a078f954349f3757ce04bb20 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:50:21 -0800 Subject: [PATCH 22/52] fixup! Separate Build Changes --- .pipelines/templates/create-cluster.jobs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pipelines/templates/create-cluster.jobs.yaml b/.pipelines/templates/create-cluster.jobs.yaml index 8a022341cb..b6800e9556 100644 --- a/.pipelines/templates/create-cluster.jobs.yaml +++ b/.pipelines/templates/create-cluster.jobs.yaml @@ -29,7 +29,7 @@ jobs: - task: AzureCLI@2 displayName: Cluster - ${{ parameters.clusterType }} - continueOnError: contains(parameters.clusterType, 'dualstack') + continueOnError: ${{ contains(parameters.clusterType, 'dualstack') }} env: AZCLI: az REGION: ${{ parameters.region }} @@ -53,5 +53,4 @@ jobs: make -C ./hack/aks "$CLUSTER_TYPE" #WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} - echo "Cluster successfully created" From afa56e75d1e3f792a2d34c1d21a845965f890271 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:59:42 -0800 Subject: [PATCH 23/52] fixup! Separate Build Changes --- .../templates/add-windows-nodepool.jobs.yaml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .pipelines/templates/add-windows-nodepool.jobs.yaml diff --git a/.pipelines/templates/add-windows-nodepool.jobs.yaml b/.pipelines/templates/add-windows-nodepool.jobs.yaml new file mode 100644 index 0000000000..2d4d302f8c --- /dev/null +++ b/.pipelines/templates/add-windows-nodepool.jobs.yaml @@ -0,0 +1,62 @@ +parameters: + depend: "" + clusterName: "" # unique identifier + vmSize: "" + +jobs: +- job: windows_nodepool + displayName: Add Windows Nodepool + dependsOn: ${{ parameters.depend }} + timeoutInMinutes: 30 + steps: + - task: AzureCLI@2 + displayName: "Add windows node to cluster" + retryCountOnTaskFailure: 5 + env: + AZCLI: az + SUB: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) + CLUSTER: ${{ parameters.clusterName }} + VM_SIZE_WIN: ${{ parameters.vmSize }} + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + set -e + + windows_nodepool=$(az aks nodepool list \ + --resource-group "$CLUSTER" \ + --cluster-name "$CLUSTER" \ + --query "[?osType=='Windows']" \ + --output tsv) + + if [ -z "$windows_nodepool" ]; then + echo "No Windows node pool found in the AKS cluster." + + # wait for cluster to update + while true; do + cluster_state=$(az aks show \ + --resource-group "$CLUSTER" \ + --name "$CLUSTER" \ + --query provisioningState) + + if echo "$cluster_state" | grep -q "Updating"; then + echo "Cluster is updating. Sleeping for 30 seconds..." + sleep 30 + else + break + fi + done + # cluster state is always set and visible outside the loop + echo "Cluster state is: $cluster_state" + + make -C ./hack/aks set-kubeconf + make -C ./hack/aks windows-nodepool-up + echo "Windows node was successfully added" + kubectl cluster-info + kubectl get node -owide + kubectl get po -owide -A + else + echo "Windows node pool already exists in the AKS cluster." + fi From e35cca3e9a4496dd0cd2aa1b31e41f1aae91c8cb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 18:03:53 -0800 Subject: [PATCH 24/52] fixup! Separate Build Changes --- .pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml | 2 +- .../dualstack-overlay/dualstackoverlay-e2e.jobs.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml index 624e233392..8c46964762 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml @@ -16,7 +16,7 @@ stages: variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: - - template: ../../templates/create-cluster.steps.yaml + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml index 37c2098f26..a3e23ca486 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml @@ -16,7 +16,7 @@ stages: variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: - - template: ../../templates/create-cluster.steps.yaml + - template: ../../templates/create-cluster.jobs.yaml parameters: name: ${{ parameters.name }} displayName: ${{ parameters.displayName }} From e75c9499aea74cef765c6393e392882d822c60fc Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 18:06:12 -0800 Subject: [PATCH 25/52] fixup! Separate Build Changes --- .pipelines/templates/delete-cluster.steps.yaml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.pipelines/templates/delete-cluster.steps.yaml b/.pipelines/templates/delete-cluster.steps.yaml index be60ad68f1..7e74a2eeab 100644 --- a/.pipelines/templates/delete-cluster.steps.yaml +++ b/.pipelines/templates/delete-cluster.steps.yaml @@ -5,6 +5,12 @@ parameters: steps: - task: AzureCLI@2 + displayName: Delete - ${{ parameters.name }} + env: + AZCLI: az + CLUSTER: ${{ parameters.clusterName }} + REGION: ${{ parameters.region }} + SUB: ${{ parameters.sub }} inputs: azureSubscription: ${{ parameters.svcConn }} scriptLocation: "inlineScript" @@ -16,12 +22,3 @@ steps: make -C ./hack/aks set-kubeconf make -C ./hack/aks down echo "Cluster and resources down" - name: delete - displayName: Delete - ${{ parameters.name }} - env: - env: - AZCLI: az - CLUSTER: ${{ parameters.clusterName }} - REGION: ${{ parameters.region }} - SUB: ${{ parameters.sub }} - From d0b7de31e9fb48bb5f4ae70533a5885f32e7792b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 16:46:52 -0800 Subject: [PATCH 26/52] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index a893417aa4..b9e692ecfc 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -51,6 +51,16 @@ extends: name: $(BUILD_POOL_NAME_DEFAULT) os: linux image: acn-runner-vmss-image-1es-v3.0 + authenticatedContainerRegistries: + - serviceConnection: $(ACR_ARM_SERVICE_CONNECTION) + - registry: onebranch.azurecr.io + tenant: AME + identity: 1ESPipelineIdentity + containers: + default_windows_container: + image: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest + default_linux_container: + image: onebranch.azurecr.io/linux/ubuntu-2204:latest sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) From 53bb7f84a93fd09ea530ded05b1aa1bb5ed693e8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:19:56 -0800 Subject: [PATCH 27/52] fixup! Separate Build Changes --- .../containers/container-template.steps.yaml | 46 +++++++---- Makefile | 76 +++++++++++++++---- 2 files changed, 94 insertions(+), 28 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index f3dc5e505f..2378ac7cbc 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -4,20 +4,36 @@ parameters: os: "" steps: -- task: AzureCLI@2 - displayName: "Image Build" +- bash: | + set -e + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" + + DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") + echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" + + EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") + echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" + displayName: "Get Image Name" + env: + VAR_ID: ${{ parameters.name }} + MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args + +- task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 inputs: - azureSubscription: $(ACR_ARM_SERVICE_CONNECTION) - addSpnToEnvironment: True - scriptLocation: "inlineScript" - scriptType: "bash" - inlineScript: | - set -e - make "$MAKE_CMD" - env: - OS: ${{ parameters.os }} - ARCH: ${{ parameters.arch }} - MAKE_CMD: ${{ parameters.name }}-image - ${{ if eq(parameters.os, 'windows') }}: - BUILDX_ACTION: '--push' + image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) + dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) + buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }}) + enableNetwork: true # Optional. Default: false + enablePull: false # Optional. Default: true + enableCache: true # Optional. Default: false + useBuildKit: true + +- task: 1ES.PushContainerImage@1 + condition: ${{ eq(parameters.os, 'windows') }} + inputs: + image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) diff --git a/Makefile b/Makefile index b564ba6c6d..5b4fcf1413 100644 --- a/Makefile +++ b/Makefile @@ -337,11 +337,20 @@ acncli-image-name: # util target to print the CNI manager image name. acncli-image-name-and-tag: # util target to print the CNI manager image name and tag. @echo $(IMAGE_REGISTRY)/$(ACNCLI_IMAGE):$(ACNCLI_PLATFORM_TAG) -acncli-image: ## build cni-manager container image. +acncli-dockerfile-path: + $(eval DOCKERFILE_PATH := $(ACNCLI_DIR)/Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +acncli-build-args: + $(eval DOCKER_BUILD_ARGS := ;) + @echo $(DOCKER_BUILD_ARGS) + +acncli-image: acncli-dockerfile-path acncli-build-args ## build cni-manager container image. $(MAKE) container \ - DOCKERFILE=tools/acncli/Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(ACNCLI_IMAGE) \ - TAG=$(ACNCLI_PLATFORM_TAG) + TAG=$(ACNCLI_PLATFORM_TAG) \ + $(DOCKER_BUILD_ARGS) acncli-image-push: ## push cni-manager container image. $(MAKE) container-push \ @@ -362,15 +371,24 @@ azure-ipam-image-name: # util target to print the azure-ipam image name. azure-ipam-image-name-and-tag: # util target to print the azure-ipam image name and tag. @echo $(IMAGE_REGISTRY)/$(AZURE_IPAM_IMAGE):$(AZURE_IPAM_PLATFORM_TAG) +azure-ipam-dockerfile-path: + $(eval DOCKERFILE_PATH := $(AZURE_IPAM_DIR)/Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +azure-ipam-build-args: + $(eval DOCKER_BUILD_ARGS := ;) + @echo $(DOCKER_BUILD_ARGS) + azure-ipam-image: ## build azure-ipam container image. $(MAKE) container \ - DOCKERFILE=azure-ipam/Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(AZURE_IPAM_IMAGE) \ PLATFORM=$(PLATFORM) \ TAG=$(AZURE_IPAM_PLATFORM_TAG) \ TARGET=$(OS) \ OS=$(OS) \ - ARCH=$(ARCH) + ARCH=$(ARCH) \ + $(DOCKER_BUILD_ARGS) azure-ipam-image-push: ## push azure-ipam container image. $(MAKE) container-push \ @@ -390,11 +408,19 @@ ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name. ipv6-hp-bpf-image-name-and-tag: # util target to print the ipv6-hp-bpf image name and tag. @echo $(IMAGE_REGISTRY)/$(IPV6_HP_BPF_IMAGE):$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) +ipv6-hp-bpf-dockerfile-path: + $(eval DOCKERFILE_PATH := $(IPV6_HP_BPF_DIR)/$(OS).Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +ipv6-hp-bpf-build-args: + $(eval DOCKER_BUILD_ARGS := '--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)') + @echo $(DOCKER_BUILD_ARGS) + ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image. $(MAKE) container \ - DOCKERFILE=bpf-prog/ipv6-hp-bpf/$(OS).Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(IPV6_HP_BPF_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)'\ + EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)'\ PLATFORM=$(PLATFORM) \ TAG=$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) \ TARGET=$(OS) \ @@ -419,16 +445,24 @@ cni-image-name: # util target to print the cni image name. cni-image-name-and-tag: # util target to print the cni image name and tag. @echo $(IMAGE_REGISTRY)/$(CNI_IMAGE):$(CNI_PLATFORM_TAG) +cni-image-dockerfile-path: + $(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR)/Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +cni-image-build-args: + $(eval DOCKER_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)') + @echo $(DOCKER_BUILD_ARGS) + cni-image: ## build cni container image. $(MAKE) container \ - DOCKERFILE=cni/Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(CNI_IMAGE) \ PLATFORM=$(PLATFORM) \ TAG=$(CNI_PLATFORM_TAG) \ TARGET=$(OS) \ OS=$(OS) \ ARCH=$(ARCH) \ - EXTRA_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' + EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' cni-image-push: ## push cni container image. $(MAKE) container-push \ @@ -449,11 +483,19 @@ cns-image-name: # util target to print the CNS image name cns-image-name-and-tag: # util target to print the CNS image name and tag. @echo $(IMAGE_REGISTRY)/$(CNS_IMAGE):$(CNS_PLATFORM_TAG) +cns-image-dockerfile-path: + $(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR)/Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +cns-image-build-args: + $(eval DOCKER_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)') + @echo $(DOCKER_BUILD_ARGS) + cns-image: ## build cns container image. $(MAKE) container \ - DOCKERFILE=cns/Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(CNS_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' \ + EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' \ PLATFORM=$(PLATFORM) \ TAG=$(CNS_PLATFORM_TAG) \ TARGET=$(OS) \ @@ -478,11 +520,19 @@ npm-image-name: # util target to print the NPM image name npm-image-name-and-tag: # util target to print the NPM image name and tag. @echo $(IMAGE_REGISTRY)/$(NPM_IMAGE):$(NPM_PLATFORM_TAG) +npm-image-dockerfile-path: + $(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR)/$(OS).Dockerfile) + @echo "$(DOCKERFILE_PATH)" + +npm-image-build-args: + $(eval DOCKER_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)') + @echo $(DOCKER_BUILD_ARGS) + npm-image: ## build the npm container image. $(MAKE) container-$(CONTAINER_BUILDER) \ - DOCKERFILE=npm/$(OS).Dockerfile \ + DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(NPM_IMAGE) \ - EXTRA_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' \ + EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' \ PLATFORM=$(PLATFORM) \ TAG=$(NPM_PLATFORM_TAG) \ TARGET=$(OS) \ From 3a4c7f921760fd4a129cc80578f2850503679470 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:25:22 -0800 Subject: [PATCH 28/52] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index b9e692ecfc..48abc84496 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -52,7 +52,7 @@ extends: os: linux image: acn-runner-vmss-image-1es-v3.0 authenticatedContainerRegistries: - - serviceConnection: $(ACR_ARM_SERVICE_CONNECTION) + - serviceConnection: 'Azure Container Networking - ACN Public Registry - Retina' - registry: onebranch.azurecr.io tenant: AME identity: 1ESPipelineIdentity From bf9c9513cc1d24e8fcad737fcf31cb63688445eb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:37:12 -0800 Subject: [PATCH 29/52] fixup! Separate Build Changes --- .../containers/container-template.steps.yaml | 5 ++++ Makefile | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 2378ac7cbc..df65cbf857 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -7,6 +7,9 @@ steps: - bash: | set -e + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" @@ -18,6 +21,7 @@ steps: displayName: "Get Image Name" env: VAR_ID: ${{ parameters.name }} + MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args @@ -27,6 +31,7 @@ steps: inputs: image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) + path: $(BUILD_CONTEXT_${{ parameters.name }}) buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }}) enableNetwork: true # Optional. Default: false enablePull: false # Optional. Default: true diff --git a/Makefile b/Makefile index 5b4fcf1413..d9088a7cc5 100644 --- a/Makefile +++ b/Makefile @@ -337,6 +337,10 @@ acncli-image-name: # util target to print the CNI manager image name. acncli-image-name-and-tag: # util target to print the CNI manager image name and tag. @echo $(IMAGE_REGISTRY)/$(ACNCLI_IMAGE):$(ACNCLI_PLATFORM_TAG) +acncli-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + acncli-dockerfile-path: $(eval DOCKERFILE_PATH := $(ACNCLI_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" @@ -371,6 +375,10 @@ azure-ipam-image-name: # util target to print the azure-ipam image name. azure-ipam-image-name-and-tag: # util target to print the azure-ipam image name and tag. @echo $(IMAGE_REGISTRY)/$(AZURE_IPAM_IMAGE):$(AZURE_IPAM_PLATFORM_TAG) +azure-ipam-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + azure-ipam-dockerfile-path: $(eval DOCKERFILE_PATH := $(AZURE_IPAM_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" @@ -408,6 +416,10 @@ ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name. ipv6-hp-bpf-image-name-and-tag: # util target to print the ipv6-hp-bpf image name and tag. @echo $(IMAGE_REGISTRY)/$(IPV6_HP_BPF_IMAGE):$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) +ipv6-hp-bpf-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + ipv6-hp-bpf-dockerfile-path: $(eval DOCKERFILE_PATH := $(IPV6_HP_BPF_DIR)/$(OS).Dockerfile) @echo "$(DOCKERFILE_PATH)" @@ -445,6 +457,10 @@ cni-image-name: # util target to print the cni image name. cni-image-name-and-tag: # util target to print the cni image name and tag. @echo $(IMAGE_REGISTRY)/$(CNI_IMAGE):$(CNI_PLATFORM_TAG) +cni-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + cni-image-dockerfile-path: $(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" @@ -483,6 +499,10 @@ cns-image-name: # util target to print the CNS image name cns-image-name-and-tag: # util target to print the CNS image name and tag. @echo $(IMAGE_REGISTRY)/$(CNS_IMAGE):$(CNS_PLATFORM_TAG) +cns-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + cns-image-dockerfile-path: $(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" @@ -520,6 +540,10 @@ npm-image-name: # util target to print the NPM image name npm-image-name-and-tag: # util target to print the NPM image name and tag. @echo $(IMAGE_REGISTRY)/$(NPM_IMAGE):$(NPM_PLATFORM_TAG) +npm-image-build-context: + $(eval BUILD_CONTEXT := $(REPO_ROOT)) + @echo "$(BUILD_CONTEXT)" + npm-image-dockerfile-path: $(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR)/$(OS).Dockerfile) @echo "$(DOCKERFILE_PATH)" From d28306f96833b0451fa704a100ca571c67ce9ff2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 22:09:43 -0800 Subject: [PATCH 30/52] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index bf6bc5ac38..6d825b9c65 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -77,6 +77,8 @@ stages: jobs: - job: containerize_amd64 displayName: Build Images + templateContext: + type: containerBuildJob strategy: maxParallel: 4 matrix: @@ -128,6 +130,8 @@ stages: os_version: $(os_version) - job: containerize_linux_arm64 displayName: Build Images + templateContext: + type: containerBuildJob pool: name: "$(BUILD_POOL_NAME_LINUX_ARM64)" os: linux From ae545d52d668ecca6192c239701fc6c475cdff9c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 00:49:58 -0800 Subject: [PATCH 31/52] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 118 +++++++++-------------------------- 1 file changed, 29 insertions(+), 89 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 6d825b9c65..ccc64b8117 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -74,96 +74,36 @@ stages: dependsOn: - setup - test + strategy: + maxParallel: 4 + matrix: + windows_amd64: + arch: amd64 + os: windows + images: | + azure-ipam + cni + cns + npm + linux_amd64: | + azure-ipam + cni + cns + ipv6-hp-bpf + npm + linux_arm64: | + azure-ipam + cni + cns + ipv6-hp-bpf + npm jobs: - - job: containerize_amd64 - displayName: Build Images - templateContext: - type: containerBuildJob - strategy: - maxParallel: 4 - matrix: - azure_ipam_linux_amd64: - arch: amd64 - name: azure-ipam - os: linux - azure_ipam_windows: - arch: amd64 - name: azure-ipam - os: windows - cni_linux_amd64: - arch: amd64 - name: cni - os: linux - cni_windows_amd64: - arch: amd64 - name: cni - os: windows - cns_linux_amd64: - arch: amd64 - name: cns - os: linux - cns_windows_amd64: - arch: amd64 - name: cns - os: windows - ipv6_hp_bpf_linux_amd64: - arch: amd64 - name: ipv6-hp-bpf - os: linux - npm_linux_amd64: - arch: amd64 - name: npm - os: linux - npm_windows_amd64: - arch: amd64 - name: npm - os: windows - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - template: containers/container-template.steps.yaml - parameters: - arch: $(arch) - name: $(name) - os: $(os) - os_version: $(os_version) - - job: containerize_linux_arm64 - displayName: Build Images - templateContext: - type: containerBuildJob - pool: - name: "$(BUILD_POOL_NAME_LINUX_ARM64)" - os: linux - strategy: - maxParallel: 4 - matrix: - azure_ipam_linux_arm64: - arch: arm64 - name: azure-ipam - os: linux - cni_linux_arm64: - arch: arm64 - name: cni - os: linux - cns_linux_arm64: - arch: arm64 - name: cns - os: linux - ipv6_hp_bpf_linux_arm64: - arch: arm64 - name: ipv6-hp-bpf - os: linux - npm_linux_arm64: - arch: arm64 - name: npm - os: linux - steps: - - template: containers/container-template.steps.yaml - parameters: - arch: $(arch) - name: $(name) - os: $(os) + - template: templates/container-template.jobs.yaml + parameters: + arch: $(arch) + os: $(os) + images: $(images) + - stage: publish displayName: Publish Multiarch Manifests From bb05d25cb03b4558e8f4979d077abddf04d5cd48 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:20:19 -0800 Subject: [PATCH 32/52] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 53 ++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index ccc64b8117..ce8211000d 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -74,35 +74,36 @@ stages: dependsOn: - setup - test - strategy: - maxParallel: 4 - matrix: - windows_amd64: - arch: amd64 - os: windows - images: | - azure-ipam - cni - cns - npm - linux_amd64: | - azure-ipam - cni - cns - ipv6-hp-bpf - npm - linux_arm64: | - azure-ipam - cni - cns - ipv6-hp-bpf - npm jobs: - template: templates/container-template.jobs.yaml parameters: - arch: $(arch) - os: $(os) - images: $(images) + arch: amd64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: templates/container-template.jobs.yaml + parameters: + arch: arm64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: templates/container-template.jobs.yaml + parameters: + arch: amd64 + os: windows + images: + - azure-ipam + - cni + - cns + - npm - stage: publish From 37b44d0d95c1ed7654bd1aa5b2e49e159ba8ed66 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:24:50 -0800 Subject: [PATCH 33/52] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .pipelines/containers/container-template.jobs.yaml diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml new file mode 100644 index 0000000000..21101cb58a --- /dev/null +++ b/.pipelines/containers/container-template.jobs.yaml @@ -0,0 +1,69 @@ +parameters: +- name: arch + type: string + values: + - amd64 + - arm64 + +- name: os + type: string + values: + - windows + - linux + +- name: images + type: object + + +jobs: +- ${{ each image in parameters.images }}: + - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} + displayName: Build Images + pool: + arch: ${{ parameters.arch }} + os: ${{ parameters.os }} + ${{ if eq(parameters.os, 'windows' }}: + name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) + ${{ elseif eq(parameters.os, 'linux' }}: + ${{ if eq(parameters.arch, 'amd64') }}: + name: $(BUILD_POOL_NAME_DEFAULT) + ${{ elseif eq(parameters.arch, 'arm64') }}: + name: $(BUILD_POOL_NAME_LINUX_ARM64) + + templateContext: + type: containerBuildJob + arguments: + image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) + dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) + path: $(BUILD_CONTEXT_${{ parameters.name }}) + buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }}) + enableNetwork: true # Optional. Default: false + enablePull: false # Optional. Default: true + enableCache: true # Optional. Default: false + useBuildKit: true + + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + - bash: | + set -e + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" + + DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") + echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" + + EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") + echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" + displayName: "Get Image Name" + env: + VAR_ID: ${{ parameters.name }} + MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context + MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args From a2b44a7cca2f6ef864c44e28cacf23dc13c7ce49 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:32:44 -0800 Subject: [PATCH 34/52] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index ce8211000d..a548844d69 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -75,7 +75,7 @@ stages: - setup - test jobs: - - template: templates/container-template.jobs.yaml + - template: containers/container-template.jobs.yaml parameters: arch: amd64 os: linux @@ -85,7 +85,7 @@ stages: - cns - ipv6-hp-bpf - npm - - template: templates/container-template.jobs.yaml + - template: containers/container-template.jobs.yaml parameters: arch: arm64 os: linux @@ -95,7 +95,7 @@ stages: - cns - ipv6-hp-bpf - npm - - template: templates/container-template.jobs.yaml + - template: containers/container-template.jobs.yaml parameters: arch: amd64 os: windows From e633d58de1a55763b8e0ba17112f2bcc9c1e54c3 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:35:26 -0800 Subject: [PATCH 35/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 21101cb58a..d599fcb5b4 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -22,9 +22,9 @@ jobs: pool: arch: ${{ parameters.arch }} os: ${{ parameters.os }} - ${{ if eq(parameters.os, 'windows' }}: + ${{ if eq(parameters.os, 'windows') }}: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) - ${{ elseif eq(parameters.os, 'linux' }}: + ${{ elseif eq(parameters.os, 'linux') }}: ${{ if eq(parameters.arch, 'amd64') }}: name: $(BUILD_POOL_NAME_DEFAULT) ${{ elseif eq(parameters.arch, 'arm64') }}: From 226451424118e25ad5c71a3da796e74ebb43e38c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:49:31 -0800 Subject: [PATCH 36/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index d599fcb5b4..fcb24482bd 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -31,8 +31,13 @@ jobs: name: $(BUILD_POOL_NAME_LINUX_ARM64) templateContext: + outputs: + - output: pipelineArtifact + targetPath: $(System.DefaultWorkingDirectory)/output + artifactName: output type: containerBuildJob arguments: + pipelineArtifact: output image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) path: $(BUILD_CONTEXT_${{ parameters.name }}) From 889a931d057a3376d0a214b9ce8f8050e2071392 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:52:16 -0800 Subject: [PATCH 37/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index fcb24482bd..52f6a6b66f 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -17,7 +17,7 @@ parameters: jobs: - ${{ each image in parameters.images }}: - - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} + - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Images pool: arch: ${{ parameters.arch }} From e7aebf078e69dc0aa4eb215dbf6536e3035653a5 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 21:17:12 -0800 Subject: [PATCH 38/52] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 52f6a6b66f..cbcfc78a4f 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -19,18 +19,24 @@ jobs: - ${{ each image in parameters.images }}: - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Images - pool: - arch: ${{ parameters.arch }} - os: ${{ parameters.os }} - ${{ if eq(parameters.os, 'windows') }}: - name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) - ${{ elseif eq(parameters.os, 'linux') }}: - ${{ if eq(parameters.arch, 'amd64') }}: - name: $(BUILD_POOL_NAME_DEFAULT) - ${{ elseif eq(parameters.arch, 'arm64') }}: - name: $(BUILD_POOL_NAME_LINUX_ARM64) - + # pool: + # arch: ${{ parameters.arch }} + # os: ${{ parameters.os }} + # ${{ if eq(parameters.os, 'windows') }}: + # name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) + # ${{ elseif eq(parameters.os, 'linux') }}: + # ${{ if eq(parameters.arch, 'amd64') }}: + # name: $(BUILD_POOL_NAME_DEFAULT) + # ${{ elseif eq(parameters.arch, 'arm64') }}: + # name: $(BUILD_POOL_NAME_LINUX_ARM64) templateContext: + containers: + ${{ if eq(parameters.os, 'windows') }}: + default_windows_container: + image: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest + ${{ elseif eq(parameters.os, 'linux') }}: + default_linux_container: + image: onebranch.azurecr.io/linux/ubuntu-2204:latest outputs: - output: pipelineArtifact targetPath: $(System.DefaultWorkingDirectory)/output From 52e3ec496b8ed4e4bedf3b8f72e56943936f2868 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 17 Nov 2024 19:58:46 -0800 Subject: [PATCH 39/52] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 48abc84496..7dcad2a301 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -56,11 +56,6 @@ extends: - registry: onebranch.azurecr.io tenant: AME identity: 1ESPipelineIdentity - containers: - default_windows_container: - image: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest - default_linux_container: - image: onebranch.azurecr.io/linux/ubuntu-2204:latest sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) From 8f628cfaa49972ba34dd3f82d61a198cc7a57117 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 17 Nov 2024 20:00:50 -0800 Subject: [PATCH 40/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index cbcfc78a4f..0720ff92b3 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -30,6 +30,11 @@ jobs: # ${{ elseif eq(parameters.arch, 'arm64') }}: # name: $(BUILD_POOL_NAME_LINUX_ARM64) templateContext: + authenticatedContainerRegistries: + - serviceConnection: 'Azure Container Networking - ACN Public Registry - Retina' + - registry: onebranch.azurecr.io + tenant: AME + identity: 1ESPipelineIdentity containers: ${{ if eq(parameters.os, 'windows') }}: default_windows_container: From c5613d2d506783829ae23a1c5ecadf4129e591a2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 16:59:39 -0800 Subject: [PATCH 41/52] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 107 ++++++------------ .../containers/container-template.steps.yaml | 49 ++++---- .pipelines/run-pipeline.yaml | 3 + .pipelines/trigger.yaml | 9 +- 4 files changed, 62 insertions(+), 106 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 0720ff92b3..1cf898b1ff 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -1,85 +1,48 @@ parameters: - name: arch type: string - values: - - amd64 - - arm64 - name: os type: string - values: - - windows - - linux - name: images type: object jobs: -- ${{ each image in parameters.images }}: - - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} - displayName: Build Images - # pool: - # arch: ${{ parameters.arch }} - # os: ${{ parameters.os }} - # ${{ if eq(parameters.os, 'windows') }}: - # name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) - # ${{ elseif eq(parameters.os, 'linux') }}: - # ${{ if eq(parameters.arch, 'amd64') }}: - # name: $(BUILD_POOL_NAME_DEFAULT) - # ${{ elseif eq(parameters.arch, 'arm64') }}: - # name: $(BUILD_POOL_NAME_LINUX_ARM64) - templateContext: - authenticatedContainerRegistries: - - serviceConnection: 'Azure Container Networking - ACN Public Registry - Retina' - - registry: onebranch.azurecr.io - tenant: AME - identity: 1ESPipelineIdentity - containers: - ${{ if eq(parameters.os, 'windows') }}: - default_windows_container: - image: onebranch.azurecr.io/windows/ltsc2019/vse2022:latest - ${{ elseif eq(parameters.os, 'linux') }}: - default_linux_container: - image: onebranch.azurecr.io/linux/ubuntu-2204:latest - outputs: - - output: pipelineArtifact - targetPath: $(System.DefaultWorkingDirectory)/output - artifactName: output - type: containerBuildJob - arguments: - pipelineArtifact: output - image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) - dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) - path: $(BUILD_CONTEXT_${{ parameters.name }}) - buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }}) - enableNetwork: true # Optional. Default: false - enablePull: false # Optional. Default: true - enableCache: true # Optional. Default: false - useBuildKit: true - +- ${{ each image in split(parameters.images, '\n') }}: + - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} + displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) + steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - bash: | - set -e - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" - - DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") - echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" - - EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") - echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" - displayName: "Get Image Name" - env: - VAR_ID: ${{ parameters.name }} - MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context - MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - bash: | + set -e + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" + + DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") + echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" + + EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") + echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" + displayName: "Get Image Name" + env: + VAR_ID: ${{ parameters.name }} + MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context + MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args + + - template: containers/container-template.steps.yaml + parameters: + arch: ${{ parameters.arch }} + name: ${{ parameters.name }} + os: ${{ parameters.os }} diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index df65cbf857..63c8af6c37 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -1,31 +1,28 @@ parameters: - arch: "" - name: "" - os: "" +- name: name + type: string + values: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm -steps: -- bash: | - set -e - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" +- name: arch + type: string + values: + - amd64 + - arm64 - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" +- name: os + type: string + default: "" + values: + - windows + - linux - DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") - echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" - - EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") - echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" - displayName: "Get Image Name" - env: - VAR_ID: ${{ parameters.name }} - MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context - MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args +steps: - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 inputs: @@ -33,9 +30,9 @@ steps: dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) path: $(BUILD_CONTEXT_${{ parameters.name }}) buildArguments: TARGET=${{ parameters.os }} OS=${{ parameters.os }} PLATFORM=${{ parameters.os }} ARCH=${{ parameters.arch }} $(EXTRA_BUILD_ARGS_${{ parameters.name }}) - enableNetwork: true # Optional. Default: false - enablePull: false # Optional. Default: true - enableCache: true # Optional. Default: false + enableNetwork: true + enablePull: false + enableCache: true useBuildKit: true - task: 1ES.PushContainerImage@1 diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index a548844d69..b469ab481c 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -85,6 +85,7 @@ stages: - cns - ipv6-hp-bpf - npm + pushAcr: acnpublic - template: containers/container-template.jobs.yaml parameters: arch: arm64 @@ -95,6 +96,7 @@ stages: - cns - ipv6-hp-bpf - npm + pushAcr: acnpublic - template: containers/container-template.jobs.yaml parameters: arch: amd64 @@ -104,6 +106,7 @@ stages: - cni - cns - npm + pushAcr: acnpublic - stage: publish diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 7dcad2a301..0830b26a9d 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -28,12 +28,6 @@ resources: name: 1ESPipelineTemplates/1ESPipelineTemplates ref: refs/tags/stable - - repository: azure-container-networking - type: github - name: Azure/azure-container-networking - endpoint: 'Azure-ACN RO Service Connection' - ref: refs/heads/feature/ob-onboard-2 - variables: REPO_REF: $[ resources.repositories['azure-container-networking'].ref ] @@ -52,7 +46,6 @@ extends: os: linux image: acn-runner-vmss-image-1es-v3.0 authenticatedContainerRegistries: - - serviceConnection: 'Azure Container Networking - ACN Public Registry - Retina' - registry: onebranch.azurecr.io tenant: AME identity: 1ESPipelineIdentity @@ -69,4 +62,4 @@ extends: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true stages: - - template: /.pipelines/run-pipeline.yaml@azure-container-networking + - template: /.pipelines/run-pipeline.yaml From 2d31ab4299e1bdce2c4014ccb7f042eeb8ba1c10 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:04:28 -0800 Subject: [PATCH 42/52] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 78 +++++++++++-------- .../templates/add-windows-nodepool-job.yaml | 4 +- 2 files changed, 48 insertions(+), 34 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 1cf898b1ff..3b52a07ee2 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -8,41 +8,55 @@ parameters: - name: images type: object +- name: pushAcr + type: string + jobs: - ${{ each image in split(parameters.images, '\n') }}: - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) - + steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - - bash: | - set -e - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" - - DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") - echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" - - EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") - echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" - displayName: "Get Image Name" - env: - VAR_ID: ${{ parameters.name }} - MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context - MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args - - - template: containers/container-template.steps.yaml - parameters: - arch: ${{ parameters.arch }} - name: ${{ parameters.name }} - os: ${{ parameters.os }} + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - task: AzureCLI@2 + inputs: + azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + az acr login --name "$ACR" + env: + ACR: ${{ parameters.pushAcr }} + + - bash: | + set -e + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMG_NAME_AND_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" + + DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") + echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" + + EXTRA_BUILD_ARGS=$(make "$MAKE_EXTRA_BUILD_ARGS") + echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" + displayName: "Get Image Name" + env: + VAR_ID: ${{ parameters.name }} + MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context + MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args + + - template: containers/container-template.steps.yaml + parameters: + arch: ${{ parameters.arch }} + name: ${{ parameters.name }} + os: ${{ parameters.os }} diff --git a/.pipelines/templates/add-windows-nodepool-job.yaml b/.pipelines/templates/add-windows-nodepool-job.yaml index fe700371b4..9200169dcb 100644 --- a/.pipelines/templates/add-windows-nodepool-job.yaml +++ b/.pipelines/templates/add-windows-nodepool-job.yaml @@ -22,7 +22,7 @@ jobs: addSpnToEnvironment: true inlineScript: | set -e - + windows_nodepool=$(az aks nodepool list \ --resource-group ${{ parameters.clusterName }} \ --cluster-name ${{ parameters.clusterName }} \ @@ -38,7 +38,7 @@ jobs: --name "${{ parameters.clusterName }}" \ --resource-group "${{ parameters.clusterName }}" \ --query provisioningState) - + if echo "$cluster_state" | grep -q "Updating"; then echo "Cluster is updating. Sleeping for 30 seconds..." sleep 30 From f7e996baa8cee7f2c76b86e7e224a13f54700978 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:06:09 -0800 Subject: [PATCH 43/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 3b52a07ee2..752e0f274d 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -13,7 +13,7 @@ parameters: jobs: -- ${{ each image in split(parameters.images, '\n') }}: +- ${{ each image in parameters.images }}: - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) From 24b0f981e4bd7f0d9cc1e6d8fddd7d042bfe09d0 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:07:14 -0800 Subject: [PATCH 44/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 752e0f274d..b6f0f3d1cb 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -55,7 +55,7 @@ jobs: MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args - - template: containers/container-template.steps.yaml + - template: container-template.steps.yaml parameters: arch: ${{ parameters.arch }} name: ${{ parameters.name }} From 37147ba1d3d58f3335edfa590fdd32384353bdf2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:09:13 -0800 Subject: [PATCH 45/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index b6f0f3d1cb..c653d6f54f 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -49,14 +49,14 @@ jobs: echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" displayName: "Get Image Name" env: - VAR_ID: ${{ parameters.name }} - MAKE_BUILD_CONTEXT: ${{ parameters.name }}-image-build-context - MAKE_IMG_NAME_AND_TAG: ${{ parameters.name }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.name }}-image-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.name }}-image-build-args + VAR_ID: ${{ image }} + MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context + MAKE_IMG_NAME_AND_TAG: ${{ image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ image }}-image-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ image }}-image-build-args - template: container-template.steps.yaml parameters: arch: ${{ parameters.arch }} - name: ${{ parameters.name }} + name: ${{ image }} os: ${{ parameters.os }} From 9c00b9739df7ac4e699329a37143b229acd1cc2b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:11:58 -0800 Subject: [PATCH 46/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index c653d6f54f..a463c4b824 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -14,7 +14,7 @@ parameters: jobs: - ${{ each image in parameters.images }}: - - job: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} + - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) steps: From 539c316d22f6470d6ffe2f4363ef26ad87b56833 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 19:35:16 -0800 Subject: [PATCH 47/52] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 16 ++- .pipelines/run-pipeline.yaml | 12 +- .../templates/run-unit-tests.stages.yaml | 114 +++++++++--------- 3 files changed, 78 insertions(+), 64 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index a463c4b824..f38e518977 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -8,28 +8,36 @@ parameters: - name: images type: object -- name: pushAcr - type: string +- name: containerRegistry + type: object jobs: - ${{ each image in parameters.images }}: - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) + templateContext: + authenticatedContainerRegistries: + - registry: ${{ parameters.containerRegistry.name }} + identity: ManagedIdentity + - registry: onebranch.azurecr.io + tenant: AME + identity: 1ESPipelineIdentity steps: - task: GoTool@0 inputs: version: $(GO_VERSION) - + - task: AzureCLI@2 + displayName: "Docker Login" inputs: azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) scriptLocation: "inlineScript" scriptType: "bash" addSpnToEnvironment: true inlineScript: | - az acr login --name "$ACR" + ls -la /bin env: ACR: ${{ parameters.pushAcr }} diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index b469ab481c..068055bbbe 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -85,7 +85,9 @@ stages: - cns - ipv6-hp-bpf - npm - pushAcr: acnpublic + containerRegistry: + name: $(ACR_NAME) + #clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: arm64 @@ -96,7 +98,9 @@ stages: - cns - ipv6-hp-bpf - npm - pushAcr: acnpublic + containerRegistry: + name: $(ACR_NAME) + #clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: amd64 @@ -106,7 +110,9 @@ stages: - cni - cns - npm - pushAcr: acnpublic + containerRegistry: + name: $(ACR_NAME) + #clientId: $(ACR_CLIENTID) - stage: publish diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index 842624ab8b..2c51c9d373 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -1,62 +1,62 @@ stages: - - 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)" - os: linux - image: acn-runner-vmss-image-1es-v3.0 - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) +- 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)" + os: linux + image: acn-runner-vmss-image-1es-v3.0 + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) - - 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" + - 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" - - stage: test_windows - displayName: Test ACN Windows - dependsOn: - - setup - jobs: - - job: test - displayName: Run Tests - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - pool: - name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" - os: windows - image: acn-runner-vmss-image-windows-1es-v2.0 - steps: - - task: GoTool@0 - inputs: - version: $(GO_VERSION) +- stage: test_windows + displayName: Test ACN Windows + dependsOn: + - setup + jobs: + - job: test + displayName: Run Tests + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + pool: + name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" + os: windows + image: acn-runner-vmss-image-windows-1es-v2.0 + steps: + - task: GoTool@0 + inputs: + version: $(GO_VERSION) - - script: | - cd npm/ - go test ./... - cd ../cni/ - go test ./... - cd ../platform/ - go test ./... - retryCountOnTaskFailure: 3 - name: "TestWindows" - displayName: "Run Windows Tests" + - script: | + cd npm/ + go test ./... + cd ../cni/ + go test ./... + cd ../platform/ + go test ./... + retryCountOnTaskFailure: 3 + name: "TestWindows" + displayName: "Run Windows Tests" From 33e7e0939f19420d2f2548d3d76be0c07f6a3551 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 19:40:22 -0800 Subject: [PATCH 48/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index f38e518977..9c55de7a50 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -18,7 +18,7 @@ jobs: displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) templateContext: authenticatedContainerRegistries: - - registry: ${{ parameters.containerRegistry.name }} + - registry: acnpublic.azurecr.io identity: ManagedIdentity - registry: onebranch.azurecr.io tenant: AME @@ -39,7 +39,7 @@ jobs: inlineScript: | ls -la /bin env: - ACR: ${{ parameters.pushAcr }} + ACR: ${{ parameters.containerRegistry.name }} - bash: | set -e From 194c6bb90c87f8d4a784f0c97e05872fd3dfc6a7 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:13:38 -0800 Subject: [PATCH 49/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 1 + .pipelines/run-pipeline.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 9c55de7a50..7d76e04a09 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -20,6 +20,7 @@ jobs: authenticatedContainerRegistries: - registry: acnpublic.azurecr.io identity: ManagedIdentity + clientId: ${{ parameters.containerRegistry.clientId }} - registry: onebranch.azurecr.io tenant: AME identity: 1ESPipelineIdentity diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 068055bbbe..e67d84e788 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -26,7 +26,7 @@ stages: name: "EnvironmentalVariables" displayName: "Set environmental variables" - - template: templates/run-unit-tests.stages.yaml + - template: templates/unit-tests.stages.yaml #- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - stage: binaries @@ -87,7 +87,7 @@ stages: - npm containerRegistry: name: $(ACR_NAME) - #clientId: $(ACR_CLIENTID) + clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: arm64 @@ -100,7 +100,7 @@ stages: - npm containerRegistry: name: $(ACR_NAME) - #clientId: $(ACR_CLIENTID) + clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: amd64 @@ -112,7 +112,7 @@ stages: - npm containerRegistry: name: $(ACR_NAME) - #clientId: $(ACR_CLIENTID) + clientId: $(ACR_CLIENTID) - stage: publish From cdc924d668277ae23e72ecd80d2a8e08b2e9afc5 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:16:28 -0800 Subject: [PATCH 50/52] fixup! Separate Build Changes --- .pipelines/templates/run-unit-tests.stages.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index 2c51c9d373..6f9123a828 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -57,6 +57,5 @@ stages: cd ../platform/ go test ./... retryCountOnTaskFailure: 3 - name: "TestWindows" displayName: "Run Windows Tests" From 0b9335bc808272eb9ada95db608d8f4e35cf3857 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:18:29 -0800 Subject: [PATCH 51/52] fixup! Separate Build Changes --- .pipelines/templates/unit-tests.stages.yaml | 110 +++++++++----------- 1 file changed, 47 insertions(+), 63 deletions(-) diff --git a/.pipelines/templates/unit-tests.stages.yaml b/.pipelines/templates/unit-tests.stages.yaml index 204cde4c2e..a9b4bb5bb7 100644 --- a/.pipelines/templates/unit-tests.stages.yaml +++ b/.pipelines/templates/unit-tests.stages.yaml @@ -1,66 +1,50 @@ stages: - - stage: test - displayName: Test ACN - dependsOn: - - setup - jobs: - - job: test - displayName: Run Tests - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - ob_git_checkout: true - pool: - isCustom: true - type: linux - name: "$(BUILD_POOL_NAME_DEFAULT)" - steps: - # Test changes under review - - checkout: ACNReviewChanges - clean: true +- stage: test + displayName: Test ACN + dependsOn: + - setup + jobs: + - job: test + displayName: Run Tests + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + steps: + - script: | + cd azure-container-networking + 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 + displayName: "Run Tests" - - script: | - cd azure-container-networking - 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" - - - stage: test_windows - displayName: Test ACN Windows - dependsOn: - - setup - jobs: - - job: test - displayName: Run Tests - variables: - STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - ob_git_checkout: true - pool: - isCustom: true - type: windows - name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS_ALT)" - steps: - # Test changes under review - - checkout: ACNReviewChanges - clean: true - - - script: | - cd azure-container-networking/ - cd npm/ - go test ./... - cd ../cni/ - go test ./... - cd ../platform/ - go test ./... - retryCountOnTaskFailure: 3 - name: "TestWindows" - displayName: "Run Windows Tests" +- stage: test_windows + displayName: Test ACN Windows + dependsOn: + - setup + jobs: + - job: test + displayName: Run Tests + variables: + STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + pool: + isCustom: true + type: windows + name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS_ALT)" + steps: + - script: | + cd azure-container-networking/ + cd npm/ + go test ./... + cd ../cni/ + go test ./... + cd ../platform/ + go test ./... + retryCountOnTaskFailure: 3 + displayName: "Run Windows Tests" From 3784bce6477315111d5c46ee0f6ca313f1a8a0a0 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 23:02:10 -0800 Subject: [PATCH 52/52] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 1 + .pipelines/templates/unit-tests.stages.yaml | 1 - .pipelines/trigger.yaml | 8 ++++---- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 63c8af6c37..ac8937c0d2 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -10,6 +10,7 @@ parameters: - name: arch type: string + default: "" values: - amd64 - arm64 diff --git a/.pipelines/templates/unit-tests.stages.yaml b/.pipelines/templates/unit-tests.stages.yaml index a9b4bb5bb7..e023bc45ba 100644 --- a/.pipelines/templates/unit-tests.stages.yaml +++ b/.pipelines/templates/unit-tests.stages.yaml @@ -33,7 +33,6 @@ stages: variables: STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] pool: - isCustom: true type: windows name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS_ALT)" steps: diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 0830b26a9d..3bf543dffe 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -45,10 +45,10 @@ extends: name: $(BUILD_POOL_NAME_DEFAULT) os: linux image: acn-runner-vmss-image-1es-v3.0 - authenticatedContainerRegistries: - - registry: onebranch.azurecr.io - tenant: AME - identity: 1ESPipelineIdentity + #authenticatedContainerRegistries: + #- registry: onebranch.azurecr.io + #tenant: AME + #identity: 1ESPipelineIdentity sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS)