api / docker /Dockerfile.spark
gary-boon
Try PyTorch nightly for GB10/sm_121 GPU support
a009a49
raw
history blame
1.44 kB
# GPU-enabled Dockerfile for DGX Spark deployment (ARM64/aarch64 + CUDA 13.0)
FROM nvidia/cuda:12.4.0-runtime-ubuntu22.04
# Install Python and system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-dev \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /app
# Install PyTorch nightly with CUDA support (for newer GPU architectures like GB10/sm_121)
# Using nightly builds which may have support for newer compute capabilities
RUN pip3 install --no-cache-dir --pre \
torch \
--index-url https://download.pytorch.org/whl/nightly/cu124
# Copy requirements and install (excluding packages with ARM64 issues)
COPY requirements.txt .
RUN grep -v "^torch==" requirements.txt | \
grep -v "^zarr==" | \
grep -v "^numcodecs==" > requirements-spark.txt && \
pip3 install --no-cache-dir -r requirements-spark.txt
# Copy backend code
COPY backend/ ./backend/
COPY app.py .
# Create runs directory
RUN mkdir -p /app/runs
# Health check (uses configurable port via environment)
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
CMD curl -f http://localhost:${PORT:-8000}/health || exit 1
# Expose configurable port
EXPOSE ${PORT:-8000}
# Default command (overridden by compose.spark.yml)
CMD ["uvicorn", "backend.model_service:app", "--host", "0.0.0.0", "--port", "8000"]