-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathtest.containerfile
More file actions
48 lines (36 loc) · 1.63 KB
/
test.containerfile
File metadata and controls
48 lines (36 loc) · 1.63 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
# Upstream llama-stack built from Red Hat UBI
FROM registry.access.redhat.com/ubi9/ubi-minimal
USER root
# Install Python and build tools
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
# Install uv
ENV PATH="/root/.local/bin:${PATH}"
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
# Copy project files for dependency installation
WORKDIR /opt/app-root
COPY pyproject.toml uv.lock LICENSE README.md ./
COPY src ./src
# Install dependencies using uv sync
RUN uv sync --locked --no-install-project --group llslibdev
# Add virtual environment to PATH for llama command
ENV PATH="/opt/app-root/.venv/bin:$PATH" \
PYTHONPATH="/opt/app-root/src"
# Set HOME directory so llama-stack uses /opt/app-root/src/.llama
ENV HOME="/opt/app-root/src"
# Create python3 symlink for compatibility
RUN ln -sf /usr/bin/python3.12 /usr/bin/python3
# Create required directories
RUN mkdir -p /opt/app-root/src/.llama/storage \
/opt/app-root/src/.llama/providers.d \
/opt/app-root/src/.cache/huggingface && \
chown -R 1001:0 /opt/app-root && \
chmod -R 775 /opt/app-root
# Copy enrichment scripts for runtime config enrichment
COPY src/llama_stack_configuration.py /opt/app-root/llama_stack_configuration.py
COPY scripts/llama-stack-entrypoint.sh /opt/app-root/enrich-entrypoint.sh
RUN chmod +x /opt/app-root/enrich-entrypoint.sh && \
chown 1001:0 /opt/app-root/enrich-entrypoint.sh /opt/app-root/llama_stack_configuration.py
# Switch back to the original user
USER 1001
ENTRYPOINT ["/opt/app-root/enrich-entrypoint.sh"]