Skip to content

Commit

Permalink
Don't install .image quadlet in bootc Containerfiles
Browse files Browse the repository at this point in the history
Make sure to clean out /var/lib/containers directories

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
  • Loading branch information
rhatdan committed Apr 3, 2024
1 parent 7f62aef commit 8173ed5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion recipes/natural_language_processing/chatbot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ quadlet:
-e "s|APPIMAGE|${APPIMAGE}|g" \
-e "s|MODELIMAGE|${MODELIMAGE}|g" \
quadlet/${APP}.yaml \
> /tmp/${APP}.yaml
> build/${APP}.yaml
cp quadlet/${APP}.kube build/${APP}.kube

.PHONY: install
Expand Down
19 changes: 17 additions & 2 deletions recipes/natural_language_processing/chatbot/bootc/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,34 @@ ARG APPIMAGE=quay.io/ai-lab/${RECIPE}:latest
ARG SERVERIMAGE=quay.io/ai-lab/llamacpp-python:latest

# Add quadlet files to setup system to automatically run AI application on boot
COPY quadlet/${RECIPE}.kube quadlet/${RECIPE}.yaml quadlet/${RECIPE}.image /usr/share/containers/systemd
COPY quadlet/${RECIPE}.kube quadlet/${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" \
-i \
/usr/share/containers/systemd/${RECIPE}.image \
/usr/share/containers/systemd/${RECIPE}.yaml

# Because images are prepulled, no need for .image quadlet
# COPY quadlet/${RECIPE}.image /usr/share/containers/systemd
# RUN sed -e "s|SERVERIMAGE|${SERVERIMAGE}|" \
# -e "s|APPIMAGE|${APPIMAGE}|g" \
# -e "s|MODELIMAGE|${MODELIMAGE}|g" \
# -i \
# /usr/share/containers/systemd/${RECIPE}.image

# Setup /usr/lib/containers/storage as an additional store for images.
# Remove once the base images have this set by default.
RUN sed -i -e '/additionalimage.*/a "/usr/lib/containers/storage",' \
/etc/containers/storage.conf

# Added for running as an OCI Container to prevent Overlay on Overlay issues.
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 system reset --force 2>/dev/null

0 comments on commit 8173ed5

Please sign in to comment.