Skip to content

Commit 0f8e4ad

Browse files
committed
LCORE-399: Simplify image building and dependency list. Drop requirements.txt.
The lightspeed-stack image 0.2.0 bundles now all required Python dependencies. Also bump up the lightspeed-stack image to 0.2.0.
1 parent be2cb9f commit 0f8e4ad

File tree

4 files changed

+17
-2458
lines changed

4 files changed

+17
-2458
lines changed

Containerfile

Lines changed: 17 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,56 +4,37 @@ ARG IMAGE_TAGS=image-tags-not-defined
44
ARG 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

1117
ARG APP_ROOT=/app-root
1218
WORKDIR /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.
1522
ENV 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

3428
USER 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
4130
RUN 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

5839
ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
5940

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ check-env-build:
9494
exit 1; \
9595
fi
9696

97-
requirements.txt:
98-
uv export --no-hashes --no-header --no-annotate --no-dev --format requirements.txt > requirements.txt
99-
10097
build: check-env-build setup requirements.txt
10198
@echo "Building customized Ansible Chatbot Stack image from lightspeed-core/lightspeed-stack..."
10299
$(CONTAINER_RUNTIME) build --no-cache --platform $(PLATFORM) -f ./Containerfile \

pyproject.toml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,9 @@ description = "Ansible Lightspeed Intelligent Assistant (ALIA)"
55
readme = "README.md"
66
requires-python = ">=3.12"
77
dependencies = [
8-
"aiosqlite~=0.21.0",
9-
"faiss-cpu~=1.11",
10-
"fire~=0.7.0",
118
"lightspeed-stack-providers==0.1.15",
12-
"mcp~=1.9.4",
13-
"numpy==2.2.6",
14-
"opentelemetry-api~=1.34.1",
15-
"opentelemetry-exporter-otlp~=1.34.1",
16-
"sentence-transformers>=5.0.0",
17-
"sqlalchemy~=2.0.41",
18-
"litellm~=1.75.3",
199
]
2010

2111
[dependency-groups]
2212
dev = [
23-
"cachetools>=6.1.0",
24-
"kubernetes>=33.1.0",
2513
]

0 commit comments

Comments
 (0)