Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
459a12e
Template
Nov 4, 2024
a15519c
Use Separate Pipeline File
Nov 8, 2024
1b6926b
fixup! Template
Nov 8, 2024
ad44eaf
fixup! Template
Nov 8, 2024
238fcc0
fixup! Template
Nov 8, 2024
d443e38
fixup! Template
Nov 8, 2024
cf851ac
fixup! Template
Nov 8, 2024
dfed765
fixup! Template
Nov 9, 2024
1aaa8cc
fixup! Template
Nov 14, 2024
cd544be
fixup! Template
Nov 14, 2024
8638f02
fixup! Template
Nov 14, 2024
509f7a4
fixup! Template
Nov 14, 2024
618f471
fixup! Template
Nov 14, 2024
2249b3c
fixup! Template
Nov 14, 2024
9c965d2
fixup! Template
Nov 14, 2024
3b96a6b
fixup! Template
Nov 14, 2024
8456005
Separate Build Changes
Nov 14, 2024
1c1350b
fixup! Separate Build Changes
Nov 14, 2024
1945cec
fixup! Separate Build Changes
Nov 14, 2024
a6c1939
fixup! Separate Build Changes
Nov 14, 2024
c80d012
fixup! Separate Build Changes
Nov 15, 2024
9bca36b
fixup! Separate Build Changes
Nov 15, 2024
afa56e7
fixup! Separate Build Changes
Nov 15, 2024
e35cca3
fixup! Separate Build Changes
Nov 15, 2024
e75c949
fixup! Separate Build Changes
Nov 15, 2024
d0b7de3
fixup! Separate Build Changes
Nov 16, 2024
53bb7f8
fixup! Separate Build Changes
Nov 16, 2024
3a4c7f9
fixup! Separate Build Changes
Nov 16, 2024
bf9c951
fixup! Separate Build Changes
Nov 16, 2024
d28306f
fixup! Separate Build Changes
Nov 16, 2024
ae545d5
fixup! Separate Build Changes
Nov 16, 2024
bb05d25
fixup! Separate Build Changes
Nov 16, 2024
37b44d0
fixup! Separate Build Changes
Nov 16, 2024
a2b44a7
fixup! Separate Build Changes
Nov 16, 2024
e633d58
fixup! Separate Build Changes
Nov 16, 2024
2264514
fixup! Separate Build Changes
Nov 16, 2024
889a931
fixup! Separate Build Changes
Nov 16, 2024
e7aebf0
fixup! Separate Build Changes
Nov 17, 2024
52e3ec4
fixup! Separate Build Changes
Nov 18, 2024
8f628cf
fixup! Separate Build Changes
Nov 18, 2024
c5613d2
fixup! Separate Build Changes
Nov 19, 2024
2d31ab4
fixup! Separate Build Changes
Nov 19, 2024
f7e996b
fixup! Separate Build Changes
Nov 19, 2024
24b0f98
fixup! Separate Build Changes
Nov 19, 2024
37147ba
fixup! Separate Build Changes
Nov 19, 2024
9c00b97
fixup! Separate Build Changes
Nov 19, 2024
539c316
fixup! Separate Build Changes
Nov 19, 2024
33e7e09
fixup! Separate Build Changes
Nov 19, 2024
194c6bb
fixup! Separate Build Changes
Nov 19, 2024
cdc924d
fixup! Separate Build Changes
Nov 19, 2024
0b9335b
fixup! Separate Build Changes
Nov 19, 2024
3784bce
fixup! Separate Build Changes
Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .pipelines/OneBranch.NonOfficial.CrossPlat.yaml

This file was deleted.

27 changes: 0 additions & 27 deletions .pipelines/OneBranch.Official.CrossPlat.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .pipelines/cni/k8s-e2e/k8s-e2e-job-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
42 changes: 11 additions & 31 deletions .pipelines/cni/k8s-e2e/k8s-e2e.jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
71 changes: 71 additions & 0 deletions .pipelines/containers/container-template.jobs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
parameters:
- name: arch
type: string

- name: os
type: string

- name: images
type: object

- 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: acnpublic.azurecr.io
identity: ManagedIdentity
clientId: ${{ parameters.containerRegistry.clientId }}
- 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: |
ls -la /bin
env:
ACR: ${{ parameters.containerRegistry.name }}

- 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: ${{ 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: ${{ image }}
os: ${{ parameters.os }}
67 changes: 36 additions & 31 deletions .pipelines/containers/container-template.steps.yaml
Original file line number Diff line number Diff line change
@@ -1,37 +1,42 @@
parameters:
arch: ""
name: ""
os: ""
- name: name
type: string
values:
- azure-ipam
- cni
- cns
- ipv6-hp-bpf
- npm

steps:
- task: AzureCLI@2
displayName: "Login"
inputs:
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
inlineScript: |
az acr login -n $(ACR)
- name: arch
type: string
default: ""
values:
- amd64
- arm64

- name: os
type: string
default: ""
values:
- windows
- linux

- 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)
retryCountOnTaskFailure: 3
env:
IMGNAME: '${{ parameters.name }}-image'
IN_OS: '${{ parameters.os }}'
IN_ARCH: '${{ parameters.arch }}'

- task: AzureCLI@2
displayName: "Logout"
steps:
- task: 1ES.BuildContainerImage@1
retryCountOnTaskFailure: 3
inputs:
azureSubscription: $(ACR_ARM_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
inlineScript: |
docker logout
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
enablePull: false
enableCache: true
useBuildKit: true

- task: 1ES.PushContainerImage@1
condition: ${{ eq(parameters.os, 'windows') }}
inputs:
image: $(IMAGE_NAME_AND_TAG_${{ parameters.name }})
19 changes: 4 additions & 15 deletions .pipelines/containers/manifest-template.steps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)"
Loading
Loading