Skip to content

Commit

Permalink
Merge pull request #367 from PaulYuuu/bib-skip-bootc-build
Browse files Browse the repository at this point in the history
minor update for `bootc-image-builder` target
  • Loading branch information
rhatdan authored Apr 29, 2024
2 parents 1f2db77 + 2ba7c8f commit 3925281
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions recipes/common/Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ SSH_PUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;)
BOOTC_IMAGE ?= quay.io/$(REGISTRY_ORG)/${APP}-bootc:latest
BOOTC_IMAGE_BUILDER ?= quay.io/centos-bootc/bootc-image-builder
DISK_TYPE ?= qcow2
DISK_USER ?= $(shell id -u)
DISK_GROUP ?= $(shell id -g)
DISK_UID ?= $(shell id -u)
DISK_GID ?= $(shell id -g)
FROM ?=
ARCH ?=
CONTAINERFILE ?= Containerfile
Expand Down Expand Up @@ -106,7 +106,12 @@ bootc-run:
$(BOOTC_IMAGE) /sbin/init

.PHONY: bootc-image-builder
bootc-image-builder: bootc
bootc-image-builder:
@if podman image exists $(BOOTC_IMAGE); then \
echo "$(BOOTC_IMAGE) exists in local storage, using it"; \
else \
$(MAKE) bootc; \
fi
mkdir -p build/store
podman run \
--rm \
Expand All @@ -122,7 +127,7 @@ bootc-image-builder: bootc
$(BOOTC_IMAGE_BUILDER) \
$(ARCH:%=--target-arch %) \
--type $(DISK_TYPE) \
--chown $(DISK_USER):$(DISK_GROUP) \
--chown $(DISK_UID):$(DISK_GID) \
--local \
$(BOOTC_IMAGE)

Expand Down
2 changes: 2 additions & 0 deletions recipes/common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ used to override defaults for a variety of make targets.
|BOOTC_IMAGE_BUILDER | Bootc Image Builder container image | `quay.io/centos-bootc/bootc-image-builder` |
|CHROMADB_IMAGE | ChromaDB image to be used for application | `$(REGISTRY)/$(REGISTRY_ORG)/chromadb:latest` |
|DISK_TYPE | Disk type to be created by BOOTC_IMAGE_BUILDER | `qcow2` (Options: ami, iso, vmdk, raw) |
|DISK_UID | Disk UID to be specified by BOOTC_IMAGE_BUILDER | `$(shell id -u)` |
|DISK_GID | Disk GID to be specified by BOOTC_IMAGE_BUILDER | `$(shell id -g)` |
|MODEL_IMAGE | AI Model to be used by application | `$(REGISTRY)/$(REGISTRY_ORG)/mistral-7b-instruct:latest`|
|SERVER_IMAGE | AI Model Server Application | `$(REGISTRY)/$(REGISTRY_ORG)/llamacpp_python:latest` |
|SSH_PUBKEY | SSH Public key preloaded in bootc image. | `$(shell cat ${HOME}/.ssh/id_rsa.pub;)` |
Expand Down

0 comments on commit 3925281

Please sign in to comment.