From 9a989848acb45bc99875651445cd7038c8d2e7d1 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Fri, 29 Mar 2024 10:56:39 -0400 Subject: [PATCH] Fix quadlet copy issues Signed-off-by: Daniel J Walsh --- .../natural_language_processing/chatbot/Makefile | 5 +++++ .../chatbot/bootc/Containerfile | 16 +++++++++------- .../chatbot/quadlet/chatbot.image | 6 +++--- .../chatbot/quadlet/chatbot.yaml | 6 +++--- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/recipes/natural_language_processing/chatbot/Makefile b/recipes/natural_language_processing/chatbot/Makefile index 5670a7da8..e9a2312b1 100644 --- a/recipes/natural_language_processing/chatbot/Makefile +++ b/recipes/natural_language_processing/chatbot/Makefile @@ -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 diff --git a/recipes/natural_language_processing/chatbot/bootc/Containerfile b/recipes/natural_language_processing/chatbot/bootc/Containerfile index 9098f5a3d..688c90238 100644 --- a/recipes/natural_language_processing/chatbot/bootc/Containerfile +++ b/recipes/natural_language_processing/chatbot/bootc/Containerfile @@ -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 && \ @@ -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} diff --git a/recipes/natural_language_processing/chatbot/quadlet/chatbot.image b/recipes/natural_language_processing/chatbot/quadlet/chatbot.image index 2d60f41c8..f871c909a 100644 --- a/recipes/natural_language_processing/chatbot/quadlet/chatbot.image +++ b/recipes/natural_language_processing/chatbot/quadlet/chatbot.image @@ -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 diff --git a/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml b/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml index 2d3431f3a..540d8d0d9 100644 --- a/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml +++ b/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml @@ -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 @@ -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 @@ -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