-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathContainerfile.llama-stack
More file actions
76 lines (58 loc) · 2.3 KB
/
Copy pathContainerfile.llama-stack
File metadata and controls
76 lines (58 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Llama Stack Server Container
# Multi-stage build for smaller, more secure image
# Configuration uses ${env.VAR} syntax - resolved at runtime by Llama Stack
# =============================================================================
# BUILDER STAGE
# =============================================================================
FROM registry.access.redhat.com/ubi9/python-312:9.8-1785140801@sha256:ebd0347a0422ad0d24db801972b4c1efa6f3352e5c2553b034e6b70e91235854 AS builder
USER root
ENV UV_COMPILE_BYTECODE=0 \
UV_LINK_MODE=copy
WORKDIR /app-root
# Install build dependencies
RUN dnf install -y gcc python3-devel make && \
dnf clean all && \
pip3.12 install uv
# Copy Llama Stack specific dependency specification
COPY ./pyproject.llama-stack.toml ./pyproject.toml
# Install Python dependencies
RUN uv sync --no-dev
# =============================================================================
# RUNTIME STAGE
# =============================================================================
FROM registry.access.redhat.com/ubi9/python-312-minimal:9.8-1784732125@sha256:fb32c8ad908b78f1595282639a7870028d436579eb73890635b6b867e65faf63
ARG APP_ROOT=/app-root
WORKDIR /app-root
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONCOERCECLOCALE=0 \
PYTHONUTF8=1 \
PYTHONIOENCODING=UTF-8 \
LANG=en_US.UTF-8 \
PATH="/app-root/.venv/bin:$PATH"
# Copy virtual environment from builder
COPY --from=builder --chown=1001:1001 /app-root/.venv ./.venv
# Copy Llama Stack configuration
# Uses ${env.VAR} syntax - resolved at runtime
COPY --chown=1001:1001 ./run.yaml ./
# Create data directories for runtime
USER root
RUN mkdir -p /data /data/files && \
chgrp -R 0 /data /app-root && \
chmod -R g=u /data /app-root
# License
RUN mkdir -p /licenses
COPY LICENSE /licenses/
# Expose Llama Stack server port
EXPOSE 8321
USER 1001
# Default command - run.yaml is in /app-root
CMD ["llama", "stack", "run", "/app-root/run.yaml"]
# Labels
LABEL com.redhat.component=llama-stack-agentic \
description="Llama Stack Agentic AI Server" \
io.k8s.description="Llama Stack Agentic AI Server" \
io.k8s.display-name="Llama Stack Agentic" \
io.openshift.tags="ai,llama-stack,inference,agents" \
name=llama-stack-agentic \
summary="Llama Stack server for agentic AI workflows"