From a523095225a56615a7ec23a4bdd52c739d1e4511 Mon Sep 17 00:00:00 2001 From: Lance Galletti Date: Tue, 7 Oct 2025 09:51:59 -0400 Subject: [PATCH 1/3] Add Red Hat llama-stack image support - Add test.containerfile to extend Red Hat image with FAISS - Update docker-compose.yaml to use Red Hat llama-stack image - Configure platform and volume paths for Red Hat image compatibility - Fix Containerfile build issue by temporarily disabling uv installation in final stage --- Containerfile | 3 ++- docker-compose.yaml | 8 ++++++-- test.containerfile | 33 +++++++-------------------------- 3 files changed, 15 insertions(+), 29 deletions(-) diff --git a/Containerfile b/Containerfile index 1a20d7c87..704083411 100644 --- a/Containerfile +++ b/Containerfile @@ -57,7 +57,8 @@ COPY --from=builder /app-root/LICENSE /licenses/ # Add uv to final image for derived images to add additional dependencies # with command: # $ uv pip install -RUN pip3.12 install "uv==0.8.15" +# Temporarily disabled due to temp directory issues +# RUN pip3.12 install "uv==0.8.15" USER root diff --git a/docker-compose.yaml b/docker-compose.yaml index b36245260..17a9be60d 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,19 @@ services: + # Red Hat llama-stack distribution with FAISS llama-stack: build: context: . dockerfile: test.containerfile + platform: linux/amd64 container_name: llama-stack ports: - "8321:8321" # Expose llama-stack on 8321 (adjust if needed) volumes: - - ./run.yaml:/app-root/run.yaml:Z + - ./run.yaml:/opt/app-root/run.yaml:Z environment: - OPENAI_API_KEY=${OPENAI_API_KEY} + - BRAVE_SEARCH_API_KEY=${BRAVE_SEARCH_API_KEY:-} + - TAVILY_SEARCH_API_KEY=${TAVILY_SEARCH_API_KEY:-} networks: - lightspeednet healthcheck: @@ -44,4 +48,4 @@ services: networks: lightspeednet: - driver: bridge + driver: bridge \ No newline at end of file diff --git a/test.containerfile b/test.containerfile index 1ee04326f..a6363187d 100644 --- a/test.containerfile +++ b/test.containerfile @@ -1,28 +1,9 @@ -# vim: set filetype=dockerfile -FROM registry.access.redhat.com/ubi9/ubi-minimal +# Custom Red Hat llama-stack image with missing dependencies +FROM quay.io/opendatahub/llama-stack:rhoai-v2.25-latest -ARG APP_ROOT=/app-root +# Install missing dependencies +USER root +RUN pip install faiss-cpu==1.11.0 -ENV PATH="$PATH:/root/.local/bin" - -WORKDIR ${APP_ROOT} -COPY run.yaml ./ -COPY pyproject.toml ./ -COPY uv.lock ./ -COPY LICENSE ./ -COPY README.md ./ -COPY src/ ./src/ - -RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs \ - python3.12 python3.12-devel python3.12-pip git tar gcc gcc-c++ make - -RUN curl -LsSf https://astral.sh/uv/install.sh | sh - -RUN uv -h - -# Install from pyproject.toml using uv sync for version consistency -# Note: using --no-install-project since this is llama-stack container, not lightspeed-stack -# Include dev deps for testing (pytest, behave, etc.) -RUN uv sync --locked --no-install-project --group dev --group llslibdev - -CMD ["uv", "run", "llama", "stack", "run", "run.yaml"] \ No newline at end of file +# Switch back to the original user +USER 1001 From 168921a02715eaa2d58459855d73f1e54610da1b Mon Sep 17 00:00:00 2001 From: Radovan Fuchs Date: Thu, 9 Oct 2025 16:23:59 +0200 Subject: [PATCH 2/3] test --- test.containerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test.containerfile b/test.containerfile index a6363187d..1efac0913 100644 --- a/test.containerfile +++ b/test.containerfile @@ -3,7 +3,13 @@ FROM quay.io/opendatahub/llama-stack:rhoai-v2.25-latest # Install missing dependencies USER root -RUN pip install faiss-cpu==1.11.0 +RUN pip install faiss-cpu==1.11.0 && \ + mkdir -p /opt/app-root/.llama/distributions/ollama && \ + chown -R 1001:0 /opt/app-root/.llama && \ + chmod -R g+rwx /opt/app-root/.llama + +# Set working directory +WORKDIR /opt/app-root # Switch back to the original user USER 1001 From be6f10d5907672c0a50b9cb93b44934ba3aac64d Mon Sep 17 00:00:00 2001 From: Radovan Fuchs Date: Thu, 9 Oct 2025 16:39:47 +0200 Subject: [PATCH 3/3] change permissions for the path --- test.containerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test.containerfile b/test.containerfile index 1efac0913..e0c0d7875 100644 --- a/test.containerfile +++ b/test.containerfile @@ -4,12 +4,9 @@ FROM quay.io/opendatahub/llama-stack:rhoai-v2.25-latest # Install missing dependencies USER root RUN pip install faiss-cpu==1.11.0 && \ - mkdir -p /opt/app-root/.llama/distributions/ollama && \ - chown -R 1001:0 /opt/app-root/.llama && \ - chmod -R g+rwx /opt/app-root/.llama - -# Set working directory -WORKDIR /opt/app-root + mkdir -p /app-root && \ + chown -R 1001:0 /app-root && \ + chmod -R 775 /app-root # Switch back to the original user USER 1001