@@ -4,56 +4,37 @@ ARG IMAGE_TAGS=image-tags-not-defined
4
4
ARG GIT_COMMIT=git-commit-not-defined
5
5
6
6
# ======================================================
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
8
14
# ------------------------------------------------------
9
- FROM quay.io/lightspeed-core/lightspeed-stack:0.1.3 AS builder
15
+ FROM quay.io/lightspeed-core/lightspeed-stack:0.2.0
10
16
11
17
ARG APP_ROOT=/app-root
12
18
WORKDIR /app-root
13
19
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.
15
22
ENV UV_COMPILE_BYTECODE=0 \
16
23
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
33
27
34
28
USER 0
35
29
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
41
30
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs jq
42
31
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 ./
54
35
55
36
# 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/
57
38
58
39
ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
59
40
0 commit comments