Skip to content
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

move bootc builder (dtk) to common #586

Merged
merged 2 commits into from
Jun 20, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/training_bootc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:

- name: Build Image
id: build_image
run: make dtk ARCH=${{ matrix.arch }}
run: make driver-toolkit ARCH=${{ matrix.arch }}
working-directory: ${{ matrix.context }}

- name: Login to Container Registry
Expand Down
6 changes: 4 additions & 2 deletions training/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,15 @@ vllm:
#
# Create bootc container images prepared for AI
#
.PHONY: amd nvidia intel vllm
.PHONY: driver-tookit amd nvidia intel vllm
driver-tookit:
make -C common/ -f Makefile.common driver-toolkit
amd:
make -C amd-bootc/ bootc bootc-models
intel:
make -C intel-bootc/ bootc bootc-models
nvidia:
make -C nvidia-bootc/ dtk bootc bootc-models
make -C nvidia-bootc/ driver-toolkit bootc bootc-models

#
# Make Bootc container images preinstalled with cloud-init
Expand Down
20 changes: 19 additions & 1 deletion 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

DRIVER_TOOLKIT_IMAGE_NAME ?= driver-toolkit
DRIVER_TOOLKIT_IMAGE_TAG ?= latest
DRIVER_TOOLKIT_IMAGE = ${REGISTRY}/${REGISTRY_ORG}/${DRIVER_TOOLKIT_IMAGE_NAME}:${DRIVER_TOOLKIT_IMAGE_TAG}

ENABLE_RT ?=

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

.PHONY: prepare-files
Expand Down Expand Up @@ -113,7 +119,19 @@ bootc-models: generate-model-cfile
--file ${MODELS_CONTAINERFILE} \
--security-opt label=disable \
--tag "${BOOTC_MODELS_IMAGE}" \
-v ${OUTDIR}:/run/.input:ro \
-v ${OUTDIR}:/run/.input:ro

.PHONY: driver-toolkit
driver-toolkit:
"${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 ../common/driver-toolkit/Containerfile \
--tag "${DRIVER_TOOLKIT_IMAGE}" \
${CONTAINER_TOOL_EXTRA_ARGS} .

.PHONY: clean
Expand Down
20 changes: 1 addition & 19 deletions training/nvidia-bootc/Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,14 @@
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
bootc: driver-toolkit check-sshkey prepare-files growfs
"${CONTAINER_TOOL}" build \
$(ARCH:%=--platform linux/%) \
$(BUILD_ARG_FILE:%=--build-arg-file=%) \
Expand Down