Skip to content

Commit

Permalink
backport: Windows HPC base image (#3105)
Browse files Browse the repository at this point in the history
Signed-off-by: Evan Baker <[email protected]>
  • Loading branch information
rbtr committed Jan 3, 2025
1 parent b5a1ede commit e42b448
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 222 deletions.
23 changes: 3 additions & 20 deletions .pipelines/cni/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,46 +39,32 @@ stages:
arch: amd64
name: azure-ipam
os: linux
azure_ipam_windows2019_amd64:
azure_ipam_windows_amd64:
arch: amd64
name: azure-ipam
os: windows
os_version: ltsc2019
azure_ipam_windows2022_amd64:
arch: amd64
name: azure-ipam
os: windows
os_version: ltsc2022
cni_linux_amd64:
arch: amd64
name: cni
os: linux
cni_windows2019_amd64:
arch: amd64
name: cni
os: windows
os_version: ltsc2019
cni_windows2022_amd64:
cni_windows_amd64:
arch: amd64
name: cni
os: windows
os_version: ltsc2022
npm_linux_amd64:
arch: amd64
name: npm
os: linux
npm_windows2022_amd64:
npm_windows_amd64:
arch: amd64
name: npm
os: windows
os_version: ltsc2022
steps:
- template: ../containers/container-template.yaml
parameters:
arch: $(arch)
name: $(name)
os: $(os)
os_version: $(os_version)
- job: containerize_linux_arm64
displayName: Build Images
pool:
Expand Down Expand Up @@ -152,17 +138,14 @@ stages:
platforms: linux/amd64 linux/arm64 windows/amd64
cni:
name: cni
os_versions: ltsc2019 ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
npm:
name: npm
os_versions: ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
steps:
- template: ../containers/manifest-template.yaml
parameters:
name: $(name)
os_versions: $(os_versions)
platforms: $(platforms)

## Windows E2E
Expand Down
3 changes: 1 addition & 2 deletions .pipelines/containers/container-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ parameters:
arch: ""
name: ""
os: ""
os_version: ""

steps:
- task: AzureCLI@2
Expand All @@ -17,7 +16,7 @@ steps:
- script: |
set -e
if [ ${{ parameters.os }} = 'windows' ]; then export BUILDX_ACTION='--push'; fi
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }} OS_VERSION=${{ parameters.os_version }}
make ${{ parameters.name }}-image OS=${{ parameters.os }} ARCH=${{ parameters.arch }}
name: image_build
displayName: Image Build
retryCountOnTaskFailure: 3
Expand Down
3 changes: 1 addition & 2 deletions .pipelines/containers/manifest-template.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
parameters:
name: ""
platforms: ""
os_versions: ""

steps:

Expand All @@ -16,7 +15,7 @@ steps:
- script: |
set -e
make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}" OS_VERSIONS="${{ parameters.os_versions }}"
make ${{ parameters.name }}-manifest-build PLATFORMS="${{ parameters.platforms }}"
name: manifest_build
displayName: Manifest Build
retryCountOnTaskFailure: 3
Expand Down
33 changes: 4 additions & 29 deletions .pipelines/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -110,44 +110,26 @@ stages:
arch: amd64
name: azure-ipam
os: linux
azure_ipam_windows2019_amd64:
azure_ipam_windows_amd64:
arch: amd64
name: azure-ipam
os: windows
os_version: ltsc2019
azure_ipam_windows2022_amd64:
arch: amd64
name: azure-ipam
os: windows
os_version: ltsc2022
cni_linux_amd64:
arch: amd64
name: cni
os: linux
cni_windows2019_amd64:
cni_windows_amd64:
arch: amd64
name: cni
os: windows
os_version: ltsc2019
cni_windows2022_amd64:
arch: amd64
name: cni
os: windows
os_version: ltsc2022
cns_linux_amd64:
arch: amd64
name: cns
os: linux
cns_windows2019_amd64:
arch: amd64
name: cns
os: windows
os_version: ltsc2019
cns_windows2022_amd64:
cns_windows_amd64:
arch: amd64
name: cns
os: windows
os_version: ltsc2022
ipv6_hp_bpf_linux_amd64:
arch: amd64
name: ipv6-hp-bpf
Expand All @@ -156,18 +138,16 @@ stages:
arch: amd64
name: npm
os: linux
npm_windows2022_amd64:
npm_windows_amd64:
arch: amd64
name: npm
os: windows
os_version: ltsc2022
steps:
- template: containers/container-template.yaml
parameters:
arch: $(arch)
name: $(name)
os: $(os)
os_version: $(os_version)
- job: containerize_linux_arm64
displayName: Build Images
pool:
Expand Down Expand Up @@ -216,28 +196,23 @@ stages:
matrix:
azure_ipam:
name: azure-ipam
os_versions: ltsc2019 ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
cni:
name: cni
os_versions: ltsc2019 ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
cns:
name: cns
os_versions: ltsc2019 ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
ipv6_hp_bpf:
name: ipv6-hp-bpf
platforms: linux/amd64 linux/arm64
npm:
name: npm
os_versions: ltsc2022
platforms: linux/amd64 linux/arm64 windows/amd64
steps:
- template: containers/manifest-template.yaml
parameters:
name: $(name)
os_versions: $(os_versions)
platforms: $(platforms)

