diff --git a/.pipelines/build/generate-manifest.steps.yaml b/.pipelines/build/generate-manifest.steps.yaml index 5077e99a73..7065eed0bc 100644 --- a/.pipelines/build/generate-manifest.steps.yaml +++ b/.pipelines/build/generate-manifest.steps.yaml @@ -12,7 +12,7 @@ steps: .args = [ (.platform | split("/")[0]), (.platform | split("/")[1]) ] | .args = [ ("--os " + .args[0] ), ("--arch " + .args[1] ) ] | if .osVersion then .args += ["--os-version " + .osVersion] else . end | - { image: .imageReference, annotate: .args }' | \ + { image: .imageReference, annotate: (.args | join(" ")) }' | \ jq -rcs) echo >&2 "##vso[task.setvariable variable=MANIFEST_JSON;isOutput=true]$MANIFEST_DATA" echo "$MANIFEST_DATA" | jq -r . diff --git a/.pipelines/build/image.steps.yaml b/.pipelines/build/image.steps.yaml index 28ec223990..e8403a6241 100644 --- a/.pipelines/build/image.steps.yaml +++ b/.pipelines/build/image.steps.yaml @@ -33,6 +33,7 @@ parameters: default: - "--target $(os) " - "--platform $(os)/$(arch) " + - "--provenance false " - name: common_build_args type: object diff --git a/.pipelines/build/images.jobs.yaml b/.pipelines/build/images.jobs.yaml index 7589f20e9e..9d107b0b03 100644 --- a/.pipelines/build/images.jobs.yaml +++ b/.pipelines/build/images.jobs.yaml @@ -112,8 +112,8 @@ jobs: pool: os: linux type: docker -# ${{ if eq(job_data.job, 'linux_arm64') }}: -# hostArchitecture: arm64 + ${{ if eq(job_data.job, 'linux_arm64') }}: + hostArchitecture: arm64 # ${{ else }}: # LinuxHostVersion: 'AzLinux3.0AMD64' variables: @@ -127,12 +127,10 @@ jobs: OS: linux ${{ elseif eq(job_data.job, 'windows_amd64') }}: LinuxContainerImage: 'mcr.microsoft.com/onebranch/azurelinux/build:3.0' - ob_enable_qemu: true ARCH: amd64 OS: windows ${{ elseif eq(job_data.job, 'linux_arm64') }}: LinuxContainerImage: 'mcr.microsoft.com/onebranch/azurelinux/build:3.0' - ob_enable_qemu: true ARCH: arm64 OS: linux GOARCH: arm64 diff --git a/.pipelines/build/ob-prepare.steps.yaml b/.pipelines/build/ob-prepare.steps.yaml index bfd6f004b5..a707d34fb0 100644 --- a/.pipelines/build/ob-prepare.steps.yaml +++ b/.pipelines/build/ob-prepare.steps.yaml @@ -17,14 +17,14 @@ steps: # target_path: npm-windows # source_dockerfile: windows.Dockerfile -# - template: utils/rename-dockerfile-references.steps.yaml -# parameters: -# topic: "Linux - npm" -# replace_references: true -# working_directory: $(ACN_DIR) -# source_path: npm -# target_path: npm -# source_dockerfile: linux.Dockerfile +- template: utils/rename-dockerfile-references.steps.yaml + parameters: + topic: "Linux - npm" + replace_references: true + working_directory: $(ACN_DIR) + source_path: npm + target_path: npm + source_dockerfile: linux.Dockerfile - bash: | rm -rf .hooks .github diff --git a/.pipelines/run-pipeline.yaml b/.pipelines/run-pipeline.yaml index 851bf9289f..20de915350 100644 --- a/.pipelines/run-pipeline.yaml +++ b/.pipelines/run-pipeline.yaml @@ -20,154 +20,154 @@ stages: - template: templates/run-unit-tests.stages.yaml - -- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - - stage: build - displayName: "Build Project" - dependsOn: - - setup - - unittest - variables: - ACN_DIR: drop_setup_env_source - ACN_PACKAGE_PATH: github.com/Azure/azure-container-networking - CNI_AI_PATH: $(ACN_PACKAGE_PATH)/telemetry.aiMetadata - CNS_AI_PATH: $(ACN_PACKAGE_PATH)/cns/logger.aiMetadata - NPM_AI_PATH: $(ACN_PACKAGE_PATH)/npm.aiMetadata - - STORAGE_ID: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] - TAG: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] - - IMAGE_REPO_PATH: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.imageRepositoryPath'] ] - AZURE_IPAM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.azureIpamVersion'] ] - CNI_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ] - CNS_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cnsVersion'] ] - IPV6_HP_BPF_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.ipv6HpBpfVersion'] ] - NPM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.npmVersion'] ] - jobs: - - template: /.pipelines/build/images.jobs.yaml - parameters: - images: - - job: linux_amd64 - displayName: "Linux/AMD64" - templateContext: - repositoryArtifact: drop_setup_env_source - buildScript: .pipelines/build/scripts/$(name).sh - obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile - strategy: - maxParallel: 5 - matrix: - azure_ipam: - name: azure-ipam - extraArgs: '' - archiveName: azure-ipam - archiveVersion: $(AZURE_IPAM_VERSION) - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cni: - name: cni - extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' - archiveName: azure-cni - archiveVersion: $(CNI_VERSION) - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cns: - name: cns - extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' - archiveName: azure-cns - archiveVersion: $(CNS_VERSION) - imageTag: $(Build.BuildNumber) - ipv6_hp_bpf: - name: ipv6-hp-bpf - extraArgs: "--build-arg DEBUG=$(System.Debug)" - archiveName: ipv6-hp-bpf - archiveVersion: $(IPV6_HP_BPF_VERSION) - imageTag: $(Build.BuildNumber) - # npm: - # name: npm - # extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' - # archiveName: azure-npm - # archiveVersion: $(NPM_VERSION) - # imageTag: $(Build.BuildNumber) - - - job: windows_amd64 - displayName: "Windows" - templateContext: - repositoryArtifact: drop_setup_env_source - buildScript: .pipelines/build/scripts/$(name).sh - obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile - strategy: - maxParallel: 5 - matrix: - azure_ipam: - name: azure-ipam - extraArgs: '' - archiveName: azure-ipam - archiveVersion: $(AZURE_IPAM_VERSION) - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cni: - name: cni - extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' - archiveName: azure-cni - archiveVersion: $(CNI_VERSION) - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cns: - name: cns - extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' - archiveName: azure-cns - archiveVersion: $(CNS_VERSION) - imageTag: $(Build.BuildNumber) - # npm: - # name: npm - # extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' - # archiveName: azure-npm - # archiveVersion: $(NPM_VERSION) - # imageTag: $(Build.BuildNumber) - - - job: linux_arm64 - displayName: "Linux/ARM64" - templateContext: - repositoryArtifact: drop_setup_env_source - buildScript: .pipelines/build/scripts/$(name).sh - obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile - strategy: - maxParallel: 3 - matrix: - azure_ipam: - name: azure-ipam - archiveName: azure-ipam - archiveVersion: $(AZURE_IPAM_VERSION) - extraArgs: '' - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cni: - name: cni - extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' - archiveName: azure-cni - archiveVersion: $(CNI_VERSION) - imageTag: $(Build.BuildNumber) - packageWithDropGZ: True - cns: - name: cns - extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' - archiveName: azure-cns - archiveVersion: $(CNS_VERSION) - imageTag: $(Build.BuildNumber) - ipv6_hp_bpf: - name: ipv6-hp-bpf - extraArgs: "--build-arg DEBUG=$(System.Debug)" - archiveName: ipv6-hp-bpf - archiveVersion: $(IPV6_HP_BPF_VERSION) - imageTag: $(Build.BuildNumber) - # npm: - # name: npm - # extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' - # archiveName: azure-npm - # archiveVersion: $(NPM_VERSION) - # imageTag: $(Build.BuildNumber) +- stage: build + displayName: "Build Project" + dependsOn: + - setup + - unittest + variables: + ACN_DIR: drop_setup_env_source + ACN_PACKAGE_PATH: github.com/Azure/azure-container-networking + CNI_AI_PATH: $(ACN_PACKAGE_PATH)/telemetry.aiMetadata + CNS_AI_PATH: $(ACN_PACKAGE_PATH)/cns/logger.aiMetadata + NPM_AI_PATH: $(ACN_PACKAGE_PATH)/npm.aiMetadata + + STORAGE_ID: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ] + TAG: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ] + + IMAGE_REPO_PATH: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.imageRepositoryPath'] ] + AZURE_IPAM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.azureIpamVersion'] ] + CNI_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ] + CNS_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.cnsVersion'] ] + IPV6_HP_BPF_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.ipv6HpBpfVersion'] ] + NPM_VERSION: $[ stageDependencies.setup.env.outputs['EnvironmentalVariables.npmVersion'] ] + jobs: + - template: /.pipelines/build/images.jobs.yaml + parameters: + images: + - job: linux_amd64 + displayName: "Linux/AMD64" + templateContext: + repositoryArtifact: drop_setup_env_source + buildScript: .pipelines/build/scripts/$(name).sh + obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile + strategy: + maxParallel: 5 + matrix: + azure_ipam: + name: azure-ipam + extraArgs: '' + archiveName: azure-ipam + archiveVersion: $(AZURE_IPAM_VERSION) + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cni: + name: cni + extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' + archiveName: azure-cni + archiveVersion: $(CNI_VERSION) + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cns: + name: cns + extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' + archiveName: azure-cns + archiveVersion: $(CNS_VERSION) + imageTag: $(Build.BuildNumber) + ipv6_hp_bpf: + name: ipv6-hp-bpf + extraArgs: "--build-arg DEBUG=$(System.Debug)" + archiveName: ipv6-hp-bpf + archiveVersion: $(IPV6_HP_BPF_VERSION) + imageTag: $(Build.BuildNumber) + npm: + name: npm + extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' + archiveName: azure-npm + archiveVersion: $(NPM_VERSION) + imageTag: $(Build.BuildNumber) + + - job: windows_amd64 + displayName: "Windows" + templateContext: + repositoryArtifact: drop_setup_env_source + buildScript: .pipelines/build/scripts/$(name).sh + obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile + strategy: + maxParallel: 5 + matrix: + azure_ipam: + name: azure-ipam + extraArgs: '' + archiveName: azure-ipam + archiveVersion: $(AZURE_IPAM_VERSION) + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cni: + name: cni + extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' + archiveName: azure-cni + archiveVersion: $(CNI_VERSION) + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cns: + name: cns + extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' + archiveName: azure-cns + archiveVersion: $(CNS_VERSION) + imageTag: $(Build.BuildNumber) + # We do not build NPM for Windows 1.6+ + # npm: + # name: npm + # extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' + # archiveName: azure-npm + # archiveVersion: $(NPM_VERSION) + # imageTag: $(Build.BuildNumber) + + - job: linux_arm64 + displayName: "Linux/ARM64" + templateContext: + repositoryArtifact: drop_setup_env_source + buildScript: .pipelines/build/scripts/$(name).sh + obDockerfile: .pipelines/build/dockerfiles/$(name).Dockerfile + strategy: + maxParallel: 3 + matrix: + azure_ipam: + name: azure-ipam + archiveName: azure-ipam + archiveVersion: $(AZURE_IPAM_VERSION) + extraArgs: '' + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cni: + name: cni + extraArgs: '--build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' + archiveName: azure-cni + archiveVersion: $(CNI_VERSION) + imageTag: $(Build.BuildNumber) + packageWithDropGZ: True + cns: + name: cns + extraArgs: '--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' + archiveName: azure-cns + archiveVersion: $(CNS_VERSION) + imageTag: $(Build.BuildNumber) + ipv6_hp_bpf: + name: ipv6-hp-bpf + extraArgs: "--build-arg DEBUG=$(System.Debug)" + archiveName: ipv6-hp-bpf + archiveVersion: $(IPV6_HP_BPF_VERSION) + imageTag: $(Build.BuildNumber) + npm: + name: npm + extraArgs: '--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' + archiveName: azure-npm + archiveVersion: $(NPM_VERSION) + imageTag: $(Build.BuildNumber) +- ${{ if not(contains(variables['Build.SourceBranch'], 'refs/pull')) }}: - stage: manifests displayName: "Image Manifests" dependsOn: @@ -247,17 +247,17 @@ stages: imageReference: $(IPV6_LINUX_AMD64_REF) - platform: linux/arm64 imageReference: $(IPV6_LINUX_ARM64_REF) - # - job: npm - # templateContext: - # name: npm - # image_tag: $(NPM_VERSION) - # platforms: - # - platform: linux/amd64 - # imageReference: $(NPM_LINUX_AMD64_REF) - # - platform: linux/arm64 - # imageReference: $(NPM_LINUX_ARM64_REF) - # - platform: windows/amd64 - # imageReference: $(NPM_WINDOWS_AMD64_REF) + - job: npm + templateContext: + name: npm + image_tag: $(NPM_VERSION) + platforms: + - platform: linux/amd64 + imageReference: $(NPM_LINUX_AMD64_REF) + - platform: linux/arm64 + imageReference: $(NPM_LINUX_ARM64_REF) + # - platform: windows/amd64 + # imageReference: $(NPM_WINDOWS_AMD64_REF) # Cilium Podsubnet E2E tests diff --git a/.pipelines/templates/run-unit-tests.stages.yaml b/.pipelines/templates/run-unit-tests.stages.yaml index a4e920ffba..79754e01ad 100644 --- a/.pipelines/templates/run-unit-tests.stages.yaml +++ b/.pipelines/templates/run-unit-tests.stages.yaml @@ -47,7 +47,6 @@ stages: } | { read xs; exit $xs; } } 4>&1 - cp coverage-all.out "$COVERAGE_OUT" ls -la "$REPORT_DIR" retryCountOnTaskFailure: 3 displayName: "Run Unit Tests - Linux"