Skip to content

[release-1.27] Make a windows cloud-node-manager image based off the host-process-containers base image #6774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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))

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
## --------------------------------------
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"]