@@ -4,56 +4,37 @@ ARG IMAGE_TAGS=image-tags-not-defined
44ARG GIT_COMMIT=git-commit-not-defined
55
66# ======================================================
7- # Transient image to construct Python venv
7+ # Base-image with all dependencies for Python venv
8+ # Lightspeed-stack bundles all required dependencies
9+ # For running llama-stack in library mode.
10+ #
11+ # To include more dependencies, create upstream PR
12+ # to update this file:
13+ # https://github.com/lightspeed-core/lightspeed-stack/blob/main/pyproject.toml
814# ------------------------------------------------------
9- FROM quay.io/lightspeed-core/lightspeed-stack:0.1.3 AS builder
15+ FROM quay.io/lightspeed-core/lightspeed-stack:0.2.0
1016
1117ARG APP_ROOT=/app-root
1218WORKDIR /app-root
1319
14- # UV_PYTHON_DOWNLOADS=0 : Disable Python interpreter downloads and use the system interpreter.
20+ # Add only project-specific dependencies without adding other dependencies
21+ # to not break the dependencies of the base image.
1522ENV UV_COMPILE_BYTECODE=0 \
1623 UV_LINK_MODE=copy \
17- UV_PYTHON_DOWNLOADS=0
18-
19- # Install uv package manager
20- RUN pip3.12 install uv
21-
22- # Add explicit files and directories
23- # (avoid accidental inclusion of local directories or env files or credentials)
24- COPY requirements.txt LICENSE.md README.md ./
25-
26- RUN uv pip install -r requirements.txt
27- # ======================================================
28-
29- # ======================================================
30- # Final image without uv package manager and based on lightspeed-stack base image
31- # ------------------------------------------------------
32- FROM registry.access.redhat.com/ubi9/python-312-minimal
24+ UV_PYTHON_DOWNLOADS=0 \
25+ UV_NO_CACHE=1
26+ RUN uv pip install . --no-deps && uv clean
3327
3428USER 0
3529
36- # Re-declaring arguments without a value, inherits the global default one.
37- ARG APP_ROOT
38- ARG ANSIBLE_CHATBOT_VERSION
39- ARG IMAGE_TAGS
40- ARG GIT_COMMIT
4130RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs jq
4231
43- # PYTHONDONTWRITEBYTECODE 1 : disable the generation of .pyc
44- # PYTHONUNBUFFERED 1 : force the stdout and stderr streams to be unbuffered
45- # PYTHONCOERCECLOCALE 0, PYTHONUTF8 1 : skip legacy locales and use UTF-8 mode
46- ENV PYTHONDONTWRITEBYTECODE=1 \
47- PYTHONUNBUFFERED=1 \
48- PYTHONCOERCECLOCALE=0 \
49- PYTHONUTF8=1 \
50- PYTHONIOENCODING=UTF-8 \
51- LANG=en_US.UTF-8
52-
53- COPY --from=builder --chown=1001:1001 /app-root /app-root
32+ # Add explicit files and directories
33+ # (avoid accidental inclusion of local directories or env files or credentials)
34+ COPY LICENSE.md README.md ./
5435
5536# this directory is checked by ecosystem-cert-preflight-checks task in Konflux
56- COPY --from=builder /app-root/ LICENSE.md /licenses/
37+ COPY LICENSE.md /licenses/
5738
5839ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
5940
0 commit comments