From 8e171cd922dc990a492f27f9877b171eb13f0d8a Mon Sep 17 00:00:00 2001 From: Mark Rossetti Date: Fri, 31 May 2024 13:09:00 -0700 Subject: [PATCH] Make a windows cloud-node-manager-image based off the host-process-contaieners base image --- Makefile | 28 +++++++++++++++++++++++ cloud-node-manager-windows-hpc.Dockerfile | 20 ++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 cloud-node-manager-windows-hpc.Dockerfile diff --git a/Makefile b/Makefile index d0f6f4e243..4a1bc672ab 100644 --- a/Makefile +++ b/Makefile @@ -175,6 +175,17 @@ build-node-image-windows: buildx-setup $(BIN_DIR)/azure-cloud-node-manager.exe # --provenance=false \ --sbom=false +.PHONY: build-node-image-windows-hpc +build-node-image-windows-hpc: buildx-setup $(BIN_DIR)/azure-cloud-node-manager.exe ## Build node-manager image for Windows. + $(DOCKER_BUILDX) build --pull \ + --output=type=$(OUTPUT_TYPE) \ + --platform windows/$(ARCH) \ + -t $(NODE_MANAGER_WINDOWS_FULL_IMAGE_PREFIX)-hpc-$(ARCH) \ + --build-arg ARCH=$(ARCH) \ + -f cloud-node-manager-windows-hpc.Dockerfile . \ + --provenance=false \ + --sbom=false + .PHONY: build-ccm-e2e-test-image build-ccm-e2e-test-image: ## Build e2e test image. docker build -t $(CCM_E2E_TEST_IMAGE) -f ./e2e.Dockerfile . @@ -262,6 +273,9 @@ push-all-node-images-linux: $(addprefix push-node-image-linux-,$(ALL_ARCH.linux) .PHONY: push-all-node-images-windows ## Push node-manager image for Windows. push-all-node-images-windows: $(addprefix push-node-image-windows-,$(ALL_OS_ARCH.windows)) +.PHONY: push-all-node-images-windows-hpc ## Push node-manager image for Windows. +push-all-node-images-windows-hpc: $(addprefix push-node-images-windows-hpc-,$(ALL_OS_ARCH.windows)) + # split words on hyphen, access by 1-index word-hyphen = $(word $2,$(subst -, ,$1)) @@ -271,6 +285,9 @@ push-node-image-linux-%: push-node-image-windows-%: $(MAKE) WINDOWS_OSVERSION=$(call word-hyphen,$*,1) ARCH=$(call word-hyphen,$*,2) OUTPUT_TYPE=registry build-node-image-windows +push-node-image-windows-hpc-%: + $(MAKE) ARCH=$(call word-hyphen,$*,1) OUTPUT_TYPE=registry build-node-image-windows-hpc + .PHONY: build-all-node-images ## Build node-manager image for all OS and archs. build-all-node-images: build-all-node-images-linux build-all-node-images-windows @@ -301,6 +318,9 @@ push-ccm-image-%: manifest-node-manager-image-windows-%: $(MAKE) WINDOWS_OSVERSION=$(call word-hyphen,$*,1) ARCH=$(call word-hyphen,$*,2) manifest-node-manager-image-windows +manifest-node-manager-image-windows-hpc-%: + $(MAKE) ARCH=$(call word-hyphen,$*,1) manifest-node-manager-image-windows-hpc + .PHONY: manifest-node-manager-image-windows manifest-node-manager-image-windows: set -x @@ -310,6 +330,14 @@ manifest-node-manager-image-windows: docker manifest annotate --os windows --arch $(ARCH) --os-version $${full_version} $(NODE_MANAGER_IMAGE) $(NODE_MANAGER_WINDOWS_FULL_IMAGE_PREFIX)-$(WINDOWS_OSVERSION)-$(ARCH) docker manifest push --purge $(NODE_MANAGER_IMAGE) +.PHONY: manifest-node-manager-images-windows-hpc +manifest-node-manager-image-windows-hpc: + set -x + docker manifest create --amend $(NODE_MANAGER_IMAGE) $(NODE_MANAGER_LINUX_FULL_IMAGE_PREFIX)-$(ARCH) $(NODE_MANAGER_WINDOWS_FULL_IMAGE_PREFIX)-hpc-$(ARCH) + docker manifest annotate --os linux --arch $(ARCH) $(NODE_MANAGER_IMAGE) $(NODE_MANAGER_LINUX_FULL_IMAGE_PREFIX)-$(ARCH) + docker manifest annotate --os windows --arch $(ARCH) $(NODE_MANAGER_IMAGE) $(NODE_MANAGER_WINDOWS_FULL_IMAGE_PREFIX)-hpc-$(ARCH) + docker manifest push --purge $(NODE_MANAGER_IMAGE) + ## -------------------------------------- ##@ Tests ## -------------------------------------- diff --git a/cloud-node-manager-windows-hpc.Dockerfile b/cloud-node-manager-windows-hpc.Dockerfile new file mode 100644 index 0000000000..98b7692de0 --- /dev/null +++ b/cloud-node-manager-windows-hpc.Dockerfile @@ -0,0 +1,20 @@ +# syntax=docker/dockerfile:1 + +# Copyright 2024 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +ARG ARCH=amd64 +FROM mcr.microsoft.com/oss/kubernetes/windows-host-process-containers-base-image:v1.0.0 +ARG ARCH +COPY bin/azure-cloud-node-manager-${ARCH}.exe /cloud-node-manager.exe +ENTRYPOINT ["/azure-cloud-node-manager.exe"] \ No newline at end of file