Skip to content

Commit

Permalink
Merge pull request #544 from rhatdan/build
Browse files Browse the repository at this point in the history
Add support for BUILD_ARG_FILE
  • Loading branch information
rhatdan authored Jun 15, 2024
2 parents b910e23 + cb742bb commit 7b1d2f9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion recipes/common/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions recipes/natural_language_processing/rag/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions training/amd-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=%) \
Expand Down
1 change: 1 addition & 0 deletions training/common/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions training/deepspeed/Makefile
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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 \
Expand Down
1 change: 1 addition & 0 deletions training/intel-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=%) \
Expand Down
2 changes: 2 additions & 0 deletions training/nvidia-bootc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=%) \
Expand All @@ -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=%) \
Expand Down
2 changes: 2 additions & 0 deletions training/vllm/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
CONTAINER_TOOL ?= podman
SOURCE_DATE_EPOCH ?= $(shell git log -1 --pretty=%ct)
BUILD_ARG_FILE ?=

default: image

Expand All @@ -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 \
Expand Down

0 comments on commit 7b1d2f9

Please sign in to comment.