diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index 48a6f591..26ea7948 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -14,6 +14,7 @@ DISK_UID ?= $(shell id -u) DISK_GID ?= $(shell id -g) FROM ?= ARCH ?= +BUILD_ARG_FILE ?= CONTAINERFILE ?= Containerfile GRAPH_ROOT=$(shell podman info --format '{{ .Store.GraphRoot }}') UMASK=$(shell umask) @@ -76,12 +77,16 @@ install:: .PHONY: build build: - podman build --squash-all $(ARCH:%=--platform linux/%) $(FROM:%=--from %) -t ${APP_IMAGE} app/ + podman build --squash-all \ + $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ + $(FROM:%=--from %) -t ${APP_IMAGE} app/ .PHONY: bootc bootc: quadlet growfs podman build \ $(ARCH:%=--arch %) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(FROM:%=--from %) \ $(AUTH_JSON:%=-v %:/run/containers/0/auth.json) \ --security-opt label=disable \ diff --git a/recipes/natural_language_processing/rag/Makefile b/recipes/natural_language_processing/rag/Makefile index 3ac26f88..4564e247 100644 --- a/recipes/natural_language_processing/rag/Makefile +++ b/recipes/natural_language_processing/rag/Makefile @@ -18,6 +18,7 @@ run: bootc: quadlet "${CONTAINER_TOOL}" build \ $(ARCH:%=--arch %) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(FROM:%=--from %) \ $(AUTH_JSON:%=-v %:/run/containers/0/auth.json) \ --security-opt label=disable \ diff --git a/training/amd-bootc/Makefile b/training/amd-bootc/Makefile index ec442599..9956e04a 100644 --- a/training/amd-bootc/Makefile +++ b/training/amd-bootc/Makefile @@ -9,6 +9,7 @@ default: bootc bootc: prepare-files growfs "${CONTAINER_TOOL}" build \ $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \ $(FROM:%=--from=%) \ $(INSTRUCTLAB_IMAGE:%=--build-arg INSTRUCTLAB_IMAGE=%) \ diff --git a/training/common/Makefile.common b/training/common/Makefile.common index 1fb38209..03d3e61b 100644 --- a/training/common/Makefile.common +++ b/training/common/Makefile.common @@ -18,6 +18,7 @@ AUTH_JSON ?= SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) BOOTC_IMAGE_BUILDER ?= quay.io/centos-bootc/bootc-image-builder +BUILD_ARG_FILE ?= IMAGE_BUILDER_CONFIG ?= IMAGE_BUILDER_EXTRA_ARGS ?= DISK_TYPE ?= qcow2 diff --git a/training/deepspeed/Makefile b/training/deepspeed/Makefile index 65d8c6ea..c6989a73 100644 --- a/training/deepspeed/Makefile +++ b/training/deepspeed/Makefile @@ -1,6 +1,7 @@ IMAGE_NAME ?= deepspeed-trainer CONTAINER_TOOL ?= podman SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) +BUILD_ARG_FILE ?= default: image @@ -10,6 +11,7 @@ image: rm -rf ../build/deepspeed-trainer "${CONTAINER_TOOL}" build \ $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(SOURCE_DATE_EPOCH:%=--timestamp=%) \ --file Containerfile \ --squash-all \ diff --git a/training/intel-bootc/Makefile b/training/intel-bootc/Makefile index c3c60463..aa39273d 100644 --- a/training/intel-bootc/Makefile +++ b/training/intel-bootc/Makefile @@ -8,6 +8,7 @@ default: bootc bootc: growfs prepare-files ${CONTAINER_TOOL} build \ $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=%) \ $(EXTRA_RPM_PACKAGES:%=--build-arg EXTRA_RPM_PACKAGES=%) \ $(FROM:%=--build-arg BASEIMAGE=%) \ diff --git a/training/nvidia-bootc/Makefile b/training/nvidia-bootc/Makefile index 8a0d6f53..b807b656 100644 --- a/training/nvidia-bootc/Makefile +++ b/training/nvidia-bootc/Makefile @@ -16,6 +16,7 @@ default: bootc 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=%) \ @@ -28,6 +29,7 @@ dtk: bootc: dtk check-sshkey prepare-files growfs "${CONTAINER_TOOL}" build \ $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(CUDA_VERSION:%=--build-arg CUDA_VERSION=%) \ $(DRIVER_TOOLKIT_IMAGE:%=--build-arg DRIVER_TOOLKIT_IMAGE=%) \ $(DRIVER_VERSION:%=--build-arg DRIVER_VERSION=%) \ diff --git a/training/vllm/Makefile b/training/vllm/Makefile index fc65cf50..cf071a58 100644 --- a/training/vllm/Makefile +++ b/training/vllm/Makefile @@ -1,5 +1,6 @@ CONTAINER_TOOL ?= podman SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct) +BUILD_ARG_FILE ?= default: image @@ -9,6 +10,7 @@ image: rm -rf ../build/vllm "${CONTAINER_TOOL}" build \ $(ARCH:%=--platform linux/%) \ + $(BUILD_ARG_FILE:%=--build-arg-file=%) \ $(SOURCE_DATE_EPOCH:%=--timestamp=%) \ --file Containerfile \ --squash-all \