Skip to content

Commit

Permalink
Make a windows cloud-node-manager-image based off the host-process-co…
Browse files Browse the repository at this point in the history
…ntaieners base image
  • Loading branch information
marosset authored and k8s-infra-cherrypick-robot committed Aug 6, 2024
1 parent e2d8e6b commit 0c6ea5d
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,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 .
Expand Down Expand Up @@ -256,6 +267,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))

Expand All @@ -265,6 +279,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

Expand Down Expand Up @@ -295,6 +312,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
Expand All @@ -304,6 +324,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
## --------------------------------------
Expand Down
20 changes: 20 additions & 0 deletions cloud-node-manager-windows-hpc.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 0c6ea5d

Please sign in to comment.