-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.hpc
54 lines (45 loc) · 1.15 KB
/
Dockerfile.hpc
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
# Use NVIDIA CUDA base image
FROM nvidia/cuda:11.8.0-devel-ubuntu22.04
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
NVIDIA_VISIBLE_DEVICES=all \
DEBIAN_FRONTEND=noninteractive
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3.10 \
python3.10-dev \
python3-pip \
build-essential \
curl \
git \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Install HPC and ML dependencies
RUN pip3 install --no-cache-dir \
torch \
torchvision \
torchaudio \
cupy-cuda11x \
horovod \
mpi4py \
dask \
dask-cuda \
ray[default] \
ray[serve]
# Copy application code
COPY hpc /app/hpc
COPY config /app/config
# Set Python path
ENV PYTHONPATH=/app
# Add health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8001/health || exit 1
# Command to run the application
CMD ["python3", "-m", "hpc.orchestrator"]