# Cilium Podsubnet E2E tests
Expand Down
72 changes: 28 additions & 44 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
GOOSES ?= "linux windows" # To override at the cli do: GOOSES="\"darwin bsd\""
GOARCHES ?= "amd64 arm64" # To override at the cli do: GOARCHES="\"ppc64 mips\""
ltsc2019 = "10.0.17763.4010"
ltsc2022 = "10.0.20348.643"

# Windows specific extensions
# set these based on the GOOS, not the OS
Expand Down Expand Up @@ -274,15 +272,15 @@ CNS_IMAGE = azure-cns
NPM_IMAGE = azure-npm

## Image platform tags.
ACNCLI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(ACN_VERSION)
AZURE_IPAM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(AZURE_IPAM_VERSION)
AZURE_IPAM_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(AZURE_IPAM_VERSION)-$(OS_SKU_WIN)
IPV6_HP_BPF_IMAGE_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(IPV6_HP_BPF_VERSION)
CNI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_VERSION)
CNI_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNI_VERSION)-$(OS_SKU_WIN)
CNS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNS_VERSION)
CNS_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(CNS_VERSION)-$(OS_SKU_WIN)
NPM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(NPM_VERSION)
ACNCLI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(ACN_VERSION)
AZURE_IPAM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(AZURE_IPAM_VERSION)
AZURE_IPAM_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(AZURE_IPAM_VERSION)
IPV6_HP_BPF_IMAGE_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(IPV6_HP_BPF_VERSION)
CNI_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNI_VERSION)
CNI_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNI_VERSION)
CNS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNS_VERSION)
CNS_WINDOWS_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(CNS_VERSION)
NPM_PLATFORM_TAG ?= $(subst /,-,$(PLATFORM))-$(NPM_VERSION)


qemu-user-static: ## Set up the host to run qemu multiplatform container builds.
Expand Down Expand Up @@ -316,8 +314,7 @@ container: # util target to build container images. do not invoke directly.
PLATFORM=$(PLATFORM) \
TAG=$(TAG) \
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

container-push: # util target to publish container image. do not invoke directly.
$(CONTAINER_BUILDER) push \
Expand Down Expand Up @@ -367,12 +364,11 @@ azure-ipam-image: ## build azure-ipam container image.
$(MAKE) container \
DOCKERFILE=azure-ipam/$(OS).Dockerfile \
IMAGE=$(AZURE_IPAM_IMAGE) \
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION)' \
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH)' \
PLATFORM=$(PLATFORM) \
TAG=$(AZURE_IPAM_PLATFORM_TAG) \
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

azure-ipam-image-push: ## push azure-ipam container image.
$(MAKE) container-push \
Expand All @@ -396,12 +392,11 @@ ipv6-hp-bpf-image: ## build ipv6-hp-bpf container image.
$(MAKE) container \
DOCKERFILE=bpf-prog/ipv6-hp-bpf/$(OS).Dockerfile \
IMAGE=$(IPV6_HP_BPF_IMAGE) \
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION) --build-arg DEBUG=$(DEBUG)'\
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg DEBUG=$(DEBUG)'\
PLATFORM=$(PLATFORM) \
TAG=$(IPV6_HP_BPF_IMAGE_PLATFORM_TAG) \
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

ipv6-hp-bpf-image-push: ## push ipv6-hp-bpf container image.
$(MAKE) container-push \
Expand All @@ -425,12 +420,11 @@ cni-image: ## build cni container image.
$(MAKE) container \
DOCKERFILE=cni/$(OS).Dockerfile \
IMAGE=$(CNI_IMAGE) \
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg OS_VERSION=$(OS_VERSION) --build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' \
EXTRA_BUILD_ARGS='--build-arg OS=$(OS) --build-arg ARCH=$(ARCH) --build-arg CNI_AI_PATH=$(CNI_AI_PATH) --build-arg CNI_AI_ID=$(CNI_AI_ID)' \
PLATFORM=$(PLATFORM) \
TAG=$(CNI_PLATFORM_TAG) \
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

cni-image-push: ## push cni container image.
$(MAKE) container-push \
Expand All @@ -455,12 +449,11 @@ cns-image: ## build cns container image.
$(MAKE) container \
DOCKERFILE=cns/$(OS).Dockerfile \
IMAGE=$(CNS_IMAGE) \
EXTRA_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID) --build-arg OS_VERSION=$(OS_VERSION)' \
EXTRA_BUILD_ARGS='--build-arg CNS_AI_PATH=$(CNS_AI_PATH) --build-arg CNS_AI_ID=$(CNS_AI_ID)' \
PLATFORM=$(PLATFORM) \
TAG=$(CNS_PLATFORM_TAG) \
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

