Skip to content

Commit

Permalink
Fix quadlet copy issues
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Mar 29, 2024
1 parent 7b7add6 commit 9a98984
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
5 changes: 5 additions & 0 deletions recipes/natural_language_processing/chatbot/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
SSHPUBKEY := $(shell cat ${HOME}/.ssh/id_rsa.pub;)
.PHONY: build
build:
podman build -f builds/Containerfile -t ghcr.io/ai-lab-recipes/chatbot .

.PHONY: bootc
bootc:
podman build --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" --build-arg MODEL-IMAGE=${MODEL-IMAGE} -f bootc/Containerfile -t ghcr.io/ai-lab-recipes/chatbot-bootc .

.PHONY: install
install:
pip install -r tests/requirements-test.txt
Expand Down
16 changes: 9 additions & 7 deletions recipes/natural_language_processing/chatbot/bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

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 && \
Expand All @@ -17,14 +16,17 @@ RUN mkdir /usr/etc-system && \
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
COPY quadlet/chatbot.kube quadlet/chatbot.yaml quadlet/chatbot.image /usr/share/containers/systemd

# 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

ARG MODELIMAGE=quay.io/ai-lab/mistral-7b-instruct:latest
ARG APPIMAGE=quay.io/ai-lab/chatbot:latest
ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest

RUN podman pull --root /usr/lib/containers/storage ${SERVERIMAGE}
RUN podman pull --root /usr/lib/containers/storage ${APPIMAGE}
RUN podman pull --root /usr/lib/containers/storage ${MODELIMAGE}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
WantedBy=chatbot.service

[Image]
Image=quay.io/redhat-et/locallm-mistral-7b-gguf:latest
Image=quay.io/redhat-et/locallm-model-service:latest
Image=quay.io/redhat-et/locallm-chatbot:latest
Image=quay.io/ai-lab/llamacpp-python:latest
Image=quay.io/ai-lab/mistral-7b-instruct:latest
Image=quay.io/ai-lab/chatbot:latest
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
initContainers:
- name: model-file
image: quay.io/redhat-et/locallm-mistral-7b-gguf:latest
image: quay.io/ai-lab/mistral-7b-instruct:latest
command: ['/usr/bin/install', "/model/mistral-7b-instruct-v0.1.Q4_K_S.gguf", "/shared/"]
volumeMounts:
- name: model-file
Expand All @@ -16,7 +16,7 @@ spec:
- env:
- name: MODEL_SERVICE_ENDPOINT
value: http://0.0.0.0:8001/v1
image: quay.io/redhat-et/locallm-chatbot:latest
image: quay.io/ai-lab/chatbot:latest
name: chatbot-inference
ports:
- containerPort: 8501
Expand All @@ -30,7 +30,7 @@ spec:
value: 8001
- name: MODEL_PATH
value: /model/mistral-7b-instruct-v0.1.Q4_K_S.gguf
image: quay.io/redhat-et/locallm-model-service:latest
image: quay.io/ai-lab/llamacpp-python:latest
name: chatbot-model-service
ports:
- containerPort: 8001
Expand Down

0 comments on commit 9a98984

Please sign in to comment.