Skip to content

Commit 358de20

Browse files
rbtrthatmattlong
andauthored
Add multiplat Windows 2019 and 2022 image support to tooling and pipelines, use for CNS/NPM (#1820)
* build: add ws2019 cns image to build pipeline * add windows2019 build pool * fix: npm pipelines * fix: npm pipelines * update multiplat build process for winver flavors * optional buildx push for npm cyclonus --------- Signed-off-by: Evan Baker <[email protected]> Co-authored-by: Matthew Long <[email protected]> Co-authored-by: Matthew Long <[email protected]>
1 parent c8d2c1f commit 358de20

17 files changed

+225
-377
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 NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
45+
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker BUILDX_ACTION='--load'
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 NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker
45+
make npm-image NPM_PLATFORM_TAG=cyclonus PLATFORM=linux/amd64 CONTAINER_BUILDER=docker BUILDX_ACTION='--load'
4646
4747
- name: Install Azure NPM
4848
# set the ConfigMap based on the build matrix

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

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

.pipelines/containers/container-template.yaml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
parameters:
2+
arch: ""
23
name: ""
34
os: ""
4-
arch: ""
5+
os_version: ""
56

67
steps:
78
- task: Docker@2
@@ -13,29 +14,12 @@ steps:
1314

1415
- script: |
1516
set -e
16-
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
17+
if [ ${{ parameters.os }} = 'windows' ]; then export BUILDX_ACTION='--push'; fi
18+
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }} OS_VERSION=${{ parameters.os_version }}
1719
name: image_build
1820
displayName: Image Build
1921
retryCountOnTaskFailure: 3
2022

21-
- script: |
22-
set -e
23-
make ${{ parameters.name }}-skopeo-export OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
24-
wget https://github.com/aquasecurity/trivy/releases/download/v0.18.1/trivy_0.18.1_Linux-64bit.tar.gz
25-
tar -zxvf trivy*.tar.gz
26-
mkdir -p ./trivy-cache
27-
sudo ./trivy --exit-code 1 --cache-dir ./trivy-cache --severity HIGH,CRITICAL $REF
28-
name: trivy
29-
displayName: Vulnerability Scan
30-
retryCountOnTaskFailure: 3
31-
32-
- script: |
33-
set -e
34-
make ${{ parameters.name }}-image-push OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
35-
retryCountOnTaskFailure: 3
36-
name: image_push
37-
displayName: Push Images
38-
3923
- task: Docker@2
4024
displayName: Logout
4125
inputs:

.pipelines/containers/manifest-template.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
22
name: ""
33
platforms: ""
4+
os_versions: ""
45

56
steps:
67
- task: Docker@2
@@ -12,9 +13,10 @@ steps:
1213

