Skip to content

Commit

Permalink
[kjobctl] Add slurm-init alpine image.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbobrovskyi committed Oct 25, 2024
1 parent 6300ff3 commit 1d73998
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cmd/experimental/kjobctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions cmd/experimental/kjobctl/images/slurm-init/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 1d73998

Please sign in to comment.