Skip to content

Commit 8888338

Browse files
authored
Pipeline support for Go submodules versioned independently of root repo (#1533)
* use submodule specific tags Signed-off-by: Evan Baker <[email protected]> * support separate go submodule versions Signed-off-by: Evan Baker <[email protected]> * move version and tag responsibilities to the makefile Signed-off-by: Evan Baker <[email protected]> * update integration tests to use component tags Signed-off-by: Evan Baker <[email protected]> Signed-off-by: Evan Baker <[email protected]>
1 parent d32a66f commit 8888338

26 files changed

+291
-340
lines changed

.github/workflows/cyclonus-netpol-extended-nightly-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Make NPM image
4444
run: |
45-
make npm-image VERSION=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
45+
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
4646
4747
- name: Install Azure NPM
4848
# set the ConfigMap based on the build matrix

.github/workflows/cyclonus-netpol-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
4343
- name: Make NPM image
4444
run: |
45-
make npm-image VERSION=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
45+
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
4646
4747
- name: Install Azure NPM
4848
# set the ConfigMap based on the build matrix

.pipelines/Dockerfile

Lines changed: 0 additions & 25 deletions
This file was deleted.

.pipelines/containers/container-template-windows.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ steps:
1212
addPipelineData: false
1313

1414
- powershell: |
15-
powershell.exe -command "& { . .\windows.ps1; Retry({${{ parameters.name }}-image windows-${{ parameters.arch }}-${{ parameters.tag }}}) }"
15+
powershell.exe -command "& { . .\build\scripts\windows.ps1; Retry({${{ parameters.name }}-image windows-${{ parameters.arch }}-${{ parameters.tag }}}) }"
1616
name: image_build
1717
displayName: Image Build
1818

.pipelines/containers/container-template.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ parameters:
22
name: ""
33
os: ""
44
arch: ""
5-
tag: ""
65

76
steps:
87
- task: Docker@2
@@ -14,35 +13,31 @@ steps:
1413

1514
- script: |
1615
set -e
17-
sudo podman run --rm --privileged multiarch/qemu-user-static --reset -p yes
16+
make qemu-user-static
1817
name: container_env
1918
displayName: Prepare Environment
2019

2120
- script: |
2221
set -e
23-
export PLATFORM_TAG=$(make container-platform-tag TAG=${{ parameters.tag }} PLATFORM=${{ parameters.os }}/${{ parameters.arch }})
24-
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }} PLATFORM=${{ parameters.os }}/${{ parameters.arch }} TAG=$PLATFORM_TAG
22+
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
2523
name: image_build
2624
displayName: Image Build
2725
retryCountOnTaskFailure: 3
2826

2927
- script: |
3028
set -e
31-
export PLATFORM_TAG=$(make container-platform-tag TAG=${{ parameters.tag }} PLATFORM=${{ parameters.os }}/${{ parameters.arch }})
32-
export REF=$(IMAGE_REGISTRY)/$(make ${{ parameters.name }}-image-name):$PLATFORM_TAG
33-
skopeo copy containers-storage:$REF docker-daemon:$REF
29+
make ${{ parameters.name }}-skopeo-export OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
3430
wget https://github.com/aquasecurity/trivy/releases/download/v0.18.1/trivy_0.18.1_Linux-64bit.tar.gz
3531
tar -zxvf trivy*.tar.gz
3632
mkdir -p ./trivy-cache
3733
sudo ./trivy --exit-code 1 --cache-dir ./trivy-cache --severity HIGH,CRITICAL $REF
3834
name: trivy
3935
displayName: Vulnerability Scan
36+
retryCountOnTaskFailure: 3
4037

4138
- script: |
4239
set -e
43-
export PLATFORM_TAG=$(make container-platform-tag TAG=${{ parameters.tag }} PLATFORM=${{ parameters.os }}/${{ parameters.arch }})
44-
make ${{ parameters.name }}-image-push PLATFORM=${{ parameters.os }}/${{ parameters.arch }} TAG=$PLATFORM_TAG
45-
make ${{ parameters.name }}-image-pull PLATFORM=${{ parameters.os }}/${{ parameters.arch }} TAG=$PLATFORM_TAG
40+
make ${{ parameters.name }}-image-push OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
4641
retryCountOnTaskFailure: 3
4742
name: image_push
4843
displayName: Push Images

.pipelines/containers/manifest-template.yaml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
parameters:
22
name: ""
33
platforms: ""
4-
tag: ""
54

