Skip to content

Commit

Permalink
Merge pull request containers#120 from rhatdan/bootc
Browse files Browse the repository at this point in the history
Cleanup bootc and quadlet handling
  • Loading branch information
sallyom authored Mar 29, 2024
2 parents 07fe7d2 + 0b2baaa commit 7b7add6
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 17 deletions.
2 changes: 1 addition & 1 deletion recipes/natural_language_processing/chatbot/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: build
build:
podman build -t ghcr.io/ai-lab-recipes/chatbot .
podman build -f builds/Containerfile -t ghcr.io/ai-lab-recipes/chatbot .

.PHONY: install
install:
Expand Down
6 changes: 0 additions & 6 deletions recipes/natural_language_processing/chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,3 @@ podman run --rm -it -p 8501:8501 -e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001
### Interact with the AI Application

Everything should now be up an running with the chat application available at [`http://localhost:8501`](http://localhost:8501). By using this recipe and getting this starting point established, users should now have an easier time customizing and building their own LLM enabled chatbot applications.






30 changes: 30 additions & 0 deletions recipes/natural_language_processing/chatbot/bootc/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Example: an AI powered sample application is embedded as a systemd service
# via Podman quadlet files in /usr/share/containers/systemd
#
# Use build command:
# podman build --build-arg "sshpubkey=$(cat $HOME/.ssh/mykey.pub)" -t quay.io/exampleos/chatbot .
# The --build-arg "SSHPUBKEY=$(cat ~/.ssh/mykey.pub)" option inserts your
# public key into the image, allowing root access via ssh.

FROM quay.io/centos-bootc/centos-bootc:stream9
ARG SSHPUBKEY
ARG MODEL-SERVER-IMAGE=quay.io/redhat-et/locallm-model-service:latest

RUN mkdir /usr/etc-system && \
echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \
echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys

RUN dnf -y update && (dnf install -y vim || true) && dnf clean all

# Add quadlet files to setup system to automatically run AI application on boot
COPY ../quadlet/chatbot.kube /usr/share/containers/systemd/chatbot.kube
COPY ../quadlet/chatbot.yaml /usr/share/containers/systemd/chatbot.yaml
COPY ../quadlet/chatbot.image /usr/share/containers/systemd/chatbot.image

# pre-pull workload images:
# Comment the pull commands to keep bootc image smaller.
# The quadlet .image file added above pulls following images on boot if not
# pre-pulled here
RUN podman pull quay.io/redhat-et/ai-model:latest
RUN podman pull ${MODEL-SERVER-IMAGE}
RUN podman pull quay.io/redhat-et/chatbot:latest

This file was deleted.

10 changes: 10 additions & 0 deletions recipes/natural_language_processing/chatbot/quadlet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### Run chatbot as a systemd service

```bash
sudo cp chatbot.yaml /usr/share/containers/systemd/chatbot.yaml
sudo cp chatbot.kube /usr/share/containers/chatbot.kube
sudo cp chatbot.image /usr/share/containers/chatbot.image
sudo /usr/libexec/podman/quadlet --dryrun (optional)
sudo systemctl daemon-reload
sudo systemctl start chatbot
```

0 comments on commit 7b7add6

Please sign in to comment.