cns-image-push: ## push cns container image.
$(MAKE) container-push \
Expand All @@ -484,12 +477,11 @@ npm-image: ## build the npm container image.
$(MAKE) container-$(CONTAINER_BUILDER) \
DOCKERFILE=npm/$(OS).Dockerfile \
IMAGE=$(NPM_IMAGE) \
EXTRA_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID) --build-arg OS_VERSION=$(OS_VERSION)' \
EXTRA_BUILD_ARGS='--build-arg NPM_AI_PATH=$(NPM_AI_PATH) --build-arg NPM_AI_ID=$(NPM_AI_ID)' \
PLATFORM=$(PLATFORM) \
TAG=$(NPM_PLATFORM_TAG)\
OS=$(OS) \
ARCH=$(ARCH) \
OS_VERSION=$(OS_VERSION)
ARCH=$(ARCH)

npm-image-push: ## push npm container image.
$(MAKE) container-push \
Expand Down Expand Up @@ -543,21 +535,18 @@ manifest-create:
$(CONTAINER_BUILDER) manifest create $(IMAGE_REGISTRY)/$(IMAGE):$(TAG)

manifest-add:
$(CONTAINER_BUILDER) manifest add --os=$(OS) --os-version=$($(OS_VERSION)) $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(subst /,-,$(PLATFORM))$(if $(OS_VERSION),-$(OS_VERSION),)-$(TAG)
$(CONTAINER_BUILDER) manifest add --os=$(OS) $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(subst /,-,$(PLATFORM))-$(TAG)

manifest-build: # util target to compose multiarch container manifests from platform specific images.
$(MAKE) manifest-create
$(foreach PLATFORM,$(PLATFORMS),\
$(if $(filter $(PLATFORM),windows/amd64),\
$(foreach OS_VERSION,$(OS_VERSIONS),\
$(MAKE) manifest-add CONTAINER_BUILDER=$(CONTAINER_BUILDER) OS=windows OS_VERSION=$(OS_VERSION) PLATFORM=$(PLATFORM);\
),\
$(MAKE) manifest-add PLATFORM=$(PLATFORM);\
$(MAKE) manifest-add CONTAINER_BUILDER=$(CONTAINER_BUILDER) OS=windows PLATFORM=$(PLATFORM);,\
$(MAKE) manifest-add PLATFORM=$(PLATFORM);\
)\
)\



manifest-push: # util target to push multiarch container manifest.
$(CONTAINER_BUILDER) manifest push --all $(IMAGE_REGISTRY)/$(IMAGE):$(TAG) docker://$(IMAGE_REGISTRY)/$(IMAGE):$(TAG)

Expand Down Expand Up @@ -586,8 +575,7 @@ azure-ipam-manifest-build: ## build azure-ipam multiplat container manifest.
$(MAKE) manifest-build \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(AZURE_IPAM_IMAGE) \
TAG=$(AZURE_IPAM_VERSION) \
OS_VERSIONS="$(OS_VERSIONS)"
TAG=$(AZURE_IPAM_VERSION)

azure-ipam-manifest-push: ## push azure-ipam multiplat container manifest
$(MAKE) manifest-push \
Expand All @@ -603,8 +591,7 @@ ipv6-hp-bpf-manifest-build: ## build ipv6-hp-bpf multiplat container manifest.
$(MAKE) manifest-build \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(IPV6_HP_BPF_IMAGE) \
TAG=$(IPV6_HP_BPF_VERSION) \
OS_VERSIONS="$(OS_VERSIONS)"
TAG=$(IPV6_HP_BPF_VERSION)

ipv6-hp-bpf-manifest-push: ## push ipv6-hp-bpf multiplat container manifest
$(MAKE) manifest-push \
Expand All @@ -620,8 +607,7 @@ cni-manifest-build: ## build cni multiplat container manifest.
$(MAKE) manifest-build \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(CNI_IMAGE) \
TAG=$(CNI_VERSION) \
OS_VERSIONS="$(OS_VERSIONS)"
TAG=$(CNI_VERSION)

cni-manifest-push: ## push cni multiplat container manifest
$(MAKE) manifest-push \
Expand All @@ -637,8 +623,7 @@ cns-manifest-build: ## build azure-cns multiplat container manifest.
$(MAKE) manifest-build \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(CNS_IMAGE) \
TAG=$(CNS_VERSION) \
OS_VERSIONS="$(OS_VERSIONS)"
TAG=$(CNS_VERSION)

cns-manifest-push: ## push cns multiplat container manifest
$(MAKE) manifest-push \
Expand All @@ -654,8 +639,7 @@ npm-manifest-build: ## build azure-npm multiplat container manifest.
$(MAKE) manifest-build \
PLATFORMS="$(PLATFORMS)" \
IMAGE=$(NPM_IMAGE) \
TAG=$(NPM_VERSION) \
OS_VERSIONS="$(OS_VERSIONS)"
TAG=$(NPM_VERSION)

npm-manifest-push: ## push multiplat container manifest
$(MAKE) manifest-push \
Expand Down
1 change: 0 additions & 1 deletion azure-ipam/linux.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ARG ARCH
ARG DROPGZ_VERSION=v0.0.12
ARG OS_VERSION
ARG OS

FROM mcr.microsoft.com/oss/go/microsoft/golang:1.22 AS azure-ipam
Expand Down
Loading

0 comments on commit e42b448

Please sign in to comment.