From 54cefe04fa371588c161db1e02efcd015263d054 Mon Sep 17 00:00:00 2001 From: Mykhailo Bobrovskyi Date: Mon, 21 Oct 2024 08:31:51 +0300 Subject: [PATCH 1/2] [kjobctl] Add slurm-init alpine image. --- cmd/experimental/kjobctl/Makefile | 15 +++++++++++++++ .../kjobctl/images/slurm-init/Dockerfile | 18 ++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 cmd/experimental/kjobctl/images/slurm-init/Dockerfile diff --git a/cmd/experimental/kjobctl/Makefile b/cmd/experimental/kjobctl/Makefile index e15788ad99..c9bee4f138 100644 --- a/cmd/experimental/kjobctl/Makefile +++ b/cmd/experimental/kjobctl/Makefile @@ -17,6 +17,15 @@ CGO_ENABLED ?= 0 GO_CMD ?= go GO_FMT ?= gofmt +GIT_TAG ?= $(shell git describe --tags --dirty --always) + +DOCKER_BUILDX_CMD ?= docker buildx +IMAGE_BUILD_CMD ?= $(DOCKER_BUILDX_CMD) build +STAGING_IMAGE_REGISTRY ?= us-central1-docker.pkg.dev/k8s-staging-images +IMAGE_PROJECT ?= kjob +IMAGE_REGISTRY ?= $(STAGING_IMAGE_REGISTRY)/$(IMAGE_PROJECT) +PLATFORMS ?= linux/amd64,linux/arm64,linux/s390x,linux/ppc64le + PROJECT_DIR := $(shell dirname $(abspath $(lastword $(MAKEFILE_LIST)))) ARTIFACTS ?= $(PROJECT_DIR)/bin TOOLS_DIR ?= $(PROJECT_DIR)/hack/tools @@ -165,6 +174,12 @@ install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion. $(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f - +SLURM_INIT_IMAGE_NAME ?= slurm-init +SLURM_INIT_IMAGE_REPO ?= $(IMAGE_REGISTRY)/$(SLURM_INIT_IMAGE_NAME) +SLURM_INIT_IMAGE_TAG ?= $(SLURM_INIT_IMAGE_REPO):$(GIT_TAG) +.PHONY: slurm-init-image-build +slurm-init-image-build: + $(IMAGE_BUILD_CMD) -t $(SLURM_INIT_IMAGE_TAG) --platform=$(PLATFORMS) $(PUSH) $(PROJECT_DIR)/images/slurm-init .PHONY: kubectl-kjob kubectl-kjob: embeded-manifest ## Build kubectl-kjob binary file to bin directory. diff --git a/cmd/experimental/kjobctl/images/slurm-init/Dockerfile b/cmd/experimental/kjobctl/images/slurm-init/Dockerfile new file mode 100644 index 0000000000..212852e806 --- /dev/null +++ b/cmd/experimental/kjobctl/images/slurm-init/Dockerfile @@ -0,0 +1,18 @@ +# 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. + +FROM alpine:20240807 + +RUN apk add --no-cache ca-certificates && update-ca-certificates +RUN apk add --no-cache bash bind-tools From 1cbd30267563157fdcf2cfe5143f33d8b0995cef Mon Sep 17 00:00:00 2001 From: Mykhailo Bobrovskyi Date: Wed, 13 Nov 2024 07:58:53 +0200 Subject: [PATCH 2/2] Remove ca-certificates from image. --- cmd/experimental/kjobctl/images/slurm-init/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/cmd/experimental/kjobctl/images/slurm-init/Dockerfile b/cmd/experimental/kjobctl/images/slurm-init/Dockerfile index 212852e806..b9324b7642 100644 --- a/cmd/experimental/kjobctl/images/slurm-init/Dockerfile +++ b/cmd/experimental/kjobctl/images/slurm-init/Dockerfile @@ -14,5 +14,4 @@ FROM alpine:20240807 -RUN apk add --no-cache ca-certificates && update-ca-certificates RUN apk add --no-cache bash bind-tools