- Add Dockerfiles for nvidia, rdna2, strixhalo, and intel GPU targets - Add ray-serve modules (embeddings, whisper, tts, llm, reranker) - Add Gitea Actions workflow for automated builds - Add Makefile for local development - Update README with comprehensive documentation
78 lines
2.7 KiB
Docker
78 lines
2.7 KiB
Docker
# Intel GPU Ray Worker for danilo (Intel i915 iGPU)
|
|
# Used for: Reranker
|
|
#
|
|
# Build from llm-workflows root:
|
|
# docker build -t git.daviestechlabs.io/daviestechlabs/ray-worker-intel:latest -f dockerfiles/Dockerfile.ray-worker-intel .
|
|
#
|
|
# Multi-stage build to ensure Python 3.11.11 matches Ray head node
|
|
FROM rayproject/ray:2.53.0-py311 AS base
|
|
|
|
LABEL maintainer="billy-davies-2"
|
|
LABEL description="Ray worker for Intel GPUs (Reranker)"
|
|
LABEL gpu.target="intel-xpu"
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for Intel GPU support
|
|
USER root
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
git \
|
|
curl \
|
|
wget \
|
|
gnupg2 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Add Intel oneAPI repository for runtime libraries
|
|
RUN wget -qO - https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor -o /usr/share/keyrings/intel-oneapi-archive-keyring.gpg && \
|
|
echo "deb [signed-by=/usr/share/keyrings/intel-oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" > /etc/apt/sources.list.d/intel-oneapi.list
|
|
|
|
# Add Intel compute-runtime repository for Level Zero
|
|
RUN wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | gpg --dearmor -o /usr/share/keyrings/intel-graphics-archive-keyring.gpg && \
|
|
echo "deb [signed-by=/usr/share/keyrings/intel-graphics-archive-keyring.gpg arch=amd64] https://repositories.intel.com/gpu/ubuntu jammy client" > /etc/apt/sources.list.d/intel-gpu.list && \
|
|
apt-get update && apt-get install -y --no-install-recommends \
|
|
intel-oneapi-runtime-opencl \
|
|
intel-oneapi-runtime-compilers \
|
|
intel-level-zero-gpu \
|
|
level-zero \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
USER ray
|
|
|
|
# Ensure Ray CLI is in PATH
|
|
ENV PATH="/home/ray/.local/bin:${PATH}"
|
|
|
|
# Install Intel Extension for PyTorch (IPEX) for Python 3.11
|
|
# This provides XPU support for Intel GPUs
|
|
RUN pip install --no-cache-dir \
|
|
torch==2.5.1 \
|
|
intel-extension-for-pytorch==2.5.10+xpu \
|
|
--extra-index-url https://pytorch-extension.intel.com/release-whl/stable/xpu/us/
|
|
|
|
# Install Ray Serve and AI inference dependencies
|
|
RUN pip install --no-cache-dir \
|
|
sentence-transformers \
|
|
FlagEmbedding \
|
|
fastapi \
|
|
uvicorn \
|
|
httpx \
|
|
pydantic \
|
|
transformers \
|
|
huggingface_hub
|
|
|
|
# Copy Ray Serve Python code
|
|
COPY ray-serve/ /app/ray_serve/
|
|
ENV PYTHONPATH=/app
|
|
|
|
# Copy Ray Serve entrypoint
|
|
COPY --chmod=755 dockerfiles/ray-entrypoint.sh /app/ray-entrypoint.sh
|
|
|
|
# Default environment variables
|
|
ENV RAY_HEAD_SVC="ai-inference-raycluster-head-svc"
|
|
ENV GPU_RESOURCE="gpu_intel"
|
|
ENV NUM_GPUS="1"
|
|
# Intel XPU settings
|
|
ENV ZE_AFFINITY_MASK=0
|
|
ENV SYCL_DEVICE_FILTER=level_zero:gpu
|
|
|
|
ENTRYPOINT ["/app/ray-entrypoint.sh"]
|