llama-swap-rocm now uses official image and adjusted accordingly
This commit is contained in:
@@ -39,23 +39,22 @@ WORKDIR /app
|
|||||||
# Copy llama-swap binary from builder
|
# Copy llama-swap binary from builder
|
||||||
COPY --from=swap-builder /build/llama-swap-binary /app/llama-swap
|
COPY --from=swap-builder /build/llama-swap-binary /app/llama-swap
|
||||||
|
|
||||||
# Make binary executable
|
# Make binaries executable
|
||||||
RUN chmod +x /app/llama-swap
|
RUN chmod +x /app/llama-swap
|
||||||
|
|
||||||
# Create non-root user and add to GPU access groups
|
# Add existing ubuntu user (UID 1000) to GPU access groups (using host GIDs)
|
||||||
# The official llama.cpp image already has llama-server installed
|
|
||||||
# GID 187 = render group on host, GID 989 = video/kfd group on host
|
# GID 187 = render group on host, GID 989 = video/kfd group on host
|
||||||
RUN groupadd -g 187 hostrender && \
|
RUN groupadd -g 187 hostrender && \
|
||||||
groupadd -g 989 hostvideo && \
|
groupadd -g 989 hostvideo && \
|
||||||
useradd -m -u 1000 -G hostrender,hostvideo llamaswap && \
|
usermod -aG hostrender,hostvideo ubuntu && \
|
||||||
chown -R llamaswap:llamaswap /app
|
chown -R ubuntu:ubuntu /app
|
||||||
|
|
||||||
# Set environment for ROCm (RX 6800 is gfx1030)
|
# Set environment for ROCm (RX 6800 is gfx1030)
|
||||||
ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
|
ENV HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||||
ENV ROCM_PATH=/opt/rocm
|
ENV ROCM_PATH=/opt/rocm
|
||||||
ENV HIP_VISIBLE_DEVICES=0
|
ENV HIP_VISIBLE_DEVICES=0
|
||||||
|
|
||||||
USER llamaswap
|
USER ubuntu
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
@@ -64,5 +63,6 @@ EXPOSE 8080
|
|||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
||||||
CMD curl -f http://localhost:8080/health || exit 1
|
CMD curl -f http://localhost:8080/health || exit 1
|
||||||
|
|
||||||
# Run llama-swap
|
# Override the base image's ENTRYPOINT and run llama-swap
|
||||||
|
ENTRYPOINT []
|
||||||
CMD ["/app/llama-swap", "-config", "/app/config.yaml", "-listen", "0.0.0.0:8080"]
|
CMD ["/app/llama-swap", "-config", "/app/config.yaml", "-listen", "0.0.0.0:8080"]
|
||||||
Reference in New Issue
Block a user