1314
- script: |
1415
set -e
15-
make ${{ parameters.name }}-manifest-create PLATFORMS="${{ parameters.platforms }}"
16+
make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" OS_VERSIONS="${{ parameters.os_versions }}"
1617
name: manifest_build
1718
displayName: Manifest Build
19+
retryCountOnTaskFailure: 3
1820
1921
- script: |
2022
set -e
@@ -23,6 +25,7 @@ steps:
2325
make ${{ parameters.name }}-skopeo-archive IMAGE_ARCHIVE_DIR=$(Build.ArtifactStagingDirectory)/images
2426
name: manifest_push
2527
displayName: Manifest Push
28+
retryCountOnTaskFailure: 3
2629
2730
- task: Docker@2
2831
displayName: Logout

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ jobs:
174174
175175
az aks get-credentials -n $(AZURE_CLUSTER) -g $(RESOURCE_GROUP) --file ./kubeconfig
176176
./kubectl --kubeconfig=./kubeconfig apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/examples/windows/azure-npm.yaml
177-
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-$(TAG)
177+
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-ltsc2022-$(TAG)
178178
179179
else
180180
echo "Creating Linux Cluster";
@@ -403,7 +403,7 @@ jobs:
403403
./kubectl --kubeconfig=./kubeconfig apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/examples/windows/azure-npm.yaml
404404
405405
# swap azure-npm image with one built during run
406-
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-$(TAG)
406+
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-ltsc2022-$(TAG)
407407
408408
echo "sleeping 3 minutes to allow NPM pods to restart"
409409
sleep 180

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

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -50,41 +50,20 @@ jobs:
5050
matrix:
5151
npm_linux_amd64:
5252
arch: amd64
53+
name: npm
5354
os: linux
55+
npm_windows2022_amd64:
56+
arch: amd64
5457
name: npm
58+
os: windows
59+
os_version: ltsc2022
5560
steps:
5661
- template: ../containers/container-template.yaml
5762
parameters:
58-
name: $(name)
59-
os: $(os)
6063
arch: $(arch)
61-
62-
- job: containerize_windows
63-
dependsOn: [setup]
64-
displayName: Build Images
65-
variables:
66-
TAG: $[ dependencies.setup.outputs['EnvironmentalVariables.TAG'] ]
67-
pool:
68-
name: "$(BUILD_POOL_NAME_DEFAULT_WINDOWS)"
69-
strategy:
70-
matrix:
71-
npm_windows_amd64:
72-
arch: amd64
73-
name: npm
74-
ai_path: github.com/Azure/azure-container-networking/npm.aiMetadata
75-
ai_path_var: NPM_AI_PATH
76-
ai_id: 014c22bd-4107-459e-8475-67909e96edcb
77-
ai_id_var: NPM_AI_ID
78-
steps:
79-
- template: ../containers/container-template-windows.yaml
80-
parameters:
8164
name: $(name)
82-
arch: $(arch)
83-
tag: $(TAG)
84-
ai_path: $(ai_path)
85-
ai_path_var: $(ai_path_var)
86-
ai_id: $(ai_id)
87-
ai_id_var: $(ai_id_var)
65+
os: $(os)
66+
os_version: $(os_version)
8867

8968
- job: k8se2e
9069
displayName: "Build Kubernetes Test Suite"
@@ -132,7 +111,7 @@ jobs:
132111
demands:
133112
- agent.os -equals Linux
134113
- Role -equals Build
135-
dependsOn: [setup, k8se2e, containerize, containerize_windows]
114+
dependsOn: [setup, k8se2e, containerize]
136115
variables:
137116
RESOURCE_GROUP: $[ dependencies.setup.outputs['EnvironmentalVariables.RESOURCE_GROUP'] ]
138117
TAG: $[ dependencies.setup.outputs['EnvironmentalVariables.TAG'] ]
@@ -222,7 +201,7 @@ jobs:
222201
223202
az aks get-credentials -n $(AZURE_CLUSTER) -g $(RESOURCE_GROUP) --file ./kubeconfig
224203
./kubectl --kubeconfig=./kubeconfig apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/examples/windows/azure-npm.yaml
225-
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-$(TAG)
204+
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-ltsc2022-$(TAG)
226205
227206
else
228207
echo "Creating Linux Cluster";
@@ -381,7 +360,7 @@ jobs:
381360
demands:
382361
- agent.os -equals Linux
383362
- Role -equals Build
384-
dependsOn: [containerize_windows, setup]
363+
dependsOn: [containerize, setup]
385364
variables:
386365
RESOURCE_GROUP: $[ dependencies.setup.outputs['EnvironmentalVariables.RESOURCE_GROUP'] ]
387366
TAG: $[ dependencies.setup.outputs['EnvironmentalVariables.TAG'] ]
@@ -462,7 +441,7 @@ jobs:
462441
./kubectl --kubeconfig=./kubeconfig apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/examples/windows/azure-npm.yaml
463442
464443
# swap azure-npm image with one built during run
465-
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-$(TAG)
444+
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-ltsc2022-$(TAG)
466445
467446
echo "sleeping 3 minutes to allow NPM pods to restart"
468447
sleep 180

.pipelines/npm/npm-cyc-win-tests-latest-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ jobs:
153153
./kubectl --kubeconfig=./kubeconfig apply -f https://raw.githubusercontent.com/Azure/azure-container-networking/master/npm/examples/windows/azure-npm.yaml
154154
155155
# swap azure-npm image with one built during run
156-
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-$(TAG)
156+
./kubectl --kubeconfig=./kubeconfig set image daemonset/azure-npm-win -n kube-system azure-npm=$IMAGE_REGISTRY/azure-npm:windows-amd64-ltsc2022-$(TAG)
157157
158158
echo "sleeping 3 minutes to allow NPM pods to restart"
159159
sleep 180

0 commit comments

Comments
 (0)