From 0769d88fcddbc0ecefcd64db70532f805612472d Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 9 Apr 2024 05:52:44 -0400 Subject: [PATCH 1/4] fix up renaming of IMAGE Constants. Signed-off-by: Daniel J Walsh --- recipes/common/Makefile.common | 15 +++++++++--- .../chatbot/bootc/Containerfile | 12 +++++----- .../chatbot/quadlet/chatbot.image | 6 ++--- .../chatbot/quadlet/chatbot.yaml | 6 ++--- .../codegen/README.md | 4 ++-- .../codegen/bootc/Containerfile | 24 +++++++++---------- .../codegen/quadlet/codegen.image | 7 +++--- .../codegen/quadlet/codegen.yaml | 8 +++---- .../natural_language_processing/rag/README.md | 6 ++--- .../rag/bootc/Containerfile | 12 +++++----- .../rag/quadlet/rag.image | 6 ++--- .../rag/quadlet/rag.yaml | 8 +++---- .../summarizer/README.md | 6 ++--- .../summarizer/bootc/Containerfile | 12 +++++----- .../summarizer/quadlet/summarizer.yaml | 6 ++--- 15 files changed, 74 insertions(+), 64 deletions(-) diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index 2dda6da3..ddf866f5 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -1,10 +1,10 @@ REGISTRY ?= quay.io REGISTRY_ORG ?= ai-lab -IMAGE_NAME ?= $(REGISTRY_ORG)/${APP}:latest +APP_IMAGE ?= $(REGISTRY)/$(IMAGE_NAME) CHROMADB_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/chromadb:latest +IMAGE_NAME ?= $(REGISTRY_ORG)/${APP}:latest MODEL_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/mistral-7b-instruct:latest -APP_IMAGE ?= $(REGISTRY)/$(IMAGE_NAME) SERVER_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/llamacpp-python:latest SSH_PUBKEY ?= $(shell cat ${HOME}/.ssh/id_rsa.pub;) @@ -41,7 +41,16 @@ build: .PHONY: bootc bootc: quadlet - podman build $${ARCH:+--arch $${ARCH}} $${FROM:+--from $${FROM}} --cap-add SYS_ADMIN --build-arg "SSH_PUBKEY=$(SSH_PUBKEY)" -f bootc/Containerfile -t ${BOOTC_IMAGE} . + podman build \ + $${ARCH:+--arch $${ARCH}} \ + $${FROM:+--from $${FROM}} \ + --cap-add SYS_ADMIN \ + --build-arg MODEL_IMAGE=$(MODEL_IMAGE) \ + --build-arg APP_IMAGE=$(APP_IMAGE) \ + --build-arg SERVER_IMAGE=$(SERVER_IMAGE) \ + --build-arg "SSHPUBKEY=$(SSHPUBKEY)" \ + -f bootc/Containerfile \ + -t ${BOOTC_IMAGE} . @echo "" @echo "Successfully built bootc image '${BOOTC_IMAGE}'." @echo "You may now convert the image into a disk image via bootc-image-builder" diff --git a/recipes/natural_language_processing/chatbot/bootc/Containerfile b/recipes/natural_language_processing/chatbot/bootc/Containerfile index bfa605eb..cede41ba 100644 --- a/recipes/natural_language_processing/chatbot/bootc/Containerfile +++ b/recipes/natural_language_processing/chatbot/bootc/Containerfile @@ -14,9 +14,9 @@ RUN mkdir /usr/etc-system && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys ARG RECIPE=chatbot -ARG MODELIMAGE=quay.io/ai-lab/mistral-7b-instruct:latest -ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest -ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest +ARG MODEL_IMAGE=quay.io/ai-lab/mistral-7b-instruct:latest +ARG APP_IMAGE=quay.io/ai-lab/${RECIPE}:latest +ARG SERVER_IMAGE=quay.io/ai-lab/llamacpp-python:latest # Add quadlet files to setup system to automatically run AI application on boot COPY build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd @@ -37,8 +37,8 @@ VOLUME /var/lib/containers # Prepull the model, model_server & application images to populate the system. # Comment the pull commands to keep bootc image smaller. # The quadlet .image file added above pulls following images with service startup -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} +RUN podman pull --root /usr/lib/containers/storage ${SERVER_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${APP_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${MODEL_IMAGE} RUN podman system reset --force 2>/dev/null diff --git a/recipes/natural_language_processing/chatbot/quadlet/chatbot.image b/recipes/natural_language_processing/chatbot/quadlet/chatbot.image index 6c993f80..68caa5ef 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=APPIMAGE -Image=MODELIMAGE -Image=SERVERIMAGE +Image=APP_IMAGE +Image=MODEL_IMAGE +Image=SERVER_IMAGE diff --git a/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml b/recipes/natural_language_processing/chatbot/quadlet/chatbot.yaml index b488fa7e..e5304633 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: MODELIMAGE + image: MODEL_IMAGE command: ['/usr/bin/install', "/model/model.file", "/shared/"] volumeMounts: - name: model-file @@ -16,7 +16,7 @@ spec: - env: - name: MODEL_SERVICE_ENDPOINT value: http://0.0.0.0:8001/v1 - image: APPIMAGE + image: APP_IMAGE name: chatbot-inference ports: - containerPort: 8501 @@ -30,7 +30,7 @@ spec: value: 8001 - name: MODEL_PATH value: /model/model.file - image: SERVERIMAGE + image: SERVER_IMAGE name: chatbot-model-service ports: - containerPort: 8001 diff --git a/recipes/natural_language_processing/codegen/README.md b/recipes/natural_language_processing/codegen/README.md index d16bf525..703012db 100644 --- a/recipes/natural_language_processing/codegen/README.md +++ b/recipes/natural_language_processing/codegen/README.md @@ -101,13 +101,13 @@ and run: ``` -make BOOTCIMAGE=quay.io/your/codegen-bootc:latest bootc +make BOOTC_IMAGE=quay.io/your/codegen-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/codegen-bootc:latest bootc +make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTC_IMAGE=quay.io/your/codegen-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 diff --git a/recipes/natural_language_processing/codegen/bootc/Containerfile b/recipes/natural_language_processing/codegen/bootc/Containerfile index 3bccc17b..26abe8c6 100644 --- a/recipes/natural_language_processing/codegen/bootc/Containerfile +++ b/recipes/natural_language_processing/codegen/bootc/Containerfile @@ -19,25 +19,25 @@ RUN mkdir /usr/etc-system && \ # pre-pulled here ARG RECIPE=codegen -ARG MODELIMAGE=quay.io/ai-lab/mistral-7b-instruct:latest -ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest -ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest +ARG MODEL_IMAGE=quay.io/ai-lab/mistral-7b-instruct:latest +ARG APP_IMAGE=quay.io/ai-lab/${RECIPE}:latest +ARG SERVER_IMAGE=quay.io/ai-lab/llamacpp-python:latest # Add quadlet files to setup system to automatically run AI application on boot COPY build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd # Modify quadlet files to match the server, model and app image -RUN sed -e "s|SERVERIMAGE|${SERVERIMAGE}|" \ - -e "s|APPIMAGE|${APPIMAGE}|g" \ - -e "s|MODELIMAGE|${MODELIMAGE}|g" \ +RUN sed -e "s|SERVER_IMAGE|${SERVER_IMAGE}|" \ + -e "s|APP_IMAGE|${APP_IMAGE}|g" \ + -e "s|MODEL_IMAGE|${MODEL_IMAGE}|g" \ -i \ /usr/share/containers/systemd/${RECIPE}.yaml # Because images are prepulled, no need for .image quadlet # COPY build/${RECIPE}.image /usr/share/containers/systemd -# RUN sed -e "s|SERVERIMAGE|${SERVERIMAGE}|" \ -# -e "s|APPIMAGE|${APPIMAGE}|g" \ -# -e "s|MODELIMAGE|${MODELIMAGE}|g" \ +# RUN sed -e "s|SERVER_IMAGE|${SERVER_IMAGE}|" \ +# -e "s|APP_IMAGE|${APP_IMAGE}|g" \ +# -e "s|MODEL_IMAGE|${MODEL_IMAGE}|g" \ # -i \ # /usr/share/containers/systemd/${RECIPE}.image @@ -50,8 +50,8 @@ RUN sed -i -e '/additionalimage.*/a "/usr/lib/containers/storage",' \ VOLUME /var/lib/containers # Prepull the model, model_server & application images to populate the system. -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} +RUN podman pull --root /usr/lib/containers/storage ${SERVER_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${APP_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${MODEL_IMAGE} RUN podman system reset --force 2>/dev/null diff --git a/recipes/natural_language_processing/codegen/quadlet/codegen.image b/recipes/natural_language_processing/codegen/quadlet/codegen.image index 8e733138..d1a7d74d 100644 --- a/recipes/natural_language_processing/codegen/quadlet/codegen.image +++ b/recipes/natural_language_processing/codegen/quadlet/codegen.image @@ -2,6 +2,7 @@ WantedBy=codegen.service [Image] -Image=quay.io/redhat-et/locallm-codellama-7b-gguf:latest -Image=quay.io/ai-lab/llamacpp-python:latest -Image=quay.io/redhat-et/locallm-codegen:latest +Image=APP_IMAGE +Image=MODEL_IMAGE +Image=SERVER_IMAGE + diff --git a/recipes/natural_language_processing/codegen/quadlet/codegen.yaml b/recipes/natural_language_processing/codegen/quadlet/codegen.yaml index eef266b7..1de317b6 100644 --- a/recipes/natural_language_processing/codegen/quadlet/codegen.yaml +++ b/recipes/natural_language_processing/codegen/quadlet/codegen.yaml @@ -2,8 +2,8 @@ apiVersion: v1 kind: Pod metadata: labels: - app: codegen-langchain - name: codegen-langchain + app: codegen + name: codegen spec: initContainers: - 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-codegen:latest + image: APP_IMAGE name: codegen-inference ports: - containerPort: 8501 @@ -30,7 +30,7 @@ spec: value: 8001 - name: MODEL_PATH value: /model/codellama-7b-instruct.Q4_K_M.gguf - image: quay.io/redhat-et/locallm-model-service:latest + image: SERVICE_IMAGE name: codegen-model-service ports: - containerPort: 8001 diff --git a/recipes/natural_language_processing/rag/README.md b/recipes/natural_language_processing/rag/README.md index 0b4620e1..d0a90737 100644 --- a/recipes/natural_language_processing/rag/README.md +++ b/recipes/natural_language_processing/rag/README.md @@ -128,7 +128,7 @@ Now that the Model Service is running we want to build and deploy our AI Applica ```bash cd rag -make APPIMAGE=rag build +make APP_IMAGE=rag build ``` ### Deploy the AI Application @@ -158,13 +158,13 @@ and run: ``` -make BOOTCIMAGE=quay.io/your/rag-bootc:latest bootc +make BOOTC_IMAGE=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 +make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTC_IMAGE=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 diff --git a/recipes/natural_language_processing/rag/bootc/Containerfile b/recipes/natural_language_processing/rag/bootc/Containerfile index 02fc0405..0b1131b4 100644 --- a/recipes/natural_language_processing/rag/bootc/Containerfile +++ b/recipes/natural_language_processing/rag/bootc/Containerfile @@ -15,9 +15,9 @@ RUN mkdir /usr/etc-system && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys ARG RECIPE=rag -ARG MODELIMAGE=quay.io/ai-lab/mistral-7b-instruct:latest -ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest -ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest +ARG MODEL_IMAGE=quay.io/ai-lab/mistral-7b-instruct:latest +ARG APP_IMAGE=quay.io/ai-lab/${RECIPE}:latest +ARG SERVER_IMAGE=quay.io/ai-lab/llamacpp-python:latest ARG CHROMADBImage=quay.io/ai-lab/chromadb # Add quadlet files to setup system to automatically run AI application on boot @@ -39,9 +39,9 @@ VOLUME /var/lib/containers # Prepull the model, model_server & application images to populate the system. # Comment the pull commands to keep bootc image smaller. # The quadlet .image file added above pulls following images with service startup -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} +RUN podman pull --root /usr/lib/containers/storage ${SERVER_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${APP_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${MODEL_IMAGE} RUN podman pull --root /usr/lib/containers/storage ${CHROMADBImage} RUN podman system reset --force 2>/dev/null diff --git a/recipes/natural_language_processing/rag/quadlet/rag.image b/recipes/natural_language_processing/rag/quadlet/rag.image index aaf6e20d..d6e9e117 100644 --- a/recipes/natural_language_processing/rag/quadlet/rag.image +++ b/recipes/natural_language_processing/rag/quadlet/rag.image @@ -2,6 +2,6 @@ WantedBy=rag.service [Image] -Image=APPIMAGE -Image=MODELIMAGE -Image=SERVERIMAGE +Image=APP_IMAGE +Image=MODEL_IMAGE +Image=SERVER_IMAGE diff --git a/recipes/natural_language_processing/rag/quadlet/rag.yaml b/recipes/natural_language_processing/rag/quadlet/rag.yaml index bec10a8f..00ff0b52 100644 --- a/recipes/natural_language_processing/rag/quadlet/rag.yaml +++ b/recipes/natural_language_processing/rag/quadlet/rag.yaml @@ -7,7 +7,7 @@ metadata: spec: initContainers: - name: model-file - image: MODELIMAGE + image: MODEL_IMAGE command: ['/usr/bin/install', "/model/model.file", "/shared/"] volumeMounts: - name: model-file @@ -16,7 +16,7 @@ spec: - env: - name: MODEL_SERVICE_ENDPOINT value: http://0.0.0.0:8001/v1 - image: APPIMAGE + image: APP_IMAGE name: rag-inference ports: - containerPort: 8501 @@ -26,7 +26,7 @@ spec: - env: - name: CHROMADB_ENDPOINT value: http://0.0.0.0:800O/v1 - image: CHROMADBIMAGE + image: CHROMADB_IMAGE name: rag-chromadb ports: - containerPort: 8000 @@ -40,7 +40,7 @@ spec: value: 8001 - name: MODEL_PATH value: /model/model.file - image: SERVERIMAGE + image: SERVER_IMAGE name: rag-model-service ports: - containerPort: 8001 diff --git a/recipes/natural_language_processing/summarizer/README.md b/recipes/natural_language_processing/summarizer/README.md index a06a75c6..d006c957 100644 --- a/recipes/natural_language_processing/summarizer/README.md +++ b/recipes/natural_language_processing/summarizer/README.md @@ -105,7 +105,7 @@ Now that the Model Service is running we want to build and deploy our AI Applica ```bash cd summarizer -make APPIMAGE=summarizer build +make APP_IMAGE=summarizer build ``` ### Deploy the AI Application @@ -126,7 +126,7 @@ To build a bootable container image that includes this sample summarizer workloa and run: ``` -make BOOTCIMAGE=quay.io/your/summarizer-bootc:latest bootc +make BOOTC_IMAGE=quay.io/your/summarizer-bootc:latest bootc ``` You can easily swap out the bootc/Containerfile FROM option with the following make command: @@ -135,7 +135,7 @@ You can easily swap out the bootc/Containerfile FROM option with the following m 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 +make FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 BOOTC_IMAGE=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 diff --git a/recipes/natural_language_processing/summarizer/bootc/Containerfile b/recipes/natural_language_processing/summarizer/bootc/Containerfile index bd9ab5a3..80e933fe 100644 --- a/recipes/natural_language_processing/summarizer/bootc/Containerfile +++ b/recipes/natural_language_processing/summarizer/bootc/Containerfile @@ -14,9 +14,9 @@ RUN mkdir /usr/etc-system && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys ARG RECIPE=summarizer -ARG MODELIMAGE=quay.io/ai-lab/mistral-7b-instruct:latest -ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest -ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest +ARG MODEL_IMAGE=quay.io/ai-lab/mistral-7b-instruct:latest +ARG APP_IMAGE=quay.io/ai-lab/${RECIPE}:latest +ARG SERVER_IMAGE=quay.io/ai-lab/llamacpp-python:latest # Add quadlet files to setup system to automatically run AI application on boot COPY build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd @@ -37,8 +37,8 @@ VOLUME /var/lib/containers # Prepull the model, model_server & application images to populate the system. # Comment the pull commands to keep bootc image smaller. # The quadlet .image file added above pulls following images with service startup -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} +RUN podman pull --root /usr/lib/containers/storage ${SERVER_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${APP_IMAGE} +RUN podman pull --root /usr/lib/containers/storage ${MODEL_IMAGE} RUN podman system reset --force 2>/dev/null diff --git a/recipes/natural_language_processing/summarizer/quadlet/summarizer.yaml b/recipes/natural_language_processing/summarizer/quadlet/summarizer.yaml index 55408e52..8d38faf5 100644 --- a/recipes/natural_language_processing/summarizer/quadlet/summarizer.yaml +++ b/recipes/natural_language_processing/summarizer/quadlet/summarizer.yaml @@ -7,7 +7,7 @@ metadata: spec: initContainers: - name: model-file - image: MODELIMAGE + image: MODEL_IMAGE command: ['/usr/bin/install', "/model/model.file", "/shared/"] volumeMounts: - name: model-file @@ -16,7 +16,7 @@ spec: - env: - name: MODEL_SERVICE_ENDPOINT value: http://0.0.0.0:8001/v1 - image: APPIMAGE + image: APP_IMAGE name: summarizer-inference ports: - containerPort: 8501 @@ -30,7 +30,7 @@ spec: value: 8001 - name: MODEL_PATH value: /model/model.file - image: SERVERIMAGE + image: SERVER_IMAGE name: summarizer-model-service ports: - containerPort: 8001 From e606cb7c105c8b50968186b160a315d62a30ffa9 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Mon, 8 Apr 2024 20:16:23 -0400 Subject: [PATCH 2/4] --squash-all the app image to prevent device node issue Signed-off-by: Daniel J Walsh --- recipes/common/Makefile.common | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index ddf866f5..2f173bf2 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -37,7 +37,7 @@ UNZIP_EXISTS ?= $(shell command -v unzip) .PHONY: build build: - podman build $${ARCH:+--arch $${ARCH}} $${FROM:+--from $${FROM}} -f builds/Containerfile -t ${APP_IMAGE} . + podman build --squash-all $${ARCH:+--arch $${ARCH}} $${FROM:+--from $${FROM}} -f builds/Containerfile -t ${APP_IMAGE} . .PHONY: bootc bootc: quadlet From c7af1dd613b3edec3224c039adb82717c2bedfe9 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Tue, 9 Apr 2024 04:56:25 -0400 Subject: [PATCH 3/4] Volume mount auth.json into bootc build iff it exists Also volume mount in the hosts /etc/containers/policy.json file. Signed-off-by: Daniel J Walsh --- recipes/common/Makefile.common | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index 2f173bf2..abb898d1 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -1,9 +1,9 @@ REGISTRY ?= quay.io REGISTRY_ORG ?= ai-lab +IMAGE_NAME ?= $(REGISTRY_ORG)/${APP}:latest APP_IMAGE ?= $(REGISTRY)/$(IMAGE_NAME) CHROMADB_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/chromadb:latest -IMAGE_NAME ?= $(REGISTRY_ORG)/${APP}:latest MODEL_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/mistral-7b-instruct:latest SERVER_IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/llamacpp-python:latest @@ -13,6 +13,19 @@ BOOTC_IMAGE ?= quay.io/$(REGISTRY_ORG)/${APP}-bootc:latest FROM ?= ARCH ?= +ROOTLESS_AUTH_JSON=${XDG_RUNTIME_DIR}/containers/auth.json +ROOTFUL_AUTH_JSON=/run/containers/0/auth.json +NONLINUX_AUTH_JSON=${HOME}/.config/containers/auth.json +AUTH_JSON= + +ifneq ("$(wildcard $(NONLINUX_AUTH_JSON))","") + AUTH_JSON=$(NONINUX_AUTH_JSON); +else ifneq ("$(wildcard $(ROOTLESS_AUTH_JSON))","") + AUTH_JSON=$(ROOTLESS_AUTH_JSON); +else ifneq ("$(wildcard $(ROOTFUL_AUTH_JSON))","") + AUTH_JSON=$(ROOTFUL_AUTH_JSON); +endif + CHROMEDRIVER_VERSION := 103.0.5060.53 CHROMEDRIVER_MIRROR := https://chromedriver.storage.googleapis.com CHROMEDRIVER_DOWNLOAD_PATH := @@ -44,11 +57,13 @@ bootc: quadlet podman build \ $${ARCH:+--arch $${ARCH}} \ $${FROM:+--from $${FROM}} \ + $${AUTH_JSON:+-v $${AUTH_JSON}:/run/containers/0/auth.json} \ --cap-add SYS_ADMIN \ --build-arg MODEL_IMAGE=$(MODEL_IMAGE) \ --build-arg APP_IMAGE=$(APP_IMAGE) \ --build-arg SERVER_IMAGE=$(SERVER_IMAGE) \ --build-arg "SSHPUBKEY=$(SSHPUBKEY)" \ + -v /etc/containers/policy.json:/etc/containers/policy.json \ -f bootc/Containerfile \ -t ${BOOTC_IMAGE} . @echo "" From 170012136634be6a919076d4a7c78aff7f3bdc46 Mon Sep 17 00:00:00 2001 From: sallyom Date: Tue, 9 Apr 2024 08:25:59 -0400 Subject: [PATCH 4/4] specify bash in actions Signed-off-by: sallyom --- .github/workflows/chatbot.yaml | 1 + recipes/natural_language_processing/chatbot/Makefile | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/chatbot.yaml b/.github/workflows/chatbot.yaml index ca46efcb..03802e20 100644 --- a/.github/workflows/chatbot.yaml +++ b/.github/workflows/chatbot.yaml @@ -60,6 +60,7 @@ jobs: - name: Run Functional Tests working-directory: ./recipes/natural_language_processing/chatbot + shell: bash run: make functional-tests - name: Login to Registry diff --git a/recipes/natural_language_processing/chatbot/Makefile b/recipes/natural_language_processing/chatbot/Makefile index 29f4caab..0fe43f4f 100644 --- a/recipes/natural_language_processing/chatbot/Makefile +++ b/recipes/natural_language_processing/chatbot/Makefile @@ -1,3 +1,4 @@ +SHELL := /bin/bash APP ?= chatbot PORT ?= 8501