Skip to content

Commit

Permalink
Merge pull request #176 from rhatdan/from
Browse files Browse the repository at this point in the history
add support for make bootc FROM=
  • Loading branch information
rhatdan authored Apr 6, 2024
2 parents 5253d38 + 72b0a1f commit 065d316
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 9 deletions.
3 changes: 2 additions & 1 deletion recipes/natural_language_processing/chatbot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ APPIMAGE ?= quay.io/ai-lab/${APP}:latest
SERVERIMAGE ?= quay.io/ai-lab/llamacpp-python:latest
SSHPUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;)
BOOTCIMAGE ?= quay.io/ai-lab/${APP}-bootc:latest
FROM ?=

.PHONY: build
build:
podman build -f builds/Containerfile -t ${APPIMAGE} .

.PHONY: bootc
bootc: quadlet
podman build --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .
podman build $${FROM:+--from $${FROM}} --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .

.PHONY: quadlet
quadlet:
Expand Down
10 changes: 8 additions & 2 deletions recipes/natural_language_processing/chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,20 @@ and run:


```
make BOOTCIMAGE=quay.io/your/bootc-chatbot:latest bootc
make BOOTCIMAGE=quay.io/your/chatbot-bootc:latest bootc
```

Substituting the bootc/Containerfile FROM command is simple using the Makefile FROM option.

```
make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTCIMAGE=quay.io/your/chatbot-bootc:latest bootc
```

The magic happens when you have a bootc enabled system running. If you do, and you'd like to update the operating system to the OS you just built
with the chatbot application, it's as simple as ssh-ing into the bootc system and running:

```
bootc switch quay.io/your/bootc-chatbot:latest
bootc switch quay.io/your/chatbot-bootc:latest
```

Upon a reboot, you'll see that the chatbot service is running on the system.
Expand Down
3 changes: 2 additions & 1 deletion recipes/natural_language_processing/rag/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ APPIMAGE ?= quay.io/ai-lab/${APP}:latest
SERVERIMAGE ?= quay.io/ai-lab/llamacpp-python:latest
SSHPUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;)
BOOTCIMAGE ?= quay.io/ai-lab/${APP}-bootc:latest
FROM ?=

.PHONY: build
build:
podman build -f builds/Containerfile -t ${APPIMAGE} .

.PHONY: bootc
bootc: quadlet
podman build --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .
podman build $${FROM:+--from $${FROM}} --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .

.PHONY: quadlet
quadlet:
Expand Down
10 changes: 8 additions & 2 deletions recipes/natural_language_processing/rag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,20 @@ and run:


```
make BOOTCIMAGE=quay.io/your/bootc-rag-chatbot:latest bootc
make BOOTCIMAGE=quay.io/your/rag-bootc:latest bootc
```

Substituting the bootc/Containerfile FROM command is simple using the Makefile FROM option.

```
make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTCIMAGE=quay.io/your/rag-bootc:latest bootc
```

The magic happens when you have a bootc enabled system running. If you do, and you'd like to update the operating system to the OS you just built
with the RAG chatbot application, it's as simple as ssh-ing into the bootc system and running:

```
bootc switch quay.io/your/bootc-rag-chatbot:latest
bootc switch quay.io/your/rag-bootc:latest
```

Upon a reboot, you'll see that the RAG chatbot service is running on the system.
Expand Down
3 changes: 2 additions & 1 deletion recipes/natural_language_processing/summarizer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ APPIMAGE ?= quay.io/ai-lab/${APP}:latest
SERVERIMAGE ?= quay.io/ai-lab/llamacpp-python:latest
SSHPUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;)
BOOTCIMAGE ?= quay.io/ai-lab/${APP}-bootc:latest
FROM ?=

.PHONY: build
build:
podman build -f builds/Containerfile -t ${APPIMAGE} .

.PHONY: bootc
bootc: quadlet
podman build --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .
podman build $${FROM:+--from $${FROM}} --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} .

.PHONY: quadlet
quadlet:
Expand Down
13 changes: 11 additions & 2 deletions recipes/natural_language_processing/summarizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,23 @@ To build a bootable container image that includes this sample summarizer workloa
and run:

```
make BOOTCIMAGE=quay.io/your/bootc-summarizer:latest bootc
make BOOTCIMAGE=quay.io/your/summarizer-bootc:latest bootc
```

You can easily swap out the bootc/Containerfile FROM option with the following make command:
```
Substituting the bootc/Containerfile FROM command is simple using the Makefile FROM option.
```
make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTCIMAGE=quay.io/your/summarizer-bootc:latest bootc
```
The magic happens when you have a bootc enabled system running. If you do, and you'd like to update the operating system to the OS you just built
with the summarizer application, it's as simple as ssh-ing into the bootc system and running:
```
bootc switch quay.io/your/bootc-summarizer:latest
bootc switch quay.io/your/summarizer-bootc:latest
```
Upon a reboot, you'll see that the summarizer service is running on the system.
Expand Down

0 comments on commit 065d316

Please sign in to comment.