65
steps:
76
- task: Docker@2
@@ -13,19 +12,15 @@ steps:
1312

1413
- script: |
1514
set -e
16-
make ${{ parameters.name }}-multiarch-manifest-create PLATFORMS="${{ parameters.platforms }}" TAG=${{ parameters.tag }}
17-
make ${{ parameters.name }}-image-info TAG=${{ parameters.tag }}
15+
make ${{ parameters.name }}-manifest-create PLATFORMS="${{ parameters.platforms }}"
1816
name: manifest_build
1917
displayName: Manifest Build
2018
2119
- script: |
2220
set -e
23-
export IMAGE=$(make ${{ parameters.name }}-image-name)
24-
export TAG=${{ parameters.tag }}
25-
make multiarch-manifest-push IMAGE=$IMAGE TAG=$TAG
26-
make container-pull IMAGE=$IMAGE TAG=$TAG
21+
make ${{ parameters.name }}-manifest-push
2722
mkdir -p $(Build.ArtifactStagingDirectory)/images
28-
skopeo copy --all docker://$IMAGE_REGISTRY/$IMAGE:$TAG oci-archive:$(Build.ArtifactStagingDirectory)/images/$IMAGE-$TAG.tar
23+
make ${{ parameters.name }}-skopeo-archive IMAGE_ARCHIVE_DIR=$(Build.ArtifactStagingDirectory)/images
2924
name: manifest_push
3025
displayName: Manifest Push
3126
@@ -36,12 +31,6 @@ steps:
3631
command: "logout"
3732
addPipelineData: false
3833

39-
- task: CopyFiles@2
40-
inputs:
41-
sourceFolder: "output"
42-
targetFolder: $(Build.ArtifactStagingDirectory)
43-
condition: succeeded()
44-
4534
- task: ManifestGeneratorTask@0
4635
displayName: "Add SBOM Generator tool"
4736
inputs:

.pipelines/npm/npm-conformance-tests.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
mkdir -p '$(GOPATH)/pkg'
2828
BUILD_NUMBER=$(Build.BuildNumber)
2929
RG=e2e-$(echo "npm-`date "+%Y-%m-%d-%S"`")
30-
TAG=$(make version)-conformance-test
30+
TAG=$(make npm-version)
3131
echo "Resource group: $RG"
3232
echo "Image tag: $TAG"
3333
@@ -57,7 +57,6 @@ jobs:
5757
name: $(name)
5858
os: $(os)
5959
arch: $(arch)
60-
tag: $(TAG)
6160

6261
- job: containerize_windows
6362
dependsOn: [setup]
@@ -76,7 +75,6 @@ jobs:
7675
parameters:
7776
name: $(name)
7877
arch: $(arch)
79-
tag: $(TAG)
8078

8179
- job: k8se2e
8280
displayName: "Build Kubernetes Test Suite"

.pipelines/pipeline.yaml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ stages:
2323
BUILD_NUMBER=$(Build.BuildNumber)
2424
echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})"
2525
echo "##vso[task.setvariable variable=Tag;isOutput=true]$(make version)"
26+
echo "##vso[task.setvariable variable=cniVersion;isOutput=true]$(make cni-version)"
27+
echo "##vso[task.setvariable variable=npmVersion;isOutput=true]$(make npm-version)"
2628
cat /etc/os-release
2729
uname -a
2830
sudo chown -R $(whoami):$(whoami) .
@@ -90,13 +92,12 @@ stages:
9092
- job: build
9193
displayName: Build Binaries
9294
variables:
93-
TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ]
9495
STORAGE_ID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ]
9596
pool:
9697
name: "$(BUILD_POOL_NAME_DEFAULT)"
9798
steps:
9899
- script: |
99-
make all-binaries-platforms VERSION=$(TAG)
100+
make all-binaries-platforms
100101
name: "BuildAllPlatformBinaries"
101102
displayName: "Build all platform binaries"
102103
@@ -144,8 +145,6 @@ stages:
144145
jobs:
145146
- job: containerize
146147
displayName: Build Images
147-
variables:
148-
TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ]
149148
pool:
150149
name: "$(BUILD_POOL_NAME_DEFAULT)"
151150
strategy:
@@ -188,7 +187,6 @@ stages:
188187
name: $(name)
189188
os: $(os)
190189
arch: $(arch)
191-
tag: $(TAG)
192190
- job: containerize_windows
193191
displayName: Build Images
194192
variables:
@@ -213,13 +211,10 @@ stages:
213211
- stage: publish
214212
displayName: Publish Multiarch Manifests
215213
dependsOn:
216-
- setup
217214
- containerize
218215
jobs:
219216
- job: manifest
220217
displayName: Compile Manifests
221-
variables:
222-
TAG: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ]
223218
pool:
224219
name: "$(BUILD_POOL_NAME_DEFAULT)"
225220
strategy:
@@ -241,7 +236,6 @@ stages:
241236
parameters:
242237
name: $(name)
243238
platforms: $(platforms)
244-
tag: $(TAG)
245239

