Skip to content

Commit

Permalink
move bootc builder to common
Browse files Browse the repository at this point in the history
Signed-off-by: greg pereira <[email protected]>
  • Loading branch information
Gregory-Pereira committed Jun 19, 2024
1 parent cb8cc3c commit 79bc221
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
4 changes: 3 additions & 1 deletion training/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ vllm:
#
# Create bootc container images prepared for AI
#
.PHONY: amd nvidia intel vllm
.PHONY: builder amd nvidia intel vllm
builder:
make -C common/ dtk
amd:
make -C amd-bootc/ bootc bootc-models
intel:
Expand Down
17 changes: 17 additions & 0 deletions training/common/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ TRAIN_WRAPPER = $(CURDIR)/../ilab-wrapper/ilab-training-launcher
OUTDIR = $(CURDIR)/../build
MODELS_CONTAINERFILE = $(OUTDIR)/Containerfile.models

DTK_IMAGE_NAME ?= bootc-builder
DTK_IMAGE_TAG ?= latest
DRIVER_TOOLKIT_IMAGE = ${REGISTRY}/${REGISTRY_ORG}/${DTK_IMAGE_NAME}:${DTK_IMAGE_TAG}

ENABLE_RT ?=

SSH_PUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub 2> /dev/null)

.PHONY: prepare-files
Expand Down Expand Up @@ -114,6 +120,17 @@ bootc-models: generate-model-cfile
--security-opt label=disable \
--tag "${BOOTC_MODELS_IMAGE}" \
-v ${OUTDIR}:/run/.input:ro \
.PHONY: dtk
dtk:
"${CONTAINER_TOOL}" build \
$(ARCH:%=--platform linux/%) \
$(BUILD_ARG_FILE:%=--build-arg-file=%) \
$(ENABLE_RT:%=--build-arg ENABLE_RC=%) \
$(FROM:%=--from=%) \
$(KERNEL_VERSION:%=--build-arg KERNEL_VERSION=%) \
$(SOURCE_DATE_EPOCH:%=--timestamp=%) \
--file bootc-image-builder/Containerfile \
--tag "${DRIVER_TOOLKIT_IMAGE}" \
${CONTAINER_TOOL_EXTRA_ARGS} .

.PHONY: clean
Expand Down
File renamed without changes.
18 changes: 0 additions & 18 deletions training/nvidia-bootc/Makefile
Original file line number Diff line number Diff line change
@@ -1,30 +1,12 @@
VENDOR ?= nvidia
IMAGE_NAME ?= $(VENDOR)-bootc
DTK_IMAGE_NAME ?= $(VENDOR)-builder
DTK_IMAGE_TAG ?= latest
DRIVER_TOOLKIT_IMAGE = ${REGISTRY}/${REGISTRY_ORG}/${DTK_IMAGE_NAME}:${DTK_IMAGE_TAG}

CUDA_VERSION ?=
OS_VERSION_MAJOR ?=
ENABLE_RT ?=
MODELS_CONTAINERFILE = $(OUTDIR)/Containerfile.models
include ../common/Makefile.common

default: bootc

.PHONY: dtk
dtk:
"${CONTAINER_TOOL}" build \
$(ARCH:%=--platform linux/%) \
$(BUILD_ARG_FILE:%=--build-arg-file=%) \
$(ENABLE_RT:%=--build-arg ENABLE_RC=%) \
$(FROM:%=--from=%) \
$(KERNEL_VERSION:%=--build-arg KERNEL_VERSION=%) \
$(SOURCE_DATE_EPOCH:%=--timestamp=%) \
--file Containerfile.builder \
--tag "${DRIVER_TOOLKIT_IMAGE}" \
${CONTAINER_TOOL_EXTRA_ARGS} .

.PHONY: bootc
bootc: dtk check-sshkey prepare-files growfs
"${CONTAINER_TOOL}" build \
Expand Down

0 comments on commit 79bc221

Please sign in to comment.