From 8e897757e9a09b15ffc478c7b207c10e80a5f3b0 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 11 Apr 2024 07:19:59 -0400 Subject: [PATCH] Cleanup and fix Containerfile.nocache files Signed-off-by: Daniel J Walsh --- .../chatbot/bootc/Containerfile.nocache | 17 +-------------- .../codegen/bootc/Containerfile.nocache | 21 ++++--------------- .../rag/bootc/Containerfile.nocache | 10 --------- .../summarizer/bootc/Containerfile.nocache | 10 --------- 4 files changed, 5 insertions(+), 53 deletions(-) diff --git a/recipes/natural_language_processing/chatbot/bootc/Containerfile.nocache b/recipes/natural_language_processing/chatbot/bootc/Containerfile.nocache index ea15c797..2807cf91 100644 --- a/recipes/natural_language_processing/chatbot/bootc/Containerfile.nocache +++ b/recipes/natural_language_processing/chatbot/bootc/Containerfile.nocache @@ -14,24 +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 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 quadlet/${RECIPE}.kube quadlet/${RECIPE}.yaml /usr/share/containers/systemd - -# Because images are prepulled, no need for .image quadlet -# If commenting out the pulls below, uncomment this to track the images -# so the systemd service will wait for the images with the service startup -# COPY quadlet/${RECIPE}.image /usr/share/containers/systemd - -# 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 +COPY build/${RECIPE}.image build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd # Added for running as an OCI Container to prevent Overlay on Overlay issues. VOLUME /var/lib/containers - -COPY quadlet/${RECIPE}.image /usr/share/containers/systemd diff --git a/recipes/natural_language_processing/codegen/bootc/Containerfile.nocache b/recipes/natural_language_processing/codegen/bootc/Containerfile.nocache index fea2bebb..90d96fdd 100644 --- a/recipes/natural_language_processing/codegen/bootc/Containerfile.nocache +++ b/recipes/natural_language_processing/codegen/bootc/Containerfile.nocache @@ -1,35 +1,22 @@ # Example: an AI powered sample application is embedded as a systemd service # via Podman quadlet files in /usr/share/containers/systemd # -# Use build command: -# podman build --build-arg "sshpubkey=$(cat $HOME/.ssh/id_rsa.pub)" -t quay.io/exampleos/myos . -# The --build-arg "SSHPUBKEY=$(cat ~/.ssh/id_rsa.pub)" option inserts your -# public key into the image, allowing root access via ssh. +# from recipes/natural_language_processing/summarizer, run +# 'make bootc' FROM quay.io/centos-bootc/centos-bootc:stream9 ARG SSHPUBKEY +# The --build-arg "SSHPUBKEY=$(cat ~/.ssh/id_rsa.pub)" option inserts your +# public key into the image, allowing root access via ssh. RUN mkdir /usr/etc-system && \ echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys -# 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 - ARG RECIPE=codegen -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}.image build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd -# 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 diff --git a/recipes/natural_language_processing/rag/bootc/Containerfile.nocache b/recipes/natural_language_processing/rag/bootc/Containerfile.nocache index 6fe96fa2..061d850d 100644 --- a/recipes/natural_language_processing/rag/bootc/Containerfile.nocache +++ b/recipes/natural_language_processing/rag/bootc/Containerfile.nocache @@ -5,7 +5,6 @@ # 'make bootc' FROM quay.io/centos-bootc/centos-bootc:stream9 - ARG SSHPUBKEY # The --build-arg "SSHPUBKEY=$(cat ~/.ssh/id_rsa.pub)" option inserts your @@ -15,18 +14,9 @@ RUN mkdir /usr/etc-system && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys ARG RECIPE=rag -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 COPY build/${RECIPE}.image build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd -# 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 diff --git a/recipes/natural_language_processing/summarizer/bootc/Containerfile.nocache b/recipes/natural_language_processing/summarizer/bootc/Containerfile.nocache index 38784aec..4af50650 100644 --- a/recipes/natural_language_processing/summarizer/bootc/Containerfile.nocache +++ b/recipes/natural_language_processing/summarizer/bootc/Containerfile.nocache @@ -13,18 +13,8 @@ RUN mkdir /usr/etc-system && \ echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \ echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys -ARG RECIPE=summarizer -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}.image build/${RECIPE}.kube build/${RECIPE}.yaml /usr/share/containers/systemd -# 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