246240
- template: singletenancy/cilium/cilium-e2e-job-template.yaml
247241
parameters:

.pipelines/singletenancy/aks-engine/e2e-dualstack-job-template.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ stages:
2828
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path
2929
GOBIN: "$(GOPATH)/bin" # Go binaries path
3030
acnPath: "$(GOPATH)/src/github.com/Azure/azure-container-networking"
31-
Tag: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ]
3231
CommitHash: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.CommitHash'] ]
3332
StorageID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ]
33+
cniVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ]
3434
steps:
3535
- task: DownloadPipelineArtifact@2
3636
inputs:
@@ -39,15 +39,14 @@ stages:
3939
targetPath: $(Pipeline.Workspace)
4040
- bash: |
4141
ls -lah
42-
export CNI_URL=https://$(ARTIFACT_STORAGE).blob.core.windows.net/acn-$(StorageID)/azure-vnet-cni-${{ parameters.clusterDefinitionCniBuildOS }}-amd64-$(Tag)${{ parameters.clusterDefinitionCniBuildExt }}
42+
export CNI_URL=https://$(ARTIFACT_STORAGE).blob.core.windows.net/acn-$(StorageID)/azure-vnet-cni-${{ parameters.clusterDefinitionCniBuildOS }}-amd64-$(cniVersion)${{ parameters.clusterDefinitionCniBuildExt }}
4343
export CNI_TYPE=${{ parameters.clusterDefinitionCniTypeKey }}
4444
echo CNI type is $CNI_TYPE
45-
echo Tag is $(Tag)
4645
echo CNI_URL is $CNI_URL
4746
echo Config: '${{ parameters.clusterDefinition }}'
4847
cat '${{ parameters.clusterDefinition }}'
4948
cat '${{ parameters.clusterDefinition }}' | jq --arg cnikey $CNI_TYPE --arg cniurl $CNI_URL '.properties.orchestratorProfile.kubernetesConfig[$cnikey]= $cniurl' > '${{ parameters.clusterDefinition }}'.tmp
50-
cat '${{ parameters.clusterDefinition }}'.tmp | jq --arg tag $(Tag) '.properties.orchestratorProfile.kubernetesConfig.azureCNIVersion = $tag' > '${{ parameters.clusterDefinition }}'
49+
cat '${{ parameters.clusterDefinition }}'.tmp | jq --arg ver $(cniVersion) '.properties.orchestratorProfile.kubernetesConfig.azureCNIVersion = $ver' > '${{ parameters.clusterDefinition }}'
5150
mv '${{ parameters.clusterDefinition }}'.tmp '${{ parameters.clusterDefinition }}'
5251
echo "Running E2E tests against a cluster built with the following API model:"
5352
cp ${{ parameters.clusterDefinition }} clusterDefinition.json

.pipelines/singletenancy/aks-engine/e2e-job-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ stages:
2929
GOBIN: "$(GOPATH)/bin" # Go binaries path
3030
modulePath: "$(GOPATH)/src/github.com/Azure/aks-engine"
3131
acnPath: "$(GOPATH)/src/github.com/Azure/azure-container-networking"
32-
Tag: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.Tag'] ]
3332
CommitHash: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.CommitHash'] ]
3433
StorageID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.StorageID'] ]
34+
cniVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ]
35+
npmVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.npmVersion'] ]
3536
steps:
3637
- template: e2e-step-template.yaml
3738
parameters:
@@ -40,3 +41,5 @@ stages:
4041
clusterDefinitionCniTypeKey: ${{ parameters.clusterDefinitionCniTypeKey }}
4142
clusterDefinitionCniBuildOS: ${{ parameters.clusterDefinitionCniBuildOS }}
4243
clusterDefinitionCniBuildExt: ${{ parameters.clusterDefinitionCniBuildExt }}
44+
cniVersion: $(cniVersion)
45+
npmVersion: $(npmVersion)

0 commit comments

Comments
 (0)