From 15f339f3bc45fcd3257dfc225d651a72d5dc1f81 Mon Sep 17 00:00:00 2001 From: sallyom Date: Fri, 5 Apr 2024 11:01:40 -0400 Subject: [PATCH] remove rag data dir Signed-off-by: sallyom --- recipes/natural_language_processing/rag/Makefile | 5 +---- recipes/natural_language_processing/rag/README.md | 9 ++++----- .../rag/bootc/Containerfile | 7 ------- .../natural_language_processing/rag/quadlet/rag.yaml | 10 ---------- 4 files changed, 5 insertions(+), 26 deletions(-) diff --git a/recipes/natural_language_processing/rag/Makefile b/recipes/natural_language_processing/rag/Makefile index 4717ed3fa..24350d286 100644 --- a/recipes/natural_language_processing/rag/Makefile +++ b/recipes/natural_language_processing/rag/Makefile @@ -1,5 +1,4 @@ APP=rag -HOSTDATADIR ?= ${HOME}/rag/data CHROMADBIMAGE ?= quay.io/ai-lab/chromadb:latest MODELIMAGE ?= quay.io/ai-lab/mistral-7b-instruct:latest APPIMAGE ?= quay.io/ai-lab/${APP}:latest @@ -13,8 +12,7 @@ build: .PHONY: bootc bootc: quadlet - sed -i '' -e "s|$(HOSTDATADIR)|/usr/share/rag/data|g" bootc/build/${APP}.yaml - podman build --cap-add SYS_ADMIN --build-arg "HOSTDATADIR=${HOSTDATADIR}" --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} . + podman build --cap-add SYS_ADMIN --build-arg "SSHPUBKEY=$(SSHPUBKEY)" -f bootc/Containerfile -t ${BOOTCIMAGE} . .PHONY: quadlet quadlet: @@ -30,7 +28,6 @@ quadlet: -e "s|APPIMAGE|${APPIMAGE}|g" \ -e "s|MODELIMAGE|${MODELIMAGE}|g" \ -e "s|CHROMADBIMAGE|${CHROMADBIMAGE}|g" \ - -e "s|HOSTDATADIR|${HOSTDATADIR}|g" \ quadlet/${APP}.yaml \ > bootc/build/${APP}.yaml cp quadlet/${APP}.kube bootc/build/${APP}.kube diff --git a/recipes/natural_language_processing/rag/README.md b/recipes/natural_language_processing/rag/README.md index 1c5f5dd5e..7e440cc9d 100644 --- a/recipes/natural_language_processing/rag/README.md +++ b/recipes/natural_language_processing/rag/README.md @@ -110,11 +110,10 @@ There also needs to be a volume mount into the `models/` directory so that the a The following Podman command can be used to run your AI Application: ```bash -podman run --rm -it -p 8501:8501 --e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001/v1 --e VECTORDB_HOST=10.88.0.1 --v Local/path/to/locallm/models/:/rag/models --v Local/path/to/locallm/data:/rag/data +podman run --rm -it -p 8501:8501 \ +-e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001/v1 \ +-e VECTORDB_HOST=10.88.0.1 \ +-v Local/path/to/locallm/models/:/rag/models \ rag ``` diff --git a/recipes/natural_language_processing/rag/bootc/Containerfile b/recipes/natural_language_processing/rag/bootc/Containerfile index 00a0b523e..fd57e3540 100644 --- a/recipes/natural_language_processing/rag/bootc/Containerfile +++ b/recipes/natural_language_processing/rag/bootc/Containerfile @@ -9,7 +9,6 @@ FROM quay.io/centos-bootc/centos-bootc:stream9 ARG SSHPUBKEY -ARG HOSTDATADIR RUN mkdir /usr/etc-system && \ echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \ @@ -21,12 +20,6 @@ ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest ARG CHROMADBImage=quay.io/ai-lab/chromadb -# Create RAG data directory -RUN mkdir -p ${HOSTDATADIR} && mkdir -p /usr/share/rag/data -# populate with sample data for testing application -COPY sample-data ${HOSTDATADIR} -RUN cp ${HOSTDATADIR}/* /usr/share/rag/data/. - # Add quadlet files to setup system to automatically run AI application on boot COPY bootc/build/${RECIPE}.kube bootc/build/${RECIPE}.yaml /usr/share/containers/systemd diff --git a/recipes/natural_language_processing/rag/quadlet/rag.yaml b/recipes/natural_language_processing/rag/quadlet/rag.yaml index 2f14d42fd..bec10a8fc 100644 --- a/recipes/natural_language_processing/rag/quadlet/rag.yaml +++ b/recipes/natural_language_processing/rag/quadlet/rag.yaml @@ -23,9 +23,6 @@ spec: hostPort: 8501 securityContext: runAsNonRoot: true - volumeMounts: - - name: data - mountPath: /rag/data - env: - name: CHROMADB_ENDPOINT value: http://0.0.0.0:800O/v1 @@ -36,9 +33,6 @@ spec: hostPort: 8000 securityContext: runAsNonRoot: true - volumeMounts: - - name: data - mountPath: /rag/data - env: - name: HOST value: 0.0.0.0 @@ -57,9 +51,5 @@ spec: - name: model-file mountPath: /model volumes: - - name: data - hostPath: - path: HOSTDATADIR - type: File - name: model-file emptyDir: {}