From cafd8f150503e1ffd52e41eb7ad8b2d44ae22338 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 3 Nov 2024 19:37:11 -0800 Subject: [PATCH 001/136] Template --- .pipelines/containers/manifest-template.yaml | 19 +---- .pipelines/pipeline.yaml | 82 +++++++++----------- .pipelines/run-pipeline.yaml | 7 +- .pipelines/template.trigger.jobs.yaml | 2 +- .pipelines/templates/log-template.yaml | 9 ++- .pipelines/trigger.yaml | 24 +++--- 6 files changed, 61 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 1bb07ef85c..398a549e0a 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 @@ -383,6 +352,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: + maxParallel: 4 matrix: cilium_e2e: name: cilium_e2e @@ -440,3 +410,27 @@ stages: 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: "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.yaml + parameters: + name: $(name) + clusterName: $(clusterName)-$(commitID) + region: $(region) + sub: $(SUB_AZURE_NETWORK_AGENT_TEST) + svcConn: $(ACN_TEST_SERVICE_CONNECTION) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 59c72c2d97..ef243eeb71 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 e063ced15ec7bb68076a8ff44934374e77f624d6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 12:40:01 -0800 Subject: [PATCH 002/136] fixup! Separate Build Changes --- .pipelines/pipeline.yaml | 59 +++++--- .pipelines/run-pipeline.yaml | 254 +++++++++++++++-------------------- 2 files changed, 155 insertions(+), 158 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 398a549e0a..96b01f7c17 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 @@ -352,7 +383,6 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" strategy: - maxParallel: 4 matrix: cilium_e2e: name: cilium_e2e @@ -416,7 +446,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 ef243eeb71..2a33f22a22 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 @@ -399,14 +326,31 @@ stages: vmSize: Standard_B2ms dependsOn: "containerize" + # Swiftv2 E2E tests with multitenancy cluster start up + - template: multitenancy/swiftv2-e2e-job-template.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 @@ -415,68 +359,92 @@ stages: - dualstackoverlay_e2e - cilium_dualstackoverlay_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 - 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_DUALSTACKOVERLAY_CLUSTER_TEST) steps: - - checkout: ACNReviewChanges - clean: true + - 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) - - template: templates/delete-cluster.steps.yaml@ACNTools + - job: delete_test + displayName: Delete Cluster + pool: + name: "$(BUILD_POOL_NAME_DEFAULT)" + 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.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 9990f6e8f18207d7313d9be0868e8b4cc0ee1b0b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:30:46 -0800 Subject: [PATCH 003/136] 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 938d8b52d23057bdfb91388aede599dd560a36ce Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:33:44 -0800 Subject: [PATCH 004/136] 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 ca622a003f88dd7ff2e387a86a17cc78af512651 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:55:01 -0800 Subject: [PATCH 005/136] 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 448ffbcb0f884a6fd562ec66e44064e9a423f993 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:56:54 -0800 Subject: [PATCH 006/136] 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 0b010f481179ea47fae9b95345ddc0d0a8e08022 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 7 Nov 2024 17:59:47 -0800 Subject: [PATCH 007/136] 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 39d27304611550cd6a63cebe6bf20a722a0dc746 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 8 Nov 2024 16:22:57 -0800 Subject: [PATCH 008/136] 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 4501d586deac9590a9f245abb45013996b05ff01 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 16:04:12 -0800 Subject: [PATCH 009/136] fixup! Template --- .pipelines/pipeline.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 96b01f7c17..243706a15d 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 6bab4fd169e8ece131fedaca277a2567091e3e53 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 16:49:58 -0800 Subject: [PATCH 010/136] fixup! Template --- .pipelines/pipeline.yaml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 243706a15d..15b0155e8a 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 229295ed1ab5367982c3ea0f90c796ed8e8cafe4 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:00:30 -0800 Subject: [PATCH 011/136] 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 15b0155e8a..86caac8ed2 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: @@ -362,6 +366,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: matrix: cilium_e2e: @@ -425,6 +430,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 72d8ebe85bfb000ed34ee92275435c86b580379e Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:31:51 -0800 Subject: [PATCH 012/136] 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 bf8b31109bdefa630af43b9e250a2ea9a11aaa3b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 17:49:08 -0800 Subject: [PATCH 013/136] 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 86caac8ed2..29feb89567 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 a8696130cfa162559258bdab456a3564d47c27e6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 22:48:06 -0800 Subject: [PATCH 014/136] fixup! Template --- .pipelines/pipeline.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 29feb89567..aedaf83b2f 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 519bbba11f6284f6b21a690156e94145d81b29de Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 22:49:24 -0800 Subject: [PATCH 015/136] fixup! Template --- .pipelines/pipeline.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index aedaf83b2f..57501f823f 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 b02ed0619b7cb7c2791ad052a76b351f0cd3ff78 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 13 Nov 2024 23:40:34 -0800 Subject: [PATCH 016/136] 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 2a33f22a22..96aa50fd3f 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) @@ -365,6 +390,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: maxParallel: 4 matrix: @@ -429,6 +455,7 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" + os: linux strategy: maxParallel: 4 matrix: From ba691338e268e0f764d72148db2b7667cdac3a0d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:23:27 -0800 Subject: [PATCH 017/136] 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 57501f823f..28a6d19bec 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) @@ -375,7 +382,6 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: matrix: cilium_e2e: @@ -427,7 +433,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) @@ -439,7 +445,6 @@ stages: displayName: Delete Cluster pool: name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: matrix: swiftv2_e2e: @@ -451,7 +456,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 96aa50fd3f..62441bf418 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 @@ -443,7 +443,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) @@ -468,7 +468,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 e20190a40a02d1c2b5b0f288e106f020ffd8ce9d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:33:22 -0800 Subject: [PATCH 018/136] 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 0abb86c4836bdc137560935c42a2e2c8c38b8ab1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:36:43 -0800 Subject: [PATCH 019/136] 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 6de5f762fcb7bdfe5225e83eae204033bd36ac17 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 15:56:54 -0800 Subject: [PATCH 020/136] 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 62441bf418..eb033213f1 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: @@ -388,9 +376,6 @@ stages: jobs: - job: delete_build displayName: Delete Cluster - pool: - name: "$(BUILD_POOL_NAME_DEFAULT)" - os: linux strategy: maxParallel: 4 matrix: @@ -453,9 +438,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 b2d472606c2352b2fe66d079bdc7a9e24b08e759 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:44:01 -0800 Subject: [PATCH 021/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 811 +++++++++--------- .../templates/run-unit-tests.stages.yaml | 62 ++ 2 files changed, 464 insertions(+), 409 deletions(-) create mode 100644 .pipelines/templates/run-unit-tests.stages.yaml diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index eb033213f1..0dfbce2d45 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -26,434 +26,427 @@ 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 - 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) - - 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 40a4947012cc9cc6d11586ff9ceb04f2a63399b1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:50:21 -0800 Subject: [PATCH 022/136] 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 567affaf91a023315fc36f223c026aabfe15af43 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 17:59:42 -0800 Subject: [PATCH 023/136] 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 055460d0af110c74842a3401a30ca96e39c065bd Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 18:03:53 -0800 Subject: [PATCH 024/136] 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 01709b83a0bbfbaa1271061a50e452ea2c5a7bd0 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 14 Nov 2024 18:06:12 -0800 Subject: [PATCH 025/136] 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 3271edbabc9483420bad96b19523e47466181761 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 16:46:52 -0800 Subject: [PATCH 026/136] 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 56b3ba349d1e4bc886783577b4c3a4611a4fbeb1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:19:56 -0800 Subject: [PATCH 027/136] 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 48cef23993b90321c287b7dbd2a68dd37a5d57ad Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:25:22 -0800 Subject: [PATCH 028/136] 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 9192925c06f0f1d556e7c91fbbec1a4f87a96482 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 18:37:12 -0800 Subject: [PATCH 029/136] 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 48c05fc9529679ea9c36e630d8e81bdb86dc753b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 15 Nov 2024 22:09:43 -0800 Subject: [PATCH 030/136] 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 0dfbce2d45..594986d15a 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 eac8770cb37487dd0636c331289296c29eb1acce Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 00:49:58 -0800 Subject: [PATCH 031/136] 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 594986d15a..49b3e7a242 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 4a82b86ab1134907524f3d01d785a83e61422567 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:20:19 -0800 Subject: [PATCH 032/136] 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 49b3e7a242..fdc1f3bd53 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 9244832a9db02bb17ac0662458054fa7435fc00d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:24:50 -0800 Subject: [PATCH 033/136] 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 697d351322ad56c9c5a4583b19d2aaa3bd7987e6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:32:44 -0800 Subject: [PATCH 034/136] 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 fdc1f3bd53..b46311c63a 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 226fcbb3ac4d65f7ade973f976805f0973dc6c9c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:35:26 -0800 Subject: [PATCH 035/136] 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 c1ef3be111b39725b42198d2df269ced648b9137 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:49:31 -0800 Subject: [PATCH 036/136] 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 382abbc3d1ec6e5671e9ad8824e261f26484e07c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 01:52:16 -0800 Subject: [PATCH 037/136] 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 ec9e7091da2abf50e2b6d3fcafbe7d13bd710145 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 16 Nov 2024 21:17:12 -0800 Subject: [PATCH 038/136] 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 69572410634a7609d4d51fb8e522da2d2bbb28c1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 17 Nov 2024 19:58:46 -0800 Subject: [PATCH 039/136] 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 82af24989302c6c6fea682e1c7eb1b7e7f1ab73b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 17 Nov 2024 20:00:50 -0800 Subject: [PATCH 040/136] 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 569e7abf03d08d4a27aafbc317930f55ed56ed9b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 16:59:39 -0800 Subject: [PATCH 041/136] 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 b46311c63a..d2470bf963 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 9746944ff273ab5d2f41646bb52f739f8137b6d6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:04:28 -0800 Subject: [PATCH 042/136] 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 046d782a605bdc3aa628d7fd3d0184ba994ef743 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:06:09 -0800 Subject: [PATCH 043/136] 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 a76ad532ebf68b2dabe57447099a605022356cd4 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:07:14 -0800 Subject: [PATCH 044/136] 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 90bb302094c363f0c1e595c9f7050570addcbafe Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:09:13 -0800 Subject: [PATCH 045/136] 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 f015b4db366dfd7e7558c28e0ebb6988d27d223b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 17:11:58 -0800 Subject: [PATCH 046/136] 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 b33e146c7163845266f40d0fe306d707b5df1807 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 19:35:16 -0800 Subject: [PATCH 047/136] 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 d2470bf963..d3a24edd23 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 8fb425653b83f4852c709e3264195704dea50953 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 19:40:22 -0800 Subject: [PATCH 048/136] 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 fd3ec4994b8379b5730307f46f984c99994da666 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:13:38 -0800 Subject: [PATCH 049/136] 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 d3a24edd23..351bd5487d 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 ffc69356dbf24712b27807f0135a51d406d319dd Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:16:28 -0800 Subject: [PATCH 050/136] 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 95dad702789a3d694fa39f97b826595a81643cc0 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 20:18:29 -0800 Subject: [PATCH 051/136] 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 da410822d7c95f48b695cacf149d766b5daaeed7 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 23:02:10 -0800 Subject: [PATCH 052/136] 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) From 187eb7cbcc70a72fce877367f8281db2dc2c6ae8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 18 Nov 2024 23:25:30 -0800 Subject: [PATCH 053/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 7d76e04a09..e364a66471 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -21,9 +21,6 @@ jobs: - registry: acnpublic.azurecr.io identity: ManagedIdentity clientId: ${{ parameters.containerRegistry.clientId }} - - registry: onebranch.azurecr.io - tenant: AME - identity: 1ESPipelineIdentity steps: - task: GoTool@0 From b978bf34c9d9838a4aea8d10a38d4b15399b149c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 19 Nov 2024 13:58:41 -0800 Subject: [PATCH 054/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 2 +- .pipelines/templates/run-unit-tests.stages.yaml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 351bd5487d..981e092253 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -26,7 +26,7 @@ stages: name: "EnvironmentalVariables" displayName: "Set environmental variables" - - template: templates/unit-tests.stages.yaml + - template: templates/run-unit-tests.stages.yaml #- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - stage: binaries diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index 6f9123a828..7075cdfdac 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -35,15 +35,15 @@ stages: displayName: Test ACN Windows dependsOn: - setup + pool: + name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" + os: windows + image: acn-runner-vmss-image-windows-1es-v2.0 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: From c7f13f60f79afc920ff87548adca836fd46bb868 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 12:34:32 -0800 Subject: [PATCH 055/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index e364a66471..ee87bc6cca 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -18,9 +18,7 @@ jobs: displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) templateContext: authenticatedContainerRegistries: - - registry: acnpublic.azurecr.io - identity: ManagedIdentity - clientId: ${{ parameters.containerRegistry.clientId }} + - serviceConnection: $(ACR_SERVICECONNECTION) steps: - task: GoTool@0 From f592cedd7f8231ada2a5c21cadb6c60ed3510b34 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 12:48:10 -0800 Subject: [PATCH 056/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 42 +++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 981e092253..77db7b95a9 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -382,25 +382,33 @@ stages: name: cilium_dualstackoverlay_e2e clusterName: "cildsovere2e" region: $(REGION_DUALSTACKOVERLAY_CLUSTER_TEST) - - - 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: + 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) + 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) From 5ceaccbafa204afea34000763d9e0ce29569846d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 12:50:32 -0800 Subject: [PATCH 057/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 58 ++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 77db7b95a9..06ec6d3210 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -382,33 +382,33 @@ stages: 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) + 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) From ea8175e29b95c4559a5e98c6f9af6f69950d6605 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 12:53:31 -0800 Subject: [PATCH 058/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 776 +++++++++++++++++------------------ 1 file changed, 388 insertions(+), 388 deletions(-) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 06ec6d3210..88614e34d7 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -1,414 +1,414 @@ stages: - - stage: setup - displayName: ACN - jobs: - - job: env - displayName: Setup - 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 - BUILD_NUMBER=$(Build.BuildNumber) - echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" - echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))" - echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" - echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" - cat /etc/os-release - uname -a - sudo chown -R $(whoami):$(whoami) . - go version - go env - which go - echo $PATH - echo "------" - echo $(Build.QueuedBy) - echo $(Build.Reason) # manual, PR, IndividualCI - echo $(Build.SourceBranch) - name: "EnvironmentalVariables" - displayName: "Set environmental variables" +- stage: setup + displayName: ACN + jobs: + - job: env + displayName: Setup + 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 + BUILD_NUMBER=$(Build.BuildNumber) + echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" + echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))" + echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" + echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" + cat /etc/os-release + uname -a + sudo chown -R $(whoami):$(whoami) . + go version + go env + which go + echo $PATH + echo "------" + echo $(Build.QueuedBy) + echo $(Build.Reason) # manual, PR, IndividualCI + echo $(Build.SourceBranch) + name: "EnvironmentalVariables" + displayName: "Set environmental variables" - - template: templates/run-unit-tests.stages.yaml +- template: templates/run-unit-tests.stages.yaml - #- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - - stage: binaries +#- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: +- stage: binaries + displayName: Build Binaries + dependsOn: + - setup + - test + jobs: + - job: build 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) + 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: - - template: containers/container-template.jobs.yaml - parameters: - arch: amd64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - - template: containers/container-template.jobs.yaml - parameters: - arch: arm64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - - template: containers/container-template.jobs.yaml - parameters: - arch: amd64 - os: windows - images: - - azure-ipam - - cni - - cns - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) +- stage: containerize + displayName: Build Images + dependsOn: + - setup + - test + jobs: + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) + - template: containers/container-template.jobs.yaml + parameters: + arch: arm64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: windows + images: + - azure-ipam + - cni + - cns + - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) - - 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) From ed8fde586aedeb8a9f920d9fb974d14956cde9fc Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 14:16:38 -0800 Subject: [PATCH 059/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 4 ++-- Makefile | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index ee87bc6cca..0262ae5369 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -56,8 +56,8 @@ jobs: 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 + MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args - template: container-template.steps.yaml parameters: diff --git a/Makefile b/Makefile index d9088a7cc5..fb3922e5f0 100644 --- a/Makefile +++ b/Makefile @@ -345,7 +345,7 @@ acncli-dockerfile-path: $(eval DOCKERFILE_PATH := $(ACNCLI_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" -acncli-build-args: +acncli-docker-build-args: $(eval DOCKER_BUILD_ARGS := ;) @echo $(DOCKER_BUILD_ARGS) @@ -383,7 +383,7 @@ azure-ipam-dockerfile-path: $(eval DOCKERFILE_PATH := $(AZURE_IPAM_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" -azure-ipam-build-args: +azure-ipam-docker-build-args: $(eval DOCKER_BUILD_ARGS := ;) @echo $(DOCKER_BUILD_ARGS) @@ -424,7 +424,7 @@ ipv6-hp-bpf-dockerfile-path: $(eval DOCKERFILE_PATH := $(IPV6_HP_BPF_DIR)/$(OS).Dockerfile) @echo "$(DOCKERFILE_PATH)" -ipv6-hp-bpf-build-args: +ipv6-hp-bpf-docker-build-args: $(eval DOCKER_BUILD_ARGS := '--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)') @echo $(DOCKER_BUILD_ARGS) @@ -461,11 +461,11 @@ cni-image-build-context: $(eval BUILD_CONTEXT := $(REPO_ROOT)) @echo "$(BUILD_CONTEXT)" -cni-image-dockerfile-path: +cni-dockerfile-path: $(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" -cni-image-build-args: +cni-docker-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) @@ -503,11 +503,11 @@ cns-image-build-context: $(eval BUILD_CONTEXT := $(REPO_ROOT)) @echo "$(BUILD_CONTEXT)" -cns-image-dockerfile-path: +cns-dockerfile-path: $(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR)/Dockerfile) @echo "$(DOCKERFILE_PATH)" -cns-image-build-args: +cns-docker-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) @@ -544,11 +544,11 @@ npm-image-build-context: $(eval BUILD_CONTEXT := $(REPO_ROOT)) @echo "$(BUILD_CONTEXT)" -npm-image-dockerfile-path: +npm-dockerfile-path: $(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR)/$(OS).Dockerfile) @echo "$(DOCKERFILE_PATH)" -npm-image-build-args: +npm-docker-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) From 815305999f1c1285c0c24231d8950e2865939bcf Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 15:08:05 -0800 Subject: [PATCH 060/136] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 3bf543dffe..a93cc7d264 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -61,5 +61,8 @@ extends: # Enables CodeQL on PR branches ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true + suppression: + suppressionFile: $(Build.SourcesDirectory)\.config\.gdnsuppress + suppressionSet: default stages: - template: /.pipelines/run-pipeline.yaml From c05edafec1e9a4b5d11ca198c981111f129fc485 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 15:51:57 -0800 Subject: [PATCH 061/136] fixup! Separate Build Changes --- .config/credScanSuppressions.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.config/credScanSuppressions.json b/.config/credScanSuppressions.json index 402a6cd9ea..8ca99ae249 100644 --- a/.config/credScanSuppressions.json +++ b/.config/credScanSuppressions.json @@ -1,4 +1,9 @@ { - "tool": "Credential Scanner", - "suppressions": [] + "tool": "Credential Scanner", + "suppressions": [ + { + "file": "keyvault/testdata/dummy.pem", + "_justification": "Fake credentials for testing" + } + ] } From 24ce7a654ce87c74c49926237600821f157097e8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 15:54:15 -0800 Subject: [PATCH 062/136] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index a93cc7d264..8d103a62e6 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -62,7 +62,10 @@ extends: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true suppression: - suppressionFile: $(Build.SourcesDirectory)\.config\.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)/.config/.gdnsuppress suppressionSet: default + credscan: + enabled: true + suppressionsFileForArtifacts: $(Build.SourcesDirectory)/.config/credScanSuppressions.json stages: - template: /.pipelines/run-pipeline.yaml From 58cdf2fc78bbe12dc10e3ee6d6e75c84b5915edd Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 20 Nov 2024 17:04:37 -0800 Subject: [PATCH 063/136] fixup! Separate Build Changes --- .config/.gdnsuppress | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/.gdnsuppress b/.config/.gdnsuppress index 1077b13362..aa25d18b7c 100644 --- a/.config/.gdnsuppress +++ b/.config/.gdnsuppress @@ -11,7 +11,7 @@ "d7e55b5f3e54f9253a2fec595f97520ab0ffece607981d2db0fcfe4dae4cd490": { "signature": "d7e55b5f3e54f9253a2fec595f97520ab0ffece607981d2db0fcfe4dae4cd490", "alternativeSignatures": [], - "target": "**/testdata/dummy.pem", + "target": "keyvault/testdata/dummy.pem", "memberOf": [ "default" ], From 0d291edc21656fd7071ac04000e1c09ba8d5262c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 14:21:26 -0800 Subject: [PATCH 064/136] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 8d103a62e6..b5a4f1ed5f 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -54,6 +54,13 @@ extends: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows image: acn-runner-vmss-image-windows-1es-v2.0 + globalSdl: # https://aka.ms/obpipelines/sdl + #baseline: + #baselineFile: $(Build.SourcesDirectory)\.config\.gdnbaselines + #suppressionSet: default + suppression: + suppressionFile: $(Build.SourcesDirectory)\.config\.gdnsuppress + suppressionSet: default codeql: # Enables CodeQL on the main branch compiled: From d43a0a70a7646446b0e5868f4dbdcfcf29dcd8f5 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 15:08:35 -0800 Subject: [PATCH 065/136] fixup! Separate Build Changes --- .config/.gdnsuppress | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.config/.gdnsuppress b/.config/.gdnsuppress index aa25d18b7c..221145c1df 100644 --- a/.config/.gdnsuppress +++ b/.config/.gdnsuppress @@ -3,24 +3,22 @@ "suppressionSets": { "default": { "name": "default", - "createdDate": "2022-11-28 20:04:38Z", - "lastUpdatedDate": "2022-11-28 20:04:38Z" + "createdDate": "2024-11-21 01:58:07Z", + "lastUpdatedDate": "2024-11-21 01:58:07Z" } }, "results": { - "d7e55b5f3e54f9253a2fec595f97520ab0ffece607981d2db0fcfe4dae4cd490": { - "signature": "d7e55b5f3e54f9253a2fec595f97520ab0ffece607981d2db0fcfe4dae4cd490", + "9a675be4784d448ece481deb7f6f1429fd6606a08b9598f33f23c2123c581520": { + "signature": "9a675be4784d448ece481deb7f6f1429fd6606a08b9598f33f23c2123c581520", "alternativeSignatures": [], "target": "keyvault/testdata/dummy.pem", + "line": 1, "memberOf": [ "default" ], "tool": "credscan", "ruleId": "CSCAN-GENERAL0020", - "justification": null, - "createdDate": "2022-11-28 20:04:38Z", - "expirationDate": null, - "type": null + "createdDate": "2024-11-21 01:58:07Z" } } } From 97130bf76c3e4d8dcae7cb71bdf97a0e3a57fcda Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 16:04:28 -0800 Subject: [PATCH 066/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 2 ++ .pipelines/run-pipeline.yaml | 1 - .pipelines/trigger.yaml | 13 +++---------- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 0262ae5369..a01f6f5939 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -21,6 +21,8 @@ jobs: - serviceConnection: $(ACR_SERVICECONNECTION) steps: + - checkout: self + - task: GoTool@0 inputs: version: $(GO_VERSION) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 88614e34d7..93e85af7f5 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -56,7 +56,6 @@ stages: find . -name '*.zip' -print -exec mv -t ./bins/ {} + shopt -s extglob rm -rf !("bins") - name: "PrepareArtifacts" displayName: "Prepare Artifacts" - task: CopyFiles@2 diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index b5a4f1ed5f..7b1fedd448 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -45,10 +45,6 @@ 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 sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) @@ -61,6 +57,9 @@ extends: suppression: suppressionFile: $(Build.SourcesDirectory)\.config\.gdnsuppress suppressionSet: default + credscan: + enabled: true + suppressionsFileForArtifacts: $(Build.SourcesDirectory)/.config/credScanSuppressions.json codeql: # Enables CodeQL on the main branch compiled: @@ -68,11 +67,5 @@ extends: # Enables CodeQL on PR branches ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true - suppression: - suppressionFile: $(Build.SourcesDirectory)/.config/.gdnsuppress - suppressionSet: default - credscan: - enabled: true - suppressionsFileForArtifacts: $(Build.SourcesDirectory)/.config/credScanSuppressions.json stages: - template: /.pipelines/run-pipeline.yaml From 55c074adc839b448f1c80fe32047dcb63e8ed124 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 19:45:14 -0800 Subject: [PATCH 067/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 22 ++++++------------- .../containers/container-template.steps.yaml | 4 ++-- .pipelines/trigger.yaml | 2 ++ Makefile | 21 +++++++++++++++--- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index a01f6f5939..a7a6cb3c3e 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -26,18 +26,6 @@ jobs: - 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: | - ls -la /bin - env: - ACR: ${{ parameters.containerRegistry.name }} - bash: | set -e @@ -45,7 +33,10 @@ jobs: 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") + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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") @@ -53,11 +44,12 @@ jobs: 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" + displayName: "Get Image Build Data" env: VAR_ID: ${{ image }} + MAKE_IMAGE_TAG: ${{ image }}-image-tag MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context - MAKE_IMG_NAME_AND_TAG: ${{ image }}-image-name-and-tag + MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index ac8937c0d2..4d1a37688d 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -29,8 +29,8 @@ 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 }}) + path: $(Build.SourcesDirectory) + buildArguments: --platform "${{ parameters.os }}/${{ parameters.arch }}" --build-arg ARCH="${{ parameters.arch }}" --build-arg OS="${{ parameters.os }}" --build-arg PLATFORM="${{ parameters.os }}/${{ parameters.arch }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) enableNetwork: true enablePull: false enableCache: true diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 7b1fedd448..7858ee92a5 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -45,6 +45,8 @@ extends: name: $(BUILD_POOL_NAME_DEFAULT) os: linux image: acn-runner-vmss-image-1es-v3.0 + featureFlags: + automaticContainerPatching: true sdl: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) diff --git a/Makefile b/Makefile index fb3922e5f0..31703ce957 100644 --- a/Makefile +++ b/Makefile @@ -346,7 +346,7 @@ acncli-dockerfile-path: @echo "$(DOCKERFILE_PATH)" acncli-docker-build-args: - $(eval DOCKER_BUILD_ARGS := ;) + $(eval DOCKER_BUILD_ARGS := '') @echo $(DOCKER_BUILD_ARGS) acncli-image: acncli-dockerfile-path acncli-build-args ## build cni-manager container image. @@ -372,6 +372,9 @@ acncli-image-pull: ## pull cni-manager container image. azure-ipam-image-name: # util target to print the azure-ipam image name. @echo $(AZURE_IPAM_IMAGE) +azure-ipam-image-tag: + @echo $(AZURE_IPAM_PLATFORM_TAG) + 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) @@ -384,7 +387,7 @@ azure-ipam-dockerfile-path: @echo "$(DOCKERFILE_PATH)" azure-ipam-docker-build-args: - $(eval DOCKER_BUILD_ARGS := ;) + $(eval DOCKER_BUILD_ARGS := '') @echo $(DOCKER_BUILD_ARGS) azure-ipam-image: ## build azure-ipam container image. @@ -413,6 +416,9 @@ azure-ipam-image-pull: ## pull azure-ipam container image. ipv6-hp-bpf-image-name: # util target to print the ipv6-hp-bpf image name. @echo $(IPV6_HP_BPF_IMAGE) +ipv6-hp-bpf-image-tag: + @echo $(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) + 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) @@ -425,7 +431,7 @@ ipv6-hp-bpf-dockerfile-path: @echo "$(DOCKERFILE_PATH)" ipv6-hp-bpf-docker-build-args: - $(eval DOCKER_BUILD_ARGS := '--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)') + $(eval DOCKER_BUILD_ARGS := '--build-arg DEBUG=$(DEBUG)') @echo $(DOCKER_BUILD_ARGS) ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image. @@ -454,6 +460,9 @@ ipv6-hp-bpf-image-pull: ## pull ipv6-hp-bpf container image. cni-image-name: # util target to print the cni image name. @echo $(CNI_IMAGE) +cni-image-tag: + @echo $(CNI_PLATFORM_TAG) + cni-image-name-and-tag: # util target to print the cni image name and tag. @echo $(IMAGE_REGISTRY)/$(CNI_IMAGE):$(CNI_PLATFORM_TAG) @@ -496,6 +505,9 @@ cni-image-pull: ## pull cni container image. cns-image-name: # util target to print the CNS image name @echo $(CNS_IMAGE) +cns-image-tag: + @echo $(CNS_PLATFORM_TAG) + cns-image-name-and-tag: # util target to print the CNS image name and tag. @echo $(IMAGE_REGISTRY)/$(CNS_IMAGE):$(CNS_PLATFORM_TAG) @@ -537,6 +549,9 @@ cns-image-pull: ## pull cns container image. npm-image-name: # util target to print the NPM image name @echo $(NPM_IMAGE) +npm-image-tag: # util target to print the NPM image name and tag. + @echo $(NPM_PLATFORM_TAG) + npm-image-name-and-tag: # util target to print the NPM image name and tag. @echo $(IMAGE_REGISTRY)/$(NPM_IMAGE):$(NPM_PLATFORM_TAG) From 2b6f40a9aa2af7a31905be6dab4dbd4ce49a8012 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 20:59:11 -0800 Subject: [PATCH 068/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index a7a6cb3c3e..c4515e46d7 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -29,6 +29,15 @@ jobs: - bash: | set -e + + if ! $(which sudo); then + apt-get update -y + apt-get install -y sudo net-tools + fi + ifconfig + ip address + sudo systemctl status docker + sudo systemctl restart docker BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" From 9bde1cc26ea2b5b5b91d69bf1de9c1af155e984d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 21 Nov 2024 21:33:57 -0800 Subject: [PATCH 069/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index c4515e46d7..c8850d12c2 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -30,14 +30,9 @@ jobs: - bash: | set -e - if ! $(which sudo); then - apt-get update -y - apt-get install -y sudo net-tools - fi - ifconfig ip address - sudo systemctl status docker - sudo systemctl restart docker + systemctl status docker + systemctl restart docker BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" From 52413f6ccd7208babb20a9eef4993df8d202568a Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 13:55:30 -0800 Subject: [PATCH 070/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index c8850d12c2..e269baaaeb 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -23,6 +23,11 @@ jobs: steps: - checkout: self + - task: DockerInstaller@0 + inputs: + version: 17.09.0-ce + releaseType: stable + - task: GoTool@0 inputs: version: $(GO_VERSION) @@ -32,7 +37,7 @@ jobs: ip address systemctl status docker - systemctl restart docker + #systemctl restart docker BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" From b78bd9c93829e30441b0622537460ad2ec7b07b3 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 15:12:32 -0800 Subject: [PATCH 071/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index e269baaaeb..684b1a5c44 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -23,11 +23,6 @@ jobs: steps: - checkout: self - - task: DockerInstaller@0 - inputs: - version: 17.09.0-ce - releaseType: stable - - task: GoTool@0 inputs: version: $(GO_VERSION) From 0666b85b1c586f26720c5c1c76cdee8d60da95f5 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 15:32:38 -0800 Subject: [PATCH 072/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.jobs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 684b1a5c44..ff54bcb039 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -31,6 +31,7 @@ jobs: set -e ip address + /usr/bin/dockerd -D & systemctl status docker #systemctl restart docker From f8c0509b9929b03867cd6c3cf88217a465c8895b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 15:32:56 -0800 Subject: [PATCH 073/136] 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 ff54bcb039..2f3c87777d 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -32,7 +32,7 @@ jobs: ip address /usr/bin/dockerd -D & - systemctl status docker + systemctl status docker.socket #systemctl restart docker BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") From d106cdc46cdc1b27e6e2a764e3562238686111eb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 16:48:07 -0800 Subject: [PATCH 074/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 8 +--- .../containers/container-template.steps.yaml | 6 ++- .pipelines/run-pipeline.yaml | 46 ++----------------- .pipelines/trigger.yaml | 9 +--- 4 files changed, 13 insertions(+), 56 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 2f3c87777d..947230fec8 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -29,11 +29,6 @@ jobs: - bash: | set -e - - ip address - /usr/bin/dockerd -D & - systemctl status docker.socket - #systemctl restart docker BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" @@ -60,6 +55,7 @@ jobs: - template: container-template.steps.yaml parameters: - arch: ${{ parameters.arch }} name: ${{ image }} os: ${{ parameters.os }} + arch: ${{ parameters.arch }} + platform: ${{ parameters.os }}/${{ parameters.arch }} diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 4d1a37688d..d508853c4e 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -22,6 +22,10 @@ parameters: - windows - linux +- name: platform + type: string + default: "" + steps: - task: 1ES.BuildContainerImage@1 @@ -30,7 +34,7 @@ steps: image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) path: $(Build.SourcesDirectory) - buildArguments: --platform "${{ parameters.os }}/${{ parameters.arch }}" --build-arg ARCH="${{ parameters.arch }}" --build-arg OS="${{ parameters.os }}" --build-arg PLATFORM="${{ parameters.os }}/${{ parameters.arch }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) + buildArguments: --platform "${{ parameters.platform }}" --build-arg ARCH="${{ parameters.arch }}" --build-arg OS="${{ parameters.os }}" --build-arg PLATFORM="${{ parameters.platform }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) enableNetwork: true enablePull: false enableCache: true diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 93e85af7f5..8113b0f641 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -84,7 +84,7 @@ stages: - cns - ipv6-hp-bpf - npm - containerRegistry: + containerRegistry: name: $(ACR_NAME) clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml @@ -97,7 +97,7 @@ stages: - cns - ipv6-hp-bpf - npm - containerRegistry: + containerRegistry: name: $(ACR_NAME) clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml @@ -109,7 +109,7 @@ stages: - cni - cns - npm - containerRegistry: + containerRegistry: name: $(ACR_NAME) clientId: $(ACR_CLIENTID) @@ -292,21 +292,6 @@ stages: 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 - - stage: delete displayName: Delete Clusters condition: always() @@ -324,7 +309,6 @@ stages: - aks_windows_22_e2e - dualstackoverlay_e2e - cilium_dualstackoverlay_e2e - - swiftv2_e2e variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: @@ -336,7 +320,7 @@ stages: cilium_e2e: name: cilium_e2e clusterName: "ciliume2e" - region: $(REGION_AKS_CLUSTER_TEST) + region: $(REGION_AKS_CLUSTER_TEST) cilium_nodesubnet_e2e: name: cilium_nodesubnet_e2e clusterName: "cilndsubnete2e" @@ -389,25 +373,3 @@ stages: 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) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 7858ee92a5..101ae8c1bd 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -30,11 +30,6 @@ resources: variables: - REPO_REF: $[ resources.repositories['azure-container-networking'].ref ] - REPO_COMMIT: $[ resources.repositories['azure-container-networking'].version ] - 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/')] @@ -48,11 +43,11 @@ extends: featureFlags: automaticContainerPatching: true sdl: - sourceAnalysisPool: + sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows image: acn-runner-vmss-image-windows-1es-v2.0 - globalSdl: # https://aka.ms/obpipelines/sdl + globalSdl: #baseline: #baselineFile: $(Build.SourcesDirectory)\.config\.gdnbaselines #suppressionSet: default From 83eb88db7e210fc04a11863043e76cefba8ea5b2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 17:22:43 -0800 Subject: [PATCH 075/136] fixup! Separate Build Changes --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 31703ce957..8df9a56ea3 100644 --- a/Makefile +++ b/Makefile @@ -471,7 +471,7 @@ cni-image-build-context: @echo "$(BUILD_CONTEXT)" cni-dockerfile-path: - $(eval DOCKERFILE_PATH := $(CNI_BUILD_DIR)/Dockerfile) + $(eval DOCKERFILE_PATH := $(REPO_ROOT)/cni/Dockerfile) @echo "$(DOCKERFILE_PATH)" cni-docker-build-args: @@ -516,7 +516,7 @@ cns-image-build-context: @echo "$(BUILD_CONTEXT)" cns-dockerfile-path: - $(eval DOCKERFILE_PATH := $(CNS_BUILD_DIR)/Dockerfile) + $(eval DOCKERFILE_PATH := $(REPO_ROOT)/cns/Dockerfile) @echo "$(DOCKERFILE_PATH)" cns-docker-build-args: @@ -560,7 +560,7 @@ npm-image-build-context: @echo "$(BUILD_CONTEXT)" npm-dockerfile-path: - $(eval DOCKERFILE_PATH := $(NPM_BUILD_DIR)/$(OS).Dockerfile) + $(eval DOCKERFILE_PATH := $(REPO_ROOT)/npm/Dockerfile) @echo "$(DOCKERFILE_PATH)" npm-docker-build-args: From 5ae9156340561e5ce3978e2f7039a44a535deb1e Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 20:42:37 -0800 Subject: [PATCH 076/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 58 ++++++++++++++++--- .pipelines/run-pipeline.yaml | 9 --- Makefile | 2 +- 3 files changed, 52 insertions(+), 17 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 947230fec8..01522c5a41 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -1,9 +1,17 @@ parameters: - name: arch type: string + default: "" + values: + - amd64 + - arm64 - name: os type: string + default: "" + values: + - windows + - linux - name: images type: object @@ -19,6 +27,14 @@ jobs: templateContext: authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) + ${{ if eq(variables.Agent.OSArchitecture, 'ARM' }}: + buildArch: arm64 + ${{ else }}: + buildArch: amd64 + ${{ if eq(variables.Agent.OS, 'Linux') }}: + buildOs: linux + ${{ else }}: + buildOs: windows steps: - checkout: self @@ -30,6 +46,16 @@ jobs: - bash: | set -e + echo >&2 "##vso[task.setvariable variable=${VAR_ID};]$VAR_ID" + displayName: "Get Image ID" + env: + VAR_ID: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} + + - bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" @@ -46,16 +72,34 @@ jobs: echo >&2 "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_${VAR_ID};]$EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" env: - VAR_ID: ${{ image }} + IMAGE: ${{ image }} + OS: ${{ parameters.os }} + ARCH: ${{ parameters.arch }} + PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} MAKE_IMAGE_TAG: ${{ image }}-image-tag MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args - - template: container-template.steps.yaml - parameters: - name: ${{ image }} - os: ${{ parameters.os }} - arch: ${{ parameters.arch }} - platform: ${{ parameters.os }}/${{ parameters.arch }} + - task: 1ES.BuildContainerImage@1 + retryCountOnTaskFailure: 3 + inputs: + image: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + dockerfile: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + path: $(Build.SourcesDirectory) + buildArguments: | + --platform "${{ templateContext.targetOs }}/${{ templateContext.targetArch }}" \ + --build-arg ARCH="${{ templateContext.buildArch }}" \ + --build-arg OS="${{ templateContext.buildOs }}" \ + --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }})" \ + --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + enableNetwork: true + enablePull: false + enableCache: true + useBuildKit: true + + - task: 1ES.PushContainerImage@1 + condition: ${{ eq(parameters.os, 'windows') }} + inputs: + image: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 8113b0f641..e5d1beff79 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -84,9 +84,6 @@ stages: - cns - ipv6-hp-bpf - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: arm64 @@ -97,9 +94,6 @@ stages: - cns - ipv6-hp-bpf - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: amd64 @@ -109,9 +103,6 @@ stages: - cni - cns - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - stage: publish diff --git a/Makefile b/Makefile index 8df9a56ea3..7b86715943 100644 --- a/Makefile +++ b/Makefile @@ -560,7 +560,7 @@ npm-image-build-context: @echo "$(BUILD_CONTEXT)" npm-dockerfile-path: - $(eval DOCKERFILE_PATH := $(REPO_ROOT)/npm/Dockerfile) + $(eval DOCKERFILE_PATH := $(REPO_ROOT)/npm/$(OS).Dockerfile) @echo "$(DOCKERFILE_PATH)" npm-docker-build-args: From 177de69fd2fcbd0d4293680a942cf30af95ddf31 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 20:44:37 -0800 Subject: [PATCH 077/136] 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 01522c5a41..aafef5b2bc 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -27,7 +27,7 @@ jobs: templateContext: authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) - ${{ if eq(variables.Agent.OSArchitecture, 'ARM' }}: + ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: buildArch: arm64 ${{ else }}: buildArch: amd64 From 66b5406732bba1b022b974c3776be9b9cd5b1a71 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 22 Nov 2024 20:46:43 -0800 Subject: [PATCH 078/136] fixup! Separate Build Changes --- .pipelines/run-pipeline.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index e5d1beff79..8113b0f641 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -84,6 +84,9 @@ stages: - cns - ipv6-hp-bpf - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: arm64 @@ -94,6 +97,9 @@ stages: - cns - ipv6-hp-bpf - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) - template: containers/container-template.jobs.yaml parameters: arch: amd64 @@ -103,6 +109,9 @@ stages: - cni - cns - npm + containerRegistry: + name: $(ACR_NAME) + clientId: $(ACR_CLIENTID) - stage: publish From 660de781c9f7559bed9e3e7781ec5bd04733d5ce Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 14:08:18 -0800 Subject: [PATCH 079/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 78 ++++++++++++------- .../containers/container-template.steps.yaml | 68 ++++++++++------ 2 files changed, 96 insertions(+), 50 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index aafef5b2bc..e53c43d8f1 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -27,14 +27,6 @@ jobs: templateContext: authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) - ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: - buildArch: arm64 - ${{ else }}: - buildArch: amd64 - ${{ if eq(variables.Agent.OS, 'Linux') }}: - buildOs: linux - ${{ else }}: - buildOs: windows steps: - checkout: self @@ -82,24 +74,56 @@ jobs: MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args - - task: 1ES.BuildContainerImage@1 - retryCountOnTaskFailure: 3 - inputs: - image: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + - template: ./container-template.steps.yaml + parameters: + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) dockerfile: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) path: $(Build.SourcesDirectory) - buildArguments: | - --platform "${{ templateContext.targetOs }}/${{ templateContext.targetArch }}" \ - --build-arg ARCH="${{ templateContext.buildArch }}" \ - --build-arg OS="${{ templateContext.buildOs }}" \ - --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }})" \ - --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - enableNetwork: true - enablePull: false - enableCache: true - useBuildKit: true - - - task: 1ES.PushContainerImage@1 - condition: ${{ eq(parameters.os, 'windows') }} - inputs: - image: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + targetOs: ${{ parameters.os }} + targetArch: ${{ parameters.arch }} + targetPlatform: "${{ templateContext.targetOs }}/${{ templateContext.targetArch }}" + addBuildArgs: + ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: + buildArch: arm64 + + ${{ if eq(variables.Agent.OS, 'Linux') }}: + buildOs: linux + buildPlatform: linux/amd64 + ${{ else }}: + buildOs: windows + buildPlatform: windows/amd64 + + ${{ else }}: + buildArch: amd64 + + ${{ if eq(variables.Agent.OS, 'Linux') }}: + buildOs: linux + buildPlatform: linux/amd64 + ${{ else }}: + buildOs: windows + buildPlatform: windows/amd64 + +# - task: 1ES.BuildContainerImage@1 +# retryCountOnTaskFailure: 3 +# inputs: +# image: ${{ parameters.imageNameAndTag }} +# dockerfile: ${{ parameters.dockerfilePath }} +# path: ${{ parameters.targetPath }} $(Build.SourcesDirectory) +# buildArguments: | +# --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ +# --build-arg ARCH="${{ parameters.buildArch }}" \ +# --build-arg OS="${{ parameters.buildOs }}" \ +# --build-arg VERSION="${{ parameters.platformVersion }}" \ +# --platform "${{ parameters.targetPlatform }}" \ +# --target "${{ parameters.targetOs }}" \ +# ${{ parameters.addBuildArgs }} +# enableNetwork: true +# enablePull: false +# enableCache: true +# useBuildKit: true +# +# - task: 1ES.PushContainerImage@1 +# condition: ${{ eq(parameters.os, 'windows') }} +# inputs: +# image: ${{ parameters.imageNameAndTag }} diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index d508853c4e..2b331ec3c9 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -1,4 +1,6 @@ parameters: +- name: imageName + type: string - name: name type: string values: @@ -8,39 +10,59 @@ parameters: - ipv6-hp-bpf - npm -- name: arch +- name: platformVersionTag type: string default: "" - values: - - amd64 - - arm64 -- name: os +- name: targetPlatform type: string default: "" + +- name: buildOs + type: string values: - - windows - linux + - windows -- name: platform +- name: buildArch type: string + values: + - amd64 + - arm64 + +- name: addBuildArgs + type: object default: "" steps: -- task: 1ES.BuildContainerImage@1 - retryCountOnTaskFailure: 3 - inputs: - image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) - dockerfile: $(DOCKERFILE_PATH_${{ parameters.name }}) - path: $(Build.SourcesDirectory) - buildArguments: --platform "${{ parameters.platform }}" --build-arg ARCH="${{ parameters.arch }}" --build-arg OS="${{ parameters.os }}" --build-arg PLATFORM="${{ parameters.platform }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) - enableNetwork: true - enablePull: false - enableCache: true - useBuildKit: true - -- task: 1ES.PushContainerImage@1 - condition: ${{ eq(parameters.os, 'windows') }} - inputs: - image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }}) +# path: $(Build.SourcesDirectory) +# buildArguments: --platform "${{ parameters.targetPlatform }}" --build-arg ARCH="${{ parameters.buildArch }}" --build-arg OS="${{ parameters.buildOs }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) +# enableNetwork: true +# enablePull: false +# enableCache: true +# useBuildKit: true + + - task: 1ES.BuildContainerImage@1 + retryCountOnTaskFailure: 3 + inputs: + image: ${{ parameters.imageNameAndTag }} + dockerfile: ${{ parameters.dockerfilePath }} + path: ${{ parameters.targetPath }} $(Build.SourcesDirectory) + buildArguments: | + --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ + --build-arg ARCH="${{ parameters.buildArch }}" \ + --build-arg OS="${{ parameters.buildOs }}" \ + --build-arg VERSION="${{ parameters.platformVersionTag }}" \ + --platform "${{ parameters.targetPlatform }}" \ + --target "${{ parameters.targetOs }}" \ + ${{ parameters.addBuildArgs }} + enableNetwork: true + enablePull: false + enableCache: true + useBuildKit: true + + - task: 1ES.PushContainerImage@1 + condition: ${{ eq(parameters.os, 'windows') }} + inputs: + image: ${{ parameters.imageNameAndTag }} From 33871d9ea9b83afafb12030c32f00a46048be9c1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 14:09:42 -0800 Subject: [PATCH 080/136] 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 e53c43d8f1..add59bbf48 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -82,7 +82,7 @@ jobs: targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) targetOs: ${{ parameters.os }} targetArch: ${{ parameters.arch }} - targetPlatform: "${{ templateContext.targetOs }}/${{ templateContext.targetArch }}" + targetPlatform: "${{ parameters.targetOs }}/${{ parameters.targetArch }}" addBuildArgs: ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: buildArch: arm64 From 9b8b6532802dd6adabe342b0a492b4be1262734b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 14:15:15 -0800 Subject: [PATCH 081/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 6 ++-- .../containers/container-template.steps.yaml | 33 ++++++++++++++----- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index add59bbf48..84f9fa9e8e 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -77,12 +77,12 @@ jobs: - template: ./container-template.steps.yaml parameters: imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - dockerfile: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - path: $(Build.SourcesDirectory) + dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + buildContextPath: $(Build.SourcesDirectory) targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) targetOs: ${{ parameters.os }} targetArch: ${{ parameters.arch }} - targetPlatform: "${{ parameters.targetOs }}/${{ parameters.targetArch }}" + targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" addBuildArgs: ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: buildArch: arm64 diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 2b331ec3c9..4995e95a55 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -1,23 +1,34 @@ parameters: -- name: imageName +- name: imageNameAndTag type: string -- name: name + +- name: dockerfilePath type: string - values: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - name: platformVersionTag type: string default: "" +- name: buildContextPath + type: string + default: "" + - name: targetPlatform type: string default: "" +- name: targetOs + type: string + values: + - linux + - windows + +- name: targetArch + type: string + values: + - amd64 + - arm64 + - name: buildOs type: string values: @@ -30,6 +41,10 @@ parameters: - amd64 - arm64 +- name: buildPlatform + type: string + default: "" + - name: addBuildArgs type: object default: "" @@ -48,7 +63,7 @@ steps: inputs: image: ${{ parameters.imageNameAndTag }} dockerfile: ${{ parameters.dockerfilePath }} - path: ${{ parameters.targetPath }} $(Build.SourcesDirectory) + path: ${{ parameters.buildContextPath }} buildArguments: | --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ --build-arg ARCH="${{ parameters.buildArch }}" \ From 7e546e463fc17f1ec8c63387b61b240ecc7ef2ed Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 14:16:44 -0800 Subject: [PATCH 082/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 4995e95a55..25d5d7af78 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -5,7 +5,7 @@ parameters: - name: dockerfilePath type: string -- name: platformVersionTag +- name: targetVersion type: string default: "" @@ -68,7 +68,7 @@ steps: --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ --build-arg ARCH="${{ parameters.buildArch }}" \ --build-arg OS="${{ parameters.buildOs }}" \ - --build-arg VERSION="${{ parameters.platformVersionTag }}" \ + --build-arg VERSION="${{ parameters.targetVersion }}" \ --platform "${{ parameters.targetPlatform }}" \ --target "${{ parameters.targetOs }}" \ ${{ parameters.addBuildArgs }} From 348ebafc128c6828e9de09d89a98c9d66e4ddf05 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 14:17:34 -0800 Subject: [PATCH 083/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 25d5d7af78..d6921dd610 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -78,6 +78,6 @@ steps: useBuildKit: true - task: 1ES.PushContainerImage@1 - condition: ${{ eq(parameters.os, 'windows') }} + condition: ${{ eq(parameters.targetOs, 'windows') }} inputs: image: ${{ parameters.imageNameAndTag }} From b8badaaa917905bdb63bf627281dba905fc18479 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 16:13:20 -0800 Subject: [PATCH 084/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index d6921dd610..df34f15808 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -65,12 +65,12 @@ steps: dockerfile: ${{ parameters.dockerfilePath }} path: ${{ parameters.buildContextPath }} buildArguments: | - --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ - --build-arg ARCH="${{ parameters.buildArch }}" \ - --build-arg OS="${{ parameters.buildOs }}" \ - --build-arg VERSION="${{ parameters.targetVersion }}" \ - --platform "${{ parameters.targetPlatform }}" \ - --target "${{ parameters.targetOs }}" \ + --build-arg PLATFORM="${{ parameters.buildPlatform }}" + --build-arg ARCH="${{ parameters.buildArch }}" + --build-arg OS="${{ parameters.buildOs }}" + --build-arg VERSION="${{ parameters.targetVersion }}" + --platform "${{ parameters.targetPlatform }}" + --target "${{ parameters.targetOs }}" ${{ parameters.addBuildArgs }} enableNetwork: true enablePull: false From e8afcd8fc6bd387cbbd80e7c18a263ed91fa5a32 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 17:08:38 -0800 Subject: [PATCH 085/136] fixup! Separate Build Changes --- .pipelines/trigger.yaml | 14 ++++++++++++++ Makefile | 16 ++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 101ae8c1bd..9e437c10f9 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -32,6 +32,20 @@ resources: variables: # Local analysis is only enabled on PR branches Codeql.AnalyzeInPipeline: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')] + Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) + Codeql.ADO.Build.Repository.Name: $(Build.Repository.Name) + Codeql.ADO.Build.SourceVersion: $(Build.SourceVersion) + Codeql.ADO.Build.DefinitionName: $(Build.DefinitionName) + Codeql.ADO.Build.BuildId: $(Build.BuildId) + Codeql.ADO.System.CollectionUri: $(System.CollectionUri) + Codeql.ADO.System.TeamProject: $(System.TeamProject) + Codeql.ADO.System.JobId: $(System.JobId) + Codeql.ADO.Build.Repository.LocalPath: $(Build.Repository.LocalPath) + Codeql.ADO.Build.SourceBranch: $(Build.SourceBranch) + Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) + Codeql.ADO.Build.SourceBranchName: $(Build.SourceBranchName) + Codeql.ADO.Build.SourcesDirectory: $(Build.SourcesDirectory) + extends: template: v1/1ES.Unofficial.PipelineTemplate.yml@1ESPipelineTemplates diff --git a/Makefile b/Makefile index 7b86715943..2ceb878651 100644 --- a/Makefile +++ b/Makefile @@ -399,7 +399,7 @@ azure-ipam-image: ## build azure-ipam container image. TARGET=$(OS) \ OS=$(OS) \ ARCH=$(ARCH) \ - $(DOCKER_BUILD_ARGS) + EXTRA_BUILD_ARGS=$(DOCKER_BUILD_ARGS) azure-ipam-image-push: ## push azure-ipam container image. $(MAKE) container-push \ @@ -438,7 +438,7 @@ ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image. $(MAKE) container \ DOCKERFILE=$(DOCKERFILE_PATH) \ IMAGE=$(IPV6_HP_BPF_IMAGE) \ - EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)'\ + EXTRA_BUILD_ARGS=$(DOCKER_BUILD_ARGS) \ PLATFORM=$(PLATFORM) \ TAG=$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) \ TARGET=$(OS) \ @@ -475,7 +475,7 @@ cni-dockerfile-path: @echo "$(DOCKERFILE_PATH)" cni-docker-build-args: - $(eval DOCKER_BUILD_ARGS='--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)') + $(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. @@ -487,7 +487,7 @@ cni-image: ## build cni container image. TARGET=$(OS) \ OS=$(OS) \ ARCH=$(ARCH) \ - EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' + EXTRA_BUILD_ARGS=$(DOCKER_BUILD_ARGS) cni-image-push: ## push cni container image. $(MAKE) container-push \ @@ -520,14 +520,14 @@ cns-dockerfile-path: @echo "$(DOCKERFILE_PATH)" cns-docker-build-args: - $(eval DOCKER_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)') + $(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=$(DOCKERFILE_PATH) \ IMAGE=$(CNS_IMAGE) \ - EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' \ + EXTRA_BUILD_ARGS=$(DOCKER_BUILD_ARGS) \ PLATFORM=$(PLATFORM) \ TAG=$(CNS_PLATFORM_TAG) \ TARGET=$(OS) \ @@ -564,14 +564,14 @@ npm-dockerfile-path: @echo "$(DOCKERFILE_PATH)" npm-docker-build-args: - $(eval DOCKER_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)') + $(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=$(DOCKERFILE_PATH) \ IMAGE=$(NPM_IMAGE) \ - EXTRA_BUILD_ARGS='$(DOCKER_BUILD_ARGS)' \ + EXTRA_BUILD_ARGS=$(DOCKER_BUILD_ARGS) \ PLATFORM=$(PLATFORM) \ TAG=$(NPM_PLATFORM_TAG) \ TARGET=$(OS) \ From fdc112e4e55997f5eff4d96be4c9a87ef6cb84cb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 18:00:53 -0800 Subject: [PATCH 086/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 2 +- .../containers/container-template.steps.yaml | 7 ----- .pipelines/trigger.yaml | 26 +++++++++---------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 84f9fa9e8e..65845bb738 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -83,7 +83,7 @@ jobs: targetOs: ${{ parameters.os }} targetArch: ${{ parameters.arch }} targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" - addBuildArgs: + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: buildArch: arm64 diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index df34f15808..a0adccaf40 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -51,13 +51,6 @@ parameters: steps: -# path: $(Build.SourcesDirectory) -# buildArguments: --platform "${{ parameters.targetPlatform }}" --build-arg ARCH="${{ parameters.buildArch }}" --build-arg OS="${{ parameters.buildOs }}" --build-arg VERSION="$(IMAGE_PLATFORM_TAG_${{ parameters.name }})" --target "${{ parameters.os }}" $(EXTRA_BUILD_ARGS_${{ parameters.name }}) -# enableNetwork: true -# enablePull: false -# enableCache: true -# useBuildKit: true - - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 inputs: diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 9e437c10f9..7b2077c1c0 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -32,19 +32,19 @@ resources: variables: # Local analysis is only enabled on PR branches Codeql.AnalyzeInPipeline: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')] - Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) - Codeql.ADO.Build.Repository.Name: $(Build.Repository.Name) - Codeql.ADO.Build.SourceVersion: $(Build.SourceVersion) - Codeql.ADO.Build.DefinitionName: $(Build.DefinitionName) - Codeql.ADO.Build.BuildId: $(Build.BuildId) - Codeql.ADO.System.CollectionUri: $(System.CollectionUri) - Codeql.ADO.System.TeamProject: $(System.TeamProject) - Codeql.ADO.System.JobId: $(System.JobId) - Codeql.ADO.Build.Repository.LocalPath: $(Build.Repository.LocalPath) - Codeql.ADO.Build.SourceBranch: $(Build.SourceBranch) - Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) - Codeql.ADO.Build.SourceBranchName: $(Build.SourceBranchName) - Codeql.ADO.Build.SourcesDirectory: $(Build.SourcesDirectory) +# Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) +# Codeql.ADO.Build.Repository.Name: $(Build.Repository.Name) +# Codeql.ADO.Build.SourceVersion: $(Build.SourceVersion) +# Codeql.ADO.Build.DefinitionName: $(Build.DefinitionName) +# Codeql.ADO.Build.BuildId: $(Build.BuildId) +# Codeql.ADO.System.CollectionUri: $(System.CollectionUri) +# Codeql.ADO.System.TeamProject: $(System.TeamProject) +# Codeql.ADO.System.JobId: $(System.JobId) +# Codeql.ADO.Build.Repository.LocalPath: $(Build.Repository.LocalPath) +# Codeql.ADO.Build.SourceBranch: $(Build.SourceBranch) +# Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) +# Codeql.ADO.Build.SourceBranchName: $(Build.SourceBranchName) +# Codeql.ADO.Build.SourcesDirectory: $(Build.SourcesDirectory) extends: From 54b968b2ab752d839a2ffa3050c67aba105d03ff Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 19:11:07 -0800 Subject: [PATCH 087/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 177 ++++++------------ .../containers/container-template.steps.yaml | 46 ++--- .pipelines/run-pipeline.yaml | 76 ++++---- 3 files changed, 120 insertions(+), 179 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index 65845bb738..c817657377 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -1,129 +1,72 @@ parameters: +- name: jobs + type: jobList + default: [] + - name: arch type: string - default: "" - values: - - amd64 - - arm64 - name: os type: string - default: "" - values: - - windows - - linux - name: images type: object - -- name: containerRegistry - type: object + default: [] jobs: -- ${{ each image in parameters.images }}: - - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} - displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) - templateContext: - authenticatedContainerRegistries: - - serviceConnection: $(ACR_SERVICECONNECTION) - - steps: - - checkout: self - - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - - bash: | - set -e - - echo >&2 "##vso[task.setvariable variable=${VAR_ID};]$VAR_ID" - displayName: "Get Image ID" - env: - VAR_ID: ${{ image }}_${{ parameters.os }}_${{ parameters.arch }} - - - bash: | - set -e - - VAR_ID="${IMAGE}_${OS}_${ARCH}" - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" - env: - IMAGE: ${{ image }} - OS: ${{ parameters.os }} - ARCH: ${{ parameters.arch }} - PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} - MAKE_IMAGE_TAG: ${{ image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args - - - template: ./container-template.steps.yaml - parameters: - imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - buildContextPath: $(Build.SourcesDirectory) - targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - targetOs: ${{ parameters.os }} - targetArch: ${{ parameters.arch }} - targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - ${{ if eq(variables.Agent.OSArchitecture, 'ARM') }}: - buildArch: arm64 - - ${{ if eq(variables.Agent.OS, 'Linux') }}: - buildOs: linux - buildPlatform: linux/amd64 - ${{ else }}: - buildOs: windows - buildPlatform: windows/amd64 - - ${{ else }}: - buildArch: amd64 - - ${{ if eq(variables.Agent.OS, 'Linux') }}: - buildOs: linux - buildPlatform: linux/amd64 - ${{ else }}: - buildOs: windows - buildPlatform: windows/amd64 - -# - task: 1ES.BuildContainerImage@1 -# retryCountOnTaskFailure: 3 -# inputs: -# image: ${{ parameters.imageNameAndTag }} -# dockerfile: ${{ parameters.dockerfilePath }} -# path: ${{ parameters.targetPath }} $(Build.SourcesDirectory) -# buildArguments: | -# --build-arg PLATFORM="${{ parameters.buildPlatform }}" \ -# --build-arg ARCH="${{ parameters.buildArch }}" \ -# --build-arg OS="${{ parameters.buildOs }}" \ -# --build-arg VERSION="${{ parameters.platformVersion }}" \ -# --platform "${{ parameters.targetPlatform }}" \ -# --target "${{ parameters.targetOs }}" \ -# ${{ parameters.addBuildArgs }} -# enableNetwork: true -# enablePull: false -# enableCache: true -# useBuildKit: true -# -# - task: 1ES.PushContainerImage@1 -# condition: ${{ eq(parameters.os, 'windows') }} -# inputs: -# image: ${{ parameters.imageNameAndTag }} +- ${{ each job in parameters.jobs }}: + - ${{ each image in parameters.images }}: + - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} + displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) + steps: + - checkout: self + + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" + env: + IMAGE: ${{ image }} + OS: ${{ parameters.os }} + ARCH: ${{ parameters.arch }} + PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} + MAKE_IMAGE_TAG: ${{ image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args + + - template: ./container-template.steps.yaml + parameters: + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + buildContextPath: $(Build.SourcesDirectory) + targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + targetOs: ${{ parameters.os }} + targetArch: ${{ parameters.arch }} + targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + buildOs: ${{ job.templatContext.buildOs }} + buildArch: ${{ job.templateContext.buildArch }} + buildPlatform: "${{ job.templatContext.buildOs }}/${{ job.templateContext.buildArch }}" diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index a0adccaf40..b986f037cc 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -51,26 +51,26 @@ parameters: steps: - - task: 1ES.BuildContainerImage@1 - retryCountOnTaskFailure: 3 - inputs: - image: ${{ parameters.imageNameAndTag }} - dockerfile: ${{ parameters.dockerfilePath }} - path: ${{ parameters.buildContextPath }} - buildArguments: | - --build-arg PLATFORM="${{ parameters.buildPlatform }}" - --build-arg ARCH="${{ parameters.buildArch }}" - --build-arg OS="${{ parameters.buildOs }}" - --build-arg VERSION="${{ parameters.targetVersion }}" - --platform "${{ parameters.targetPlatform }}" - --target "${{ parameters.targetOs }}" - ${{ parameters.addBuildArgs }} - enableNetwork: true - enablePull: false - enableCache: true - useBuildKit: true - - - task: 1ES.PushContainerImage@1 - condition: ${{ eq(parameters.targetOs, 'windows') }} - inputs: - image: ${{ parameters.imageNameAndTag }} +- task: 1ES.BuildContainerImage@1 + retryCountOnTaskFailure: 3 + inputs: + image: ${{ parameters.imageNameAndTag }} + dockerfile: ${{ parameters.dockerfilePath }} + path: ${{ parameters.buildContextPath }} + buildArguments: | + --build-arg PLATFORM="${{ parameters.buildPlatform }}" + --build-arg ARCH="${{ parameters.buildArch }}" + --build-arg OS="${{ parameters.buildOs }}" + --build-arg VERSION="${{ parameters.targetVersion }}" + --platform "${{ parameters.targetPlatform }}" + --target "${{ parameters.targetOs }}" + ${{ parameters.addBuildArgs }} + enableNetwork: true + enablePull: false + enableCache: true + useBuildKit: true + +- task: 1ES.PushContainerImage@1 + condition: ${{ eq(parameters.targetOs, 'windows') }} + inputs: + image: ${{ parameters.imageNameAndTag }} diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 8113b0f641..43d0b606d3 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -73,45 +73,43 @@ stages: dependsOn: - setup - test - jobs: - - template: containers/container-template.jobs.yaml - parameters: - arch: amd64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - - template: containers/container-template.jobs.yaml - parameters: - arch: arm64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) - - template: containers/container-template.jobs.yaml - parameters: - arch: amd64 - os: windows - images: - - azure-ipam - - cni - - cns - - npm - containerRegistry: - name: $(ACR_NAME) - clientId: $(ACR_CLIENTID) + templateContext: + buildArch: amd64 + buildOs: linux + buildPlatform: linux/amd64 + authenticatedContainerRegistries: + - serviceConnection: $(ACR_SERVICECONNECTION) + parameters: + jobs: + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: containers/container-template.jobs.yaml + parameters: + arch: arm64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: windows + images: + - azure-ipam + - cni + - cns + - npm - stage: publish From e833ff46af3c49af065c044c1a0b6c8d8e29ca5a Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 19:17:00 -0800 Subject: [PATCH 088/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 26 +++++++++---------- .pipelines/run-pipeline.yaml | 6 ++--- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index c817657377..d1c2bbcf5e 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -16,9 +16,9 @@ parameters: jobs: - ${{ each job in parameters.jobs }}: - - ${{ each image in parameters.images }}: - - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} - displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) + - ${{ each image in job.templateContext.images }}: + - job: ${{ replace(image, '-', '_') }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }} + displayName: Build Image - (${{ image }} ${{ job.templateContext.os }}/${{ job.templateContext.arch }}) steps: - checkout: self @@ -48,9 +48,9 @@ jobs: displayName: "Get Image Build Data" env: IMAGE: ${{ image }} - OS: ${{ parameters.os }} - ARCH: ${{ parameters.arch }} - PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} + OS: ${{ job.templateContext.os }} + ARCH: ${{ job.templateContext.arch }} + PLATFORM: ${{ job.templateContext.os }}/${{ job.templateContext.arch }} MAKE_IMAGE_TAG: ${{ image }}-image-tag MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag @@ -59,14 +59,14 @@ jobs: - template: ./container-template.steps.yaml parameters: - imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) + dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) buildContextPath: $(Build.SourcesDirectory) - targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - targetOs: ${{ parameters.os }} - targetArch: ${{ parameters.arch }} - targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) + targetOs: ${{ job.templateContext.os }} + targetArch: ${{ job.templateContext.arch }} + targetPlatform: "${{ job.templateContext.os }}/${{ job.templateContext.arch }}" + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) buildOs: ${{ job.templatContext.buildOs }} buildArch: ${{ job.templateContext.buildArch }} buildPlatform: "${{ job.templatContext.buildOs }}/${{ job.templateContext.buildArch }}" diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 43d0b606d3..a88ea4104d 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -82,7 +82,7 @@ stages: parameters: jobs: - template: containers/container-template.jobs.yaml - parameters: + templateContext: arch: amd64 os: linux images: @@ -92,7 +92,7 @@ stages: - ipv6-hp-bpf - npm - template: containers/container-template.jobs.yaml - parameters: + templateContext: arch: arm64 os: linux images: @@ -102,7 +102,7 @@ stages: - ipv6-hp-bpf - npm - template: containers/container-template.jobs.yaml - parameters: + templateContext: arch: amd64 os: windows images: From 4281639afd65938faf30347f75bd4e49e7ea3e59 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 19:20:57 -0800 Subject: [PATCH 089/136] fixup! Separate Build Changes --- .../containers/container-template.jobs.yaml | 26 ++++---- .pipelines/run-pipeline.yaml | 61 +++++++++---------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml index d1c2bbcf5e..c817657377 100644 --- a/.pipelines/containers/container-template.jobs.yaml +++ b/.pipelines/containers/container-template.jobs.yaml @@ -16,9 +16,9 @@ parameters: jobs: - ${{ each job in parameters.jobs }}: - - ${{ each image in job.templateContext.images }}: - - job: ${{ replace(image, '-', '_') }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }} - displayName: Build Image - (${{ image }} ${{ job.templateContext.os }}/${{ job.templateContext.arch }}) + - ${{ each image in parameters.images }}: + - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} + displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) steps: - checkout: self @@ -48,9 +48,9 @@ jobs: displayName: "Get Image Build Data" env: IMAGE: ${{ image }} - OS: ${{ job.templateContext.os }} - ARCH: ${{ job.templateContext.arch }} - PLATFORM: ${{ job.templateContext.os }}/${{ job.templateContext.arch }} + OS: ${{ parameters.os }} + ARCH: ${{ parameters.arch }} + PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} MAKE_IMAGE_TAG: ${{ image }}-image-tag MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag @@ -59,14 +59,14 @@ jobs: - template: ./container-template.steps.yaml parameters: - imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) - dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) buildContextPath: $(Build.SourcesDirectory) - targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) - targetOs: ${{ job.templateContext.os }} - targetArch: ${{ job.templateContext.arch }} - targetPlatform: "${{ job.templateContext.os }}/${{ job.templateContext.arch }}" - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ job.templateContext.os }}_${{ job.templateContext.arch }}) + targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) + targetOs: ${{ parameters.os }} + targetArch: ${{ parameters.arch }} + targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) buildOs: ${{ job.templatContext.buildOs }} buildArch: ${{ job.templateContext.buildArch }} buildPlatform: "${{ job.templatContext.buildOs }}/${{ job.templateContext.buildArch }}" diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index a88ea4104d..fa864bcfca 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -79,37 +79,36 @@ stages: buildPlatform: linux/amd64 authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) - parameters: - jobs: - - template: containers/container-template.jobs.yaml - templateContext: - arch: amd64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: containers/container-template.jobs.yaml - templateContext: - arch: arm64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: containers/container-template.jobs.yaml - templateContext: - arch: amd64 - os: windows - images: - - azure-ipam - - cni - - cns - - npm + jobs: + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: containers/container-template.jobs.yaml + parameters: + arch: arm64 + os: linux + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: containers/container-template.jobs.yaml + parameters: + arch: amd64 + os: windows + images: + - azure-ipam + - cni + - cns + - npm - stage: publish From 2a69d6af0a757c665810abbcfd809bae5dffb97b Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 22:21:08 -0800 Subject: [PATCH 090/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 68 ++++++++++++++++++ .pipelines/run-pipeline.yaml | 74 +++++++++++--------- 2 files changed, 108 insertions(+), 34 deletions(-) create mode 100644 .pipelines/containers/containerize.jobs.yaml diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml new file mode 100644 index 0000000000..a94ea4d0af --- /dev/null +++ b/.pipelines/containers/containerize.jobs.yaml @@ -0,0 +1,68 @@ +parameters: +- name: supportedPlatforms + type: jobList + default: [] + +- name: targetOs + type: string + +- name: targetArch + type: string + + +jobs: +- ${{ each supportedPlatformJob in parameters.supportedPlatforms }}: + - ${{ each imageName in supportedPlatformJob.images }}: + - job: ${{ replace(concat(imageName, '_', supportedPlatformJob.name), '-', '_') }} + displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) + steps: + - checkout: self + + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + - bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" + env: + IMAGE: ${{ imageName }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ imageName }}-image-tag + MAKE_BUILD_CONTEXT: ${{ imageName }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ imageName }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ imageName }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ imageName }}-docker-build-args + + - template: ./container-template.steps.yaml + parameters: + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + buildContextPath: $(Build.SourcesDirectory) + targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + targetPlatform: "${{ parameters.targetOs }}/${{ parameters.targetArch }}" + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + buildOs: ${{ supportedPlatformJob.templatContext.buildOs }} + buildArch: ${{ supportedPlatformJob.templateContext.buildArch }} + buildPlatform: "${{ supportedPlatformJob.templatContext.buildOs }}/${{ supportedPlatformJob.templateContext.buildArch }}" diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index fa864bcfca..7f0c7758d1 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -73,42 +73,48 @@ stages: dependsOn: - setup - test - templateContext: - buildArch: amd64 - buildOs: linux - buildPlatform: linux/amd64 - authenticatedContainerRegistries: - - serviceConnection: $(ACR_SERVICECONNECTION) + strategy: + matrix: + linux_amd64: + os: linux + arch: amd64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + linux_arm64: + os: linux + arch: arm64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + windows_amd64: + os: windows + arch: amd64 + images: + - azure-ipam + - cni + - cns + - npm jobs: - - template: containers/container-template.jobs.yaml + - template: containerize.jobs.yaml parameters: - arch: amd64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: containers/container-template.jobs.yaml - parameters: - arch: arm64 - os: linux - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: containers/container-template.jobs.yaml - parameters: - arch: amd64 - os: windows - images: - - azure-ipam - - cni - - cns - - npm + targetOs: $(os) + targetArch: $(arch) + images: ${{ convertToJson(images) }} + supportedPlatforms: + - job: $(os)_$(arch) + templateContext: + buildArch: amd64 + buildOs: linux + buildPlatform: linux/amd64 + authenticatedContainerRegistries: + - serviceConnection: $(ACR_SERVICECONNECTION) - stage: publish From 2ad54b08ede8badc5eb450830d9df96d0967534d Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sat, 23 Nov 2024 23:01:34 -0800 Subject: [PATCH 091/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 17 +++++ .pipelines/run-pipeline.yaml | 73 ++++++++++---------- 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index a94ea4d0af..1da57ee967 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -10,6 +10,23 @@ parameters: type: string +- name: buildPlatform + type: string + default: '' + +- name: buildOs + type: string + values: + - linux + - windows + +- name: buildArch + type: string + values: + - amd64 + - arm64 + + jobs: - ${{ each supportedPlatformJob in parameters.supportedPlatforms }}: - ${{ each imageName in supportedPlatformJob.images }}: diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 7f0c7758d1..b2f47420bc 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -73,48 +73,45 @@ stages: dependsOn: - setup - test - strategy: - matrix: - linux_amd64: - os: linux - arch: amd64 - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - linux_arm64: - os: linux - arch: arm64 - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - windows_amd64: - os: windows - arch: amd64 - images: - - azure-ipam - - cni - - cns - - npm + templateContext: + authenticatedContainerRegistries: + - serviceConnection: $(ACR_SERVICECONNECTION) jobs: - template: containerize.jobs.yaml parameters: - targetOs: $(os) - targetArch: $(arch) - images: ${{ convertToJson(images) }} + buildArch: amd64 + buildOs: linux + buildPlatform: linux/amd64 supportedPlatforms: - - job: $(os)_$(arch) - templateContext: - buildArch: amd64 - buildOs: linux - buildPlatform: linux/amd64 - authenticatedContainerRegistries: - - serviceConnection: $(ACR_SERVICECONNECTION) + - template: ./containers/containerize.jobs.yaml + parameters: + targetOs: linux + targetArch: amd64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: ./containers/containerize.jobs.yaml + parameters: + targetOs: linux + targetArch: arm64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + - template: ./containers/containerize.jobs.yaml + parameters: + targetOs: windows + targetArch: amd64 + images: + - azure-ipam + - cni + - cns + - npm - stage: publish From 326c9e260781ee5a2de443d2b90f9352d6622669 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 17:00:59 -0800 Subject: [PATCH 092/136] fixup! Separate Build Changes --- .../build-variables-template.steps.yaml | 54 +++++++++ .../containers/container-template.steps.yaml | 31 ++--- .pipelines/containers/containerize.jobs.yaml | 112 +++++++++--------- .pipelines/run-pipeline.yaml | 65 +++++----- 4 files changed, 146 insertions(+), 116 deletions(-) create mode 100644 .pipelines/containers/build-variables-template.steps.yaml diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml new file mode 100644 index 0000000000..f0a0a4c899 --- /dev/null +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -0,0 +1,54 @@ +parameters: +- name: targetOs + type: string + values: + - linux + - windows + +- name: targetArch + type: string + values: + - amd64 + - arm64 + +- name: image + type: string + values: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + + +steps: +- bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" + env: + IMAGE: ${{ parameters.image }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index b986f037cc..15082a0cde 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -5,46 +5,31 @@ parameters: - name: dockerfilePath type: string -- name: targetVersion - type: string - default: "" - - name: buildContextPath type: string default: "" -- name: targetPlatform +- name: buildPlatform type: string default: "" -- name: targetOs - type: string - values: - - linux - - windows - -- name: targetArch +- name: buildArch type: string - values: - - amd64 - - arm64 - name: buildOs type: string - values: - - linux - - windows -- name: buildArch +- name: targetVersion type: string - values: - - amd64 - - arm64 + default: "" -- name: buildPlatform +- name: targetPlatform type: string default: "" +- name: targetOs + type: string + - name: addBuildArgs type: object default: "" diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 1da57ee967..505ae04a29 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -1,85 +1,79 @@ parameters: -- name: supportedPlatforms - type: jobList + +- name: images + type: object default: [] - name: targetOs type: string + default: linux + values: + - linux + - windows - name: targetArch type: string - - -- name: buildPlatform - type: string - default: '' + default: amd64 + values: + - amd64 + - arm64 - name: buildOs type: string + default: linux values: - linux - windows - name: buildArch type: string + default: amd64 values: - amd64 - arm64 +- name: buildVariablesStepTemplate + type: string + default: '' + jobs: -- ${{ each supportedPlatformJob in parameters.supportedPlatforms }}: - - ${{ each imageName in supportedPlatformJob.images }}: - - job: ${{ replace(concat(imageName, '_', supportedPlatformJob.name), '-', '_') }} - displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) - steps: - - checkout: self - - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - - bash: | - set -e - - VAR_ID="${IMAGE}_${OS}_${ARCH}" - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" - env: - IMAGE: ${{ imageName }} - OS: ${{ parameters.targetOs }} - ARCH: ${{ parameters.targetArch }} - PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - MAKE_IMAGE_TAG: ${{ imageName }}-image-tag - MAKE_BUILD_CONTEXT: ${{ imageName }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ imageName }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ imageName }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ imageName }}-docker-build-args - - - template: ./container-template.steps.yaml +- ${{ each imageName in parameters.images }}: + - job: ${{ replace(concat(imageName, '_', parameters.), '-', '_') }} + displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) + variables: + buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} + targetPlatform: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + steps: + - checkout: self + + - task: GoTool@0 + inputs: + version: $(GO_VERSION) + + + # Requires creation of the following variables: + # - IMAGE_NAME_AND_TAG_${image}_${OS}_${ARCH}} + # - DOCKERFILE_PATH_${image}_${OS}_${ARCH}} + # - IMAGE_PLATFORM_TAG_${image}_${OS}_${ARCH}} + # - EXTRA_BUILD_ARGS_$${image}_${OS}_${ARCH}} + - ${{ if parameters.buildVariablesStepTemplate }}: + - template: ${{ parameters.buildVariablesStepTemplate }} parameters: - imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - buildContextPath: $(Build.SourcesDirectory) - targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetOs: ${{ parameters.targetOs }} targetArch: ${{ parameters.targetArch }} - targetPlatform: "${{ parameters.targetOs }}/${{ parameters.targetArch }}" - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - buildOs: ${{ supportedPlatformJob.templatContext.buildOs }} - buildArch: ${{ supportedPlatformJob.templateContext.buildArch }} - buildPlatform: "${{ supportedPlatformJob.templatContext.buildOs }}/${{ supportedPlatformJob.templateContext.buildArch }}" + image: ${{ imageName }} + + + - template: ./container-template.steps.yaml + parameters: + imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + buildContextPath: $(Build.SourcesDirectory) + buildPlatform: $(buildPlatform) + buildArch: ${{ parameters.buildArch }} + buildOs: ${{ parameters.buildOs }} + targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + targetPlatform: $(targetPlatform) + targetOs: ${{ parameters.targetOs }} + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index b2f47420bc..e10e41ccd5 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -77,41 +77,38 @@ stages: authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) jobs: - - template: containerize.jobs.yaml + - template: containers/containerize.jobs.yaml parameters: - buildArch: amd64 - buildOs: linux - buildPlatform: linux/amd64 - supportedPlatforms: - - template: ./containers/containerize.jobs.yaml - parameters: - targetOs: linux - targetArch: amd64 - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: ./containers/containerize.jobs.yaml - parameters: - targetOs: linux - targetArch: arm64 - images: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - template: ./containers/containerize.jobs.yaml - parameters: - targetOs: windows - targetArch: amd64 - images: - - azure-ipam - - cni - - cns - - npm + targetOs: linux + targetArch: amd64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml + - template: containers/containerize.jobs.yaml + parameters: + targetOs: linux + targetArch: arm64 + images: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml + - template: containers/containerize.jobs.yaml + parameters: + targetOs: windows + targetArch: amd64 + images: + - azure-ipam + - cni + - cns + - npm + imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - stage: publish From 4c76fdc08abe947364d084857844c69859c9a806 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 17:03:07 -0800 Subject: [PATCH 093/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 505ae04a29..e9bf553734 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -39,7 +39,7 @@ parameters: jobs: - ${{ each imageName in parameters.images }}: - - job: ${{ replace(concat(imageName, '_', parameters.), '-', '_') }} + - job: ${{ replace(concat(imageName, '_', parameters.targetOs, '_', parameters.targetArch), '-', '_') }} displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) variables: buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} From 881f88bf0d1db66eabecf1cf257a71e9ee8dc0ee Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 17:04:32 -0800 Subject: [PATCH 094/136] 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 e10e41ccd5..13d55458d7 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -87,7 +87,7 @@ stages: - cns - ipv6-hp-bpf - npm - imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml + buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - template: containers/containerize.jobs.yaml parameters: targetOs: linux @@ -98,7 +98,7 @@ stages: - cns - ipv6-hp-bpf - npm - imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml + buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - template: containers/containerize.jobs.yaml parameters: targetOs: windows @@ -108,7 +108,7 @@ stages: - cni - cns - npm - imageBuildStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml + buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - stage: publish From dfa3508fbc575ad730eb9830db3c0c111b596f34 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 17:09:19 -0800 Subject: [PATCH 095/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index e9bf553734..39e9e62c8f 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -39,7 +39,7 @@ parameters: jobs: - ${{ each imageName in parameters.images }}: - - job: ${{ replace(concat(imageName, '_', parameters.targetOs, '_', parameters.targetArch), '-', '_') }} + - job: ${{ replace(format('{0}_{1}_{2}', imageName, parameters.targetOs, parameters.targetArch), '-', '_') }} displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) variables: buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} From dcf65dbeb501afbf02ab42fce85aa0ddab08ab31 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 18:59:48 -0800 Subject: [PATCH 096/136] fixup! Separate Build Changes --- .../containers/container-template.steps.yaml | 24 ++++++------------- .pipelines/containers/containerize.jobs.yaml | 4 +--- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 15082a0cde..848ab69703 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -7,25 +7,15 @@ parameters: - name: buildContextPath type: string - default: "" - -- name: buildPlatform - type: string - default: "" - -- name: buildArch - type: string -- name: buildOs +- name: targetVersion type: string -- name: targetVersion +- name: targetArch type: string - default: "" - name: targetPlatform type: string - default: "" - name: targetOs type: string @@ -43,15 +33,15 @@ steps: dockerfile: ${{ parameters.dockerfilePath }} path: ${{ parameters.buildContextPath }} buildArguments: | - --build-arg PLATFORM="${{ parameters.buildPlatform }}" - --build-arg ARCH="${{ parameters.buildArch }}" - --build-arg OS="${{ parameters.buildOs }}" + --build-arg DEBUG="$(System.Debug)" + --build-arg PLATFORM="${{ parameters.targetPlatform }}" + --build-arg ARCH="${{ parameters.targetArch }}" + --build-arg OS="${{ parameters.targetOs }}" --build-arg VERSION="${{ parameters.targetVersion }}" --platform "${{ parameters.targetPlatform }}" - --target "${{ parameters.targetOs }}" ${{ parameters.addBuildArgs }} enableNetwork: true - enablePull: false + enablePull: true enableCache: true useBuildKit: true diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 39e9e62c8f..096f97e8fe 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -70,10 +70,8 @@ jobs: imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) buildContextPath: $(Build.SourcesDirectory) - buildPlatform: $(buildPlatform) - buildArch: ${{ parameters.buildArch }} - buildOs: ${{ parameters.buildOs }} targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetPlatform: $(targetPlatform) + targetArch: ${ parameters.targetArch } targetOs: ${{ parameters.targetOs }} addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) From 659e896ff62f781a360e330224c9c78fd12977b6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 19:40:13 -0800 Subject: [PATCH 097/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 096f97e8fe..5e3201e49f 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -72,6 +72,6 @@ jobs: buildContextPath: $(Build.SourcesDirectory) targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetPlatform: $(targetPlatform) - targetArch: ${ parameters.targetArch } + targetArch: ${{ parameters.targetArch }} targetOs: ${{ parameters.targetOs }} addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) From 841e234653fb5987a530cb0b04d241b7cbc418ea Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 20:36:21 -0800 Subject: [PATCH 098/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.steps.yaml | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .pipelines/containers/containerize.steps.yaml diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml new file mode 100644 index 0000000000..6116d7196d --- /dev/null +++ b/.pipelines/containers/containerize.steps.yaml @@ -0,0 +1,55 @@ +parameters: +- name: targetOs + type: string + values: + - linux + - windows + +- name: targetArch + type: string + values: + - amd64 + - arm64 + +- name: image + type: string + values: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + + +steps: +- bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" + env: + IMAGE: ${{ parameters.image }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args + From dcf2e246694dafa9f798ed52d1866769249a80ca Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 20:36:44 -0800 Subject: [PATCH 099/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 848ab69703..8b5552ba4c 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -42,7 +42,7 @@ steps: ${{ parameters.addBuildArgs }} enableNetwork: true enablePull: true - enableCache: true + enableCache: false useBuildKit: true - task: 1ES.PushContainerImage@1 From ec4499ff83991247542f8e4db728476a60f7e61f Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 24 Nov 2024 21:23:00 -0800 Subject: [PATCH 100/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 8b5552ba4c..a66607e0a1 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -41,7 +41,7 @@ steps: --platform "${{ parameters.targetPlatform }}" ${{ parameters.addBuildArgs }} enableNetwork: true - enablePull: true + enablePull: false enableCache: false useBuildKit: true From b24e29817afd46eee21c6f81008c10fded632174 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 00:13:14 -0800 Subject: [PATCH 101/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index a66607e0a1..274363238d 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -42,7 +42,7 @@ steps: ${{ parameters.addBuildArgs }} enableNetwork: true enablePull: false - enableCache: false + enableCache: true useBuildKit: true - task: 1ES.PushContainerImage@1 From 4b2e1ac8a6b72e3feb61eadbe8f234916a60c40f Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 13:10:34 -0800 Subject: [PATCH 102/136] fixup! Separate Build Changes --- bpf-prog/ipv6-hp-bpf/linux.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile index 12fe515dcc..3a42ee3d55 100644 --- a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile +++ b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile @@ -1,9 +1,9 @@ # skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.23.2 --format "{{.Name}}@{{.Digest}}" +ARG ARCH FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:86c5b00bbed2a6e7157052d78bf4b45c0bf26545ed6e8fd7dbad51ac9415f534 AS builder ARG VERSION ARG DEBUG ARG OS -ARG ARCH WORKDIR /bpf-prog/ipv6-hp-bpf COPY ./bpf-prog/ipv6-hp-bpf . COPY ./bpf-prog/ipv6-hp-bpf/cmd/ipv6-hp-bpf/*.go /bpf-prog/ipv6-hp-bpf/ From c82a9f8b22d92ec9d70096c79b8c3d9e4b7f2861 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 14:32:59 -0800 Subject: [PATCH 103/136] fixup! Separate Build Changes --- .pipelines/containers/container-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml index 274363238d..69528205c4 100644 --- a/.pipelines/containers/container-template.steps.yaml +++ b/.pipelines/containers/container-template.steps.yaml @@ -38,7 +38,7 @@ steps: --build-arg ARCH="${{ parameters.targetArch }}" --build-arg OS="${{ parameters.targetOs }}" --build-arg VERSION="${{ parameters.targetVersion }}" - --platform "${{ parameters.targetPlatform }}" + --target "${{ parameters.targetOs }}" ${{ parameters.addBuildArgs }} enableNetwork: true enablePull: false From d87277615947b8bf24f03e66fd7b5230caf8587e Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 15:28:09 -0800 Subject: [PATCH 104/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 5e3201e49f..ab2213cfe4 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -44,6 +44,13 @@ jobs: variables: buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} targetPlatform: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + + ${{ if eq(parameters.targetOs, 'windows') }}: + pool: + name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) + os: windows + image: acn-runner-vmss-image-windows-1es-v2.0 + steps: - checkout: self From b7695e702ff7894fd782bb155e6725eeb163b912 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 16:12:36 -0800 Subject: [PATCH 105/136] fixup! Separate Build Changes --- .pipelines/containers/build-variables-template.steps.yaml | 2 +- bpf-prog/ipv6-hp-bpf/linux.Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index f0a0a4c899..0105021fc8 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -22,7 +22,7 @@ parameters: steps: -- bash: | +- shell: | set -e VAR_ID="${IMAGE}_${OS}_${ARCH}" diff --git a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile index 3a42ee3d55..fb4f227741 100644 --- a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile +++ b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile @@ -4,6 +4,7 @@ FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:8 ARG VERSION ARG DEBUG ARG OS +ARG ARCH WORKDIR /bpf-prog/ipv6-hp-bpf COPY ./bpf-prog/ipv6-hp-bpf . COPY ./bpf-prog/ipv6-hp-bpf/cmd/ipv6-hp-bpf/*.go /bpf-prog/ipv6-hp-bpf/ From 04d430fe929238714fd1d5a7339da9d9b1ad9b8a Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 16:15:29 -0800 Subject: [PATCH 106/136] fixup! Separate Build Changes --- .pipelines/containers/build-variables-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 0105021fc8..f1cb1e3290 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -22,7 +22,7 @@ parameters: steps: -- shell: | +- script: | set -e VAR_ID="${IMAGE}_${OS}_${ARCH}" From a1288fc686852d07f7c556e2e454f10822a69a04 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 17:38:11 -0800 Subject: [PATCH 107/136] fixup! Separate Build Changes --- .../build-variables-template.steps.yaml | 2 +- ...uild-variables-template.windows.steps.yaml | 53 +++++++++++++++++++ .pipelines/containers/containerize.jobs.yaml | 28 +++++----- .pipelines/run-pipeline.yaml | 3 -- 4 files changed, 69 insertions(+), 17 deletions(-) create mode 100644 .pipelines/containers/build-variables-template.windows.steps.yaml diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index f1cb1e3290..f0a0a4c899 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -22,7 +22,7 @@ parameters: steps: -- script: | +- bash: | set -e VAR_ID="${IMAGE}_${OS}_${ARCH}" diff --git a/.pipelines/containers/build-variables-template.windows.steps.yaml b/.pipelines/containers/build-variables-template.windows.steps.yaml new file mode 100644 index 0000000000..417a811f59 --- /dev/null +++ b/.pipelines/containers/build-variables-template.windows.steps.yaml @@ -0,0 +1,53 @@ +parameters: +- name: targetOs + type: string + values: + - linux + - windows + +- name: targetArch + type: string + values: + - amd64 + - arm64 + +- name: image + type: string + values: + - azure-ipam + - cni + - cns + - ipv6-hp-bpf + - npm + + +steps: +- pwsh: | + $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" + + $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") + Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" + + $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" + + $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" + + $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") + Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" + + $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") + Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" + displayName: "Get Image Build Data" + errorActionPreference: stop + env: + IMAGE: ${{ parameters.image }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index ab2213cfe4..7b11090404 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -32,10 +32,6 @@ parameters: - amd64 - arm64 -- name: buildVariablesStepTemplate - type: string - default: '' - jobs: - ${{ each imageName in parameters.images }}: @@ -58,27 +54,33 @@ jobs: inputs: version: $(GO_VERSION) - # Requires creation of the following variables: # - IMAGE_NAME_AND_TAG_${image}_${OS}_${ARCH}} # - DOCKERFILE_PATH_${image}_${OS}_${ARCH}} + # - BUILD_CONTEXT_${image}_${OS}_${ARCH}} # - IMAGE_PLATFORM_TAG_${image}_${OS}_${ARCH}} # - EXTRA_BUILD_ARGS_$${image}_${OS}_${ARCH}} - ${{ if parameters.buildVariablesStepTemplate }}: - - template: ${{ parameters.buildVariablesStepTemplate }} - parameters: - targetOs: ${{ parameters.targetOs }} - targetArch: ${{ parameters.targetArch }} - image: ${{ imageName }} - + - ${{ if eq(parameters.targetOs, 'windows') }}: + - template: /.pipelines/containers/build-variables-template.windows.steps.yaml + parameters: + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + image: ${{ imageName }} + - ${{ else }}: + - template: /.pipelines/containers/build-variables-template.steps.yaml + parameters: + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + image: ${{ imageName }} - template: ./container-template.steps.yaml parameters: imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - buildContextPath: $(Build.SourcesDirectory) + buildContextPath: $(BUILD_CONTEXT_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) + addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetPlatform: $(targetPlatform) targetArch: ${{ parameters.targetArch }} targetOs: ${{ parameters.targetOs }} - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 13d55458d7..862555f205 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -87,7 +87,6 @@ stages: - cns - ipv6-hp-bpf - npm - buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - template: containers/containerize.jobs.yaml parameters: targetOs: linux @@ -98,7 +97,6 @@ stages: - cns - ipv6-hp-bpf - npm - buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - template: containers/containerize.jobs.yaml parameters: targetOs: windows @@ -108,7 +106,6 @@ stages: - cni - cns - npm - buildVariablesStepTemplate: /.pipelines/containers/build-variables-template.steps.yaml - stage: publish From 26cce4f36c8e6f59af80ab6923b57630ab7870d6 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 17:41:42 -0800 Subject: [PATCH 108/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 7b11090404..07e41974f8 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -67,7 +67,7 @@ jobs: targetOs: ${{ parameters.targetOs }} targetArch: ${{ parameters.targetArch }} image: ${{ imageName }} - - ${{ else }}: + - ${{ else }}: - template: /.pipelines/containers/build-variables-template.steps.yaml parameters: targetOs: ${{ parameters.targetOs }} From ff27834434199a38cb857b5753e886f28e2f44b8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 18:51:59 -0800 Subject: [PATCH 109/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 25 ++++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 07e41974f8..2792fcd27b 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -60,19 +60,18 @@ jobs: # - BUILD_CONTEXT_${image}_${OS}_${ARCH}} # - IMAGE_PLATFORM_TAG_${image}_${OS}_${ARCH}} # - EXTRA_BUILD_ARGS_$${image}_${OS}_${ARCH}} - - ${{ if parameters.buildVariablesStepTemplate }}: - - ${{ if eq(parameters.targetOs, 'windows') }}: - - template: /.pipelines/containers/build-variables-template.windows.steps.yaml - parameters: - targetOs: ${{ parameters.targetOs }} - targetArch: ${{ parameters.targetArch }} - image: ${{ imageName }} - - ${{ else }}: - - template: /.pipelines/containers/build-variables-template.steps.yaml - parameters: - targetOs: ${{ parameters.targetOs }} - targetArch: ${{ parameters.targetArch }} - image: ${{ imageName }} + - ${{ if eq(parameters.targetOs, 'windows') }}: + - template: /.pipelines/containers/build-variables-template.windows.steps.yaml + parameters: + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + image: ${{ imageName }} + - ${{ else }}: + - template: /.pipelines/containers/build-variables-template.steps.yaml + parameters: + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + image: ${{ imageName }} - template: ./container-template.steps.yaml parameters: From 2e676335311ec49e97b35ea75be9e4f8ccabb223 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 25 Nov 2024 22:05:02 -0800 Subject: [PATCH 110/136] fixup! Separate Build Changes --- .pipelines/containers/containerize.jobs.yaml | 2 +- .pipelines/trigger.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 2792fcd27b..88d997f622 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -45,7 +45,7 @@ jobs: pool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows - image: acn-runner-vmss-image-windows-1es-v2.0 + image: acn-runner-vmss-image-windows-1es-v2.1 steps: - checkout: self diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 7b2077c1c0..c1e5dba37a 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -60,7 +60,7 @@ extends: sourceAnalysisPool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows - image: acn-runner-vmss-image-windows-1es-v2.0 + image: acn-runner-vmss-image-windows-1es-v2.1 globalSdl: #baseline: #baselineFile: $(Build.SourcesDirectory)\.config\.gdnbaselines From 2fc7d0325b65de548bd1e70d83d60ee80fa44aeb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 12:05:03 -0800 Subject: [PATCH 111/136] Clean up --- .../{ => credscan}/credScanSuppressions.json | 0 .config/{ => guardian}/.gdnsuppress | 0 .../build-variables-template.steps.yaml | 89 +++++++++++++------ ...uild-variables-template.windows.steps.yaml | 53 ----------- .../containers/container-template.jobs.yaml | 72 --------------- .../containers/container-template.steps.yaml | 51 ----------- .pipelines/containers/containerize.jobs.yaml | 24 +++-- .pipelines/containers/containerize.steps.yaml | 80 ++++++++--------- .../templates/run-unit-tests.stages.yaml | 2 +- .pipelines/trigger.yaml | 4 +- Makefile | 4 +- 11 files changed, 114 insertions(+), 265 deletions(-) rename .config/{ => credscan}/credScanSuppressions.json (100%) rename .config/{ => guardian}/.gdnsuppress (100%) delete mode 100644 .pipelines/containers/build-variables-template.windows.steps.yaml delete mode 100644 .pipelines/containers/container-template.jobs.yaml delete mode 100644 .pipelines/containers/container-template.steps.yaml diff --git a/.config/credScanSuppressions.json b/.config/credscan/credScanSuppressions.json similarity index 100% rename from .config/credScanSuppressions.json rename to .config/credscan/credScanSuppressions.json diff --git a/.config/.gdnsuppress b/.config/guardian/.gdnsuppress similarity index 100% rename from .config/.gdnsuppress rename to .config/guardian/.gdnsuppress diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index f0a0a4c899..3e9a1830b7 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -22,33 +22,66 @@ parameters: steps: -- bash: | - set -e - VAR_ID="${IMAGE}_${OS}_${ARCH}" +- ${{ if eq(parameters.targetOs, 'linux') }}: + - bash: | + set -e + + VAR_ID="${IMAGE}_${OS}_${ARCH}" + + BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") + echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" + + IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") + echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" + + IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" + env: + IMAGE: ${{ parameters.image }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" - env: - IMAGE: ${{ parameters.image }} - OS: ${{ parameters.targetOs }} - ARCH: ${{ parameters.targetArch }} - PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args +- ${{ elseif eq(parameters.targetOs, 'windows') }}: + - pwsh: | + $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" + + $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") + Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" + + $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" + + $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" + + $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") + Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" + + $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") + Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" + displayName: "Get Image Build Data" + errorActionPreference: stop + env: + IMAGE: ${{ parameters.image }} + OS: ${{ parameters.targetOs }} + ARCH: ${{ parameters.targetArch }} + PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} + MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag + MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context + MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag + MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path + MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args diff --git a/.pipelines/containers/build-variables-template.windows.steps.yaml b/.pipelines/containers/build-variables-template.windows.steps.yaml deleted file mode 100644 index 417a811f59..0000000000 --- a/.pipelines/containers/build-variables-template.windows.steps.yaml +++ /dev/null @@ -1,53 +0,0 @@ -parameters: -- name: targetOs - type: string - values: - - linux - - windows - -- name: targetArch - type: string - values: - - amd64 - - arm64 - -- name: image - type: string - values: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - - -steps: -- pwsh: | - $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" - - $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") - Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" - - $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" - - $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" - - $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") - Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" - - $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") - Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" - displayName: "Get Image Build Data" - errorActionPreference: stop - env: - IMAGE: ${{ parameters.image }} - OS: ${{ parameters.targetOs }} - ARCH: ${{ parameters.targetArch }} - PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args diff --git a/.pipelines/containers/container-template.jobs.yaml b/.pipelines/containers/container-template.jobs.yaml deleted file mode 100644 index c817657377..0000000000 --- a/.pipelines/containers/container-template.jobs.yaml +++ /dev/null @@ -1,72 +0,0 @@ -parameters: -- name: jobs - type: jobList - default: [] - -- name: arch - type: string - -- name: os - type: string - -- name: images - type: object - default: [] - - -jobs: -- ${{ each job in parameters.jobs }}: - - ${{ each image in parameters.images }}: - - job: ${{ replace(image, '-', '_') }}_${{ parameters.os }}_${{ parameters.arch }} - displayName: Build Image - (${{ image }} ${{ parameters.os }}/${{ parameters.arch }}) - steps: - - checkout: self - - - task: GoTool@0 - inputs: - version: $(GO_VERSION) - - - bash: | - set -e - - VAR_ID="${IMAGE}_${OS}_${ARCH}" - - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" - - IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" - - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_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 Build Data" - env: - IMAGE: ${{ image }} - OS: ${{ parameters.os }} - ARCH: ${{ parameters.arch }} - PLATFORM: ${{ parameters.os }}/${{ parameters.arch }} - MAKE_IMAGE_TAG: ${{ image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ image }}-docker-build-args - - - template: ./container-template.steps.yaml - parameters: - imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - dockerfilePath: $(DOCKERFILE_PATH_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - buildContextPath: $(Build.SourcesDirectory) - targetVersion: $(IMAGE_PLATFORM_TAG_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - targetOs: ${{ parameters.os }} - targetArch: ${{ parameters.arch }} - targetPlatform: "${{ parameters.os }}/${{ parameters.arch }}" - addBuildArgs: $(EXTRA_BUILD_ARGS_${{ image }}_${{ parameters.os }}_${{ parameters.arch }}) - buildOs: ${{ job.templatContext.buildOs }} - buildArch: ${{ job.templateContext.buildArch }} - buildPlatform: "${{ job.templatContext.buildOs }}/${{ job.templateContext.buildArch }}" diff --git a/.pipelines/containers/container-template.steps.yaml b/.pipelines/containers/container-template.steps.yaml deleted file mode 100644 index 69528205c4..0000000000 --- a/.pipelines/containers/container-template.steps.yaml +++ /dev/null @@ -1,51 +0,0 @@ -parameters: -- name: imageNameAndTag - type: string - -- name: dockerfilePath - type: string - -- name: buildContextPath - type: string - -- name: targetVersion - type: string - -- name: targetArch - type: string - -- name: targetPlatform - type: string - -- name: targetOs - type: string - -- name: addBuildArgs - type: object - default: "" - - -steps: -- task: 1ES.BuildContainerImage@1 - retryCountOnTaskFailure: 3 - inputs: - image: ${{ parameters.imageNameAndTag }} - dockerfile: ${{ parameters.dockerfilePath }} - path: ${{ parameters.buildContextPath }} - buildArguments: | - --build-arg DEBUG="$(System.Debug)" - --build-arg PLATFORM="${{ parameters.targetPlatform }}" - --build-arg ARCH="${{ parameters.targetArch }}" - --build-arg OS="${{ parameters.targetOs }}" - --build-arg VERSION="${{ parameters.targetVersion }}" - --target "${{ parameters.targetOs }}" - ${{ parameters.addBuildArgs }} - enableNetwork: true - enablePull: false - enableCache: true - useBuildKit: true - -- task: 1ES.PushContainerImage@1 - condition: ${{ eq(parameters.targetOs, 'windows') }} - inputs: - image: ${{ parameters.imageNameAndTag }} diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 88d997f622..cecd3cb2e6 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -37,7 +37,10 @@ jobs: - ${{ each imageName in parameters.images }}: - job: ${{ replace(format('{0}_{1}_{2}', imageName, parameters.targetOs, parameters.targetArch), '-', '_') }} displayName: Build Image - (${{ imageName }} ${{ parameters.targetOs }}/${{ parameters.targetArch }}) - variables: + # This can be removed after we verify that an increase in agent pool improves the run time. + timeoutInMinutes: 120 + + variables: buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} targetPlatform: ${{ parameters.targetOs }}/${{ parameters.targetArch }} @@ -60,20 +63,13 @@ jobs: # - BUILD_CONTEXT_${image}_${OS}_${ARCH}} # - IMAGE_PLATFORM_TAG_${image}_${OS}_${ARCH}} # - EXTRA_BUILD_ARGS_$${image}_${OS}_${ARCH}} - - ${{ if eq(parameters.targetOs, 'windows') }}: - - template: /.pipelines/containers/build-variables-template.windows.steps.yaml - parameters: - targetOs: ${{ parameters.targetOs }} - targetArch: ${{ parameters.targetArch }} - image: ${{ imageName }} - - ${{ else }}: - - template: /.pipelines/containers/build-variables-template.steps.yaml - parameters: - targetOs: ${{ parameters.targetOs }} - targetArch: ${{ parameters.targetArch }} - image: ${{ imageName }} + - template: /.pipelines/containers/build-variables-template.steps.yaml + parameters: + targetOs: ${{ parameters.targetOs }} + targetArch: ${{ parameters.targetArch }} + image: ${{ imageName }} - - template: ./container-template.steps.yaml + - template: ./containerize.steps.yaml parameters: imageNameAndTag: $(IMAGE_NAME_AND_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) dockerfilePath: $(DOCKERFILE_PATH_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 6116d7196d..69528205c4 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -1,55 +1,51 @@ parameters: -- name: targetOs +- name: imageNameAndTag type: string - values: - - linux - - windows -- name: targetArch +- name: dockerfilePath type: string - values: - - amd64 - - arm64 -- name: image +- name: buildContextPath type: string - values: - - azure-ipam - - cni - - cns - - ipv6-hp-bpf - - npm - -steps: -- bash: | - set -e - - VAR_ID="${IMAGE}_${OS}_${ARCH}" +- name: targetVersion + type: string - BUILD_CONTEXT=$(make "$MAKE_BUILD_CONTEXT") - echo >&2 "##vso[task.setvariable variable=BUILD_CONTEXT_${VAR_ID};]$BUILD_CONTEXT" +- name: targetArch + type: string - IMAGE_PLATFORM_TAG=$(make "$MAKE_IMAGE_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_${VAR_ID};]$IMAGE_PLATFORM_TAG" +- name: targetPlatform + type: string - IMAGE_NAME_AND_TAG=$(make "$MAKE_IMAGE_NAME_AND_TAG") - echo >&2 "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_${VAR_ID};]$IMAGE_NAME_AND_TAG" +- name: targetOs + type: string - DOCKERFILE_PATH=$(make "$MAKE_DOCKERFILE_PATH") - echo >&2 "##vso[task.setvariable variable=DOCKERFILE_PATH_${VAR_ID};]$DOCKERFILE_PATH" +- name: addBuildArgs + type: object + default: "" - 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 Build Data" - env: - IMAGE: ${{ parameters.image }} - OS: ${{ parameters.targetOs }} - ARCH: ${{ parameters.targetArch }} - PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args +steps: +- task: 1ES.BuildContainerImage@1 + retryCountOnTaskFailure: 3 + inputs: + image: ${{ parameters.imageNameAndTag }} + dockerfile: ${{ parameters.dockerfilePath }} + path: ${{ parameters.buildContextPath }} + buildArguments: | + --build-arg DEBUG="$(System.Debug)" + --build-arg PLATFORM="${{ parameters.targetPlatform }}" + --build-arg ARCH="${{ parameters.targetArch }}" + --build-arg OS="${{ parameters.targetOs }}" + --build-arg VERSION="${{ parameters.targetVersion }}" + --target "${{ parameters.targetOs }}" + ${{ parameters.addBuildArgs }} + enableNetwork: true + enablePull: false + enableCache: true + useBuildKit: true + +- task: 1ES.PushContainerImage@1 + condition: ${{ eq(parameters.targetOs, 'windows') }} + inputs: + image: ${{ parameters.imageNameAndTag }} diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index 7075cdfdac..826ceea581 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -38,7 +38,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)" os: windows - image: acn-runner-vmss-image-windows-1es-v2.0 + image: acn-runner-vmss-image-windows-1es-v2.1 jobs: - job: test displayName: Run Tests diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index c1e5dba37a..b38e7f0ca6 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -66,11 +66,11 @@ extends: #baselineFile: $(Build.SourcesDirectory)\.config\.gdnbaselines #suppressionSet: default suppression: - suppressionFile: $(Build.SourcesDirectory)\.config\.gdnsuppress + suppressionFile: $(Build.SourcesDirectory)/.config/guardian/.gdnsuppress suppressionSet: default credscan: enabled: true - suppressionsFileForArtifacts: $(Build.SourcesDirectory)/.config/credScanSuppressions.json + suppressionsFileForArtifacts: $(Build.SourcesDirectory)/.config/credscan/credScanSuppressions.json codeql: # Enables CodeQL on the main branch compiled: diff --git a/Makefile b/Makefile index 2ceb878651..f8281bee58 100644 --- a/Makefile +++ b/Makefile @@ -372,7 +372,7 @@ acncli-image-pull: ## pull cni-manager container image. azure-ipam-image-name: # util target to print the azure-ipam image name. @echo $(AZURE_IPAM_IMAGE) -azure-ipam-image-tag: +azure-ipam-image-tag: @echo $(AZURE_IPAM_PLATFORM_TAG) azure-ipam-image-name-and-tag: # util target to print the azure-ipam image name and tag. @@ -460,7 +460,7 @@ ipv6-hp-bpf-image-pull: ## pull ipv6-hp-bpf container image. cni-image-name: # util target to print the cni image name. @echo $(CNI_IMAGE) -cni-image-tag: +cni-image-tag: @echo $(CNI_PLATFORM_TAG) cni-image-name-and-tag: # util target to print the cni image name and tag. From 747f35569d2ac1f3693345a1dad598938f425c52 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 13:12:50 -0800 Subject: [PATCH 112/136] fixup! Clean up --- .pipelines/containers/build-variables-template.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 3e9a1830b7..54da66d391 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -56,7 +56,7 @@ steps: MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args - ${{ elseif eq(parameters.targetOs, 'windows') }}: - - pwsh: | + - powershell: | $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") From 6c94cab0bfc0aba8c60e958cd00e33fc579c3cd2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 16:25:48 -0800 Subject: [PATCH 113/136] fixup! Clean up --- .../containers/build-variables-template.steps.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 54da66d391..35485b789a 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -59,19 +59,19 @@ steps: - powershell: | $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" - $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") + $env:BUILD_CONTEXT = (cmake "$env:MAKE_BUILD_CONTEXT") Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" - $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") + $env:IMAGE_PLATFORM_TAG = (cmake "$env:MAKE_IMAGE_TAG") Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" - $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") + $env:IMAGE_NAME_AND_TAG = (cmake "$env:MAKE_IMAGE_NAME_AND_TAG") Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" - $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") + $env:DOCKERFILE_PATH = (cmake "$env:MAKE_DOCKERFILE_PATH") Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" - $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") + $env:EXTRA_BUILD_ARGS = (cmake "$env:MAKE_EXTRA_BUILD_ARGS") Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" errorActionPreference: stop From 5582878962421c3569431276e82c581039246ab9 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 17:45:24 -0800 Subject: [PATCH 114/136] fixup! Clean up --- .../build-variables-template.steps.yaml | 10 +-- .pipelines/run-pipeline.yaml | 77 ++++++++++--------- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 35485b789a..54da66d391 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -59,19 +59,19 @@ steps: - powershell: | $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" - $env:BUILD_CONTEXT = (cmake "$env:MAKE_BUILD_CONTEXT") + $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" - $env:IMAGE_PLATFORM_TAG = (cmake "$env:MAKE_IMAGE_TAG") + $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" - $env:IMAGE_NAME_AND_TAG = (cmake "$env:MAKE_IMAGE_NAME_AND_TAG") + $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" - $env:DOCKERFILE_PATH = (cmake "$env:MAKE_DOCKERFILE_PATH") + $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" - $env:EXTRA_BUILD_ARGS = (cmake "$env:MAKE_EXTRA_BUILD_ARGS") + $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" errorActionPreference: stop diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 862555f205..c2f80d932d 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -5,26 +5,26 @@ stages: - job: env displayName: Setup 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 - BUILD_NUMBER=$(Build.BuildNumber) - echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" - echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))" - echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" - echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" - cat /etc/os-release - uname -a - sudo chown -R $(whoami):$(whoami) . - go version - go env - which go - echo $PATH - echo "------" - echo $(Build.QueuedBy) - echo $(Build.Reason) # manual, PR, IndividualCI - echo $(Build.SourceBranch) - name: "EnvironmentalVariables" - displayName: "Set environmental variables" + - 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) + echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})" + echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))" + echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)" + echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)" + cat /etc/os-release + uname -a + sudo chown -R $(whoami):$(whoami) . + go version + go env + which go + echo $PATH + echo "------" + echo $(Build.QueuedBy) + echo $(Build.Reason) # manual, PR, IndividualCI + echo $(Build.SourceBranch) + name: "EnvironmentalVariables" + displayName: "Set environmental variables" - template: templates/run-unit-tests.stages.yaml @@ -32,8 +32,8 @@ stages: - stage: binaries displayName: Build Binaries dependsOn: - - setup - - test + - setup + - test jobs: - job: build displayName: Build Binaries @@ -71,8 +71,8 @@ stages: - stage: containerize displayName: Build Images dependsOn: - - setup - - test + - setup + - test templateContext: authenticatedContainerRegistries: - serviceConnection: $(ACR_SERVICECONNECTION) @@ -99,6 +99,7 @@ stages: - npm - template: containers/containerize.jobs.yaml parameters: + buildOs: windows targetOs: windows targetArch: amd64 images: @@ -111,7 +112,7 @@ stages: - stage: publish displayName: Publish Multiarch Manifests dependsOn: - - containerize + - containerize variables: Packaging.EnableSBOMSigning: false jobs: @@ -290,19 +291,19 @@ stages: 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 + - 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 variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: From 11403aaf956b0726939fbbb4e17134d44c4df676 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 18:48:44 -0800 Subject: [PATCH 115/136] fixup! Clean up --- .../build-variables-template.steps.yaml | 8 +++++++- .pipelines/containers/containerize.jobs.yaml | 16 +--------------- .pipelines/run-pipeline.yaml | 1 - 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 54da66d391..991e484dc5 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -56,7 +56,13 @@ steps: MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args - ${{ elseif eq(parameters.targetOs, 'windows') }}: - - powershell: | + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' # string. Required. Version spec. Default: 3.x. + addToPath: true # boolean. Add to PATH. Default: true. + architecture: 'x64' + + - pwsh: | $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index cecd3cb2e6..a6691d43e5 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -18,20 +18,6 @@ parameters: - amd64 - arm64 -- name: buildOs - type: string - default: linux - values: - - linux - - windows - -- name: buildArch - type: string - default: amd64 - values: - - amd64 - - arm64 - jobs: - ${{ each imageName in parameters.images }}: @@ -48,7 +34,7 @@ jobs: pool: name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) os: windows - image: acn-runner-vmss-image-windows-1es-v2.1 + image: acn-runner-vmss-image-windows-1es-v2.0 steps: - checkout: self diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index c2f80d932d..07775d9996 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -99,7 +99,6 @@ stages: - npm - template: containers/containerize.jobs.yaml parameters: - buildOs: windows targetOs: windows targetArch: amd64 images: From 9f8fe7b55b32d30fcffabee086eeb9d41b3ef8f7 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 19:42:43 -0800 Subject: [PATCH 116/136] fixup! Clean up --- .../build-variables-template.steps.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 991e484dc5..0bcf5bbeb2 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -63,22 +63,22 @@ steps: architecture: 'x64' - pwsh: | - $env:VAR_ID = "$env:IMAGE_$env:OS_$env:ARCH" + $VAR_ID = '{0}_{1}_{2}' -f $env:IMAGE, $env:OS, $env:ARCH - $env:BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") - Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$env:VAR_ID;]$env:BUILD_CONTEXT" + $BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") + Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" - $env:IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$env:IMAGE_PLATFORM_TAG" + $IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$IMAGE_PLATFORM_TAG" - $env:IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$env:IMAGE_NAME_AND_TAG" + $IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") + Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$IMAGE_NAME_AND_TAG" - $env:DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") - Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$env:DOCKERFILE_PATH" + $DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") + Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$DOCKERFILE_PATH" - $env:EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") - Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$env:EXTRA_BUILD_ARGS" + $EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") + Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" errorActionPreference: stop env: From dde76fb6cb250fd32b5ea486f8e66b65d8f7f2d2 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 21:28:20 -0800 Subject: [PATCH 117/136] fixup! Clean up --- .../containers/build-variables-template.steps.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 0bcf5bbeb2..9dd0d0850e 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -66,19 +66,19 @@ steps: $VAR_ID = '{0}_{1}_{2}' -f $env:IMAGE, $env:OS, $env:ARCH $BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") - Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" + echo "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" $IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$IMAGE_PLATFORM_TAG" + echo "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$IMAGE_PLATFORM_TAG" $IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$IMAGE_NAME_AND_TAG" + echo "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$IMAGE_NAME_AND_TAG" $DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") - Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$DOCKERFILE_PATH" + echo "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$DOCKERFILE_PATH" $EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") - Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$EXTRA_BUILD_ARGS" + echo "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" errorActionPreference: stop env: From 4d5934a2b0525b1fb1fb8ea81bfa0f22bf974050 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 21:31:29 -0800 Subject: [PATCH 118/136] fixup! Clean up --- .../containers/build-variables-template.steps.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 9dd0d0850e..cb6213509f 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -66,19 +66,19 @@ steps: $VAR_ID = '{0}_{1}_{2}' -f $env:IMAGE, $env:OS, $env:ARCH $BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") - echo "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" + Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" $IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") - echo "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$env:VAR_ID;]$IMAGE_PLATFORM_TAG" + Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$VAR_ID;]$IMAGE_PLATFORM_TAG" $IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") - echo "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$env:VAR_ID;]$IMAGE_NAME_AND_TAG" + Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$VAR_ID;]$IMAGE_NAME_AND_TAG" $DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") - echo "##vso[task.setvariable variable=DOCKERFILE_PATH_$env:VAR_ID;]$DOCKERFILE_PATH" + Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$VAR_ID;]$DOCKERFILE_PATH" $EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") - echo "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$env:VAR_ID;]$EXTRA_BUILD_ARGS" + Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$VAR_ID;]$EXTRA_BUILD_ARGS" displayName: "Get Image Build Data" errorActionPreference: stop env: From 30bba2058dda441d5f9553a0d99a7af55bdb0f46 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Tue, 26 Nov 2024 23:04:58 -0800 Subject: [PATCH 119/136] fixup! Clean up --- .pipelines/containers/build-variables-template.steps.yaml | 3 +++ .pipelines/containers/containerize.steps.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index cb6213509f..3e2fc0ac57 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -82,6 +82,9 @@ steps: displayName: "Get Image Build Data" errorActionPreference: stop env: + CONTAINER_BUILDER: docker + CONTAINER_RUNTIME: docker + CONTAINER_TRANSPORT: docker IMAGE: ${{ parameters.image }} OS: ${{ parameters.targetOs }} ARCH: ${{ parameters.targetArch }} diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 69528205c4..061af0f594 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -43,7 +43,7 @@ steps: enableNetwork: true enablePull: false enableCache: true - useBuildKit: true + useBuildKit: ${{ eq(parameters.targetOs, 'linux') }} - task: 1ES.PushContainerImage@1 condition: ${{ eq(parameters.targetOs, 'windows') }} From 2d3dcb1b850e4076e316b412e547a6f1d3d13084 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 27 Nov 2024 00:06:03 -0800 Subject: [PATCH 120/136] fixup! Clean up --- .../build-variables-template.steps.yaml | 80 +++++++++---------- .pipelines/containers/containerize.jobs.yaml | 10 +-- .pipelines/containers/containerize.steps.yaml | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.pipelines/containers/build-variables-template.steps.yaml b/.pipelines/containers/build-variables-template.steps.yaml index 3e2fc0ac57..b4ce1fc830 100644 --- a/.pipelines/containers/build-variables-template.steps.yaml +++ b/.pipelines/containers/build-variables-template.steps.yaml @@ -23,7 +23,7 @@ parameters: steps: -- ${{ if eq(parameters.targetOs, 'linux') }}: +#- ${{ if eq(parameters.targetOs, 'linux') }}: - bash: | set -e @@ -55,42 +55,42 @@ steps: MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args -- ${{ elseif eq(parameters.targetOs, 'windows') }}: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' # string. Required. Version spec. Default: 3.x. - addToPath: true # boolean. Add to PATH. Default: true. - architecture: 'x64' - - - pwsh: | - $VAR_ID = '{0}_{1}_{2}' -f $env:IMAGE, $env:OS, $env:ARCH - - $BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") - Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" - - $IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$VAR_ID;]$IMAGE_PLATFORM_TAG" - - $IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") - Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$VAR_ID;]$IMAGE_NAME_AND_TAG" - - $DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") - Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$VAR_ID;]$DOCKERFILE_PATH" - - $EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") - Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$VAR_ID;]$EXTRA_BUILD_ARGS" - displayName: "Get Image Build Data" - errorActionPreference: stop - env: - CONTAINER_BUILDER: docker - CONTAINER_RUNTIME: docker - CONTAINER_TRANSPORT: docker - IMAGE: ${{ parameters.image }} - OS: ${{ parameters.targetOs }} - ARCH: ${{ parameters.targetArch }} - PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag - MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context - MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag - MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path - MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args +#- ${{ elseif eq(parameters.targetOs, 'windows') }}: +# - task: UsePythonVersion@0 +# inputs: +# versionSpec: '3.x' # string. Required. Version spec. Default: 3.x. +# addToPath: true # boolean. Add to PATH. Default: true. +# architecture: 'x64' +# +# - pwsh: | +# $VAR_ID = '{0}_{1}_{2}' -f $env:IMAGE, $env:OS, $env:ARCH +# +# $BUILD_CONTEXT = (make "$env:MAKE_BUILD_CONTEXT") +# Write-Host "##vso[task.setvariable variable=BUILD_CONTEXT_$VAR_ID;]$BUILD_CONTEXT" +# +# $IMAGE_PLATFORM_TAG = (make "$env:MAKE_IMAGE_TAG") +# Write-Host "##vso[task.setvariable variable=IMAGE_PLATFORM_TAG_$VAR_ID;]$IMAGE_PLATFORM_TAG" +# +# $IMAGE_NAME_AND_TAG = (make "$env:MAKE_IMAGE_NAME_AND_TAG") +# Write-Host "##vso[task.setvariable variable=IMAGE_NAME_AND_TAG_$VAR_ID;]$IMAGE_NAME_AND_TAG" +# +# $DOCKERFILE_PATH = (make "$env:MAKE_DOCKERFILE_PATH") +# Write-Host "##vso[task.setvariable variable=DOCKERFILE_PATH_$VAR_ID;]$DOCKERFILE_PATH" +# +# $EXTRA_BUILD_ARGS = (make "$env:MAKE_EXTRA_BUILD_ARGS") +# Write-Host "##vso[task.setvariable variable=EXTRA_BUILD_ARGS_$VAR_ID;]$EXTRA_BUILD_ARGS" +# displayName: "Get Image Build Data" +# errorActionPreference: stop +# env: +# CONTAINER_BUILDER: docker +# CONTAINER_RUNTIME: docker +# CONTAINER_TRANSPORT: docker +# IMAGE: ${{ parameters.image }} +# OS: ${{ parameters.targetOs }} +# ARCH: ${{ parameters.targetArch }} +# PLATFORM: ${{ parameters.targetOs }}/${{ parameters.targetArch }} +# MAKE_IMAGE_TAG: ${{ parameters.image }}-image-tag +# MAKE_BUILD_CONTEXT: ${{ parameters.image }}-image-build-context +# MAKE_IMAGE_NAME_AND_TAG: ${{ parameters.image }}-image-name-and-tag +# MAKE_DOCKERFILE_PATH: ${{ parameters.image }}-dockerfile-path +# MAKE_EXTRA_BUILD_ARGS: ${{ parameters.image }}-docker-build-args diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index a6691d43e5..7fd2127bbe 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -30,11 +30,11 @@ jobs: buildPlatform: ${{ parameters.buildOs }}/${{ parameters.buildArch }} targetPlatform: ${{ parameters.targetOs }}/${{ parameters.targetArch }} - ${{ if eq(parameters.targetOs, 'windows') }}: - pool: - name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) - os: windows - image: acn-runner-vmss-image-windows-1es-v2.0 +# ${{ if eq(parameters.targetOs, 'windows') }}: +# pool: +# name: $(BUILD_POOL_NAME_DEFAULT_WINDOWS) +# os: windows +# image: acn-runner-vmss-image-windows-1es-v2.0 steps: - checkout: self diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 061af0f594..69528205c4 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -43,7 +43,7 @@ steps: enableNetwork: true enablePull: false enableCache: true - useBuildKit: ${{ eq(parameters.targetOs, 'linux') }} + useBuildKit: true - task: 1ES.PushContainerImage@1 condition: ${{ eq(parameters.targetOs, 'windows') }} From 285dd01d6d467730ce34ec8a69159b14750a50fb Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 27 Nov 2024 12:41:34 -0800 Subject: [PATCH 121/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 69528205c4..b42bd8878c 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -41,9 +41,10 @@ steps: --target "${{ parameters.targetOs }}" ${{ parameters.addBuildArgs }} enableNetwork: true - enablePull: false - enableCache: true + enableCache: false useBuildKit: true + enablePull: false +# {{ eq(parameters.targetOs, 'windows') }} - task: 1ES.PushContainerImage@1 condition: ${{ eq(parameters.targetOs, 'windows') }} From f755ca4e5513a82717a109f9fc4146b67b317931 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 27 Nov 2024 14:27:09 -0800 Subject: [PATCH 122/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index b42bd8878c..69087ce3b2 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -26,6 +26,10 @@ parameters: steps: +- bash: | + docker build buildx ls + # rm ~/.docker/config.json + - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 inputs: @@ -33,6 +37,7 @@ steps: dockerfile: ${{ parameters.dockerfilePath }} path: ${{ parameters.buildContextPath }} buildArguments: | + --debug --build-arg DEBUG="$(System.Debug)" --build-arg PLATFORM="${{ parameters.targetPlatform }}" --build-arg ARCH="${{ parameters.targetArch }}" @@ -41,10 +46,9 @@ steps: --target "${{ parameters.targetOs }}" ${{ parameters.addBuildArgs }} enableNetwork: true - enableCache: false - useBuildKit: true + enableCache: true + useBuildKit: ${{ eq(parameters.targetOs, 'linux') }} enablePull: false -# {{ eq(parameters.targetOs, 'windows') }} - task: 1ES.PushContainerImage@1 condition: ${{ eq(parameters.targetOs, 'windows') }} From 7c5854610ba0eba6df230ca3d2e97da2c98ad29f Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 27 Nov 2024 14:39:46 -0800 Subject: [PATCH 123/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 69087ce3b2..f923efcf3d 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -27,7 +27,7 @@ parameters: steps: - bash: | - docker build buildx ls + docker buildx ls # rm ~/.docker/config.json - task: 1ES.BuildContainerImage@1 From 422953252eacab6d2aaea3352ffe53393fa5e4b9 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Wed, 27 Nov 2024 22:54:53 -0800 Subject: [PATCH 124/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index f923efcf3d..1291870864 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -29,6 +29,9 @@ steps: - bash: | docker buildx ls # rm ~/.docker/config.json + # Pull windows image to allow building windows images on the Linux platform. + docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2019 + docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2022 - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 From e5d22f05a481b9bf3461301ac348f1bbfe155912 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 29 Nov 2024 17:10:55 -0800 Subject: [PATCH 125/136] fixup! Clean up --- .pipelines/containers/containerize.jobs.yaml | 2 +- .pipelines/containers/containerize.steps.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index 7fd2127bbe..ecc521641d 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -62,6 +62,6 @@ jobs: buildContextPath: $(BUILD_CONTEXT_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - targetPlatform: $(targetPlatform) + targetPlatform: $(targetPlatform),linux/${{ parameters.targetArch }} targetArch: ${{ parameters.targetArch }} targetOs: ${{ parameters.targetOs }} diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 1291870864..dc27bc30e1 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -32,6 +32,7 @@ steps: # Pull windows image to allow building windows images on the Linux platform. docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2019 docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2022 + displayName: Pull Required Images - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 From e67819b34629874b2238d409a8b3c88092741ac0 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 29 Nov 2024 17:12:56 -0800 Subject: [PATCH 126/136] fixup! Clean up --- bpf-prog/ipv6-hp-bpf/linux.Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile index fb4f227741..12fe515dcc 100644 --- a/bpf-prog/ipv6-hp-bpf/linux.Dockerfile +++ b/bpf-prog/ipv6-hp-bpf/linux.Dockerfile @@ -1,5 +1,4 @@ # skopeo inspect docker://mcr.microsoft.com/oss/go/microsoft/golang:1.23.2 --format "{{.Name}}@{{.Digest}}" -ARG ARCH FROM --platform=linux/${ARCH} mcr.microsoft.com/oss/go/microsoft/golang@sha256:86c5b00bbed2a6e7157052d78bf4b45c0bf26545ed6e8fd7dbad51ac9415f534 AS builder ARG VERSION ARG DEBUG From 30b5e08f0d64571d3d068726e3ed62fcf0f067c8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 29 Nov 2024 18:13:10 -0800 Subject: [PATCH 127/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index dc27bc30e1..3bca8e69c9 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -26,13 +26,13 @@ parameters: steps: -- bash: | - docker buildx ls - # rm ~/.docker/config.json - # Pull windows image to allow building windows images on the Linux platform. - docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2019 - docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2022 - displayName: Pull Required Images +#- bash: | +# docker buildx ls +# # rm ~/.docker/config.json +# # Pull windows image to allow building windows images on the Linux platform. +# docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2019 +# docker pull --platform windows mcr.microsoft.com/windows/servercore:ltsc2022 +# displayName: Pull Required Images - task: 1ES.BuildContainerImage@1 retryCountOnTaskFailure: 3 From cabc4792fcd407e5121af4fae44c2ae7605281b1 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 29 Nov 2024 19:21:02 -0800 Subject: [PATCH 128/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index 3bca8e69c9..eca1c4a1ad 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -43,6 +43,7 @@ steps: buildArguments: | --debug --build-arg DEBUG="$(System.Debug)" + --platform "${{ parameters.targetPlatform }}" --build-arg PLATFORM="${{ parameters.targetPlatform }}" --build-arg ARCH="${{ parameters.targetArch }}" --build-arg OS="${{ parameters.targetOs }}" From e346cd0e17abe35d19097891cd0533a06f605be8 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 29 Nov 2024 22:06:58 -0800 Subject: [PATCH 129/136] fixup! Clean up --- .pipelines/containers/containerize.steps.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.pipelines/containers/containerize.steps.yaml b/.pipelines/containers/containerize.steps.yaml index eca1c4a1ad..b35ab9ff64 100644 --- a/.pipelines/containers/containerize.steps.yaml +++ b/.pipelines/containers/containerize.steps.yaml @@ -43,7 +43,6 @@ steps: buildArguments: | --debug --build-arg DEBUG="$(System.Debug)" - --platform "${{ parameters.targetPlatform }}" --build-arg PLATFORM="${{ parameters.targetPlatform }}" --build-arg ARCH="${{ parameters.targetArch }}" --build-arg OS="${{ parameters.targetOs }}" @@ -52,8 +51,8 @@ steps: ${{ parameters.addBuildArgs }} enableNetwork: true enableCache: true - useBuildKit: ${{ eq(parameters.targetOs, 'linux') }} - enablePull: false + useBuildKit: true + enablePull: true - task: 1ES.PushContainerImage@1 condition: ${{ eq(parameters.targetOs, 'windows') }} From 8d2af252fd4ebc9ebef63b03be58417288bd5377 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Mon, 2 Dec 2024 15:44:10 -0800 Subject: [PATCH 130/136] fixup! Clean up --- .pipelines/containers/containerize.jobs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/containers/containerize.jobs.yaml b/.pipelines/containers/containerize.jobs.yaml index ecc521641d..7fd2127bbe 100644 --- a/.pipelines/containers/containerize.jobs.yaml +++ b/.pipelines/containers/containerize.jobs.yaml @@ -62,6 +62,6 @@ jobs: buildContextPath: $(BUILD_CONTEXT_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) targetVersion: $(IMAGE_PLATFORM_TAG_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) addBuildArgs: $(EXTRA_BUILD_ARGS_${{ imageName }}_${{ parameters.targetOs }}_${{ parameters.targetArch }}) - targetPlatform: $(targetPlatform),linux/${{ parameters.targetArch }} + targetPlatform: $(targetPlatform) targetArch: ${{ parameters.targetArch }} targetOs: ${{ parameters.targetOs }} From f4adfa4e80d29fc03e56e2746de37f6241d1c05f Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Thu, 5 Dec 2024 11:15:59 -0800 Subject: [PATCH 131/136] Add Platform Defs --- cni/Dockerfile | 2 +- cns/Dockerfile | 2 +- npm/windows.Dockerfile | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cni/Dockerfile b/cni/Dockerfile index 681ad05c14..79845fc339 100644 --- a/cni/Dockerfile +++ b/cni/Dockerfile @@ -52,6 +52,6 @@ COPY --from=dropgz /go/bin/dropgz dropgz ENTRYPOINT [ "/dropgz" ] # skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" -FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows +FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows COPY --from=dropgz /go/bin/dropgz dropgz.exe ENTRYPOINT [ "/dropgz.exe" ] diff --git a/cns/Dockerfile b/cns/Dockerfile index 7ab48d8d08..37ff9c7485 100644 --- a/cns/Dockerfile +++ b/cns/Dockerfile @@ -31,7 +31,7 @@ ENTRYPOINT [ "/usr/local/bin/azure-cns" ] EXPOSE 10090 # skopeo inspect docker://mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 --format "{{.Name}}@{{.Digest}}" -FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows +FROM --platform=windows/${ARCH} mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image@sha256:b4c9637e032f667c52d1eccfa31ad8c63f1b035e8639f3f48a510536bf34032b as windows COPY --from=builder /azure-container-networking/cns/kubeconfigtemplate.yaml kubeconfigtemplate.yaml COPY --from=builder /azure-container-networking/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /go/bin/azure-cns /azure-cns.exe diff --git a/npm/windows.Dockerfile b/npm/windows.Dockerfile index 9edae66a12..7007131dce 100644 --- a/npm/windows.Dockerfile +++ b/npm/windows.Dockerfile @@ -8,7 +8,7 @@ COPY . . RUN GOOS=windows CGO_ENABLED=0 go build -v -o /usr/local/bin/azure-npm.exe -ldflags "-X main.version="$VERSION" -X "$NPM_AI_PATH"="$NPM_AI_ID"" -gcflags="-dwarflocationlists=true" npm/cmd/*.go # intermediate for win-ltsc2022 -FROM mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as windows +FROM --platform=windows/amd64 mcr.microsoft.com/windows/servercore@sha256:45952938708fbde6ec0b5b94de68bcdec3f8c838be018536b1e9e5bd95e6b943 as windows COPY --from=builder /usr/local/src/npm/examples/windows/kubeconfigtemplate.yaml kubeconfigtemplate.yaml COPY --from=builder /usr/local/src/npm/examples/windows/setkubeconfigpath.ps1 setkubeconfigpath.ps1 COPY --from=builder /usr/local/src/npm/examples/windows/setkubeconfigpath-capz.ps1 setkubeconfigpath-capz.ps1 From 7958233df2183e4ff62f71157e87cd010c631a3c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 12 Jan 2025 22:20:55 -0800 Subject: [PATCH 132/136] fixup! Add Platform Defs --- .pipelines/trigger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index b38e7f0ca6..1548573532 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -32,7 +32,7 @@ resources: variables: # Local analysis is only enabled on PR branches Codeql.AnalyzeInPipeline: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')] -# Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) + Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) # Codeql.ADO.Build.Repository.Name: $(Build.Repository.Name) # Codeql.ADO.Build.SourceVersion: $(Build.SourceVersion) # Codeql.ADO.Build.DefinitionName: $(Build.DefinitionName) From fbc0285b78f91930bba84e145d43ebe231d5e36a Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 12 Jan 2025 22:49:49 -0800 Subject: [PATCH 133/136] fixup! Add Platform Defs --- .pipelines/trigger.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 1548573532..9ed21c9ca4 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -42,7 +42,7 @@ variables: # Codeql.ADO.System.JobId: $(System.JobId) # Codeql.ADO.Build.Repository.LocalPath: $(Build.Repository.LocalPath) # Codeql.ADO.Build.SourceBranch: $(Build.SourceBranch) -# Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) + Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) # Codeql.ADO.Build.SourceBranchName: $(Build.SourceBranchName) # Codeql.ADO.Build.SourcesDirectory: $(Build.SourcesDirectory) @@ -79,4 +79,4 @@ extends: ${{ if startsWith(variables['Build.SourceBranch'], 'refs/pull/') }}: enabledOnNonDefaultBranches: true stages: - - template: /.pipelines/run-pipeline.yaml + - template: /.pipelines/run-pipeline.yaml@self From ae3a295ffab48b620f32c6ece06c2ada8d33fc45 Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Sun, 12 Jan 2025 22:50:42 -0800 Subject: [PATCH 134/136] fixup! Add Platform Defs --- .pipelines/trigger.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 9ed21c9ca4..a2b61b6a52 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -33,6 +33,7 @@ variables: # Local analysis is only enabled on PR branches Codeql.AnalyzeInPipeline: $[startsWith(variables['Build.SourceBranch'], 'refs/pull/')] Codeql.ADO.Build.Repository.Uri: $(Build.Repository.Uri) + Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) # Codeql.ADO.Build.Repository.Name: $(Build.Repository.Name) # Codeql.ADO.Build.SourceVersion: $(Build.SourceVersion) # Codeql.ADO.Build.DefinitionName: $(Build.DefinitionName) @@ -42,7 +43,6 @@ variables: # Codeql.ADO.System.JobId: $(System.JobId) # Codeql.ADO.Build.Repository.LocalPath: $(Build.Repository.LocalPath) # Codeql.ADO.Build.SourceBranch: $(Build.SourceBranch) - Codeql.ADO.Build.Repository.Provider: $(Build.Repository.Provider) # Codeql.ADO.Build.SourceBranchName: $(Build.SourceBranchName) # Codeql.ADO.Build.SourcesDirectory: $(Build.SourcesDirectory) From 8dbb6a7d55c19fe4972ee6e58700decafe81f52c Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 7 Mar 2025 16:59:48 -0800 Subject: [PATCH 135/136] Update Image Version --- .pipelines/multitenancy/swiftv2-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/aks/aks-e2e.jobs.yaml | 2 +- .../azure-cni-overlay-stateless-e2e.jobs.yaml | 2 +- .../azure-cni-overlay/add-windows-nodepool.jobs.yaml | 2 +- .../azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml | 4 ++-- .../cilium-dualstackoverlay-e2e.jobs.yaml | 2 +- .../cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml | 2 +- .../cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml | 2 +- .../singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml | 4 ++-- .../dualstack-overlay/dualstackoverlay-e2e.jobs.yaml | 4 ++-- .pipelines/templates/run-unit-tests.stages.yaml | 2 +- .pipelines/trigger.yaml | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml index 3211a40a53..3d1e22af14 100644 --- a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml +++ b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml @@ -48,7 +48,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml index 8c46964762..83cdee2023 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml @@ -48,7 +48,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml index f9dda9c1b3..88448bdd98 100644 --- a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml @@ -50,7 +50,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 2b1108e202..384cfb3070 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,7 +51,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 7d9c695058..f923994bb6 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml @@ -10,7 +10,7 @@ jobs: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) timeoutInMinutes: 30 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 73c304c7f6..fbdf9218a0 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,7 +45,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: @@ -72,7 +72,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 edcb792f10..5b3c404ad9 100644 --- a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml @@ -45,7 +45,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml index 7076eea597..d1d1050606 100644 --- a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml @@ -50,7 +50,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 dd4429234b..b2e9a48c52 100644 --- a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml @@ -47,7 +47,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml index 43fcd073e9..06b7a6d17b 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml @@ -46,7 +46,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml index d053a1f291..0aab22c9af 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml @@ -17,7 +17,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: @@ -53,7 +53,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml index a3e23ca486..5e0fd1c769 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml @@ -46,7 +46,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) @@ -71,7 +71,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index 826ceea581..eaa8dbbf01 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -11,7 +11,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 steps: - task: GoTool@0 inputs: diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index a2b61b6a52..9361023549 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -53,7 +53,7 @@ extends: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.0 + image: acn-runner-vmss-image-1es-v3.1 featureFlags: automaticContainerPatching: true sdl: From ab0322c16b3bd3bb739d3c301fdc76a821e5dfca Mon Sep 17 00:00:00 2001 From: Sheyla Trudo Date: Fri, 28 Mar 2025 10:37:07 -0700 Subject: [PATCH 136/136] Configurable Pool Image --- .pipelines/multitenancy/swiftv2-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/aks/aks-e2e.jobs.yaml | 2 +- .../azure-cni-overlay-stateless-e2e.jobs.yaml | 2 +- .../azure-cni-overlay/add-windows-nodepool.jobs.yaml | 2 +- .../azure-cni-overlay/azure-cni-overlay-e2e.jobs.yaml | 4 ++-- .../cilium-dualstackoverlay-e2e.jobs.yaml | 2 +- .../cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml | 2 +- .../cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml | 2 +- .../singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml | 2 +- .pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml | 4 ++-- .../dualstack-overlay/dualstackoverlay-e2e.jobs.yaml | 4 ++-- .pipelines/templates/run-unit-tests.stages.yaml | 2 +- .pipelines/trigger.yaml | 2 +- 14 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml index 3d1e22af14..c9e81bb529 100644 --- a/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml +++ b/.pipelines/multitenancy/swiftv2-e2e.jobs.yaml @@ -48,7 +48,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml index 83cdee2023..ed60b38732 100644 --- a/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks-swift/aks-swift-e2e.jobs.yaml @@ -48,7 +48,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml index 88448bdd98..d67dca55fb 100644 --- a/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml +++ b/.pipelines/singletenancy/aks/aks-e2e.jobs.yaml @@ -50,7 +50,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 384cfb3070..a315543410 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,7 +51,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 f923994bb6..d0c4e8a2ad 100644 --- a/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml +++ b/.pipelines/singletenancy/azure-cni-overlay/add-windows-nodepool.jobs.yaml @@ -10,7 +10,7 @@ jobs: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) timeoutInMinutes: 30 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 fbdf9218a0..e073859e73 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,7 +45,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: @@ -72,7 +72,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 5b3c404ad9..a505882532 100644 --- a/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e.jobs.yaml @@ -45,7 +45,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml index d1d1050606..62c1439b1f 100644 --- a/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e.jobs.yaml @@ -50,7 +50,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: 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 b2e9a48c52..b9434b77f8 100644 --- a/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e.jobs.yaml @@ -47,7 +47,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml index 06b7a6d17b..383638b93d 100644 --- a/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e.jobs.yaml @@ -46,7 +46,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml index 0aab22c9af..0f5786bc14 100644 --- a/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml +++ b/.pipelines/singletenancy/cilium/cilium-e2e.jobs.yaml @@ -17,7 +17,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) variables: commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] jobs: @@ -53,7 +53,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml index 5e0fd1c769..099b9f58bc 100644 --- a/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml +++ b/.pipelines/singletenancy/dualstack-overlay/dualstackoverlay-e2e.jobs.yaml @@ -46,7 +46,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - agent.os -equals Linux - Role -equals $(CUSTOM_E2E_ROLE) @@ -71,7 +71,7 @@ stages: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) demands: - Role -equals $(CUSTOM_E2E_ROLE) steps: diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index eaa8dbbf01..446b47a291 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -11,7 +11,7 @@ stages: pool: name: "$(BUILD_POOL_NAME_DEFAULT)" os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) steps: - task: GoTool@0 inputs: diff --git a/.pipelines/trigger.yaml b/.pipelines/trigger.yaml index 9361023549..f8d4dcbff2 100644 --- a/.pipelines/trigger.yaml +++ b/.pipelines/trigger.yaml @@ -53,7 +53,7 @@ extends: pool: name: $(BUILD_POOL_NAME_DEFAULT) os: linux - image: acn-runner-vmss-image-1es-v3.1 + image: $(RUNNER_IMAGE) featureFlags: automaticContainerPatching: true sdl: