Skip to content

Commit

Permalink
Merge pull request containers#167 from sallyom/remove-rag-data-dir
Browse files Browse the repository at this point in the history
remove rag data dir
  • Loading branch information
sallyom authored Apr 5, 2024
2 parents e2d7288 + 15f339f commit f0dd92e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 26 deletions.
5 changes: 1 addition & 4 deletions recipes/natural_language_processing/rag/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand All @@ -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
Expand Down
9 changes: 4 additions & 5 deletions recipes/natural_language_processing/rag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
7 changes: 0 additions & 7 deletions recipes/natural_language_processing/rag/bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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

Expand Down
10 changes: 0 additions & 10 deletions recipes/natural_language_processing/rag/quadlet/rag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -36,9 +33,6 @@ spec:
hostPort: 8000
securityContext:
runAsNonRoot: true
volumeMounts:
- name: data
mountPath: /rag/data
- env:
- name: HOST
value: 0.0.0.0
Expand All @@ -57,9 +51,5 @@ spec:
- name: model-file
mountPath: /model
volumes:
- name: data
hostPath:
path: HOSTDATADIR
type: File
- name: model-file
emptyDir: {}

0 comments on commit f0dd92e

Please sign in to comment.